diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2019-11-17 14:18:18 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2019-11-19 20:36:52 +0100 |
commit | 8586051f02125e7358984d2cd14c5383b26bd246 (patch) | |
tree | 4fa4b072ca1f7322f1630555168e4a5e81de8c04 /sw/source | |
parent | 80530986a70bbbcca6cb71ab32da593e11e3684c (diff) |
tdf#121186: sync itemset and supportsFullDrawingLayerFillAttributeSet
In the bugdoc, there are three separate section styles, first of which
(Sect1) has fo:background-color attribute set to #ffffff, others with
no background-related attributes. The sections using the styles are
nested, the outermost one using the style Sect1 with background color.
When the XML is read, SwXTextSection::attach is called, which fills an
item set with values stored in an SwTextSectionProperties_Impl struct,
SvxBrushItem with color value of 0x00ffffff among them. The resulting
set contains the SvxBrushItem item (WhichId = RES_BACKGROUND = 105).
No XATTR_FILL_FIRST .. XATTR_FILL_LAST are put into the set.
When later the Edit Sections dialog is opened, SectRepr objects are
constructed for each section, and the brush is taken from section's
format using makeBackgroundBrushItem. It checks
supportsFullDrawingLayerFillAttributeSet, and if yes, uses
getSvxBrushItemFromSourceSet to fill in the SvxBrushItem; the latter
only considers XATTR_FILL_FIRST .. XATTR_FILL_LAST in the passed set.
For the SwSectionFormat, supportsFullDrawingLayerFillAttributeSet
inherited from SwFrameFormat returns true, which means that existing
RES_BACKGROUND item is ignored, and default transparent color is
returned.
Fix by returning false from supportsFullDrawingLayerFillAttributeSet for
SwSectionFormat. This makes nested sections' properties and behaviour
match what was in older versions (4.0), where all three nested sections
took white fill; and only setting innermost section's fill to none made
it transparent (show document's background).
Change-Id: Id0b4fce221cfa9c54097e69a3acfdf018a1043b5
Reviewed-on: https://gerrit.libreoffice.org/83016
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/docnode/section.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx index 76dad3f7ffb1..21e4247cfc62 100644 --- a/sw/source/core/docnode/section.cxx +++ b/sw/source/core/docnode/section.cxx @@ -1061,6 +1061,11 @@ SwSectionFormat::MakeUnoObject() return xMeta; } +bool SwSectionFormat::supportsFullDrawingLayerFillAttributeSet() const +{ + return false; +} + void SwSectionFormat::dumpAsXml(xmlTextWriterPtr pWriter) const { xmlTextWriterStartElement(pWriter, BAD_CAST("SwSectionFormat")); |