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

List:       kde-commits
Subject:    koffice/libs/kotext
From:       Thomas Zander <zander () kde ! org>
Date:       2010-12-18 9:44:08
Message-ID: 20101218094408.1376F3E1FB () svn ! kde ! org
[Download RAW message or body]

SVN commit 1207476 by zander:

Call relayout instead of layout

 M  +1 -0      KoTextDocumentLayout.h  
 M  +8 -1      KoTextShapeData.cpp  


--- trunk/koffice/libs/kotext/KoTextDocumentLayout.h #1207475:1207476
@@ -231,6 +231,7 @@
     /// the currently set LayoutState
     LayoutState *m_state;
 
+    friend class KoTextShapeData;
     /// make sure we start a layout run
     virtual void relayout();
 
--- trunk/koffice/libs/kotext/KoTextShapeData.cpp #1207475:1207476
@@ -54,6 +54,7 @@
     KoTextShapeDataPrivate()
             : ownsDocument(true),
             dirty(true),
+            inRelayoutForPage(false),
             offset(0.0),
             position(-1),
             endPosition(-1),
@@ -72,6 +73,7 @@
 
     bool ownsDocument;
     bool dirty;
+    bool inRelayoutForPage;
     qreal offset;
     int position, endPosition;
     KoText::Direction direction;
@@ -195,6 +197,8 @@
 void KoTextShapeData::setPage(KoTextPage *textpage)
 {
     Q_D(KoTextShapeData);
+    if (d->inRelayoutForPage)
+        return;
     delete d->textpage;
     d->textpage = textpage;
 }
@@ -234,10 +238,13 @@
         return;
     KoTextPage *oldPage = d->textpage;
     d->dirty = true;
+    d->inRelayoutForPage = true;
     d->textpage = &textPage;
     layout->interruptLayout();
-    layout->layout();
+    layout->relayout();
     d->textpage = oldPage;
+    d->dirty = true;
+    d->inRelayoutForPage = false;
 }
 
 #include <KoTextShapeData.moc>
[prev in list] [next in list] [prev in thread] [next in thread] 

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