summaryrefslogtreecommitdiff
path: root/writerperfect/source/writer/exp/txtparai.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-11-23 17:10:53 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-11-24 09:03:39 +0100
commitccd2888110a7074763e6a948f4c5da29f2196d40 (patch)
treebc2a419586b0235bd42f75be4f7bd4ee5e82d31a /writerperfect/source/writer/exp/txtparai.cxx
parente8e5bd65d31a60712afcab17d2e5f77c3322f86f (diff)
EPUB export: implement character properties of links from named styles
ODF allows text properties on hyperlinks directly, librevenge wants an inner span instead. Change-Id: I903045a688bf318e7ac7f8cac83bb4d537259969 Reviewed-on: https://gerrit.libreoffice.org/45161 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.cxx13
1 files changed, 11 insertions, 2 deletions
diff --git a/writerperfect/source/writer/exp/txtparai.cxx b/writerperfect/source/writer/exp/txtparai.cxx
index c839b8b1bbed..9c649c1d25ec 100644
--- a/writerperfect/source/writer/exp/txtparai.cxx
+++ b/writerperfect/source/writer/exp/txtparai.cxx
@@ -245,10 +245,15 @@ void XMLHyperlinkContext::startElement(const OUString &/*rName*/, const css::uno
for (sal_Int16 i = 0; i < xAttribs->getLength(); ++i)
{
const OUString &rAttributeName = xAttribs->getNameByIndex(i);
- if (rAttributeName == "xlink:href")
+ const OUString &rAttributeValue = xAttribs->getValueByIndex(i);
+ if (rAttributeName == "text:style-name")
+ // This affects the nested span's properties.
+ FillStyles(rAttributeValue, mrImport.GetAutomaticTextStyles(), mrImport.GetTextStyles(), m_aPropertyList);
+ else
{
+ // This affects the link's properties.
OString sName = OUStringToOString(rAttributeName, RTL_TEXTENCODING_UTF8);
- OString sValue = OUStringToOString(xAttribs->getValueByIndex(i), RTL_TEXTENCODING_UTF8);
+ OString sValue = OUStringToOString(rAttributeValue, RTL_TEXTENCODING_UTF8);
aPropertyList.insert(sName.getStr(), sValue.getStr());
}
}
@@ -263,8 +268,12 @@ void XMLHyperlinkContext::endElement(const OUString &/*rName*/)
void XMLHyperlinkContext::characters(const OUString &rChars)
{
+ mrImport.GetGenerator().openSpan(m_aPropertyList);
+
OString sCharU8 = OUStringToOString(rChars, RTL_TEXTENCODING_UTF8);
mrImport.GetGenerator().insertText(librevenge::RVNGString(sCharU8.getStr()));
+
+ mrImport.GetGenerator().closeSpan();
}
XMLParaContext::XMLParaContext(XMLImport &rImport)