]> git.lyx.org Git - lyx.git/blobdiff - src/paragraph_funcs.C
multicol; small stuff
[lyx.git] / src / paragraph_funcs.C
index c5b7171fa11e0ca64716a1b814ac7f9f64b147cf..d9a2a41835d304f0d44c774281ce2e3e313135dc 100644 (file)
@@ -11,6 +11,7 @@
 #include <config.h>
 
 #include "paragraph_funcs.h"
+#include "paragraph_pimpl.h"
 #include "buffer.h"
 #include "ParagraphParameters.h"
 #include "lyxtextclasslist.h"
@@ -34,6 +35,9 @@ void breakParagraph(BufferParams const & bparams,
        // remember to set the inset_owner
        tmp->setInsetOwner(par->inInset());
 
+       if (bparams.tracking_changes)
+               tmp->trackChanges();
        // this is an idea for a more userfriendly layout handling, I will
        // see what the users say
 
@@ -73,25 +77,26 @@ void breakParagraph(BufferParams const & bparams,
                pos_type pos_end = par->size() - 1;
                pos_type i = pos;
                pos_type j = pos;
+
                for (; i <= pos_end; ++i) {
+                       Change::Type change(par->lookupChange(i));
                        par->cutIntoMinibuffer(bparams, i);
-                       if (tmp->insertFromMinibuffer(j - pos))
+                       if (tmp->insertFromMinibuffer(j - pos)) {
+                               tmp->pimpl_->setChange(j - pos, change);
                                ++j;
+                       }
                }
                for (i = pos_end; i >= pos; --i) {
-                       par->erase(i);
+                       par->pimpl_->eraseIntern(i);
                }
        }
 
        if (pos)
                return;
+
        tmp->params().lineTop(par->params().lineTop());
        tmp->params().pagebreakTop(par->params().pagebreakTop());
        tmp->params().spaceTop(par->params().spaceTop());
-       tmp->bibkey = par->bibkey;
-
-       par->bibkey = 0;
        par->params().clear();
 
        par->layout(bparams.getLyXTextClass().defaultLayout());
@@ -102,6 +107,15 @@ void breakParagraph(BufferParams const & bparams,
                par->setLabelWidthString(tmp->params().labelWidthString());
                par->params().depth(tmp->params().depth());
        }
+
+       // subtle, but needed to get empty pars working right
+       if (bparams.tracking_changes) {
+               if (!par->size()) {
+                       par->cleanChanges();
+               } else if (!tmp->size()) {
+                       tmp->cleanChanges();
+               }
+       }
 }