]> git.lyx.org Git - lyx.git/blobdiff - src/Cursor.cpp
Fix functions that used functions but did not defined it
[lyx.git] / src / Cursor.cpp
index 45ae34c4b265c3fc14d093ba0fca680e1e7ad5e8..cab25022d7176cafc76db12683d5432597653ed4 100644 (file)
@@ -903,7 +903,8 @@ void Cursor::pop()
 void Cursor::push(Inset & inset)
 {
        push_back(CursorSlice(inset));
-       inset.setBuffer(*buffer());
+       // See bug #13050
+       // inset.setBuffer(*buffer());
 }
 
 
@@ -2143,7 +2144,7 @@ bool Cursor::mathBackward(bool word)
 }
 
 
-bool Cursor::upDownInText(bool up, bool & updateNeeded)
+bool Cursor::upDownInText(bool up)
 {
        LASSERT(text(), return false);
 
@@ -2153,6 +2154,9 @@ bool Cursor::upDownInText(bool up, bool & updateNeeded)
        getPos(xo, yo);
        xo = beforeDispatchPosX_;
 
+       // Is a full repaint necessary?
+       bool updateNeeded = false;
+
        // update the targetX - this is here before the "return false"
        // to set a new target which can be used by InsetTexts above
        // if we cannot move up/down inside this inset anymore
@@ -2221,12 +2225,13 @@ bool Cursor::upDownInText(bool up, bool & updateNeeded)
                        dummy.pos() = dummy.pos() == 0 ? dummy.lastpos() : 0;
                        dummy.pit() = dummy.pit() == 0 ? dummy.lastpit() : 0;
 
-                       updateNeeded |= bv().checkDepm(dummy, *this);
-                       updateTextTargetOffset();
-                       if (updateNeeded)
+                       if (bv().checkDepm(dummy, *this)) {
+                               updateNeeded = true;
                                forceBufferUpdate();
+                       }
+                       updateTextTargetOffset();
                }
-               return false;
+               return updateNeeded;
        }
 
        // with and without selection are handled differently
@@ -2252,6 +2257,7 @@ bool Cursor::upDownInText(bool up, bool & updateNeeded)
                        ++dummy.pos();
                if (bv().checkDepm(dummy, old)) {
                        updateNeeded = true;
+                       forceBufferUpdate();
                        // Make sure that cur gets back whatever happened to dummy (Lgb)
                        operator=(dummy);
                }
@@ -2292,13 +2298,14 @@ bool Cursor::upDownInText(bool up, bool & updateNeeded)
                // When selection==false, this is done by TextMetrics::editXY
                setCurrentFont();
 
-               updateNeeded |= bv().checkDepm(*this, old);
+               if (bv().checkDepm(*this, old)) {
+                       updateNeeded = true;
+                       forceBufferUpdate();
+               }
        }
 
-       if (updateNeeded)
-               forceBufferUpdate();
        updateTextTargetOffset();
-       return true;
+       return updateNeeded;
 }