[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - writerperfect/source

Laurent Alonso laurent.alonso at inria.fr
Mon Mar 11 00:57:57 PDT 2013


 writerperfect/source/filter/ListStyle.cxx    |    8 ++++++++
 writerperfect/source/filter/OdtGenerator.cxx |   14 ++++++++++++--
 writerperfect/source/filter/TableStyle.cxx   |    6 +++++-
 writerperfect/source/filter/TextRunStyle.cxx |    8 ++++++++
 4 files changed, 33 insertions(+), 3 deletions(-)

New commits:
commit b6a761a124c36ca97187c95526e7c1a1979454b5
Author: Laurent Alonso <laurent.alonso at inria.fr>
Date:   Mon Mar 11 08:29:17 2013 +0100

    Support some new parameters
    
    Change-Id: I22857f57822bff39ef5fcd576bd29e374f1aa819
    (cherry picked from commit d242c4a441964837e6a68343dfef9eb530fb41f7)
    
    Signed-off-by: Fridrich Å trba <fridrich.strba at bluewin.ch>

diff --git a/writerperfect/source/filter/ListStyle.cxx b/writerperfect/source/filter/ListStyle.cxx
index e1e5144..cf5900a 100644
--- a/writerperfect/source/filter/ListStyle.cxx
+++ b/writerperfect/source/filter/ListStyle.cxx
@@ -55,6 +55,8 @@ void OrderedListLevelStyle::write(OdfDocumentHandler *pHandler, int iLevel) cons
         else
             listLevelStyleOpen.addAttribute("text:start-value", "1");
     }
+    if (mPropList["text:display-levels"])
+        listLevelStyleOpen.addAttribute("text:display-levels", mPropList["text:display-levels"]->getStr());
     listLevelStyleOpen.write(pHandler);
 
     TagOpenElement stylePropertiesOpen("style:list-level-properties");
@@ -64,6 +66,8 @@ void OrderedListLevelStyle::write(OdfDocumentHandler *pHandler, int iLevel) cons
         stylePropertiesOpen.addAttribute("text:min-label-width", mPropList["text:min-label-width"]->getStr());
     if (mPropList["text:min-label-distance"] && mPropList["text:min-label-distance"]->getDouble() > 0.0)
         stylePropertiesOpen.addAttribute("text:min-label-distance", mPropList["text:min-label-distance"]->getStr());
+    if (mPropList["fo:text-align"])
+        stylePropertiesOpen.addAttribute("fo:text-align", mPropList["fo:text-align"]->getStr());
     stylePropertiesOpen.write(pHandler);
 
     pHandler->endElement("style:list-level-properties");
@@ -103,6 +107,8 @@ void UnorderedListLevelStyle::write(OdfDocumentHandler *pHandler, int iLevel) co
     }
     else
         listLevelStyleOpen.addAttribute("text:bullet-char", ".");
+    if (mPropList["text:display-levels"])
+        listLevelStyleOpen.addAttribute("text:display-levels", mPropList["text:display-levels"]->getStr());
     listLevelStyleOpen.write(pHandler);
 
     TagOpenElement stylePropertiesOpen("style:list-level-properties");
@@ -112,6 +118,8 @@ void UnorderedListLevelStyle::write(OdfDocumentHandler *pHandler, int iLevel) co
         stylePropertiesOpen.addAttribute("text:min-label-width", mPropList["text:min-label-width"]->getStr());
     if (mPropList["text:min-label-distance"] && mPropList["text:min-label-distance"]->getDouble() > 0.0)
         stylePropertiesOpen.addAttribute("text:min-label-distance", mPropList["text:min-label-distance"]->getStr());
+    if (mPropList["fo:text-align"])
+        stylePropertiesOpen.addAttribute("fo:text-align", mPropList["fo:text-align"]->getStr());
     stylePropertiesOpen.addAttribute("style:font-name", "OpenSymbol");
     stylePropertiesOpen.write(pHandler);
 
diff --git a/writerperfect/source/filter/OdtGenerator.cxx b/writerperfect/source/filter/OdtGenerator.cxx
index fc4ccbb..9ee2f67 100644
--- a/writerperfect/source/filter/OdtGenerator.cxx
+++ b/writerperfect/source/filter/OdtGenerator.cxx
@@ -1196,12 +1196,22 @@ void OdtGenerator::openFrame(const WPXPropertyList &propList)
         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());
