21class XMLParagraphPropertiesContext :
public XMLImportContext
24 XMLParagraphPropertiesContext(XMLImport& rImport, XMLStyleContext& rStyle);
27 startElement(
const OUString& rName,
28 const css::uno::Reference<css::xml::sax::XAttributeList>& xAttribs)
override;
35XMLParagraphPropertiesContext::XMLParagraphPropertiesContext(XMLImport& rImport,
36 XMLStyleContext& rStyle)
37 : XMLImportContext(rImport)
42void XMLParagraphPropertiesContext::startElement(
43 const OUString& ,
const css::uno::Reference<css::xml::sax::XAttributeList>& xAttribs)
45 for (sal_Int16 i = 0;
i < xAttribs->getLength(); ++
i)
48 OString sValue =
OUStringToOString(xAttribs->getValueByIndex(i), RTL_TEXTENCODING_UTF8);
49 mrStyle.GetParagraphPropertyList().insert(
sName.getStr(), sValue.getStr());
56class XMLTextPropertiesContext :
public XMLImportContext
59 XMLTextPropertiesContext(XMLImport& rImport, XMLStyleContext& rStyle);
62 startElement(
const OUString& rName,
63 const css::uno::Reference<css::xml::sax::XAttributeList>& xAttribs)
override;
70XMLTextPropertiesContext::XMLTextPropertiesContext(XMLImport& rImport, XMLStyleContext& rStyle)
71 : XMLImportContext(rImport)
76void XMLTextPropertiesContext::startElement(
77 const OUString& ,
const css::uno::Reference<css::xml::sax::XAttributeList>& xAttribs)
79 for (sal_Int16 i = 0;
i < xAttribs->getLength(); ++
i)
82 OString sValue =
OUStringToOString(xAttribs->getValueByIndex(i), RTL_TEXTENCODING_UTF8);
83 mrStyle.GetTextPropertyList().insert(
sName.getStr(), sValue.getStr());
90class XMLGraphicPropertiesContext :
public XMLImportContext
93 XMLGraphicPropertiesContext(XMLImport& rImport, XMLStyleContext& rStyle);
96 startElement(
const OUString& rName,
97 const css::uno::Reference<css::xml::sax::XAttributeList>& xAttribs)
override;
104XMLGraphicPropertiesContext::XMLGraphicPropertiesContext(XMLImport& rImport,
105 XMLStyleContext& rStyle)
106 : XMLImportContext(rImport)
111void XMLGraphicPropertiesContext::startElement(
112 const OUString& ,
const css::uno::Reference<css::xml::sax::XAttributeList>& xAttribs)
114 for (sal_Int16 i = 0;
i < xAttribs->getLength(); ++
i)
117 OString sValue =
OUStringToOString(xAttribs->getValueByIndex(i), RTL_TEXTENCODING_UTF8);
118 mrStyle.GetGraphicPropertyList().insert(
sName.getStr(), sValue.getStr());
125class XMLPageLayoutPropertiesContext :
public XMLImportContext
128 XMLPageLayoutPropertiesContext(XMLImport& rImport, XMLStyleContext& rStyle);
131 startElement(
const OUString& rName,
132 const css::uno::Reference<css::xml::sax::XAttributeList>& xAttribs)
override;
139XMLPageLayoutPropertiesContext::XMLPageLayoutPropertiesContext(XMLImport& rImport,
140 XMLStyleContext& rStyle)
141 : XMLImportContext(rImport)
146void XMLPageLayoutPropertiesContext::startElement(
147 const OUString& ,
const css::uno::Reference<css::xml::sax::XAttributeList>& xAttribs)
149 for (sal_Int16 i = 0;
i < xAttribs->getLength(); ++
i)
152 OString sValue =
OUStringToOString(xAttribs->getValueByIndex(i), RTL_TEXTENCODING_UTF8);
154 if (sName !=
"style:writing-mode")
157 mrStyle.GetPageLayoutPropertyList().insert(
sName.getStr(), sValue.getStr());
164class XMLTablePropertiesContext :
public XMLImportContext
167 XMLTablePropertiesContext(XMLImport& rImport, XMLStyleContext& rStyle);
170 startElement(
const OUString& rName,
171 const css::uno::Reference<css::xml::sax::XAttributeList>& xAttribs)
override;
178XMLTablePropertiesContext::XMLTablePropertiesContext(XMLImport& rImport, XMLStyleContext& rStyle)
179 : XMLImportContext(rImport)
184void XMLTablePropertiesContext::startElement(
185 const OUString& ,
const css::uno::Reference<css::xml::sax::XAttributeList>& xAttribs)
187 for (sal_Int16 i = 0;
i < xAttribs->getLength(); ++
i)
190 OString sValue =
OUStringToOString(xAttribs->getValueByIndex(i), RTL_TEXTENCODING_UTF8);
191 if (sName ==
"style:rel-width")
193 mrStyle.GetTablePropertyList().insert(
194 sName.getStr(), librevenge::RVNGPropertyFactory::newStringProp(sValue.getStr()));
196 mrStyle.GetTablePropertyList().insert(
sName.getStr(), sValue.getStr());
203class XMLTableRowPropertiesContext :
public XMLImportContext
206 XMLTableRowPropertiesContext(XMLImport& rImport, XMLStyleContext& rStyle);
209 startElement(
const OUString& rName,
210 const css::uno::Reference<css::xml::sax::XAttributeList>& xAttribs)
override;
217XMLTableRowPropertiesContext::XMLTableRowPropertiesContext(XMLImport& rImport,
218 XMLStyleContext& rStyle)
219 : XMLImportContext(rImport)
224void XMLTableRowPropertiesContext::startElement(
225 const OUString& ,
const css::uno::Reference<css::xml::sax::XAttributeList>& xAttribs)
227 for (sal_Int16 i = 0;
i < xAttribs->getLength(); ++
i)
230 OString sValue =
OUStringToOString(xAttribs->getValueByIndex(i), RTL_TEXTENCODING_UTF8);
231 mrStyle.GetRowPropertyList().insert(
sName.getStr(), sValue.getStr());
238class XMLTableColumnPropertiesContext :
public XMLImportContext
241 XMLTableColumnPropertiesContext(XMLImport& rImport, XMLStyleContext& rStyle);
244 startElement(
const OUString& rName,
245 const css::uno::Reference<css::xml::sax::XAttributeList>& xAttribs)
override;
252XMLTableColumnPropertiesContext::XMLTableColumnPropertiesContext(XMLImport& rImport,
253 XMLStyleContext& rStyle)
254 : XMLImportContext(rImport)
259void XMLTableColumnPropertiesContext::startElement(
260 const OUString& ,
const css::uno::Reference<css::xml::sax::XAttributeList>& xAttribs)
262 for (sal_Int16 i = 0;
i < xAttribs->getLength(); ++
i)
265 OString sValue =
OUStringToOString(xAttribs->getValueByIndex(i), RTL_TEXTENCODING_UTF8);
266 mrStyle.GetColumnPropertyList().insert(
sName.getStr(), sValue.getStr());
273class XMLTableCellPropertiesContext :
public XMLImportContext
276 XMLTableCellPropertiesContext(XMLImport& rImport, XMLStyleContext& rStyle);
279 startElement(
const OUString& rName,
280 const css::uno::Reference<css::xml::sax::XAttributeList>& xAttribs)
override;
287XMLTableCellPropertiesContext::XMLTableCellPropertiesContext(XMLImport& rImport,
288 XMLStyleContext& rStyle)
289 : XMLImportContext(rImport)
294void XMLTableCellPropertiesContext::startElement(
295 const OUString& ,
const css::uno::Reference<css::xml::sax::XAttributeList>& xAttribs)
297 for (sal_Int16 i = 0;
i < xAttribs->getLength(); ++
i)
300 OString sValue =
OUStringToOString(xAttribs->getValueByIndex(i), RTL_TEXTENCODING_UTF8);
301 mrStyle.GetCellPropertyList().insert(
sName.getStr(), sValue.getStr());
312 const OUString& rName,
const css::uno::Reference<css::xml::sax::XAttributeList>& )
314 if (rName ==
"style:paragraph-properties")
315 return new XMLParagraphPropertiesContext(
GetImport(), *
this);
316 if (rName ==
"style:text-properties")
317 return new XMLTextPropertiesContext(
GetImport(), *
this);
318 if (rName ==
"style:table-cell-properties")
319 return new XMLTableCellPropertiesContext(
GetImport(), *
this);
320 if (rName ==
"style:table-column-properties")
321 return new XMLTableColumnPropertiesContext(
GetImport(), *
this);
322 if (rName ==
"style:table-row-properties")
323 return new XMLTableRowPropertiesContext(
GetImport(), *
this);
324 if (rName ==
"style:table-properties")
325 return new XMLTablePropertiesContext(
GetImport(), *
this);
326 if (rName ==
"style:graphic-properties")
327 return new XMLGraphicPropertiesContext(
GetImport(), *
this);
328 if (rName ==
"style:page-layout-properties")
329 return new XMLPageLayoutPropertiesContext(
GetImport(), *
this);
334 const OUString& ,
const css::uno::Reference<css::xml::sax::XAttributeList>& xAttribs)
336 for (sal_Int16
i = 0;
i < xAttribs->getLength(); ++
i)
338 const OUString& rAttributeName = xAttribs->getNameByIndex(
i);
339 const OUString& rAttributeValue = xAttribs->getValueByIndex(
i);
340 if (rAttributeName ==
"style:name")
342 else if (rAttributeName ==
"style:family")
376 else if (rName ==
"style:page-layout")
378 else if (rName ==
"style:master-page")
Base class for a handler of a single XML element during ODF -> librevenge conversion.
ODT export feeds this class to make librevenge calls.
librevenge::RVNGPropertyList & GetGraphicPropertyList()
librevenge::RVNGPropertyList m_aCellPropertyList
librevenge::RVNGPropertyList & GetPageLayoutPropertyList()
librevenge::RVNGPropertyList & GetRowPropertyList()
librevenge::RVNGPropertyList m_aTablePropertyList
librevenge::RVNGPropertyList & GetTablePropertyList()
librevenge::RVNGPropertyList m_aColumnPropertyList
librevenge::RVNGPropertyList m_aMasterPagePropertyList
librevenge::RVNGPropertyList m_aGraphicPropertyList
librevenge::RVNGPropertyList & GetColumnPropertyList()
XMLStylesContext & m_rStyles
void SAL_CALL startElement(const OUString &rName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttribs) override
librevenge::RVNGPropertyList m_aTextPropertyList
void SAL_CALL endElement(const OUString &rName) override
librevenge::RVNGPropertyList & GetTextPropertyList()
librevenge::RVNGPropertyList m_aParagraphPropertyList
librevenge::RVNGPropertyList & GetParagraphPropertyList()
rtl::Reference< XMLImportContext > CreateChildContext(const OUString &rName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttribs) override
librevenge::RVNGPropertyList m_aRowPropertyList
librevenge::RVNGPropertyList & GetCellPropertyList()
librevenge::RVNGPropertyList m_aPageLayoutPropertyList
Handler for <office:automatic-styles>/<office:styles>.
std::map< OUString, librevenge::RVNGPropertyList > & GetCurrentPageLayouts()
std::map< OUString, librevenge::RVNGPropertyList > & GetCurrentColumnStyles()
std::map< OUString, librevenge::RVNGPropertyList > & GetCurrentRowStyles()
std::map< OUString, librevenge::RVNGPropertyList > & GetCurrentMasterStyles()
std::map< OUString, librevenge::RVNGPropertyList > & GetCurrentTableStyles()
std::map< OUString, librevenge::RVNGPropertyList > & GetCurrentGraphicStyles()
std::map< OUString, librevenge::RVNGPropertyList > & GetCurrentCellStyles()
std::map< OUString, librevenge::RVNGPropertyList > & GetCurrentParagraphStyles()
std::map< OUString, librevenge::RVNGPropertyList > & GetCurrentTextStyles()
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
XMLStyleContext & mrStyle