summaryrefslogtreecommitdiffstats
path: root/xmloff/source/text
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 11:48:25 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 11:48:25 +0000
commit9c0049cfae49c8e4ddef9125a69db2ad134c10c6 (patch)
tree812a86c0eee63dfc5ace12f2622ed3ce9cd3d680 /xmloff/source/text
parentReleasing progress-linux version 4:24.2.3-2~progress7.99u1. (diff)
downloadlibreoffice-9c0049cfae49c8e4ddef9125a69db2ad134c10c6.tar.xz
libreoffice-9c0049cfae49c8e4ddef9125a69db2ad134c10c6.zip
Merging upstream version 4:24.2.4.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'xmloff/source/text')
-rw-r--r--xmloff/source/text/XMLTextListBlockContext.hxx1
-rw-r--r--xmloff/source/text/txtimp.cxx72
2 files changed, 2 insertions, 71 deletions
diff --git a/xmloff/source/text/XMLTextListBlockContext.hxx b/xmloff/source/text/XMLTextListBlockContext.hxx
index 4b18d625cc..a529afd1e4 100644
--- a/xmloff/source/text/XMLTextListBlockContext.hxx
+++ b/xmloff/source/text/XMLTextListBlockContext.hxx
@@ -66,7 +66,6 @@ public:
void ResetRestartNumbering() { mbRestartNumbering = false; }
/// does this list have (possibly inherited from parent) list-style-name?
- bool HasListStyleName() { return !msListStyleName.isEmpty(); }
const css::uno::Reference < css::container::XIndexReplace >& GetNumRules() const
{ return mxNumRules; }
diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx
index d6e132323d..56d21a5196 100644
--- a/xmloff/source/text/txtimp.cxx
+++ b/xmloff/source/text/txtimp.cxx
@@ -1004,45 +1004,6 @@ static bool lcl_HasListStyle( const OUString& sStyleName,
return bRet;
}
-namespace {
-
-auto IsPropertySet(uno::Reference<container::XNameContainer> const& rxParaStyles,
- uno::Reference<beans::XPropertySet> const& rxPropSet,
- OUString const& rProperty)
-{
- uno::Reference<beans::XPropertyState> const xPropState(rxPropSet, uno::UNO_QUERY);
- // note: this is true only if it is set in automatic style
- if (xPropState->getPropertyState(rProperty) == beans::PropertyState_DIRECT_VALUE)
- {
- 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;
- while (!style.isEmpty() && rxParaStyles.is() && rxParaStyles->hasByName(style))
- {
- uno::Reference<style::XStyle> const xStyle(rxParaStyles->getByName(style), uno::UNO_QUERY);
- assert(xStyle.is());
- uno::Reference<beans::XPropertyState> const xStyleProps(xStyle, uno::UNO_QUERY);
- if (xStyleProps->getPropertyState(rProperty) == beans::PropertyState_DIRECT_VALUE)
- {
- 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;
-};
-
-} // namespace
-
OUString XMLTextImportHelper::SetStyleAndAttrs(
SvXMLImport & rImport,
const Reference < XTextCursor >& rCursor,
@@ -1126,17 +1087,8 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
bool bNumberingIsNumber(true);
// Assure that list style of automatic paragraph style is applied at paragraph. (#i101349#)
bool bApplyNumRules(pStyle && pStyle->IsListStyleSet());
- bool bApplyNumRulesFix(false);
if (pListBlock) {
- // the xNumRules is always created, even without a list-style-name
- if (!bApplyNumRules
- && (pListBlock->HasListStyleName()
- || (pListItem != nullptr && pListItem->HasNumRulesOverride())))
- {
- bApplyNumRules = true; // tdf#114287
- bApplyNumRulesFix = rImport.isGeneratorVersionOlderThan(SvXMLImport::AOO_4x, SvXMLImport::LO_76);
- }
if (!pListItem) {
bNumberingIsNumber = false; // list-header
@@ -1168,7 +1120,7 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
if (pListBlock || pNumberedParagraph)
{
- if (!bApplyNumRules || bApplyNumRulesFix)
+ if (!bApplyNumRules)
{
bool bSameNumRules = xNewNumRules == xNumRules;
if( !bSameNumRules && xNewNumRules.is() && xNumRules.is() )
@@ -1192,14 +1144,7 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
}
}
}
- if (!bApplyNumRules)
- {
- bApplyNumRules = !bSameNumRules;
- }
- if (!bSameNumRules)
- {
- bApplyNumRulesFix = false;
- }
+ bApplyNumRules = !bSameNumRules;
}
if ( bApplyNumRules )
@@ -1213,19 +1158,6 @@ OUString XMLTextImportHelper::SetStyleAndAttrs(
{
xPropSet->setPropertyValue(
s_NumberingRules, Any(xNewNumRules) );
- if (bApplyNumRulesFix)
- { // tdf#156146 override list margins for bug compatibility
- if (IsPropertySet(m_xImpl->m_xParaStyles, xPropSet, "ParaLeftMargin"))
- {
- uno::Any const left(xPropSet->getPropertyValue("ParaLeftMargin"));
- xPropSet->setPropertyValue("ParaLeftMargin", left);
- }
- if (IsPropertySet(m_xImpl->m_xParaStyles, xPropSet, "ParaFirstLineIndent"))
- {
- uno::Any const first(xPropSet->getPropertyValue("ParaFirstLineIndent"));
- xPropSet->setPropertyValue("ParaFirstLineIndent", first);
- }
- }
}
catch(const Exception&)
{