summaryrefslogtreecommitdiff
path: root/svgio
diff options
context:
space:
mode:
authorXisco Fauli <anistenis@gmail.com>2016-02-06 17:04:41 +0100
committerNoel Grandin <noelgrandin@gmail.com>2016-02-07 06:56:13 +0000
commit842313c23ec96aeb99b68f28e7d48cc9e263a0a8 (patch)
tree53f0f4db846c3b4db57b46655fd89dc22d18a094 /svgio
parent0b7337bfa049f4e3a8b87f7628025e40f5b3e825 (diff)
tdf#97543 SVGIO: Rework getVisibility()
Change-Id: Idb3eaa27e3e8ec177ebd2bad81f53c4d3da9d241 Reviewed-on: https://gerrit.libreoffice.org/22169 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'svgio')
-rw-r--r--svgio/inc/svgio/svgreader/svgstyleattributes.hxx5
-rw-r--r--svgio/source/svgreader/svgstyleattributes.cxx23
2 files changed, 21 insertions, 7 deletions
diff --git a/svgio/inc/svgio/svgreader/svgstyleattributes.hxx b/svgio/inc/svgio/svgreader/svgstyleattributes.hxx
index 9d589d1aad6e..47bace0aca05 100644
--- a/svgio/inc/svgio/svgreader/svgstyleattributes.hxx
+++ b/svgio/inc/svgio/svgreader/svgstyleattributes.hxx
@@ -170,6 +170,7 @@ namespace svgio
enum Visibility
{
+ Visibility_notset,
Visibility_visible,
Visibility_hidden,
Visibility_collapse,
@@ -429,8 +430,8 @@ namespace svgio
void setOpacity(const SvgNumber& rOpacity = SvgNumber()) { maOpacity = rOpacity; }
/// Visibility
- Visibility getVisibility() const { return maVisibility; }
- void setVisibility(Visibility eVisibility) { maVisibility = eVisibility; }
+ Visibility getVisibility() const;
+ void setVisibility(const Visibility aVisibility = Visibility_notset) { maVisibility = aVisibility; }
// Title content
const OUString& getTitle() const { return maTitle; }
diff --git a/svgio/source/svgreader/svgstyleattributes.cxx b/svgio/source/svgreader/svgstyleattributes.cxx
index e733396b3dcd..f3eec06f3ebe 100644
--- a/svgio/source/svgreader/svgstyleattributes.cxx
+++ b/svgio/source/svgreader/svgstyleattributes.cxx
@@ -1211,7 +1211,7 @@ namespace svgio
maTextAnchor(TextAnchor_notset),
maColor(),
maOpacity(),
- maVisibility(Visibility_visible),
+ maVisibility(Visibility_notset),
maTitle(),
maDesc(),
maClipPathXLink(),
@@ -1237,10 +1237,6 @@ namespace svgio
mbIsClipPathContent = pParentStyle->mbIsClipPathContent;
}
}
- if(pParentStyle)
- {
- maVisibility = pParentStyle->maVisibility;
- }
}
SvgStyleAttributes::~SvgStyleAttributes()
@@ -2185,6 +2181,23 @@ namespace svgio
return SvgNumber(1.0);
}
+ Visibility SvgStyleAttributes::getVisibility() const
+ {
+ if(Visibility_notset == maVisibility || Visibility_inherit == maVisibility)
+ {
+ const SvgStyleAttributes* pSvgStyleAttributes = getParentStyle();
+
+ if(pSvgStyleAttributes)
+ {
+ return pSvgStyleAttributes->getVisibility();
+ }
+ //default is Visible
+ return Visibility_visible;
+ }
+
+ return maVisibility;
+ }
+
FillRule SvgStyleAttributes::getFillRule() const
{
if(FillRule_notset != maFillRule)