summaryrefslogtreecommitdiff
path: root/svgio/inc
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2024-03-12 17:19:45 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2024-03-12 22:39:20 +0100
commitb22039cff8380b158307e75762bd3e4ca045d77b (patch)
tree216fe97a120c9589bb314aa94afb35bcba5cde0f /svgio/inc
parent1b9a3894ee5e249f8e86b84520ee5020ff209fea (diff)
related: tdf#159947: only parse in/result if the element supports them
There are some filters ( e.g. feMerge ) that do not support in or result attributes Change-Id: I4072dc481557557733e55cc5fcbd80cb11a7ddb5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164718 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'svgio/inc')
-rw-r--r--svgio/inc/svgfecolormatrixnode.hxx5
-rw-r--r--svgio/inc/svgfedropshadownode.hxx5
-rw-r--r--svgio/inc/svgfefloodnode.hxx5
-rw-r--r--svgio/inc/svgfegaussianblurnode.hxx5
-rw-r--r--svgio/inc/svgfeimagenode.hxx5
-rw-r--r--svgio/inc/svgfeoffsetnode.hxx5
-rw-r--r--svgio/inc/svgfilternode.hxx19
7 files changed, 36 insertions, 13 deletions
diff --git a/svgio/inc/svgfecolormatrixnode.hxx b/svgio/inc/svgfecolormatrixnode.hxx
index e2c74a03748f..4e0ad7d2aa3c 100644
--- a/svgio/inc/svgfecolormatrixnode.hxx
+++ b/svgio/inc/svgfecolormatrixnode.hxx
@@ -36,6 +36,8 @@ enum class ColorType
class SvgFeColorMatrixNode final : public SvgFilterNode
{
private:
+ OUString maIn;
+ OUString maResult;
ColorType maType;
OUString maValuesContent;
@@ -45,7 +47,8 @@ public:
virtual void parseAttribute(SVGToken aSVGToken, const OUString& aContent) override;
- void apply(drawinglayer::primitive2d::Primitive2DContainer& rTarget) const override;
+ void apply(drawinglayer::primitive2d::Primitive2DContainer& rTarget,
+ const SvgFilterNode* pParent) const override;
};
} // end of namespace svgio::svgreader
diff --git a/svgio/inc/svgfedropshadownode.hxx b/svgio/inc/svgfedropshadownode.hxx
index 04b3190f1dea..c68cdf655567 100644
--- a/svgio/inc/svgfedropshadownode.hxx
+++ b/svgio/inc/svgfedropshadownode.hxx
@@ -27,6 +27,8 @@ namespace svgio::svgreader
class SvgFeDropShadowNode final : public SvgFilterNode
{
private:
+ OUString maIn;
+ OUString maResult;
SvgNumber maDx;
SvgNumber maDy;
SvgNumber maStdDeviation;
@@ -39,7 +41,8 @@ public:
virtual void parseAttribute(SVGToken aSVGToken, const OUString& aContent) override;
- void apply(drawinglayer::primitive2d::Primitive2DContainer& rTarget) const override;
+ void apply(drawinglayer::primitive2d::Primitive2DContainer& rTarget,
+ const SvgFilterNode* pParent) const override;
};
} // end of namespace svgio::svgreader
diff --git a/svgio/inc/svgfefloodnode.hxx b/svgio/inc/svgfefloodnode.hxx
index e74794b97237..8aba2c3b0340 100644
--- a/svgio/inc/svgfefloodnode.hxx
+++ b/svgio/inc/svgfefloodnode.hxx
@@ -27,6 +27,8 @@ namespace svgio::svgreader
class SvgFeFloodNode final : public SvgFilterNode
{
private:
+ OUString maIn;
+ OUString maResult;
SvgNumber maX;
SvgNumber maY;
SvgNumber maWidth;
@@ -40,7 +42,8 @@ public:
virtual void parseAttribute(SVGToken aSVGToken, const OUString& aContent) override;
- void apply(drawinglayer::primitive2d::Primitive2DContainer& rTarget) const override;
+ void apply(drawinglayer::primitive2d::Primitive2DContainer& rTarget,
+ const SvgFilterNode* pParent) const override;
};
} // end of namespace svgio::svgreader
diff --git a/svgio/inc/svgfegaussianblurnode.hxx b/svgio/inc/svgfegaussianblurnode.hxx
index 14732a968e2d..10e6a16b1ce3 100644
--- a/svgio/inc/svgfegaussianblurnode.hxx
+++ b/svgio/inc/svgfegaussianblurnode.hxx
@@ -28,6 +28,8 @@ namespace svgio::svgreader
class SvgFeGaussianBlurNode final : public SvgFilterNode
{
private:
+ OUString maIn;
+ OUString maResult;
SvgNumber maStdDeviation;
public:
@@ -36,7 +38,8 @@ public:
virtual void parseAttribute(SVGToken aSVGToken, const OUString& aContent) override;
- void apply(drawinglayer::primitive2d::Primitive2DContainer& rTarget) const override;
+ void apply(drawinglayer::primitive2d::Primitive2DContainer& rTarget,
+ const SvgFilterNode* pParent) const override;
};
} // end of namespace svgio::svgreader
diff --git a/svgio/inc/svgfeimagenode.hxx b/svgio/inc/svgfeimagenode.hxx
index 0b05173494d0..ab303fdc92fe 100644
--- a/svgio/inc/svgfeimagenode.hxx
+++ b/svgio/inc/svgfeimagenode.hxx
@@ -27,6 +27,8 @@ namespace svgio::svgreader
class SvgFeImageNode final : public SvgFilterNode
{
private:
+ OUString maIn;
+ OUString maResult;
OUString maUrl; // external link
OUString maData; // base64 data
@@ -36,7 +38,8 @@ public:
virtual void parseAttribute(SVGToken aSVGToken, const OUString& aContent) override;
- void apply(drawinglayer::primitive2d::Primitive2DContainer& rTarget) const override;
+ void apply(drawinglayer::primitive2d::Primitive2DContainer& rTarget,
+ const SvgFilterNode* pParent) const override;
};
} // end of namespace svgio::svgreader
diff --git a/svgio/inc/svgfeoffsetnode.hxx b/svgio/inc/svgfeoffsetnode.hxx
index b56971dfd741..a52eea252e60 100644
--- a/svgio/inc/svgfeoffsetnode.hxx
+++ b/svgio/inc/svgfeoffsetnode.hxx
@@ -27,6 +27,8 @@ namespace svgio::svgreader
class SvgFeOffsetNode final : public SvgFilterNode
{
private:
+ OUString maIn;
+ OUString maResult;
SvgNumber maDx;
SvgNumber maDy;
@@ -36,7 +38,8 @@ public:
virtual void parseAttribute(SVGToken aSVGToken, const OUString& aContent) override;
- void apply(drawinglayer::primitive2d::Primitive2DContainer& rTarget) const override;
+ void apply(drawinglayer::primitive2d::Primitive2DContainer& rTarget,
+ const SvgFilterNode* pParent) const override;
};
} // end of namespace svgio::svgreader
diff --git a/svgio/inc/svgfilternode.hxx b/svgio/inc/svgfilternode.hxx
index c3aa068bd3eb..4f5d4c2f532f 100644
--- a/svgio/inc/svgfilternode.hxx
+++ b/svgio/inc/svgfilternode.hxx
@@ -19,28 +19,33 @@
#pragma once
+#include <unordered_map>
#include "svgnode.hxx"
#include "svgstyleattributes.hxx"
#include <basegfx/matrix/b2dhommatrix.hxx>
+typedef std::unordered_map<OUString, drawinglayer::primitive2d::Primitive2DContainer>
+ IdGraphicSourceMapper;
+
namespace svgio::svgreader
{
class SvgFilterNode : public SvgNode
{
private:
- OUString maIn;
- OUString maResult;
+ IdGraphicSourceMapper maIdGraphicSourceMapperList;
public:
SvgFilterNode(SVGToken aType, SvgDocument& rDocument, SvgNode* pParent);
virtual ~SvgFilterNode() override;
- virtual void parseAttribute(SVGToken aSVGToken, const OUString& aContent) override;
-
- virtual void apply(drawinglayer::primitive2d::Primitive2DContainer& rTarget) const;
+ virtual void apply(drawinglayer::primitive2d::Primitive2DContainer& rTarget,
+ const SvgFilterNode* pParent) const;
- const OUString& getIn() const { return maIn; }
- const OUString& getResult() const { return maResult; }
+ void
+ addGraphicSourceToMapper(const OUString& rStr,
+ drawinglayer::primitive2d::Primitive2DContainer pGrapicSource) const;
+ const drawinglayer::primitive2d::Primitive2DContainer*
+ findGraphicSource(const OUString& rStr) const;
};
} // end of namespace svgio::svgreader