sw/source/core/unocore/unostyle.cxx |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

New commits:
commit 0efacb9f484962d4b3be207ed3ebb8935779444c
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 20:01:00 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>
    (cherry picked from commit 9410a22cdbe7c977206456218c75683a305ef79e)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153993

diff --git a/sw/source/core/unocore/unostyle.cxx 
b/sw/source/core/unocore/unostyle.cxx
index 0f0faa227351..bb78c16244bc 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -2536,6 +2536,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

Reply via email to