diff options
author | Dennis Francis <dennis.francis@collabora.com> | 2020-03-22 19:43:03 +0530 |
---|---|---|
committer | Dennis Francis <dennis.francis@collabora.com> | 2020-03-24 18:52:47 +0100 |
commit | f08bbb5648c06a387e69f3a0e0a6a9a1eda7fc37 (patch) | |
tree | 3bf988ad8652940b1c802871a3c71988d260d4f8 /svx/source/xoutdev | |
parent | 217625058109b39752710d70fb0ab0dd1bac7435 (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
(cherry picked from commit 34969e9c04f9305d19826c72a29e38e26794cbe3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90986
Tested-by: Jenkins
Reviewed-by: Dennis Francis <dennis.francis@collabora.com>
Diffstat (limited to 'svx/source/xoutdev')
-rw-r--r-- | svx/source/xoutdev/xattr.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx index 4b11483e8e3a..2fc8ff28f861 100644 --- a/svx/source/xoutdev/xattr.cxx +++ b/svx/source/xoutdev/xattr.cxx @@ -2502,6 +2502,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; } |