summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorXisco Fauli <anistenis@gmail.com>2015-12-11 16:11:03 +0100
committerArmin Le Grand <Armin.Le.Grand@cib.de>2015-12-17 12:23:38 +0000
commitdc3eb865bd10e690dbf80f41277b062ac2253572 (patch)
tree62dad4c8d7c73b4a54505add19f652424f87ecc1 /filter
parent2f0fba494e78ede3b6691534983f6dd7e0677a7e (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>
Diffstat (limited to 'filter')
-rw-r--r--filter/source/svg/svgreader.cxx9
1 files changed, 5 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