summaryrefslogtreecommitdiff
path: root/svgio
diff options
context:
space:
mode:
authorXisco Fauli <anistenis@gmail.com>2016-01-30 01:50:07 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-02-05 15:34:48 +0000
commit9951813197e28968ba9a36d905dc0ba8dfd41f5a (patch)
treef1f6807097e6836ab0dc4770dff2135c7af7ba54 /svgio
parent1deed8dae78be05cafde17768d111035c111b567 (diff)
tdf#79163: SVGIO: Fix problem with opacity attribute
Opacity attribute didn't work because it was always set to 1.0 Change-Id: I3a2029ef23acf9d8c0f346e04341db33c6802b8e Reviewed-on: https://gerrit.libreoffice.org/21911 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de> (cherry picked from commit 359f43f8e76c3bd85c3daf35b5a6d925a4c8c64f) Reviewed-on: https://gerrit.libreoffice.org/22007 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'svgio')
-rw-r--r--svgio/inc/svgio/svgreader/svgstyleattributes.hxx2
-rw-r--r--svgio/source/svgreader/svgstyleattributes.cxx28
2 files changed, 26 insertions, 4 deletions
diff --git a/svgio/inc/svgio/svgreader/svgstyleattributes.hxx b/svgio/inc/svgio/svgreader/svgstyleattributes.hxx
index cb1982dd3578..e138eb5ec1ce 100644
--- a/svgio/inc/svgio/svgreader/svgstyleattributes.hxx
+++ b/svgio/inc/svgio/svgreader/svgstyleattributes.hxx
@@ -408,7 +408,7 @@ namespace svgio
const basegfx::BColor* getCurrentColor() const;
/// Opacity content
- SvgNumber getOpacity() const { return maOpacity; }
+ SvgNumber getOpacity() const;
void setOpacity(const SvgNumber& rOpacity = SvgNumber()) { maOpacity = rOpacity; }
/// Visibility
diff --git a/svgio/source/svgreader/svgstyleattributes.cxx b/svgio/source/svgreader/svgstyleattributes.cxx
index 6c2fef789404..5d557ac10a02 100644
--- a/svgio/source/svgreader/svgstyleattributes.cxx
+++ b/svgio/source/svgreader/svgstyleattributes.cxx
@@ -1062,7 +1062,7 @@ namespace svgio
return;
}
- const double fOpacity(getOpacity().getNumber());
+ const double fOpacity(getOpacity().solve(mrOwner));
if(basegfx::fTools::equalZero(fOpacity))
{
@@ -1119,7 +1119,7 @@ namespace svgio
{
if(rSource.hasElements())
{
- const double fOpacity(getOpacity().getNumber());
+ const double fOpacity(getOpacity().solve(mrOwner));
if(basegfx::fTools::equalZero(fOpacity))
{
@@ -1215,7 +1215,7 @@ namespace svgio
maTextDecoration(TextDecoration_notset),
maTextAnchor(TextAnchor_notset),
maColor(),
- maOpacity(1.0),
+ maOpacity(),
maVisibility(Visibility_visible),
maTitle(),
maDesc(),
@@ -2122,6 +2122,28 @@ namespace svgio
return SvgNumber(1.0);
}
+ SvgNumber SvgStyleAttributes::getOpacity() const
+ {
+ if(mbIsClipPathContent)
+ {
+ return SvgNumber(1.0);
+ }
+ else if(maOpacity.isSet())
+ {
+ return maOpacity;
+ }
+
+ const SvgStyleAttributes* pSvgStyleAttributes = getParentStyle();
+
+ if(pSvgStyleAttributes)
+ {
+ return pSvgStyleAttributes->getOpacity();
+ }
+
+ // default is 1
+ return SvgNumber(1.0);
+ }
+
FillRule SvgStyleAttributes::getFillRule() const
{
if(FillRule_notset != maFillRule)