xmloff/source/text/txtimp.cxx |    8 ++++++++
 1 file changed, 8 insertions(+)

New commits:
commit 1b2a6b98291cf8b7022951be19b915fe2a9e18e6
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Thu Apr 18 13:00:04 2024 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Fri Apr 19 10:49:40 2024 +0200

    tdf#159903 xmloff: ODF import: fix bug in margin compatibility override
    
    The check for the property being set was wrong: the state in a parent
    style may be DIRECT_VALUE but a derived style may have a list style set,
    which effectively overrides the ParaLeftMargin and ParaFirstLineIndent.
    
    Fix this so that the compatibility override only happens when required.
    
    (regression from commit 7cf5faec6fdbc27dd77d2d36fb2ff205322cba0d)
    
    Change-Id: I6c8ca493df946afcb48a63c01c132620bcd7b390
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166257
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx
index b98f6a41d3e4..b0790da2cf46 100644
--- a/xmloff/source/text/txtimp.cxx
+++ b/xmloff/source/text/txtimp.cxx
@@ -1014,6 +1014,10 @@ auto 
IsPropertySet(uno::Reference<container::XNameContainer> const& rxParaStyles
     {
         return true;
     }
+    if (xPropState->getPropertyState("NumberingStyleName") == 
beans::PropertyState_DIRECT_VALUE)
+    {
+        return false; // tdf#159903 this overrides value in the parent style
+    }
     // check if it is set by any parent common style
     OUString style;
     rxPropSet->getPropertyValue("ParaStyleName") >>= style;
@@ -1026,6 +1030,10 @@ auto 
IsPropertySet(uno::Reference<container::XNameContainer> const& rxParaStyles
         {
             return true;
         }
+        if (xStyleProps->getPropertyState("NumberingStyleName") == 
beans::PropertyState_DIRECT_VALUE)
+        {
+            return false; // tdf#159903 this overrides value in the parent 
style
+        }
         style = xStyle->getParentStyle();
     }
     return false;

Reply via email to