diff options
author | Xisco Fauli <anistenis@gmail.com> | 2015-12-11 16:11:03 +0100 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@cib.de> | 2015-12-17 12:23:38 +0000 |
commit | dc3eb865bd10e690dbf80f41277b062ac2253572 (patch) | |
tree | 62dad4c8d7c73b4a54505add19f652424f87ecc1 | |
parent | 2f0fba494e78ede3b6691534983f6dd7e0677a7e (diff) |
tdf#32248 SVG: first attempt to support tspan elements
it's not perfect but at least we can already display the text,
which is better than displaying nothing
Change-Id: I89627010ac8071c106b41c1de6b183a619f8158b
Reviewed-on: https://gerrit.libreoffice.org/20642
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
-rw-r--r-- | filter/source/svg/svgreader.cxx | 9 | ||||
-rw-r--r-- | include/xmloff/xmltoken.hxx | 1 | ||||
-rw-r--r-- | xmloff/source/core/xmltoken.cxx | 1 |
3 files changed, 7 insertions, 4 deletions
diff --git a/filter/source/svg/svgreader.cxx b/filter/source/svg/svgreader.cxx index b9737f1a3f1b..814c74512e3b 100644 --- a/filter/source/svg/svgreader.cxx +++ b/filter/source/svg/svgreader.cxx @@ -175,7 +175,7 @@ struct AnnotatingVisitor void operator()( const uno::Reference<xml::dom::XElement>& xElem) { const sal_Int32 nTagId(getTokenId(xElem->getTagName())); - if (nTagId != XML_TEXT) + if (nTagId != XML_TEXT || nTagId != XML_TSPAN) return; maCurrState = maParentStates.back(); @@ -476,7 +476,7 @@ struct AnnotatingVisitor rtl::Reference<SvXMLAttributeList> xAttrs( new SvXMLAttributeList() ); uno::Reference<xml::sax::XAttributeList> xUnoAttrs( xAttrs.get() ); - if (XML_TEXT == nTagId) { + if (XML_TEXT == nTagId || XML_TSPAN == nTagId) { rState.mbIsText = true; basegfx::B2DTuple aScale, aTranslate; double fRotate, fShearX; @@ -587,7 +587,7 @@ struct AnnotatingVisitor } // serialize to automatic-style section - if( nTagId == XML_TEXT ) + if( nTagId == XML_TEXT || nTagId == XML_TSPAN) { // write paragraph style attributes xAttrs->Clear(); @@ -633,7 +633,7 @@ struct AnnotatingVisitor // text or shape? if the former, no use in processing any // graphic attributes except stroke color, ODF can do ~nothing // with text shapes - if( nTagId == XML_TEXT ) + if( nTagId == XML_TEXT || nTagId == XML_TSPAN ) { //xAttrs->AddAttribute( "draw:auto-grow-height", "true"); xAttrs->AddAttribute( "draw:auto-grow-width", "true"); @@ -1546,6 +1546,7 @@ struct ShapeWritingVisitor writeBinaryData(xAttrs, xUnoAttrs, xElem, basegfx::B2DRange(x,y,x+width,y+height), sLinkValue); break; } + case XML_TSPAN: case XML_TEXT: { // collect text from all TEXT_NODE children into sText diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx index a63fe2374f84..062852b80357 100644 --- a/include/xmloff/xmltoken.hxx +++ b/include/xmloff/xmltoken.hxx @@ -1913,6 +1913,7 @@ namespace xmloff { namespace token { XML_TRUE, XML_TRUNCATE_ON_OVERFLOW, XML_TRY_STAGGERING_FIRST, + XML_TSPAN, XML_TTB, XML_TYPE, XML_DOT_DASH, diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx index 949ac82a47c2..0ebf728308f6 100644 --- a/xmloff/source/core/xmltoken.cxx +++ b/xmloff/source/core/xmltoken.cxx @@ -1918,6 +1918,7 @@ namespace xmloff { namespace token { TOKEN( "true", XML_TRUE ), TOKEN( "truncate-on-overflow", XML_TRUNCATE_ON_OVERFLOW ), TOKEN( "try-staggering-first", XML_TRY_STAGGERING_FIRST ), + TOKEN( "tspan", XML_TSPAN ), TOKEN( "ttb", XML_TTB ), TOKEN( "type", XML_TYPE ), TOKEN( "dot-dash", XML_DOT_DASH ), |