[calligra] libs/kopageapp: Don't show pageX as nam of the page

Thorsten Zachmann t.zachmann at zagge.de
Sun Mar 25 06:32:14 BST 2012


Git commit 4deb1cab33459e7353abb68ccb01dd0b56f4754c by Thorsten Zachmann.
Committed on 25/03/2012 at 07:29.
Pushed by zachmann into branch 'master'.

Don't show pageX as nam of the page

in case pageX is used for saving remove that on loading. This name is used
on saving if e.g. no name for the page was set. This fixes the problem that
after save/load of a document all slides/pages are named pageX.

BUG: 294223

CCMAIL: calligra-devel at kde.org

Please review so I can backport to 2.4

M  +5    -0    libs/kopageapp/KoPADocument.cpp

http://commits.kde.org/calligra/4deb1cab33459e7353abb68ccb01dd0b56f4754c

diff --git a/libs/kopageapp/KoPADocument.cpp b/libs/kopageapp/KoPADocument.cpp
index e118d9b..afcde61 100644
--- a/libs/kopageapp/KoPADocument.cpp
+++ b/libs/kopageapp/KoPADocument.cpp
@@ -314,6 +314,11 @@ QList<KoPAPageBase *> KoPADocument::loadOdfPages( const KoXmlElement & body, KoP
             KoPAPage *page = newPage(static_cast<KoPAMasterPage*>(d->masterPages.first()));
             page->loadOdf( element, context );
             pages.append( page );
+            // in case the page name is pageX where X is the page number remove the name as this is
+            // remove the page name and show the default page name like Slide X or Page X. 
+            if (page->name() == QString("page%1").arg(pages.size())) {
+                page->setName("");
+            }
         }
 
         if (d->odfPageProgressUpdater) {



More information about the calligra-devel mailing list