diff options
Diffstat (limited to 'svgio/source/svgreader/svgdocumenthandler.cxx')
-rw-r--r-- | svgio/source/svgreader/svgdocumenthandler.cxx | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/svgio/source/svgreader/svgdocumenthandler.cxx b/svgio/source/svgreader/svgdocumenthandler.cxx index 25772aa7b3c1..3817612099d6 100644 --- a/svgio/source/svgreader/svgdocumenthandler.cxx +++ b/svgio/source/svgreader/svgdocumenthandler.cxx @@ -137,7 +137,8 @@ namespace svgio SvgDocHdl::SvgDocHdl(const OUString& aAbsolutePath) : maDocument(aAbsolutePath), mpTarget(0), - maCssContents() + maCssContents(), + bSkip(false) { } @@ -167,8 +168,11 @@ namespace svgio void SvgDocHdl::startElement( const OUString& aName, const uno::Reference< xml::sax::XAttributeList >& xAttribs ) throw (xml::sax::SAXException, uno::RuntimeException, std::exception) { + if (bSkip) + return; if(!aName.isEmpty()) { + const SVGToken aSVGToken(StrToSVGToken(aName)); switch(aSVGToken) @@ -364,6 +368,13 @@ namespace svgio break; } + // ignore FlowRoot and child nodes + case SVGTokenFlowRoot: + { + bSkip = true; + break; + } + default: { /// invalid token, ignore @@ -388,6 +399,13 @@ namespace svgio SvgStyleNode* pCssStyle(SVGTokenStyle == aSVGToken ? static_cast< SvgStyleNode* >(mpTarget) : 0); SvgTitleDescNode* pSvgTitleDescNode(SVGTokenTitle == aSVGToken || SVGTokenDesc == aSVGToken ? static_cast< SvgTitleDescNode* >(mpTarget) : 0); + // if we are in skipping mode and we reach the flowRoot end tag: stop skipping mode + if(bSkip && aSVGToken == SVGTokenFlowRoot) + bSkip = false; + // we are in skipping mode: do nothing until we found the flowRoot end tag + else if(bSkip) + return; + switch(aSVGToken) { /// valid tokens for which a new one was created @@ -457,6 +475,13 @@ namespace svgio } break; } + + case SVGTokenFlowRoot: + { + bSkip = false; + break; + } + default: { /// invalid token, ignore |