]> git.lyx.org Git - features.git/commitdiff
Force update on paragraph merge
authorMartin Vermeer <martin.vermeer@hut.fi>
Mon, 19 Dec 2005 12:30:34 +0000 (12:30 +0000)
committerMartin Vermeer <martin.vermeer@hut.fi>
Mon, 19 Dec 2005 12:30:34 +0000 (12:30 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10673 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/lyxtext.h
src/text.C
src/text3.C

index 16c1189f8368443c2b700ce1e16597cc37201401..6313170c48c18cf910e559d116747d7f6bccd2d2 100644 (file)
@@ -1,3 +1,9 @@
+2005-12-19  Martin Vermeer  <martin.vermeer@hut.fi>
+
+       * lyxtext.h:
+       * text.C:
+       * text3.C (Delete, backspace): force update when merging paragraphs
+
 2005-12-16  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
 
        * BufferView.C (mouseSetCursor): clear the selection properly (bug
index 48036984376e9c508dc33fc78368fcc9d1b722ed..535d7623deda38ceab0c5fbb3cdb01177972b77e 100644 (file)
@@ -221,9 +221,9 @@ public:
        ///
        void cursorBottom(LCursor & cur);
        ///
-       void Delete(LCursor & cur);
+       bool Delete(LCursor & cur);
        ///
-       void backspace(LCursor & cur);
+       bool backspace(LCursor & cur);
        ///
        bool selectWordWhenUnderCursor(LCursor & cur, lyx::word_location);
        ///
index f19a06144c178fe0b711444366471d1c9f99c8d3..0dbaa9dd7e14e530b396cff326e42eee3fb69b65 100644 (file)
@@ -1534,31 +1534,34 @@ void LyXText::changeCase(LCursor & cur, LyXText::TextCase action)
 }
 
 
-void LyXText::Delete(LCursor & cur)
+bool LyXText::Delete(LCursor & cur)
 {
        BOOST_ASSERT(this == cur.text());
+       bool needsUpdate = false;
 
        if (cur.pos() != cur.lastpos()) {
                recordUndo(cur, Undo::DELETE, cur.pit());
                setCursorIntern(cur, cur.pit(), cur.pos() + 1, false, cur.boundary());
-               backspace(cur);
+               needsUpdate = backspace(cur);
        } else if (cur.pit() != cur.lastpit()) {
                LCursor scur = cur;
 
                setCursorIntern(cur, cur.pit()+1, 0, false, false);
                if (pars_[cur.pit()].layout() == pars_[scur.pit()].layout()) {
                        recordUndo(scur, Undo::DELETE, scur.pit());
-                       backspace(cur);
+                       needsUpdate = backspace(cur);
                } else {
                        setCursorIntern(scur, scur.pit(), scur.pos(), false, scur.boundary());
                }
        }
+       return needsUpdate;
 }
 
 
-void LyXText::backspace(LCursor & cur)
+bool LyXText::backspace(LCursor & cur)
 {
        BOOST_ASSERT(this == cur.text());
+       bool needsUpdate = false;
        if (cur.pos() == 0) {
                // The cursor is at the beginning of a paragraph, so
                // the the backspace will collapse two paragraphs into
@@ -1567,7 +1570,7 @@ void LyXText::backspace(LCursor & cur)
                // but it's not allowed unless it's new
                Paragraph & par = cur.paragraph();
                if (par.isChangeEdited(0, par.size()))
-                       return;
+                       return false;
 
                // we may paste some paragraphs
 
@@ -1592,7 +1595,7 @@ void LyXText::backspace(LCursor & cur)
                                 }
                                 
                                cursorLeft(cur);
-                               return;
+                               return true;
                        }
                }
 
@@ -1626,6 +1629,7 @@ void LyXText::backspace(LCursor & cur)
                        || pars_[tmppit].layout() == tclass.defaultLayout()))
                {
                        mergeParagraph(bufparams, pars_, cpit);
+                       needsUpdate = true;
 
                        if (cur.pos() != 0 && pars_[cpit].isSeparator(cur.pos() - 1))
                                --cur.pos();
@@ -1651,6 +1655,8 @@ void LyXText::backspace(LCursor & cur)
                setCurrentFont(cur);
 
        setCursor(cur, cur.pit(), cur.pos(), false, cur.boundary());
+
+       return needsUpdate;
 }
 
 
index 8a882e22fafed7d3f43a3a2ada784f6d6a26a76e..8ac5424993c15219c572dc29ca345968a66c886e 100644 (file)
@@ -621,7 +621,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
 
        case LFUN_DELETE:
                if (!cur.selection()) {
-                       Delete(cur);
+                       needsUpdate = Delete(cur);
                        cur.resetAnchor();
                        // It is possible to make it a lot faster still
                        // just comment out the line below...
@@ -649,7 +649,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
        case LFUN_BACKSPACE:
                if (!cur.selection()) {
                        if (bv->owner()->getIntl().getTransManager().backspace()) {
-                               backspace(cur);
+                               needsUpdate = backspace(cur);
                                cur.resetAnchor();
                                // It is possible to make it a lot faster still
                                // just comment out the line below...