summaryrefslogtreecommitdiff
path: root/writerperfect/source/filter
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2007-01-23 11:15:14 +0000
committerOliver Bolte <obo@openoffice.org>2007-01-23 11:15:14 +0000
commit90681444ef4d3d73dc453abf97be6ab433845ea0 (patch)
tree6228137d8283aa0c7fc6896206c3a87890bf05fd /writerperfect/source/filter
parentd171801250c157d92a1a5d3a822c6551acb9a674 (diff)
INTEGRATION: CWS fs08 (1.2.38); FILE MERGED
2007/01/04 11:44:20 fridrich_strba 1.2.38.2: some improvements and bug-fixes from cws wpsimport01 2006/12/19 10:09:06 fridrich_strba 1.2.38.1: removing memory leaks and warnings with GNU/Linux gcc 3.4.5
Diffstat (limited to 'writerperfect/source/filter')
-rw-r--r--writerperfect/source/filter/SectionStyle.cxx41
1 files changed, 23 insertions, 18 deletions
diff --git a/writerperfect/source/filter/SectionStyle.cxx b/writerperfect/source/filter/SectionStyle.cxx
index 29665e4992ac..51dd9fc398f1 100644
--- a/writerperfect/source/filter/SectionStyle.cxx
+++ b/writerperfect/source/filter/SectionStyle.cxx
@@ -35,10 +35,6 @@
double rint(double x);
#endif /* _WIN32 */
-const float fDefaultSideMargin = 1.0f; // inches
-const float fDefaultPageWidth = 8.5f; // inches (OOo required default: we will handle this later)
-const float fDefaultPageHeight = 11.0f; // inches
-
SectionStyle::SectionStyle(const WPXPropertyList &xPropList,
const WPXPropertyListVector &xColumns,
const char *psName) :
@@ -48,34 +44,43 @@ SectionStyle::SectionStyle(const WPXPropertyList &xPropList,
{
}
-void SectionStyle::write(DocumentHandler &xHandler) const
+void SectionStyle::write(DocumentHandler *pHandler) const
{
TagOpenElement styleOpen("style:style");
styleOpen.addAttribute("style:name", getName());
styleOpen.addAttribute("style:family", "section");
- styleOpen.write(xHandler);
+ styleOpen.write(pHandler);
// if the number of columns is <= 1, we will never come here. This is only an additional check
+ // style properties
+ pHandler->startElement("style:properties", mPropList);
+
+ // column properties
+ WPXPropertyList columnProps;
+
if (mColumns.count() > 1)
{
- // style properties
- xHandler.startElement("style:properties", mPropList);
-
- // column properties
- WPXPropertyList columnProps;
columnProps.insert("fo:column-count", (int)mColumns.count());
- xHandler.startElement("style:columns", columnProps);
+ pHandler->startElement("style:columns", columnProps);
WPXPropertyListVector::Iter i(mColumns);
for (i.rewind(); i.next();)
{
- xHandler.startElement("style:column", i());
- xHandler.endElement("style:column");
+ pHandler->startElement("style:column", i());
+ pHandler->endElement("style:column");
}
-
- xHandler.endElement("style:columns");
- xHandler.endElement("style:properties");
}
+ else
+ {
+ columnProps.insert("fo:column-count", 0);
+ columnProps.insert("fo:column-gap", 0.0f);
+ pHandler->startElement("style:columns", columnProps);
+ }
+
+ pHandler->endElement("style:columns");
+
+
+ pHandler->endElement("style:properties");
- xHandler.endElement("style:style");
+ pHandler->endElement("style:style");
}