diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-11-24 09:14:05 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-11-24 14:06:22 +0100 |
commit | 8b8aa6bc010fffbcd47679aa101075d702741f69 (patch) | |
tree | 2a18d605cfbd0a5240949619dd19513345286fd7 /writerperfect/source/writer/exp/xmltbli.cxx | |
parent | ed0e7262f859adabc56a4f251f2ef1a66c98c3f5 (diff) |
EPUB export: handle total table width
This is important when e.g. the col width are 50-50%, then without
explicit total table width the table width won't be correct.
Change-Id: I5ccd6dfb5b78c564485d54cda62e12f3d1ca36c1
Reviewed-on: https://gerrit.libreoffice.org/45204
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'writerperfect/source/writer/exp/xmltbli.cxx')
-rw-r--r-- | writerperfect/source/writer/exp/xmltbli.cxx | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/writerperfect/source/writer/exp/xmltbli.cxx b/writerperfect/source/writer/exp/xmltbli.cxx index 19ea15d502a8..bec52dab0f22 100644 --- a/writerperfect/source/writer/exp/xmltbli.cxx +++ b/writerperfect/source/writer/exp/xmltbli.cxx @@ -183,10 +183,9 @@ rtl::Reference<XMLImportContext> XMLTableContext::CreateChildContext(const OUStr if (!m_bTableOpened) { - librevenge::RVNGPropertyList aPropertyList; if (!m_aColumns.empty()) - aPropertyList.insert("librevenge:table-columns", m_aColumns); - mrImport.GetGenerator().openTable(aPropertyList); + m_aPropertyList.insert("librevenge:table-columns", m_aColumns); + mrImport.GetGenerator().openTable(m_aPropertyList); m_bTableOpened = true; } @@ -198,6 +197,24 @@ rtl::Reference<XMLImportContext> XMLTableContext::CreateChildContext(const OUStr return nullptr; } +void XMLTableContext::startElement(const OUString &/*rName*/, const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) +{ + for (sal_Int16 i = 0; i < xAttribs->getLength(); ++i) + { + const OUString &rAttributeName = xAttribs->getNameByIndex(i); + const OUString &rAttributeValue = xAttribs->getValueByIndex(i); + + if (rAttributeName == "table:style-name") + FillStyles(rAttributeValue, mrImport.GetAutomaticTableStyles(), mrImport.GetTableStyles(), m_aPropertyList); + else + { + OString sName = OUStringToOString(rAttributeName, RTL_TEXTENCODING_UTF8); + OString sValue = OUStringToOString(rAttributeValue, RTL_TEXTENCODING_UTF8); + m_aPropertyList.insert(sName.getStr(), sValue.getStr()); + } + } +} + void XMLTableContext::endElement(const OUString &/*rName*/) { mrImport.GetGenerator().closeTable(); |