summaryrefslogtreecommitdiffstats
path: root/svgio/inc
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2014-07-16 09:42:11 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-07-16 11:40:58 +0100
commit0879a639bc7c734f0847f74b965809f9107b3195 (patch)
tree94501e749cdfe270b1b20302fa3bbc79535586c3 /svgio/inc
parentcoverity#707280 Uncaught exception (diff)
downloadcore-0879a639bc7c734f0847f74b965809f9107b3195.tar.gz
core-0879a639bc7c734f0847f74b965809f9107b3195.zip
Resolves: #i125258# reworked some of the style hierarchy stuff
(cherry picked from commit 3b13e15a7174f5177700fdcd4864b64fbf0b3535) Conflicts: svgio/inc/svgio/svgreader/svgstylenode.hxx svgio/source/svgreader/svggnode.cxx svgio/source/svgreader/svgstyleattributes.cxx svgio/source/svgreader/svgstylenode.cxx svgio/source/svgreader/svgsvgnode.cxx Change-Id: I5cfe6871ab235305f206d83d643884b493901dfe
Diffstat (limited to 'svgio/inc')
-rw-r--r--svgio/inc/svgio/svgreader/svgnode.hxx3
-rw-r--r--svgio/inc/svgio/svgreader/svgstyleattributes.hxx1
-rw-r--r--svgio/inc/svgio/svgreader/svgstylenode.hxx3
-rw-r--r--svgio/inc/svgio/svgreader/svgsvgnode.hxx7
4 files changed, 14 insertions, 0 deletions
diff --git a/svgio/inc/svgio/svgreader/svgnode.hxx b/svgio/inc/svgio/svgreader/svgnode.hxx
index 38ae2438cc76..cc88b264370e 100644
--- a/svgio/inc/svgio/svgreader/svgnode.hxx
+++ b/svgio/inc/svgio/svgreader/svgnode.hxx
@@ -127,6 +127,9 @@ namespace svgio
virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent);
virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DSequence& rTarget, bool bReferenced) const;
+ /// #i125258# tell if this node is allowed to have a parent style (e.g. defs do not)
+ virtual bool supportsParentStyle() const;
+
/// basic data read access
SVGToken getType() const { return maType; }
const SvgDocument& getDocument() const { return mrDocument; }
diff --git a/svgio/inc/svgio/svgreader/svgstyleattributes.hxx b/svgio/inc/svgio/svgreader/svgstyleattributes.hxx
index 1f16a3bb4221..345eb651810a 100644
--- a/svgio/inc/svgio/svgreader/svgstyleattributes.hxx
+++ b/svgio/inc/svgio/svgreader/svgstyleattributes.hxx
@@ -283,6 +283,7 @@ namespace svgio
~SvgStyleAttributes();
/// fill content
+ bool isFillSet() const; // #i125258# ask if fill is a direct hard attribute (no hierarchy)
const basegfx::BColor* getFill() const;
void setFill(const SvgPaint& rFill) { maFill = rFill; }
diff --git a/svgio/inc/svgio/svgreader/svgstylenode.hxx b/svgio/inc/svgio/svgreader/svgstylenode.hxx
index 23e0230d644b..fc851dfe6940 100644
--- a/svgio/inc/svgio/svgreader/svgstylenode.hxx
+++ b/svgio/inc/svgio/svgreader/svgstylenode.hxx
@@ -42,6 +42,9 @@ namespace svgio
SvgNode* pParent);
virtual ~SvgStyleNode();
+ /// #i125258# tell if this node is allowed to have a parent style (e.g. defs do not)
+ virtual bool supportsParentStyle() const SAL_OVERRIDE;
+
virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) SAL_OVERRIDE;
void addCssStyleSheet(const OUString& aContent);
diff --git a/svgio/inc/svgio/svgreader/svgsvgnode.hxx b/svgio/inc/svgio/svgreader/svgsvgnode.hxx
index 27180bf3544c..d4fb304f653d 100644
--- a/svgio/inc/svgio/svgreader/svgsvgnode.hxx
+++ b/svgio/inc/svgio/svgreader/svgsvgnode.hxx
@@ -41,6 +41,13 @@ namespace svgio
SvgNumber maHeight;
SvgNumber maVersion;
+ /// #i125258# bitfield
+ bool mbStyleAttributesInitialized : 1;
+
+ // #i125258# on-demand init hard attributes when this is the outmost svg element
+ // and more (see implementation)
+ void initializeStyleAttributes();
+
public:
SvgSvgNode(
SvgDocument& rDocument,