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

List:       kde-commits
Subject:    branches/work/koffice-essen/libs/kotext/styles
From:       Casper Boemann <cbr () boemann ! dk>
Date:       2010-12-02 10:21:46
Message-ID: 20101202102146.37A14AC8A4 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1202800 by boemann:

Don't inherit  pagebreaks according to odf
Yet don't remove it from  previous block format if it was already there



 M  +7 -1      KoParagraphStyle.cpp  


--- branches/work/koffice-essen/libs/kotext/styles/KoParagraphStyle.cpp #1202799:1202800
@@ -187,10 +187,16 @@
 
 void KoParagraphStyle::applyStyle(QTextBlockFormat &format) const
 {
+    bool hadbreak = format.hasProperty(QTextFormat::PageBreakPolicy);
+
     if (d->parentStyle) {
         d->parentStyle->applyStyle(format);
     }
-
+    if (!hadBreak) {
+         // page preak should not be inherited according to odf, yet if it was there before we
+         // shouldn't remove
+         format.clearProperty(QTextFormat::PageBreakPolicy);
+    }
     const QMap<int, QVariant> props = d->stylesPrivate.properties();
     QMap<int, QVariant>::const_iterator it = props.begin();
     while (it != props.end()) {
[prev in list] [next in list] [prev in thread] [next in thread] 

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