]> git.lyx.org Git - lyx.git/blobdiff - src/paragraph_pimpl.C
Updates from Bennett and myself.
[lyx.git] / src / paragraph_pimpl.C
index 426862c246e3f8d04151b46d8ac03ef240cc1268..aad1f2bb493aac4199acaaaf8d132be966689a6f 100644 (file)
@@ -87,6 +87,19 @@ bool Paragraph::Pimpl::isChanged(pos_type start, pos_type end) const
 }
 
 
+bool Paragraph::Pimpl::isMergedOnEndOfParDeletion(bool trackChanges) const {
+       // keep the logic here in sync with the logic of eraseChars()
+
+       if (!trackChanges) {
+               return true;
+       }
+
+       Change change = changes_.lookup(size());
+
+       return change.type == Change::INSERTED && change.author == 0;
+}
+
+
 void Paragraph::Pimpl::setChange(Change const & change)
 {
        // beware of the imaginary end-of-par character!
@@ -263,6 +276,8 @@ bool Paragraph::Pimpl::eraseChar(pos_type pos, bool trackChanges)
 {
        BOOST_ASSERT(pos >= 0 && pos <= size());
 
+       // keep the logic here in sync with the logic of isMergedOnEndOfParDeletion()
+
        if (trackChanges) {
                Change change = changes_.lookup(pos);