diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2023-04-14 14:58:09 +0300 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2023-04-18 09:33:28 +0200 |
commit | a9a2ace53625a8fb3feb1c050648a875a98cb7a8 (patch) | |
tree | 470b5757557ccc6c3714bcc0da2928e175e6dd6f /svx/inc | |
parent | 90fbb14e517c95036a133697d7300fc662d1b8b5 (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/inc')
-rw-r--r-- | svx/inc/sdr/primitive2d/sdrattributecreator.hxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/svx/inc/sdr/primitive2d/sdrattributecreator.hxx b/svx/inc/sdr/primitive2d/sdrattributecreator.hxx index f372741fa68c..92a2b102ffdb 100644 --- a/svx/inc/sdr/primitive2d/sdrattributecreator.hxx +++ b/svx/inc/sdr/primitive2d/sdrattributecreator.hxx @@ -93,7 +93,8 @@ namespace drawinglayer::primitive2d attribute::SdrLineFillEffectsTextAttribute createNewSdrLineFillEffectsTextAttribute( const SfxItemSet& rSet, const SdrText* pText, - bool bHasContent); // used from OLE and graphic + bool bHasContent, // used from OLE and graphic + bool bSuppressShadow = false); // used from SC notes attribute::SdrLineFillShadowAttribute3D createNewSdrLineFillShadowAttribute( const SfxItemSet& rSet, |