[calligra/calligra/2.4] plugins/variables: Display page count if no style is defined.

Thorsten Zachmann t.zachmann at zagge.de
Sat Mar 10 15:36:30 GMT 2012


Git commit 2bb698421bc709d0fbe36d9d6be73a4ad8e83387 by Thorsten Zachmann.
Committed on 10/03/2012 at 16:25.
Pushed by zachmann into branch 'calligra/2.4'.

Display page count if no style is defined.

The page count variable should be shown if there is no  num-style defined.
Use the same way as is used for the page number.

This fixes roundtrip of saving page count variable.

Please review for backporting to 2.4

CCMAIL: calligra-devel at kde.org
BUG: 295604

Reviewed by: boemann
(cherry picked from commit e4f7211557b4e258c4c2649ac9e90498f2bf2394)

M  +2    -1    plugins/variables/PageVariable.cpp

http://commits.kde.org/calligra/2bb698421bc709d0fbe36d9d6be73a4ad8e83387

diff --git a/plugins/variables/PageVariable.cpp b/plugins/variables/PageVariable.cpp
index b99c3a8..fc46240 100644
--- a/plugins/variables/PageVariable.cpp
+++ b/plugins/variables/PageVariable.cpp
@@ -70,7 +70,8 @@ void PageVariable::propertyChanged(Property property, const QVariant &value)
     switch (m_type) {
     case PageCount:
         if (property == KoInlineObject::PageCount) {
-            QString newValue = value.toInt() >= 0 ? m_numberFormat.formattedNumber(value.toInt()) : QString();
+            KoOdfNumberDefinition defaultDefinition; // FIXME Should fetch from pagestyle
+            QString newValue = value.toInt() >= 0 ? m_numberFormat.formattedNumber(value.toInt(), &defaultDefinition) : QString();
             setValue(newValue);
         }
         break;



More information about the calligra-devel mailing list