sw/source/core/unocore/unostyle.cxx | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
New commits: commit 9410a22cdbe7c977206456218c75683a305ef79e Author: Michael Stahl <michael.st...@allotropia.de> AuthorDate: Tue Jul 4 14:54:47 2023 +0200 Commit: Michael Stahl <michael.st...@allotropia.de> CommitDate: Tue Jul 4 17:13:59 2023 +0200 tdf#156155 sw: export draw:fill to top-level ODF graphic styles The default for XATTR_FILLSTYLE for Writer flys differs from the default in the item pool, which is intended for svx shapes/SdrObjects. This is implemented with an intermediate mpDfltFrameFormat but it needs some special handling so the attribute ends up in the styles.xml. Change-Id: I8f369809a9f3b7e85a8bc7ad5d309dbc3cd6ccfe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153970 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@allotropia.de> diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index 071ca0daae31..f57cd53d407f 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -2533,6 +2533,21 @@ uno::Sequence<beans::PropertyState> SwXStyle::getPropertyStates(const uno::Seque } } break; + case XATTR_FILLSTYLE: + { + if (m_rEntry.family() == SfxStyleFamily::Frame + && xStyle->GetFrameFormat()->DerivedFrom() == GetDoc()->GetDfltFrameFormat()) + { // tdf#156155 mpDfltFrameFormat is the parent, but because + // it IsDefault() it is not enumerated/exported as a style + // to ODF, so export its one important value here. + pStates[i] = beans::PropertyState_DIRECT_VALUE; + } + else + { + pStates[i] = pPropSet->getPropertyState(*pEntry, *pSourceSet); + } + } + break; case RES_BACKGROUND: { // for FlyFrames we need to mark the used properties from type RES_BACKGROUND