summaryrefslogtreecommitdiff
path: root/writerperfect/source/writer/exp/xmltbli.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-11-24 09:09:25 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-11-24 11:13:42 +0100
commit0baecd418e79a703dcf89fec3f66e416beefcf56 (patch)
tree9b12af15996927341bc81f6dd4cf00e0c8bb4ae0 /writerperfect/source/writer/exp/xmltbli.cxx
parent7b355976ab65d059073978e4ab334c94a7dd450e (diff)
EPUB export: implement row span for tables
By turning <table:table-cell> attributes into librevenge properties. Also make sure that row/cell styles are inline at a libepubgen level. Change-Id: Ic23058748d241209845f76d8edc548bab8212c5f
Diffstat (limited to 'writerperfect/source/writer/exp/xmltbli.cxx')
-rw-r--r--writerperfect/source/writer/exp/xmltbli.cxx20
1 files changed, 17 insertions, 3 deletions
diff --git a/writerperfect/source/writer/exp/xmltbli.cxx b/writerperfect/source/writer/exp/xmltbli.cxx
index d5844fd18d5c..cdaabdab0349 100644
--- a/writerperfect/source/writer/exp/xmltbli.cxx
+++ b/writerperfect/source/writer/exp/xmltbli.cxx
@@ -42,9 +42,19 @@ rtl::Reference<XMLImportContext> XMLTableCellContext::CreateChildContext(const O
return CreateTextChildContext(mrImport, rName);
}
-void XMLTableCellContext::startElement(const OUString &/*rName*/, const css::uno::Reference<css::xml::sax::XAttributeList> &/*xAttribs*/)
-{
- mrImport.GetGenerator().openTableCell(librevenge::RVNGPropertyList());
+void XMLTableCellContext::startElement(const OUString &/*rName*/, const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs)
+{
+ librevenge::RVNGPropertyList aPropertyList;
+ for (sal_Int16 i = 0; i < xAttribs->getLength(); ++i)
+ {
+ const OUString &rAttributeName = xAttribs->getNameByIndex(i);
+ const OUString &rAttributeValue = xAttribs->getValueByIndex(i);
+
+ OString sName = OUStringToOString(rAttributeName, RTL_TEXTENCODING_UTF8);
+ OString sValue = OUStringToOString(rAttributeValue, RTL_TEXTENCODING_UTF8);
+ aPropertyList.insert(sName.getStr(), sValue.getStr());
+ }
+ mrImport.GetGenerator().openTableCell(aPropertyList);
}
void XMLTableCellContext::endElement(const OUString &/*rName*/)
@@ -73,6 +83,10 @@ rtl::Reference<XMLImportContext> XMLTableRowContext::CreateChildContext(const OU
{
if (rName == "table:table-cell")
return new XMLTableCellContext(mrImport);
+ if (rName == "table:covered-table-cell")
+ mrImport.GetGenerator().insertCoveredTableCell(librevenge::RVNGPropertyList());
+ else
+ SAL_WARN("writerperfect", "XMLTableRowContext::CreateChildContext: unhandled " << rName);
return nullptr;
}