]> git.lyx.org Git - lyx.git/blobdiff - src/paragraph_funcs.C
reduce number of calls to LyXText::getFont
[lyx.git] / src / paragraph_funcs.C
index 9add699a6d5fb377bc6279219324090d983f784d..7acc817580ded69a589c2cd2adc0185af8ae69fb 100644 (file)
@@ -58,8 +58,8 @@ using std::pair;
 namespace {
 
 bool moveItem(Paragraph & from, Paragraph & to,
-       BufferParams const & params, pos_type i, pos_type j, 
-       Change change = Change(Change::INSERTED)); 
+       BufferParams const & params, pos_type i, pos_type j,
+       Change change = Change(Change::INSERTED));
 
 bool moveItem(Paragraph & from, Paragraph & to,
        BufferParams const & params, pos_type i, pos_type j,
@@ -214,9 +214,13 @@ void breakParagraphConservative(BufferParams const & bparams,
                        if (moveItem(par, tmp, bparams, i, j - pos, change))
                                ++j;
                }
-
-               for (pos_type k = pos_end; k >= pos; --k)
-                       par.eraseIntern(k);
+               // If tracking changes, set all the text that is to be
+               // erased to Type::INSERTED.
+               for (pos_type k = pos_end; k >= pos; --k) {
+                       if (bparams.tracking_changes)
+                               par.setChange(k, Change::INSERTED);
+                       par.erase(k);
+               }
        }
 }