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

List:       kde-commits
Subject:    koffice/kword/part/frames
From:       Matus Hanzes <matus.hanzes () ixonos ! com>
Date:       2010-08-10 12:33:53
Message-ID: 20100810123354.020C1AC7E8 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1161608 by hanzes:

Revert commit 1158423 because it causes severe regressions for background images.  Discussed with ingwa.

 M  +22 -15    KWFrameLayout.cpp  
 M  +0 -1      KWPageBackground.cpp  


--- trunk/koffice/kword/part/frames/KWFrameLayout.cpp #1161607:1161608
@@ -66,11 +66,15 @@
     // create page background
     KWTextFrameSet *fs = getOrCreate(KWord::PageBackgroundFrameSet, page);
     if (!hasFrameOn(fs, pageNumber)) {
+        if (fs->frameCount() == 0) {
         KoShape *shape = new KWPageBackground();
-        shape->setSize(QSizeF(page.width(), page.height()));
-        KWFrame *f = new KWFrame(shape, fs);
-        f->setTextRunAround(KWord::RunThrough);
+            shape->setSize(QSize(20, 10));
+            new KWFrame(shape, fs);
     }
+        else {
+            createCopyFrame(fs, page);
+        }
+    }
 
     // create headers & footers
     KWord::TextFrameSetType origin;
@@ -320,19 +324,22 @@
         default:;
         }
     }
-    if (minZIndex < INT_MAX) {
-        --minZIndex;
-        if (endnote)
-            endnote->shape()->setZIndex(minZIndex--);
-        for (int i = 0; i < columns; ++i)
-            main[i]->shape()->setZIndex(minZIndex);
-        if (footer)
-            footer->shape()->setZIndex(--minZIndex);
-        if (header)
-            header->shape()->setZIndex(--minZIndex);
-        if (pageBackground)
-            pageBackground->shape()->setZIndex(--minZIndex);
+    for (int i = 0; i < columns; ++i) {
+        main[i]->shape()->setZIndex(SHRT_MIN + 3);
+
     }
+    if (footer) {
+        footer->shape()->setZIndex(SHRT_MIN + 2);
+    }
+    if (endnote) {
+        endnote->shape()->setZIndex(SHRT_MIN + 4);
+    }
+    if (header) {
+        header->shape()->setZIndex(SHRT_MIN + 1);
+    }
+    if (pageBackground) {
+        pageBackground->shape()->setZIndex(SHRT_MIN);
+    }
 
     // spread space across items.
     qreal heightLeft = page.height();
--- trunk/koffice/kword/part/frames/KWPageBackground.cpp #1161607:1161608
@@ -32,7 +32,6 @@
 
 void KWPageBackground::paint(QPainter &painter, const KoViewConverter &converter)
 {
-    return;
     if (background()) {
         applyConversion(painter, converter);
         QPainterPath p;
[prev in list] [next in list] [prev in thread] [next in thread] 

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