filters
SectionStyle.cxx00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include "FilterInternal.hxx"
00031 #include "SectionStyle.hxx"
00032 #include "DocumentElement.hxx"
00033 #include <math.h>
00034
00035 #ifdef _MSC_VER
00036 double rint(double x);
00037 #endif
00038
00039
00040 SectionStyle::SectionStyle(const WPXPropertyList &xPropList,
00041 const WPXPropertyListVector &xColumns,
00042 const char *psName) :
00043 Style(psName),
00044 mPropList(xPropList),
00045 mColumns(xColumns)
00046 {
00047 }
00048
00049 void SectionStyle::write(DocumentHandler &xHandler) const
00050 {
00051 TagOpenElement styleOpen("style:style");
00052 styleOpen.addAttribute("style:name", getName());
00053 styleOpen.addAttribute("style:family", "section");
00054 styleOpen.write(xHandler);
00055
00056
00057 if (mColumns.count() > 1)
00058 {
00059
00060 xHandler.startElement("style:properties", mPropList);
00061
00062
00063 WPXPropertyList columnProps;
00064 columnProps.insert("fo:column-count", (int)mColumns.count());
00065 xHandler.startElement("style:columns", columnProps);
00066
00067 WPXPropertyListVector::Iter i(mColumns);
00068 for (i.rewind(); i.next();)
00069 {
00070 xHandler.startElement("style:column", i());
00071 xHandler.endElement("style:column");
00072 }
00073
00074 xHandler.endElement("style:columns");
00075 xHandler.endElement("style:properties");
00076 }
00077
00078 xHandler.endElement("style:style");
00079 }
|