svgio/inc/svgdocumenthandler.hxx | 2 -- svgio/inc/svgtoken.hxx | 4 +--- svgio/source/svgreader/svgdocumenthandler.cxx | 19 +++---------------- svgio/source/svgreader/svgtoken.cxx | 6 ++---- 4 files changed, 6 insertions(+), 25 deletions(-)
New commits: commit ecadbb0c1ccc979baf073aaf391601b54d20ad19 Author: Xisco Fauli <[email protected]> AuthorDate: Thu Aug 3 18:55:50 2023 +0200 Commit: Xisco Fauli <[email protected]> CommitDate: Tue Aug 8 10:19:11 2023 +0200 Revert "fdo#50114 ingore flowRoot element during svg import" This commit reverts 5bd241b99b76ae7f4b3c1d4f2bcbaf7c487bb339 which is no longer needed after 13a41e7a12598c7896d6dc8d34aba6af5b80b83c "tdf#150124: do nothing when parent is of unkown type" and might cause unexpected results as seen with https://bugs.documentfoundation.org/attachment.cgi?id=124782 from https://bugs.documentfoundation.org/show_bug.cgi?id=99628 Change-Id: I8bb700f5c5553700f91b937330bc3730e8ea84c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155320 Tested-by: Jenkins Reviewed-by: Xisco Fauli <[email protected]> Signed-off-by: Xisco Fauli <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155327 diff --git a/svgio/inc/svgdocumenthandler.hxx b/svgio/inc/svgdocumenthandler.hxx index a13284340a38..8511a0adfbcc 100644 --- a/svgio/inc/svgdocumenthandler.hxx +++ b/svgio/inc/svgdocumenthandler.hxx @@ -40,8 +40,6 @@ namespace svgio::svgreader // text collector string stack for css styles std::vector< OUString > maCssContents; - bool bSkip; - public: SvgDocHdl(const OUString& rAbsolutePath); virtual ~SvgDocHdl() override; diff --git a/svgio/inc/svgtoken.hxx b/svgio/inc/svgtoken.hxx index 175297fa67e5..6c1a17692f22 100644 --- a/svgio/inc/svgtoken.hxx +++ b/svgio/inc/svgtoken.hxx @@ -188,9 +188,7 @@ namespace svgio::svgreader // text tokens Text, - BaselineShift, - - FlowRoot + BaselineShift }; SVGToken StrToSVGToken(const OUString& rStr, bool bCaseIndependent); diff --git a/svgio/source/svgreader/svgdocumenthandler.cxx b/svgio/source/svgreader/svgdocumenthandler.cxx index bc1e80706b18..2e7785f2626d 100644 --- a/svgio/source/svgreader/svgdocumenthandler.cxx +++ b/svgio/source/svgreader/svgdocumenthandler.cxx @@ -149,8 +149,7 @@ namespace SvgDocHdl::SvgDocHdl(const OUString& aAbsolutePath) : maDocument(aAbsolutePath), - mpTarget(nullptr), - bSkip(false) + mpTarget(nullptr) { } @@ -185,8 +184,6 @@ namespace void SvgDocHdl::startElement( const OUString& aName, const uno::Reference< xml::sax::XAttributeList >& xAttribs ) { - if (bSkip) - return; if(aName.isEmpty()) return; @@ -452,13 +449,6 @@ namespace break; } - // ignore FlowRoot and child nodes - case SVGToken::FlowRoot: - { - bSkip = true; - break; - } - default: { mpTarget = new SvgNode(SVGToken::Unknown, maDocument, mpTarget); @@ -477,13 +467,6 @@ namespace SvgStyleNode* pCssStyle(SVGToken::Style == aSVGToken ? static_cast< SvgStyleNode* >(mpTarget) : nullptr); SvgTitleDescNode* pSvgTitleDescNode(SVGToken::Title == aSVGToken || SVGToken::Desc == aSVGToken ? static_cast< SvgTitleDescNode* >(mpTarget) : nullptr); - // if we are in skipping mode and we reach the flowRoot end tag: stop skipping mode - if(bSkip && aSVGToken == SVGToken::FlowRoot) - 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 diff --git a/svgio/source/svgreader/svgtoken.cxx b/svgio/source/svgreader/svgtoken.cxx index 24e24a5a31f7..961c4ec3b5a4 100644 --- a/svgio/source/svgreader/svgtoken.cxx +++ b/svgio/source/svgreader/svgtoken.cxx @@ -177,8 +177,7 @@ constexpr auto aSVGTokenMapperList = frozen::make_unordered_map<std::u16string_v { u"stroke-width", SVGToken::StrokeWidth }, { u"text", SVGToken::Text }, - { u"baseline-shift", SVGToken::BaselineShift }, - { u"flowRoot", SVGToken::FlowRoot } + { u"baseline-shift", SVGToken::BaselineShift } }); // The same elements as the map above but lowercase. CSS is case insensitive @@ -335,8 +334,7 @@ constexpr auto aSVGLowerCaseTokenMapperList = frozen::make_unordered_map<std::u { u"stroke-width", SVGToken::StrokeWidth }, { u"text", SVGToken::Text }, - { u"baseline-shift", SVGToken::BaselineShift }, - { u"flowroot", SVGToken::FlowRoot } + { u"baseline-shift", SVGToken::BaselineShift } }); static_assert(sizeof(aSVGTokenMapperList) == sizeof(aSVGLowerCaseTokenMapperList), commit 7820ed9a912bbf5e6c0d98b5a1ea67f549b786e9 Author: Xisco Fauli <[email protected]> AuthorDate: Thu Aug 3 18:32:45 2023 +0200 Commit: Xisco Fauli <[email protected]> CommitDate: Tue Aug 8 10:19:02 2023 +0200 related tdf#156579: just break for switch element Change-Id: I4a31431325c44440f773f6f345d2a0a057d1fa37 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155317 Tested-by: Jenkins Reviewed-by: Xisco Fauli <[email protected]> Signed-off-by: Xisco Fauli <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155326 diff --git a/svgio/source/svgreader/svgdocumenthandler.cxx b/svgio/source/svgreader/svgdocumenthandler.cxx index 1f92c11d20cf..bc1e80706b18 100644 --- a/svgio/source/svgreader/svgdocumenthandler.cxx +++ b/svgio/source/svgreader/svgdocumenthandler.cxx @@ -203,7 +203,6 @@ namespace mpTarget->parseAttributes(xAttribs); break; } - case SVGToken::Switch: //TODO: Support switch element case SVGToken::Defs: case SVGToken::G: { @@ -447,6 +446,12 @@ namespace break; } + case SVGToken::Switch: + { + //TODO: Support switch element + break; + } + // ignore FlowRoot and child nodes case SVGToken::FlowRoot: { @@ -488,7 +493,6 @@ namespace case SVGToken::G: case SVGToken::Svg: case SVGToken::Symbol: - case SVGToken::Switch: case SVGToken::Use: case SVGToken::A:
