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

Fridrich Strba fridrich at kemper.freedesktop.org
Mon May 7 02:01:13 PDT 2012


 writerperfect/source/filter/OdtGenerator.cxx |   34 +++++++++++++++++++++++----
 1 file changed, 30 insertions(+), 4 deletions(-)

New commits:
commit 27482e865d1fc8d66d9a11fa524ceddf9d982833
Author: Laurent Alonso <laurent.alonso at inria.fr>
Date:   Mon May 7 10:52:13 2012 +0200

    Add possibility of generating foot/endnotes with text labels

diff --git a/writerperfect/source/filter/OdtGenerator.cxx b/writerperfect/source/filter/OdtGenerator.cxx
index 10443b9..16bc97b 100644
--- a/writerperfect/source/filter/OdtGenerator.cxx
+++ b/writerperfect/source/filter/OdtGenerator.cxx
@@ -852,8 +852,17 @@ void OdtGenerator::openFootnote(const WPXPropertyList &propList)
     }
     mpImpl->mpCurrentContentElements->push_back(pOpenFootNote);
 
-    mpImpl->mpCurrentContentElements->push_back(new TagOpenElement("text:note-citation"));
-    if (propList["libwpd:number"])
+    TagOpenElement *pOpenFootCitation = new TagOpenElement("text:note-citation");
+    if (propList["text:label"])
+    {
+        WPXString tmpString(propList["text:label"]->getStr(),true);
+        pOpenFootCitation->addAttribute("text:label", tmpString);
+    }
+    mpImpl->mpCurrentContentElements->push_back(pOpenFootCitation);
+
+    if (propList["text:label"])
+        mpImpl->mpCurrentContentElements->push_back(new CharDataElement(propList["text:label"]->getStr().cstr()));
+    else if (propList["libwpd:number"])
         mpImpl->mpCurrentContentElements->push_back(new CharDataElement(propList["libwpd:number"]->getStr().cstr()));
     mpImpl->mpCurrentContentElements->push_back(new TagCloseElement("text:note-citation"));
 
@@ -885,8 +894,17 @@ void OdtGenerator::openEndnote(const WPXPropertyList &propList)
     }
     mpImpl->mpCurrentContentElements->push_back(pOpenEndNote);
 
-    mpImpl->mpCurrentContentElements->push_back(new TagOpenElement("text:note-citation"));
-    if (propList["libwpd:number"])
+    TagOpenElement *pOpenEndCitation = new TagOpenElement("text:note-citation");
+    if (propList["text:label"])
+    {
+        WPXString tmpString(propList["text:label"]->getStr(),true);
+        pOpenEndCitation->addAttribute("text:label", tmpString);
+    }
+    mpImpl->mpCurrentContentElements->push_back(pOpenEndCitation);
+
+    if (propList["text:label"])
+        mpImpl->mpCurrentContentElements->push_back(new CharDataElement(propList["text:label"]->getStr().cstr()));
+    else if (propList["libwpd:number"])
         mpImpl->mpCurrentContentElements->push_back(new CharDataElement(propList["libwpd:number"]->getStr().cstr()));
     mpImpl->mpCurrentContentElements->push_back(new TagCloseElement("text:note-citation"));
 
commit 916b0a18acf0cabb01988a8162b9545aeee838a9
Author: Laurent Alonso <laurent.alonso at inria.fr>
Date:   Sun Apr 15 15:30:31 2012 +0200

    Check for frame borders and frame background

diff --git a/writerperfect/source/filter/OdtGenerator.cxx b/writerperfect/source/filter/OdtGenerator.cxx
index 8f6ae1b..10443b9 100644
--- a/writerperfect/source/filter/OdtGenerator.cxx
+++ b/writerperfect/source/filter/OdtGenerator.cxx
@@ -1192,6 +1192,14 @@ void OdtGenerator::openFrame(const WPXPropertyList &propList)
     if (propList["fo:max-height"])
         frameAutomaticStylePropertiesElement->addAttribute("fo:max-height", propList["fo:max-height"]->getStr());
 
+    // check if the frame has border, background attributes
+    if (propList["fo:border"])
+        frameAutomaticStylePropertiesElement->addAttribute("fo:border", propList["fo:border"]->getStr());
+    if (propList["style:border-line-width"])
+        frameAutomaticStylePropertiesElement->addAttribute("style:border-line-width", propList["style:border-line-width"]->getStr());
+    if (propList["fo:background-color"])
+        frameAutomaticStylePropertiesElement->addAttribute("fo:background-color", propList["fo:background-color"]->getStr());
+
     frameAutomaticStylePropertiesElement->addAttribute("draw:ole-draw-aspect", "1");
 
     mpImpl->mFrameAutomaticStyles.push_back(frameAutomaticStylePropertiesElement);


More information about the Libreoffice-commits mailing list