diff options
Diffstat (limited to 'svgio/source/svgreader/svgnode.cxx')
-rw-r--r-- | svgio/source/svgreader/svgnode.cxx | 44 |
1 files changed, 38 insertions, 6 deletions
diff --git a/svgio/source/svgreader/svgnode.cxx b/svgio/source/svgreader/svgnode.cxx index 0ae4e80363..7a45c681f1 100644 --- a/svgio/source/svgreader/svgnode.cxx +++ b/svgio/source/svgreader/svgnode.cxx @@ -367,17 +367,13 @@ namespace { mpParent(pParent), mpAlternativeParent(nullptr), maXmlSpace(XmlSpace::NotSet), - maDisplay(Display::Inline), + maDisplay(maType == SVGToken::Unknown ? Display::None : Display::Inline), // tdf#150124: do not display unknown nodes mbDecomposing(false), mbCssStyleVectorBuilt(false) { if (pParent) { - // tdf#150124 ignore when parent is unknown - if (pParent->getType() != SVGToken::Unknown) - pParent->maChildren.emplace_back(this); - else - mrDocument.addOrphanNode(this); + pParent->maChildren.emplace_back(this); } } @@ -527,6 +523,14 @@ namespace { } break; } + case SVGToken::SystemLanguage: + { + if(!aContent.isEmpty()) + { + setSystemLanguage(aContent); + } + break; + } case SVGToken::XmlSpace: { if(!aContent.isEmpty()) @@ -752,6 +756,34 @@ namespace { mrDocument.addSvgNodeToMapper(*mpClass, *this); } + void SvgNode::setSystemLanguage(OUString const & rSystemClass) + { + const sal_Int32 nLen(rSystemClass.getLength()); + sal_Int32 nPos(0); + OUStringBuffer aToken; + + // split into single tokens (currently only comma separator) + while(nPos < nLen) + { + const sal_Int32 nInitPos(nPos); + copyToLimiter(rSystemClass, u',', nPos, aToken, nLen); + skip_char(rSystemClass, u',', nPos, nLen); + const OUString aLang(o3tl::trim(aToken)); + aToken.setLength(0); + + if(!aLang.isEmpty()) + { + maSystemLanguage.push_back(aLang); + } + + if(nInitPos == nPos) + { + OSL_ENSURE(false, "Could not interpret on current position (!)"); + nPos++; + } + } + } + XmlSpace SvgNode::getXmlSpace() const { if(maXmlSpace != XmlSpace::NotSet) |