[Libreoffice-commits] .: 2 commits - writerperfect/source

Fridrich Strba fridrich at kemper.freedesktop.org
Mon Apr 4 08:36:02 PDT 2011


 writerperfect/source/filter/DocumentCollector.cxx |   24 +++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

New commits:
commit 5823cbe07c38282af8002b8e1650ddc2b30ae0fe
Author: Michael Meeks <michael.meeks at novell.com>
Date:   Mon Apr 4 11:51:38 2011 +0100

    fix crasher in header / footnotes with no occurrence set

diff --git a/writerperfect/source/filter/DocumentCollector.cxx b/writerperfect/source/filter/DocumentCollector.cxx
index 6d2d9ce..cae7736 100644
--- a/writerperfect/source/filter/DocumentCollector.cxx
+++ b/writerperfect/source/filter/DocumentCollector.cxx
@@ -456,14 +456,20 @@ void DocumentCollector::openPageSpan(const WPXPropertyList &propList)
     mWriterDocumentStates.top().mbFirstParagraphInPageSpan = true;
 }
 
+static bool
+isOccurrenceEven (const WPXPropertyList &propList)
+{
+    const WPXProperty *occurance = propList["libwpd:occurence"];
+    return occurance && occurance->getStr() == "even";
+}
+
 void DocumentCollector::openHeader(const WPXPropertyList &propList)
 {
     std::vector<DocumentElement *> * pHeaderFooterContentElements = new std::vector<DocumentElement *>;
-
-    if (propList["libwpd:occurence"]->getStr() == "even")
-                mpCurrentPageSpan->setHeaderLeftContent(pHeaderFooterContentElements);
-        else
-                mpCurrentPageSpan->setHeaderContent(pHeaderFooterContentElements);
+    if (isOccurrenceEven (propList))
+        mpCurrentPageSpan->setHeaderLeftContent(pHeaderFooterContentElements);
+    else
+        mpCurrentPageSpan->setHeaderContent(pHeaderFooterContentElements);
 
     mpCurrentContentElements = pHeaderFooterContentElements;
 }
@@ -477,10 +483,10 @@ void DocumentCollector::openFooter(const WPXPropertyList &propList)
 {
     std::vector<DocumentElement *> * pHeaderFooterContentElements = new std::vector<DocumentElement *>;
 
-    if (propList["libwpd:occurence"]->getStr() == "even")
-                mpCurrentPageSpan->setFooterLeftContent(pHeaderFooterContentElements);
-        else
-                mpCurrentPageSpan->setFooterContent(pHeaderFooterContentElements);
+    if (isOccurrenceEven (propList))
+        mpCurrentPageSpan->setFooterLeftContent(pHeaderFooterContentElements);
+    else
+        mpCurrentPageSpan->setFooterContent(pHeaderFooterContentElements);
 
     mpCurrentContentElements = pHeaderFooterContentElements;
 }
commit 76e77042010beba08703f23d6d76f9f54aaf6993
Author: Fridrich Å trba <fridrich.strba at bluewin.ch>
Date:   Mon Apr 4 17:30:57 2011 +0200

    occurrence -> occurence and don't crash anymore

diff --git a/writerperfect/source/filter/DocumentCollector.cxx b/writerperfect/source/filter/DocumentCollector.cxx
index 94b48bc..6d2d9ce 100644
--- a/writerperfect/source/filter/DocumentCollector.cxx
+++ b/writerperfect/source/filter/DocumentCollector.cxx
@@ -460,7 +460,7 @@ void DocumentCollector::openHeader(const WPXPropertyList &propList)
 {
     std::vector<DocumentElement *> * pHeaderFooterContentElements = new std::vector<DocumentElement *>;
 
-    if (propList["libwpd:occurrence"]->getStr() == "even")
+    if (propList["libwpd:occurence"]->getStr() == "even")
                 mpCurrentPageSpan->setHeaderLeftContent(pHeaderFooterContentElements);
         else
                 mpCurrentPageSpan->setHeaderContent(pHeaderFooterContentElements);
@@ -477,7 +477,7 @@ void DocumentCollector::openFooter(const WPXPropertyList &propList)
 {
     std::vector<DocumentElement *> * pHeaderFooterContentElements = new std::vector<DocumentElement *>;
 
-    if (propList["libwpd:occurrence"]->getStr() == "even")
+    if (propList["libwpd:occurence"]->getStr() == "even")
                 mpCurrentPageSpan->setFooterLeftContent(pHeaderFooterContentElements);
         else
                 mpCurrentPageSpan->setFooterContent(pHeaderFooterContentElements);


More information about the Libreoffice-commits mailing list