summaryrefslogtreecommitdiff
path: root/writerperfect
diff options
context:
space:
mode:
authorLaurent Alonso <laurent.alonso@inria.fr>2013-03-11 08:29:17 +0100
committerFridrich Štrba <fridrich.strba@bluewin.ch>2013-03-11 08:50:11 +0100
commitd242c4a441964837e6a68343dfef9eb530fb41f7 (patch)
tree22e56cf03c12724ab711ed2cf26a969fdc1d02a6 /writerperfect
parent09fa9ff842544f68f874e5b505b3e797c3767156 (diff)
Support some new parameters
Change-Id: I22857f57822bff39ef5fcd576bd29e374f1aa819
Diffstat (limited to 'writerperfect')
-rw-r--r--writerperfect/source/filter/ListStyle.cxx8
-rw-r--r--writerperfect/source/filter/OdtGenerator.cxx14
-rw-r--r--writerperfect/source/filter/TableStyle.cxx6
-rw-r--r--writerperfect/source/filter/TextRunStyle.cxx8
4 files changed, 33 insertions, 3 deletions
diff --git a/writerperfect/source/filter/ListStyle.cxx b/writerperfect/source/filter/ListStyle.cxx
index bb87a1cfcc41..1b6cf5c7181a 100644
--- a/writerperfect/source/filter/ListStyle.cxx
+++ b/writerperfect/source/filter/ListStyle.cxx
@@ -47,6 +47,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");
@@ -56,6 +58,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");
@@ -87,6 +91,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");
@@ -96,6 +102,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 88bcc18ca418..92ec8cc1ec87 100644
--- a/writerperfect/source/filter/OdtGenerator.cxx
+++ b/writerperfect/source/filter/OdtGenerator.cxx
@@ -1202,12 +1202,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 18331c48605c..856f578ff30e 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 4c461f96c166..8bb34efc5518 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");