filter/source/svg/svgreader.cxx | 9 +++++---- include/xmloff/xmltoken.hxx | 1 + xmloff/source/core/xmltoken.cxx | 1 + 3 files changed, 7 insertions(+), 4 deletions(-)
New commits: commit dc3eb865bd10e690dbf80f41277b062ac2253572 Author: Xisco Fauli <aniste...@gmail.com> Date: Fri Dec 11 16:11:03 2015 +0100 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 <c...@libreoffice.org> Reviewed-by: Armin Le Grand <armin.le.gr...@cib.de> diff --git a/filter/source/svg/svgreader.cxx b/filter/source/svg/svgreader.cxx index b9737f1..814c745 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 a63fe23..062852b 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 949ac82..0ebf728 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 ), _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits