]> git.lyx.org Git - features.git/commitdiff
The "I want this in now" patch.
authorLars Gullik Bjønnes <larsbj@gullik.org>
Fri, 23 May 2003 07:44:09 +0000 (07:44 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Fri, 23 May 2003 07:44:09 +0000 (07:44 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7018 a592a061-630c-0410-9148-cb99ea01b6c8

16 files changed:
src/BufferView.C
src/BufferView.h
src/ChangeLog
src/LyXAction.C
src/buffer.C
src/exporter.C
src/frontends/xforms/ChangeLog
src/frontends/xforms/Toolbar_pimpl.C
src/insets/ChangeLog
src/insets/inseterror.C
src/insets/insettabular.C
src/lfuns.h
src/lyxfunc.C
src/paragraph.h
src/text2.C
src/undo_funcs.C

index b5dc13b8a733461af0f671f1bba8a915ff84d74f..7bd571ed9a4268b983470a39309af8e0208c8bff 100644 (file)
@@ -331,142 +331,6 @@ bool BufferView::insertLyXFile(string const & filen)
 }
 
 
-bool BufferView::removeAutoInsets()
-{
-       // keep track of which pos and par the cursor was on
-       Paragraph * cursor_par = &*text->cursor.par();
-       Paragraph * cursor_par_prev = cursor_par ? cursor_par->previous() : 0;
-       Paragraph * cursor_par_next = cursor_par ? cursor_par->next() : 0;
-       pos_type cursor_pos = text->cursor.pos();
-
-       bool found = false;
-
-       // Trap the deletion of the paragraph the cursor is in.
-       // Iterate until we find a paragraph that won't be immediately deleted.
-       // In reality this should mean we only execute the body of the while
-       // loop once at most.  However for safety we iterate rather than just
-       // make this an if () conditional.
-       while ((cursor_par_prev || cursor_par_next)
-              && text->setCursor(
-                                 cursor_par_prev ? cursor_par_prev : cursor_par_next,
-                                 0)) {
-               // We just removed cursor_par so have to fix the "cursor"
-               if (cursor_par_prev) {
-                       // '.' = cursor_par
-                       //  a -> a.
-                       // .
-                       cursor_par = cursor_par_prev;
-                       cursor_pos = cursor_par->size();
-               } else {
-                       // .  -> .a
-                       //  a
-                       cursor_par = cursor_par_next;
-                       cursor_pos = 0;
-               }
-               cursor_par_prev = cursor_par->previous();
-               cursor_par_next = cursor_par->next();
-       }
-
-       // Iterate through the paragraphs removing autoDelete insets as we go.
-       // If the paragraph ends up empty after all the autoDelete insets are
-       // removed that paragraph will be removed by the next setCursor() call.
-       ParIterator it = buffer()->par_iterator_begin();
-       ParIterator end = buffer()->par_iterator_end();
-       for (; it != end; ++it) {
-               Paragraph * par = &*(*it);
-               Paragraph * par_prev = par ? par->previous() : 0;
-               bool removed = false;
-
-               if (text->setCursor(par, 0)
-                   && cursor_par == par_prev) {
-                       // The previous setCursor line was deleted and that
-                       // was the cursor_par line.  This can only happen if an
-                       // error box was the sole item on cursor_par.
-                       // It is possible for cursor_par_prev to be stray if
-                       // the line it pointed to only had a error box on it
-                       // so we have to set it to a known correct value.
-                       // This is often the same value it already had.
-                       cursor_par_prev = par->previous();
-                       if (cursor_par_prev) {
-                               // '|' = par, '.' = cursor_par, 'E' = error box
-                               // First step below may occur before while{}
-                               //  a    |a      a     a     a.
-                               //  E -> .E -> |.E -> .  -> |b
-                               // .      b      b    |b
-                               //  b
-                               cursor_par = cursor_par_prev;
-                               cursor_pos = cursor_par_prev->size();
-                               cursor_par_prev = cursor_par->previous();
-                               // cursor_par_next remains the same
-                       } else if (cursor_par_next) {
-                               // First step below may occur before while{}
-                               // .
-                               //  E -> |.E -> |.  -> . -> .|a
-                               //  a      a      a    |a
-                               cursor_par = cursor_par_next;
-                               cursor_pos = 0;
-                               // cursor_par_prev remains unset
-                               cursor_par_next = cursor_par->next();
-                       } else {
-                               // I can't find a way to trigger this
-                               // so it should be unreachable code
-                               // unless the buffer is corrupted.
-                               lyxerr << "BufferView::removeAutoInsets() is bad\n";
-                       }
-               }
-
-               InsetList::iterator pit = par->insetlist.begin();
-               InsetList::iterator pend = par->insetlist.end();
-
-               while (pit != pend) {
-                       if (pit.getInset()->autoDelete()) {
-                               removed = true;
-                               pos_type const pos = pit.getPos();
-
-                               par->erase(pos);
-                               // We just invalidated par's inset iterators so
-                               // we get the next valid iterator position
-                               pit = par->insetlist.insetIterator(pos);
-                               // and ensure we have a valid end iterator.
-                               pend = par->insetlist.end();
-
-                               if (cursor_par == par) {
-                                       // update the saved cursor position
-                                       if (cursor_pos > pos)
-                                               --cursor_pos;
-                               }
-                       } else {
-                               ++pit;
-                       }
-               }
-               if (removed) {
-                       found = true;
-                       text->redoParagraph();
-               }
-       }
-
-       // It is possible that the last line is empty if it was cursor_par
-       // and/or only had an error inset on it.  So we set the cursor to the
-       // start of the doc to force its removal and ensure a valid saved cursor
-       if (text->setCursor(&*text->ownerParagraphs().begin(), 0)
-           && 0 == cursor_par_next) {
-               cursor_par = cursor_par_prev;
-               cursor_pos = cursor_par->size();
-       } else if (cursor_pos > cursor_par->size()) {
-               // Some C-Enter lines were removed by the setCursor call which
-               // then invalidated cursor_pos. It could still be "wrong" because
-               // the cursor may appear to have jumped but since we collapsed
-               // some C-Enter lines this should be a reasonable compromise.
-               cursor_pos = cursor_par->size();
-       }
-
-       // restore the original cursor in its corrected location.
-       text->setCursorIntern(cursor_par, cursor_pos);
-
-       return found;
-}
-
-
 void BufferView::resetErrorList()
 {
        pimpl_->errorlist_.clear();
index 056e405dcc0bf679e554ce38b34c9d94acfa734c..419f807b772bc96e2df694fb4003a7ac793b4313 100644 (file)
@@ -153,8 +153,6 @@ public:
        /// redo last action
        void redo();
 
-       /// removes all autodeletable insets
-       bool removeAutoInsets();
        /// get the stored error list
        ErrorList const & getErrorList() const;
        /// clears the stored error list
index b6a2ac92c8d4112cfd65bdc3b4d48a1ed4dbba97..d7af305af00521b61eb3e1d5339df2195967a2fc 100644 (file)
@@ -1,3 +1,23 @@
+2003-05-23  Lars Gullik Bjønnes  <larsbj@gullik.net>
+
+       * undo_funcs.C (textHandleUndo): comment out next/previous stuff
+       (createUndo): ditto
+       (textUndoOrRedo): comment out a currently unused var.
+
+       * paragraph.h (NO_NEXT): enable NO_NEXT
+
+       * lyxfunc.C (dispatch): remove LFUN_REMOVEERRORS
+
+       * lfuns.h: remove LFUN_REMOVEERRORS and adjust lfun numbers.
+
+       * exporter.C (Export): adjust for removeAutoInsets removal.
+
+       * buffer.C (runChktex): adjust for removeAutoInsets removal.
+
+       * LyXAction.C (init): remove LFUN_REMOVEERRORS
+
+       * BufferView.[Ch] (removeAutoInsets): delete function
+
 2003-05-22  Angus Leeming  <leeming@lyx.org>
 
        * latexrunparams.h: add fragile and use_babel variables.
index 9f955102b944218fb14dda284ade345c1b4d5d74..4be669e9a49717ac5bf36f9ebf3884be0795289d 100644 (file)
@@ -145,7 +145,6 @@ void LyXAction::init()
                { LFUN_END_OF_SENTENCE, "end-of-sentence-period-insert", Noop },
                { LFUN_ENVIRONMENT_INSERT, "environment-insert", Noop },
                { LFUN_GOTOERROR, "error-next", ReadOnly },
-               { LFUN_REMOVEERRORS, "error-remove-all", ReadOnly },
                { LFUN_INSET_ERT, "ert-insert", Noop },
                { LFUN_FILE_INSERT, "file-insert", Noop },
                { LFUN_FILE_INSERT_ASCII, "file-insert-ascii", Noop },
index 074487376a3715e265a069f5eaced4c847476521..147316fc75d8e6f7f4e73b77017cc7ea5ddd1b04 100644 (file)
@@ -1958,9 +1958,6 @@ int Buffer::runChktex()
        Path p(path); // path to LaTeX file
        users->owner()->message(_("Running chktex..."));
 
-       // Remove all error insets
-       bool const removedErrorInsets = users->removeAutoInsets();
-
        // Generate the LaTeX file if neccessary
        LatexRunParams runparams;
        runparams.flavor = LatexRunParams::LATEX;
@@ -1981,13 +1978,6 @@ int Buffer::runChktex()
                users->showErrorList(_("ChkTeX"));
        }
 
-       // if we removed error insets before we ran chktex or if we inserted
-       // error insets after we ran chktex, this must be run:
-       if (removedErrorInsets || res) {
-#warning repaint needed here, or do you mean update() ?
-               users->repaint();
-               users->fitCursor();
-       }
        users->owner()->busy(false);
 
        return res;
index e32a451926d200590674b73bb9412ef06f2a72ea..0e0cb9ede94ad40cb2a90502d2b262ce14dca5c1 100644 (file)
@@ -33,14 +33,6 @@ bool Exporter::Export(Buffer * buffer, string const & format,
        // from that the removal of auto insets is best done here.  This ensures
        // we always have a clean buffer for inserting errors found during export.
        BufferView * bv = buffer->getUser();
-       if (bv) {
-               // Remove all error insets
-               if (bv->removeAutoInsets()) {
-#warning repaint() or update() or nothing ?
-                       bv->repaint();
-                       bv->fitCursor();
-               }
-       }
 
        string backend_format;
        LatexRunParams runparams;
index fe0fef9663df059cecfabf64b17dbf307641a60a..38e88109eb5dcb63de005bbd9dd621508433981e 100644 (file)
@@ -1,3 +1,7 @@
+2003-05-23  Lars Gullik Bjønnes  <larsbj@gullik.net>
+
+       * Toolbar_pimpl.C (displayToolbar): comment out unsused parameters.
+
 2003-05-21  Alfredo Braunstein  <abraunst@libero.it>
 
        * FormBase.[Ch]:
index ab8822ccb1fe61edb091ec53be208f71aac39107..6662a8c5d9ea1e55d141ad511276721119cfab13 100644 (file)
@@ -59,8 +59,8 @@ Toolbar::Pimpl::toolbarItem::~toolbarItem()
 
 /// Display toolbar, not implemented. But moved out of line so that
 /// linking will work properly.
-void Toolbar::Pimpl::displayToolbar(ToolbarBackend::Toolbar const & tb,
-                                   bool show)
+void Toolbar::Pimpl::displayToolbar(ToolbarBackend::Toolbar const & /*tb*/,
+                                   bool /*show*/)
 {}
 
 
index 55c9e991bb7c69bc97db002260a43162f58b128b..b77f0ab5678bd2bbf3c92d622aa643d3db39658f 100644 (file)
@@ -1,3 +1,7 @@
+2003-05-23  Lars Gullik Bjønnes  <larsbj@gullik.net>
+
+       * inseterror.C (localDispatch): comment out unused var.
+
 2003-05-22  Angus Leeming  <leeming@lyx.org>
 
        * inset*.[Ch] (latex): no longer has a fragile arg. Data is now passed
index 568f5758d05fc8bae628b67cd32a68ef66e1dfb1..b32c8880584f76273a2a466cc94df5f8c878ce2c 100644 (file)
@@ -41,7 +41,7 @@ InsetError::~InsetError()
 
 dispatch_result InsetError::localDispatch(FuncRequest const & cmd)
 {
-       dispatch_result result = UNDISPATCHED;
+       // UNUSED: dispatch_result result = UNDISPATCHED;
 
        switch (cmd.action) {
        case LFUN_MOUSE_RELEASE:
index 4277d27f38c4830780d27fd86b1bcef9f2c61e1f..4ab0c9cb42c5e11294404b0c4bfd26b89b8360ee 100644 (file)
@@ -722,7 +722,7 @@ Inset::RESULT InsetTabular::localDispatch(FuncRequest const & cmd)
        BufferView * bv = cmd.view();
 
        if (cmd.action == LFUN_INSET_EDIT) {
-               
+
                if (!bv->lockInset(this)) {
                        lyxerr[Debug::INSETTEXT] << "InsetTabular::Cannot lock inset" << endl;
                        return DISPATCHED;
index f92ad5260067df93b3973c2634236eb1dfe51cc4..e997263308bf94692e1d5e3624cf3586814111f4 100644 (file)
@@ -243,97 +243,96 @@ enum kb_action {
        LFUN_REF_GOTO,                  // Ale 970806
        LFUN_PARENTINSERT,              // Ale 970813
        // 180
-       LFUN_REMOVEERRORS,              // Asger 970906
        LFUN_LDOTS,                     // Asger 970929
        LFUN_END_OF_SENTENCE,           // Asger 970929
        LFUN_TOGGLECURSORFOLLOW,        // ARRae 971202
        LFUN_RUNCHKTEX,                 // Asger 971030
-       // 185
        LFUN_HTMLURL,                   // CFO-G 971121
+       // 185
        LFUN_URL,                       // CFO-G 971121
        LFUN_WORDFINDFORWARD,           // Etienne 980216
        LFUN_WORDFINDBACKWARD,          // Etienne 980220
        LFUN_APPENDIX,                  // ettrich 980505
-       // 190
        LFUN_IMPORT,                    // Asger 980724
+       // 190
        LFUN_MENU_SEPARATOR,            // Asger 990220
        LFUN_SEQUENCE,                  // Andre' 991111
        LFUN_DIALOG_PREFERENCES,        // ARRae 20000726
        LFUN_SAVEPREFERENCES,           // Lgb 991127
-       // 195
        LFUN_HELP_OPEN,                 // Jug 990627
+       // 195
        LFUN_DATE_INSERT,               // jdblair 20000131
        LFUN_LANGUAGE,                  // Dekel 20000203
        LFUN_INSET_ERT,                 // Jug 20000218
        LFUN_INSET_FOOTNOTE,            // Jug 20000307
-       // 200
        LFUN_PARAGRAPH_SPACING,         // Lgb 20000411
+       // 200
        LFUN_TABULAR_INSERT,            // Jug 20000412
        LFUN_LOFVIEW,                   // Dekel 20000519
        LFUN_LOTVIEW,                   // Dekel 20000519
        LFUN_LOAVIEW,                   // Dekel 20000519
-       // 205
        LFUN_SET_COLOR,                 // SLior 20000611
+       // 205
        LFUN_INSET_MARGINAL,            // Lgb 20000626
        LFUN_INSET_MINIPAGE,            // Lgb 20000627
        LFUN_INSET_FLOAT,               // Lgb 20000627
        LFUN_INSET_WIDE_FLOAT,          // Lgb 20010531
-       // 210
        LFUN_INSET_CAPTION,             // Lgb 20000718
+       // 210
        LFUN_SWITCHBUFFER,
        LFUN_TABULAR_FEATURE,           // Jug 20000728
        LFUN_LAYOUT_TABULAR,            // Jug 20000731
        LFUN_SCROLL_INSET,              // Jug 20000801
-       // 215
        LFUN_UPDATE,                    // Dekel 20000805
+       // 215
        LFUN_INDEX_INSERT,              // Angus 20000803
        LFUN_SCREEN_FONT_UPDATE,        // ARRae 20000813
        LFUN_GOTO_PARAGRAPH,            // Dekel 20000826
        LFUN_REFERENCE_GOTO,            // Dekel 20010114
-       // 220
        LFUN_BOOKMARK_SAVE,             // Dekel 20010127
+       // 220
        LFUN_BOOKMARK_GOTO,             // Dekel 20010127
        LFUN_SELECT_FILE_SYNC,          // Levon 20010214
        LFUN_MESSAGE,                   // Lgb 20010408
        LFUN_TRANSPOSE_CHARS,           // Lgb 20010425
-       // 225
        LFUN_ESCAPE,                    // Lgb 20010517
+       // 225
        LFUN_HELP_ABOUTLYX,             // Edwin 20010712
        LFUN_THESAURUS_ENTRY,           // Levon 20010720
        LFUN_HELP_TEXINFO,              // Herbert 20011001
        LFUN_FORKS_SHOW,                // Angus 16 Feb 2002
-       // 230
        LFUN_FORKS_KILL,                // Angus 16 Feb 2002
+       // 230
        LFUN_TOOLTIPS_TOGGLE,           // Angus 8 Mar 2002
        LFUN_INSET_OPTARG,              // Martin 12 Aug 2002
        LFUN_MOUSE_PRESS,               // André 9 Aug 2002
        LFUN_MOUSE_MOTION,              // André 9 Aug 2002
-       // 235
        LFUN_MOUSE_RELEASE,             // André 9 Aug 2002
+       // 235
        LFUN_MOUSE_DOUBLE,              // André 9 Aug 2002
        LFUN_MOUSE_TRIPLE,              // André 9 Aug 2002
        LFUN_INSET_EDIT,                      // André 16 Aug 2002
        LFUN_INSET_WRAP,                // Dekel 7 Apr 2002
-       // 240
        LFUN_TRACK_CHANGES,             // Levon 20021001 (cool date !)
+       // 240
        LFUN_MERGE_CHANGES,             // Levon 20021016
        LFUN_ACCEPT_CHANGE,             // Levon 20021016
        LFUN_REJECT_CHANGE,             // Levon 20021016
        LFUN_ACCEPT_ALL_CHANGES,        // Levon 20021016
-       // 245
        LFUN_REJECT_ALL_CHANGES,        // Levon 20021016
+       // 245
        LFUN_INSERT_BIBITEM,            // André 14 Feb 2003
        LFUN_DIALOG_SHOW_NEW_INSET,
        LFUN_DIALOG_SHOW_NEXT_INSET,
        LFUN_DIALOG_UPDATE,
-       // 250
        LFUN_DIALOG_HIDE,
+       // 250
        LFUN_DIALOG_DISCONNECT_INSET,
        LFUN_INSET_APPLY,
        LFUN_INSET_INSERT,
        LFUN_INSET_MODIFY,
-       // 255
        LFUN_INSET_DIALOG_UPDATE,
+       // 255
        LFUN_INSET_SETTINGS,
        LFUN_PARAGRAPH_APPLY,
        LFUN_PARAGRAPH_UPDATE,
index 76dc5425cec9398c15a1eef22ecb7e3a4a5d0bc2..bb31273b0b96818ccc71b2cac246e5b292bd1798 100644 (file)
@@ -490,7 +490,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & ev) const
        case LFUN_INSET_SETTINGS: {
                disable = true;
                UpdatableInset * inset = view()->theLockingInset();
-               
+
                if (!inset)
                        break;
 
@@ -1126,14 +1126,6 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
                owner->getDialogs().showSearch();
                break;
 
-       case LFUN_REMOVEERRORS:
-               if (view()->removeAutoInsets()) {
-#warning repaint() or update() or nothing ?
-                       view()->repaint();
-                       view()->fitCursor();
-               }
-               break;
-
        case LFUN_DEPTH_MIN:
                changeDepth(view(), TEXT(false), DEC_DEPTH, false);
                owner->view_state_changed();
index 2dcbbb94e19e7a86a8face6d786b22296b83d98b..d82b4dc47909163109637a03b13d4663d38b0030 100644 (file)
@@ -34,7 +34,7 @@ class TexRow;
 // Define this if you want to try out the new storage container for
 // paragraphs. (Lgb)
 // This is non working and far from finished.
-// #define NO_NEXT 1
+#define NO_NEXT 1
 
 /// A Paragraph holds all text, attributes and insets in a text paragraph
 class Paragraph  {
index 9cc7edc767f2da8ecff50d219e4442a193e6ba1b..b34bc99063387b290b7db708cca0ebeefd0ff9ba 100644 (file)
@@ -427,10 +427,10 @@ LyXText::setLayout(LyXCursor & cur, LyXCursor & sstart_cur,
 // set layout over selection and make a total rebreak of those paragraphs
 void LyXText::setLayout(string const & layout)
 {
-       LyXCursor tmpcursor = cursor;  // store the current cursor 
+       LyXCursor tmpcursor = cursor;  // store the current cursor
 
        // if there is no selection just set the layout
-       // of the current paragraph 
+       // of the current paragraph
        if (!selection.set()) {
                selection.start = cursor;  // dummy selection
                selection.end = cursor;
index 03235aeebb5436792e41d005e427435c1b1b5ae4..da7255979a16f0707ab8e07fa86fc92b3160b72c 100644 (file)
@@ -145,18 +145,21 @@ bool textHandleUndo(BufferView * bv, Undo & undo)
 
        // Thread the end of the undo onto the par in front if any.
        if (!undo.pars.empty()) {
-               undo.pars.back()->next(&**behind);
-               if (behind != end)
-                       (&**behind)->previous(undo.pars.back());
+#warning FIXME
+               //undo.pars.back()->next(&**behind);
+               //if (behind != end)
+               //(&**behind)->previous(undo.pars.back());
        }
 
        // Put the new stuff in the list if there is one.
        Paragraph * undopar = undo.pars.empty() ? 0 : undo.pars.front();
        if (!undo.pars.empty()) {
-               undo.pars.front()->previous(&**before);
-               if (before != end)
-                       (&**before)->next(undopar);
-               else {
+#warning FIXME
+               //undo.pars.front()->previous(&**before);
+               if (before != end) {
+#warning FIXME
+                       //(&**before)->next(undopar);
+               } else {
                        int id = undoParagraphs(bv, undo.number_of_inset_id).front().id();
                        ParIterator op = bv->buffer()->getParFromID(id);
                        if (op != end && op->inInset()) {
@@ -254,8 +257,9 @@ bool textHandleUndo(BufferView * bv, Undo & undo)
        // And here it's safe enough to delete all removed paragraphs.
        vector<Paragraph *>::iterator pit = deletelist.begin();
        for(; pit != deletelist.end(); ++pit) {
-               (*pit)->previous(0);
-               (*pit)->next(0);
+#warning FIXME
+               //(*pit)->previous(0);
+               //(*pit)->next(0);
                delete (*pit);
        }
 
@@ -280,8 +284,9 @@ bool createUndo(BufferView * bv, Undo::undo_kind kind,
        int behind_number = -1;
        int inset_id = -1;
 
-       if (first->previous())
-               before_number = first->previous()->id();
+#warning FIXME
+       //if (first->previous())
+       //      before_number = first->previous()->id();
        if (behind)
                behind_number = behind->id();
        if (first->inInset())
@@ -312,28 +317,31 @@ bool createUndo(BufferView * bv, Undo::undo_kind kind,
 
        Paragraph const * end = 0;
 
-       if (behind)
-               end = behind->previous();
-       else {
+       if (behind) {
+#warning FIXME
+               //end = behind->previous();
+       }else {
                end = first;
-               while (end->next())
-                       end = end->next();
+#warning FIXME
+               //while (end->next())
+               //      end = end->next();
        }
 
-       if (first && end && (first != end->next()) &&
-           ((before_number != behind_number) ||
-                ((before_number < 0) && (behind_number < 0))))
-       {
-               undo_pars.push_back(new Paragraph(*first, true));
-               for (Paragraph * tmppar = first; tmppar != end && tmppar->next(); ) {
-                       tmppar = tmppar->next();
-                       undo_pars.push_back(new Paragraph(*tmppar, true));
-                       size_t const n = undo_pars.size();
-                       undo_pars[n - 2]->next(undo_pars[n - 1]);
-                       undo_pars[n - 1]->previous(undo_pars[n - 2]);
-               }
-               undo_pars.back()->next(0);
-       }
+#warning FIXME
+//     if (first && end && (first != end->next()) &&
+//         ((before_number != behind_number) ||
+//              ((before_number < 0) && (behind_number < 0))))
+//     {
+//             undo_pars.push_back(new Paragraph(*first, true));
+//             for (Paragraph * tmppar = first; tmppar != end && tmppar->next(); ) {
+//                     tmppar = tmppar->next();
+//                     undo_pars.push_back(new Paragraph(*tmppar, true));
+//                     size_t const n = undo_pars.size();
+//                     undo_pars[n - 2]->next(undo_pars[n - 1]);
+//                     undo_pars[n - 1]->previous(undo_pars[n - 2]);
+//             }
+//             undo_pars.back()->next(0);
+//     }
 
        // A memory optimization: Just store the layout
        // information when only edit.
@@ -359,9 +367,9 @@ bool createUndo(BufferView * bv, Undo::undo_kind kind,
 // Returns false if no undo possible.
 bool textUndoOrRedo(BufferView * bv,
        limited_stack<boost::shared_ptr<Undo> > & stack,
-       limited_stack<boost::shared_ptr<Undo> > & otherstack)
+                   limited_stack<boost::shared_ptr<Undo> > & /*otherstack*/)
 {
-       Buffer * b = bv->buffer();
+       //Buffer * b = bv->buffer();
 
        if (stack.empty()) {
                finishNoUndo(bv);