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

New commits:
commit 3df05ad4ec73e160f8c29af94ab3a34ee403b90d
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Thu Apr 18 13:00:04 2024 +0200
Commit:     Adolfo Jayme Barrientos <fit...@ubuntu.com>
CommitDate: Mon Apr 22 16:47:14 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>
    (cherry picked from commit 1b2a6b98291cf8b7022951be19b915fe2a9e18e6)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166217
    Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>

diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx
index ac0e89474245..d6e132323d34 100644
--- a/xmloff/source/text/txtimp.cxx
+++ b/xmloff/source/text/txtimp.cxx
@@ -1016,6 +1016,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;
@@ -1028,6 +1032,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