diff options
-rw-r--r-- | writerperfect/qa/unit/EPUBExportTest.cxx | 5 | ||||
-rw-r--r-- | writerperfect/source/writer/exp/txtparai.cxx | 11 |
2 files changed, 16 insertions, 0 deletions
diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx b/writerperfect/qa/unit/EPUBExportTest.cxx index 5163c7234074..8ab03f6df48e 100644 --- a/writerperfect/qa/unit/EPUBExportTest.cxx +++ b/writerperfect/qa/unit/EPUBExportTest.cxx @@ -225,6 +225,11 @@ void EPUBExportTest::testParaNamedstyle() assertXPath(mpXmlDoc, "//xhtml:p[1]", "class", "para0"); // This failed, paragraph properties from style were not exported. 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); diff --git a/writerperfect/source/writer/exp/txtparai.cxx b/writerperfect/source/writer/exp/txtparai.cxx index b812549c69b3..932ae744f4e9 100644 --- a/writerperfect/source/writer/exp/txtparai.cxx +++ b/writerperfect/source/writer/exp/txtparai.cxx @@ -204,6 +204,17 @@ void XMLParaContext::characters(const OUString &rChars) for (itProp.rewind(); itProp.next();) 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); |