[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [calligra] libs/textlayout: Make sure we mark dirty and thus layout
From:       Casper Boemann <cbo () boemann ! dk>
Date:       2011-08-25 18:21:52
Message-ID: 20110825182152.780A2A6078 () git ! kde ! org
[Download RAW message or body]

Git commit b67c06d980c95aa125dca7f63e1017fdfe83e73c by Casper Boemann.
Committed on 25/08/2011 at 20:15.
Pushed by boemann into branch 'master'.

Make sure we mark dirty and thus layout everything we change when editing

M  +9    -2    libs/textlayout/KoTextDocumentLayout.cpp

http://commits.kde.org/calligra/b67c06d980c95aa125dca7f63e1017fdfe83e73c

diff --git a/libs/textlayout/KoTextDocumentLayout.cpp \
b/libs/textlayout/KoTextDocumentLayout.cpp index aaca6f8..39ce80f 100644
--- a/libs/textlayout/KoTextDocumentLayout.cpp
+++ b/libs/textlayout/KoTextDocumentLayout.cpp
@@ -272,7 +272,15 @@ void KoTextDocumentLayout::documentChanged(int position, int \
                charsRemoved, int c
             // the content of a variable changed (see KoVariable::setValue which \
                calls publicDocumentChanged). In
             // those cases we only need to relayout the root-area dirty where the \
                variable is on.
             KoTextLayoutRootArea *toArea = fromArea ? rootAreaForPosition(position + \
                qMax(charsRemoved, charsAdded)) : 0;
-            endIndex = (toArea && toArea != fromArea) ? qMax(startIndex, \
d->rootAreaList.indexOf(toArea)) : startIndex; +            if (toArea) {
+                if (toArea != fromArea) {
+                    endIndex = qMax(startIndex, d->rootAreaList.indexOf(toArea));
+                } else {
+                    endIndex = startIndex;
+                }
+            } else {
+                endIndex = d->rootAreaList.count() - 1;
+            }
             // The previous and following root-area of that range are selected too \
cause they can also be affect by  // changes done to the range of root-areas.
             if (startIndex >= 1)
@@ -532,7 +540,6 @@ bool KoTextDocumentLayout::doLayout()
         if (d->restartLayout) {
             return false; // Abort layouting to restart from the beginning.
         }
-
         bool shouldLayout = false;
 
         if (rootArea->top() != d->y) {


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic