Kaydet (Commit) 5270eacd authored tarafından Miklos Vajna's avatar Miklos Vajna

EPUB export: handle text properties from paragraph styles

Same as previous EPUB commit, but this time for text properties, not
paragraph ones.

Change-Id: I46d59d92028cf4155bfbbf68805a1b6c259e81e2
Reviewed-on: https://gerrit.libreoffice.org/41945Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
üst 7d96c84d
...@@ -225,6 +225,11 @@ void EPUBExportTest::testParaNamedstyle() ...@@ -225,6 +225,11 @@ void EPUBExportTest::testParaNamedstyle()
assertXPath(mpXmlDoc, "//xhtml:p[1]", "class", "para0"); assertXPath(mpXmlDoc, "//xhtml:p[1]", "class", "para0");
// This failed, paragraph properties from style were not exported. // This failed, paragraph properties from style were not exported.
assertXPath(mpXmlDoc, "//xhtml:p[2]", "class", "para1"); assertXPath(mpXmlDoc, "//xhtml:p[2]", "class", "para1");
// Test character properties from named paragraph style.
assertXPath(mpXmlDoc, "//xhtml:p[1]/xhtml:span", "class", "span0");
// This failed, character properties from paragraph style were not exported.
assertXPath(mpXmlDoc, "//xhtml:p[2]/xhtml:span", "class", "span1");
} }
CPPUNIT_TEST_SUITE_REGISTRATION(EPUBExportTest); CPPUNIT_TEST_SUITE_REGISTRATION(EPUBExportTest);
......
...@@ -204,6 +204,17 @@ void XMLParaContext::characters(const OUString &rChars) ...@@ -204,6 +204,17 @@ void XMLParaContext::characters(const OUString &rChars)
for (itProp.rewind(); itProp.next();) for (itProp.rewind(); itProp.next();)
aPropertyList.insert(itProp.key(), itProp()->clone()); aPropertyList.insert(itProp.key(), itProp()->clone());
} }
else
{
itStyle = mrImport.GetTextStyles().find(m_aStyleName);
if (itStyle != mrImport.GetTextStyles().end())
{
// Found a named text style.
librevenge::RVNGPropertyList::Iter itProp(itStyle->second);
for (itProp.rewind(); itProp.next();)
aPropertyList.insert(itProp.key(), itProp()->clone());
}
}
} }
mrImport.GetGenerator().openSpan(aPropertyList); mrImport.GetGenerator().openSpan(aPropertyList);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment