summaryrefslogtreecommitdiff
path: root/svx/source/sdr/primitive2d/sdrattributecreator.cxx
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2023-04-14 14:58:09 +0300
committerMaxim Monastirsky <momonasmon@gmail.com>2023-04-18 09:33:28 +0200
commita9a2ace53625a8fb3feb1c050648a875a98cb7a8 (patch)
tree470b5757557ccc6c3714bcc0da2928e175e6dd6f /svx/source/sdr/primitive2d/sdrattributecreator.cxx
parent90fbb14e517c95036a133697d7300fc662d1b8b5 (diff)
sc drawstyles: Comment shadow should depends on shadow attribute
The shadow of comments differs from the shadow of normal callout shapes, as it shows only for the text rectangle. However the way it's implemented is weird: The shadow attribute is set to false, which turns off the "normal" shadow, and then the special shadow is drawn unconditionally. There is also a code that forces the shadow attribute to false on import, to handle some old files that used to have the shadow on. The confusion begins when one shows the comment, and looks at right click > Area... > Shadow, which (rightfully) shows the shadow as off, but doesn't align with what is visible on the document canvas. Moreover, the other shadow settings on this page do affect the comment shadow, but in order to change them it is needed to check the "Use shadow" checkbox first. But leaving that checkbox as checked will result with a double shadow being drawn for the text rectangle, and an unnecessary shadow drawn for the arrow part. The problem becomes now more visible, as there is a Note style listed in the sidebar. One possible approach could be to draw the special shadow only when the shadow attribute is on, and patch existing files on import to "shadow on" instead of "shadow off". But this will cause the "double shadow" problem when opened in older versions (unless the comment is hidden, in which case we used to override the shadow attribute). But now there's an opportunity for a better solution: As we assign the default comment style to imported comments, we can just clear the shadow attribute DF, instead of forcing it to some value. As a result, the "shadow on" attribute of the style will be in effect in newer versions, while in older versions it will fallback to the "shadow off" pool default. Change-Id: I4b35bc1e8e2e12ed35a82b0c2e9aabcf28b46270 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150353 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
Diffstat (limited to 'svx/source/sdr/primitive2d/sdrattributecreator.cxx')
-rw-r--r--svx/source/sdr/primitive2d/sdrattributecreator.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
index 89493e4d5a45..e1f6fc10c45a 100644
--- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx
+++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
@@ -1121,7 +1121,8 @@ namespace drawinglayer::primitive2d
attribute::SdrLineFillEffectsTextAttribute createNewSdrLineFillEffectsTextAttribute(
const SfxItemSet& rSet,
const SdrText* pText,
- bool bHasContent)
+ bool bHasContent,
+ bool bSuppressShadow)
{
attribute::SdrLineAttribute aLine;
attribute::SdrFillAttribute aFill;
@@ -1171,7 +1172,8 @@ namespace drawinglayer::primitive2d
if(bHasContent || !aLine.isDefault() || !aFill.isDefault() || !aText.isDefault())
{
// try shadow
- const attribute::SdrShadowAttribute aShadow = createNewSdrShadowAttribute(rSet);
+ const attribute::SdrShadowAttribute aShadow = !bSuppressShadow ?
+ createNewSdrShadowAttribute(rSet) : attribute::SdrShadowAttribute();
// glow
const attribute::SdrGlowAttribute aGlow = createNewSdrGlowAttribute(rSet);