+    static char const *(bordersString[])=
+    {"fo:border","fo:border-top","fo:border-left","fo:border-bottom","fo:border-right"};
+    for (int b = 0; b < 5; b++)
+    {
+        if (propList[bordersString[b]])
+            frameAutomaticStylePropertiesElement->addAttribute(bordersString[b], propList[bordersString[b]]->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());
+    if (propList["style:background-transparency"])
+        frameAutomaticStylePropertiesElement->addAttribute("style:background-transparency", propList["style:background-transparency"]->getStr());
+
+    if (propList["fo:clip"])
+        frameAutomaticStylePropertiesElement->addAttribute("fo:clip", propList["fo:clip"]->getStr());
 
     frameAutomaticStylePropertiesElement->addAttribute("draw:ole-draw-aspect", "1");
 
diff --git a/writerperfect/source/filter/TableStyle.cxx b/writerperfect/source/filter/TableStyle.cxx
index 18331c4..856f578 100644
--- a/writerperfect/source/filter/TableStyle.cxx
+++ b/writerperfect/source/filter/TableStyle.cxx
@@ -40,12 +40,16 @@ void TableCellStyle::write(OdfDocumentHandler *pHandler) const
     // generalize this sort of thing into the "Style" superclass
     WPXPropertyList stylePropList;
     WPXPropertyList::Iter i(mPropList);
+    /* first set padding, so that mPropList can redefine, if
+       mPropList["fo:padding"] is defined */
+    stylePropList.insert("fo:padding", "0.0382in");
     for (i.rewind(); i.next();)
     {
         if (strlen(i.key()) > 2 && strncmp(i.key(), "fo", 2) == 0)
             stylePropList.insert(i.key(), i()->clone());
+        else if (strcmp(i.key(), "style:vertical-align")==0)
+            stylePropList.insert(i.key(), i()->clone());
     }
-    stylePropList.insert("fo:padding", "0.0382in");
     pHandler->startElement("style:table-cell-properties", stylePropList);
     pHandler->endElement("style:table-cell-properties");
 
diff --git a/writerperfect/source/filter/TextRunStyle.cxx b/writerperfect/source/filter/TextRunStyle.cxx
index 4c461f9..8bb34ef 100644
--- a/writerperfect/source/filter/TextRunStyle.cxx
+++ b/writerperfect/source/filter/TextRunStyle.cxx
@@ -69,6 +69,8 @@ void ParagraphStyle::write(OdfDocumentHandler *pHandler) const
             propList.insert("fo:text-indent", i()->getStr());
         else if (strcmp(i.key(), "fo:line-height") == 0)
             propList.insert("fo:line-height", i()->getStr());
+        else if (strcmp(i.key(), "style:line-height-at-least") == 0)
+            propList.insert("style:line-height-at-least", i()->getStr());
         else if (strcmp(i.key(), "fo:break-before") == 0)
             propList.insert("fo:break-before", i()->getStr());
         else if (strcmp(i.key(), "fo:text-align") == 0)
@@ -77,6 +79,8 @@ void ParagraphStyle::write(OdfDocumentHandler *pHandler) const
             propList.insert("fo:text-align-last", i()->getStr());
         else if (strcmp(i.key(), "style:page-number") == 0)
             propList.insert("style:page-number", i()->getStr());
+        else if (strcmp(i.key(), "fo:background-color") == 0)
+            propList.insert("fo:background-color", i()->getStr());
         else if (strncmp(i.key(), "fo:border", 9) == 0)
         {
             if (strcmp(i.key(), "fo:border") == 0 ||
@@ -86,6 +90,10 @@ void ParagraphStyle::write(OdfDocumentHandler *pHandler) const
                     strcmp(i.key(), "fo:border-bottom") == 0)
                 propList.insert(i.key(), i()->getStr());
         }
+        else if (strcmp(i.key(), "fo:keep-together") == 0)
+            propList.insert("fo:keep-together", i()->getStr());
+        else if (strcmp(i.key(), "fo:keep-with-next") == 0)
+            propList.insert("fo:keep-with-next", i()->getStr());
     }
 
     propList.insert("style:justify-single-word", "false");


More information about the Libreoffice-commits mailing list