summaryrefslogtreecommitdiff
path: root/writerperfect/source/writer/exp/txtparai.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-10-17 16:33:06 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-10-17 18:04:08 +0200
commitf61acf7ebb2365d29209310b56c371ccf63f153d (patch)
tree725107363ef5b417ce74a3a6eacd2f798ab4558a /writerperfect/source/writer/exp/txtparai.cxx
parent66b3970c946bd25647484ea1ac2c2e62bd9fb7b4 (diff)
EPUB export: handle char format of hyperlinks
<text:a> child elements were not handled. Change-Id: I7db9c005869934456ffbe5c36347b01cc76645b6 Reviewed-on: https://gerrit.libreoffice.org/43462 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'writerperfect/source/writer/exp/txtparai.cxx')
-rw-r--r--writerperfect/source/writer/exp/txtparai.cxx19
1 files changed, 16 insertions, 3 deletions
diff --git a/writerperfect/source/writer/exp/txtparai.cxx b/writerperfect/source/writer/exp/txtparai.cxx
index fa6f91f0bd7b..c839b8b1bbed 100644
--- a/writerperfect/source/writer/exp/txtparai.cxx
+++ b/writerperfect/source/writer/exp/txtparai.cxx
@@ -214,16 +214,29 @@ void XMLTabContext::startElement(const OUString &/*rName*/, const css::uno::Refe
class XMLHyperlinkContext : public XMLImportContext
{
public:
- XMLHyperlinkContext(XMLImport &rImport);
+ XMLHyperlinkContext(XMLImport &rImport, const librevenge::RVNGPropertyList &rPropertyList);
+ rtl::Reference<XMLImportContext> CreateChildContext(const OUString &rName, const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
void SAL_CALL startElement(const OUString &rName, const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs) override;
void SAL_CALL endElement(const OUString &rName) override;
void SAL_CALL characters(const OUString &rChars) override;
+
+private:
+ librevenge::RVNGPropertyList m_aPropertyList;
};
-XMLHyperlinkContext::XMLHyperlinkContext(XMLImport &rImport)
+XMLHyperlinkContext::XMLHyperlinkContext(XMLImport &rImport, const librevenge::RVNGPropertyList &rPropertyList)
: XMLImportContext(rImport)
{
+ // Inherit properties from parent.
+ librevenge::RVNGPropertyList::Iter itProp(rPropertyList);
+ for (itProp.rewind(); itProp.next();)
+ m_aPropertyList.insert(itProp.key(), itProp()->clone());
+}
+
+rtl::Reference<XMLImportContext> XMLHyperlinkContext::CreateChildContext(const OUString &rName, const css::uno::Reference<css::xml::sax::XAttributeList> &/*xAttribs*/)
+{
+ return CreateParagraphOrSpanChildContext(mrImport, rName, m_aPropertyList);
}
void XMLHyperlinkContext::startElement(const OUString &/*rName*/, const css::uno::Reference<css::xml::sax::XAttributeList> &xAttribs)
@@ -262,7 +275,7 @@ XMLParaContext::XMLParaContext(XMLImport &rImport)
rtl::Reference<XMLImportContext> XMLParaContext::CreateChildContext(const OUString &rName, const css::uno::Reference<css::xml::sax::XAttributeList> &/*xAttribs*/)
{
if (rName == "text:a")
- return new XMLHyperlinkContext(mrImport);
+ return new XMLHyperlinkContext(mrImport, m_aTextPropertyList);
return CreateParagraphOrSpanChildContext(mrImport, rName, m_aTextPropertyList);
}