summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorDennis Francis <dennis.francis@collabora.com>2020-03-22 19:43:03 +0530
committerAndras Timar <andras.timar@collabora.com>2020-03-23 12:51:42 +0100
commit8f062cdae1c71c9dd2a1e3f81617b08ac7463c5d (patch)
tree66c53c4613fc7aa558c1bd4646b5b07ca06de356 /svx
parent4ae9a263f24e06cb675dbe2408cbc160e6441a42 (diff)
lokit: unify fill transparency items
Online just listens to .uno:FillFloatTransparence but the set-item in core it corresponds to, does not represent the fill-transparency types like 'None' and 'Solid'. This is represented by another item called XFillTransparencyItem. As a result the mobile wizard does not show the correct transparency fill type always. To solve this, this patch encodes the constant transparency percentage in case of Solid and None(always 0%) as an intensity and stores this info in the statechange message of .uno:FillFloatTransparence whenever there is no gradient type and corrects the 'style' attribute of the message appropriately. More detailed information is provided as comments at appropriate places in the patch. Change-Id: I443ef4ce349badf28f6c2c702b1014868d9c6ed5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90878 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/xoutdev/xattr.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx
index 83e052231b58..1de52ad51ee5 100644
--- a/svx/source/xoutdev/xattr.cxx
+++ b/svx/source/xoutdev/xattr.cxx
@@ -2532,6 +2532,19 @@ boost::property_tree::ptree XFillFloatTransparenceItem::dumpAsJSON() const
boost::property_tree::ptree aTree = XFillGradientItem::dumpAsJSON();
aTree.put("commandName", ".uno:FillFloatTransparence");
+ if (!bEnabled)
+ {
+ boost::property_tree::ptree& rState = aTree.get_child("state");
+ // When gradient fill is disabled, the intensity fields contain the
+ // constant encoded percent-transparency. However we use that here to just
+ // distinguish between 'None' and 'Solid' types and correct the 'style'
+ // property appropriately.
+ if (GetGradientValue().GetStartIntens() == 100)
+ rState.put("style", "NONE");
+ else
+ rState.put("style", "SOLID");
+ }
+
return aTree;
}