summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2024-04-18 13:00:04 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2024-04-29 21:06:24 +0200
commit878f51b4ec313a45335585f6f88d3a2cd5631df1 (patch)
tree12610b7a1277ce5b754acdd4239f7eac520608f7
parent7ed1bd0ab67b053cb8c748f9b7388bafc64b89e1 (diff)
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.stahl@allotropia.de> (cherry picked from commit 1b2a6b98291cf8b7022951be19b915fe2a9e18e6) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166218 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> (cherry picked from commit 0b816bade2395d532862e8f2bba6fd7ea0ce540f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166718 Tested-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Patrick Luby <guibomacdev@gmail.com>
-rw-r--r--xmloff/source/text/txtimp.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx
index 1e17f9921df0..f63b13cebe86 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;