From 9c0049cfae49c8e4ddef9125a69db2ad134c10c6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 7 Jun 2024 13:48:25 +0200 Subject: Merging upstream version 4:24.2.4. Signed-off-by: Daniel Baumann --- xmloff/source/style/xmlnumfe.cxx | 2 +- xmloff/source/style/xmlnumfi.cxx | 2 +- xmloff/source/text/XMLTextListBlockContext.hxx | 1 - xmloff/source/text/txtimp.cxx | 72 +------------------------- 4 files changed, 4 insertions(+), 73 deletions(-) (limited to 'xmloff/source') diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx index 406c22236a..f86893c670 100644 --- a/xmloff/source/style/xmlnumfe.cxx +++ b/xmloff/source/style/xmlnumfe.cxx @@ -1100,7 +1100,7 @@ void SvXMLNumFmtExport::ExportPart_Impl( const SvNumberformat& rFormat, sal_uInt // element name - NfIndexTableOffset eBuiltIn = m_pFormatter->GetIndexTableOffset( nRealKey ); + NfIndexTableOffset eBuiltIn = SvNumberFormatter::GetIndexTableOffset( nRealKey ); SvNumFormatType nFmtType = SvNumFormatType::ALL; bool bThousand = false; diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx index f6d05e94c1..261c839154 100644 --- a/xmloff/source/style/xmlnumfi.cxx +++ b/xmloff/source/style/xmlnumfi.cxx @@ -1690,7 +1690,7 @@ sal_Int32 SvXMLNumFormatContext::CreateAndInsert(SvNumberFormatter* pFormatter) // use fixed-order formats instead of SYS... if bAutoOrder is false // (only if the format strings are equal for the locale) - NfIndexTableOffset eOffset = pFormatter->GetIndexTableOffset( nIndex ); + NfIndexTableOffset eOffset = SvNumberFormatter::GetIndexTableOffset( nIndex ); if ( eOffset == NF_DATE_SYS_DMMMYYYY ) { sal_uInt32 nNewIndex = pFormatter->GetFormatIndex( NF_DATE_DIN_DMMMYYYY, m_nFormatLang ); 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 const& rxParaStyles, - uno::Reference const& rxPropSet, - OUString const& rProperty) -{ - uno::Reference 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 const xStyle(rxParaStyles->getByName(style), uno::UNO_QUERY); - assert(xStyle.is()); - uno::Reference 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&) { -- cgit v1.2.3