sw/source/core/doc/DocumentContentOperationsManager.cxx     |    2 +-
 sw/source/core/doc/docfmt.cxx                               |    6 +++---
 sw/source/writerfilter/dmapper/DomainMapperTableHandler.cxx |   10 +++++-----
 3 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 075560420a7aa238182e2d80dfe1c5fbaad3edbd
Author:     Oliver Specht <oliver.spe...@cib.de>
AuthorDate: Tue Oct 15 16:20:42 2024 +0200
Commit:     Thorsten Behrens <thorsten.behr...@allotropia.de>
CommitDate: Tue Nov 19 01:13:17 2024 +0100

    tdf# 162326 reset paragraph list attributes on style apply
    
    Follow-up to a593c27e8897280871dc310184ff568bf34a6ebe.
    If Ctrl key is presseed then remove list attributes of the paragraph, too.
    
    Change-Id: I29ea97ff08f45061d532b11cb981c534cc786f0f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174977
    Tested-by: Jenkins
    Tested-by: Gabor Kelemen <gabor.kelemen.ext...@allotropia.de>
    Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de>

diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index c469f12931de..c52221d7ca53 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -3711,7 +3711,7 @@ bool DocumentContentOperationsManager::InsertPoolItem(
         //            aPara.pFormatColl = pPara->pFormatColl;
         aPara.bReset = true;
         // #i62675#
-        aPara.bResetListAttrs = false;
+        aPara.bResetListAttrs = true;
         aPara.bResetAllCharAttrs = true;
         aPara.pDelSet = pDelSet.get();
         m_rDoc.GetNodes().ForEach(
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index c9a0dfd62c05..085cdd9770f1 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -1017,8 +1017,8 @@ static bool lcl_SetTextFormatColl( SwNode* pNode, void* 
pArgs )
 
         // #i62675# check, if paragraph style has changed
         if ( pPara->bResetListAttrs &&
-             pFormat != pCNd->GetFormatColl() &&
-             pFormat->GetItemState( RES_PARATR_NUMRULE ) == SfxItemState::SET )
+             pFormat != pCNd->GetFormatColl()
+            && pCNd->GetTextNode()->IsInList() )
         {
             // Check, if the list style of the paragraph will change.
             bool bChangeOfListStyleAtParagraph( true );
@@ -1028,7 +1028,7 @@ static bool lcl_SetTextFormatColl( SwNode* pNode, void* 
pArgs )
                 if ( pNumRuleAtParagraph )
                 {
                     const SwNumRuleItem& rNumRuleItemAtParagraphStyle =
-                        pFormat->GetNumRule();
+                        rTNd.GetTextColl()->GetNumRule();
                     if ( rNumRuleItemAtParagraphStyle.GetValue() ==
                             pNumRuleAtParagraph->GetName() )
                     {
diff --git a/sw/source/writerfilter/dmapper/DomainMapperTableHandler.cxx 
b/sw/source/writerfilter/dmapper/DomainMapperTableHandler.cxx
index afd6af78ee47..6989ae844f4f 100644
--- a/sw/source/writerfilter/dmapper/DomainMapperTableHandler.cxx
+++ b/sw/source/writerfilter/dmapper/DomainMapperTableHandler.cxx
@@ -246,9 +246,9 @@ struct TableInfo
     css::beans::PropertyValues aTableProperties;
     std::vector< PropertyIds > aTablePropertyIds;
 
-    TableInfo()
-    : nLeftBorderDistance(DEF_BORDER_DIST)
-    , nRightBorderDistance(DEF_BORDER_DIST)
+    explicit TableInfo(bool bOOXMLImport)
+    : nLeftBorderDistance(bOOXMLImport ? DEF_BORDER_DIST : 0)
+    , nRightBorderDistance(bOOXMLImport ? DEF_BORDER_DIST : 0)
     , nTopBorderDistance(0)
     , nBottomBorderDistance(0)
     , nTblLook(0x4a0)
@@ -392,7 +392,7 @@ TableStyleSheetEntry * 
DomainMapperTableHandler::endTableGetTableStyle(TableInfo
                 PropertyMapPtr pMergedProperties = 
pStyleSheet->GetMergedInheritedProperties(pStyleSheetTable);
 
                 table::BorderLine2 aBorderLine;
-                TableInfo rStyleInfo;
+                TableInfo rStyleInfo(m_rDMapper_Impl.IsOOXMLImport());
                 if (lcl_extractTableBorderProperty(pMergedProperties, 
PROP_TOP_BORDER, rStyleInfo, aBorderLine))
                 {
                     aGrabBag[u"TableStyleTopBorder"_ustr] <<= aBorderLine;
@@ -1412,7 +1412,7 @@ void DomainMapperTableHandler::endTable(unsigned int 
nestedTableLevel)
     // If we want to make this table a floating one.
     std::vector<beans::PropertyValue> aFrameProperties = 
comphelper::sequenceToContainer<std::vector<beans::PropertyValue> >
             (m_rDMapper_Impl.getTableManager().getCurrentTablePosition());
-    TableInfo aTableInfo;
+    TableInfo aTableInfo(m_rDMapper_Impl.IsOOXMLImport());
     aTableInfo.nNestLevel = nestedTableLevel;
 
     // non-floating tables need floating in footnotes and endnotes, because

Reply via email to