summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2019-11-17 14:18:18 +0300
committerXisco Faulí <xiscofauli@libreoffice.org>2019-11-20 12:27:25 +0100
commit584cbb64ac1d3ed6db5531159cd8057a345cfb1e (patch)
tree1b723cf71f7a20980db81245523b9f8377b903a2
parent03573be21e9cce8e9e93593bfc3c875b3d9d227d (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> (cherry picked from commit 8586051f02125e7358984d2cd14c5383b26bd246) Reviewed-on: https://gerrit.libreoffice.org/83244 Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
-rw-r--r--sw/inc/section.hxx1
-rw-r--r--sw/source/core/docnode/section.cxx5
2 files changed, 6 insertions, 0 deletions
diff --git a/sw/inc/section.hxx b/sw/inc/section.hxx
index 54b3f8f86c01..0776afda4cf9 100644
--- a/sw/inc/section.hxx
+++ b/sw/inc/section.hxx
@@ -329,6 +329,7 @@ public:
virtual bool IsInUndo() const override;
virtual bool IsInContent() const override;
virtual css::uno::Reference< css::rdf::XMetadatable > MakeUnoObject() override;
+ virtual bool supportsFullDrawingLayerFillAttributeSet() const override;
void dumpAsXml(xmlTextWriterPtr pWriter) const;
};
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"));