[Libreoffice-commits] core.git: writerfilter/source

Justin Luth (via logerrit) logerrit at kemper.freedesktop.org
Tue May 12 08:19:49 UTC 2020


 writerfilter/source/dmapper/NumberingManager.cxx |    4 ++--
 writerfilter/source/dmapper/PropertyMap.cxx      |    1 -
 writerfilter/source/dmapper/PropertyMap.hxx      |    4 ----
 writerfilter/source/dmapper/StyleSheetTable.cxx  |    1 -
 4 files changed, 2 insertions(+), 8 deletions(-)

New commits:
commit ef4a739d94800426d205fb6e2cb5c2813771dfd3
Author:     Justin Luth <justin.luth at collabora.com>
AuthorDate: Mon Apr 13 18:21:41 2020 +0300
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Tue May 12 10:19:06 2020 +0200

    fix "NFC writerfilter numbering: remove redundant code"
    
    Earlier, in LO 7.0, I made an error in
    commit dbd98ebe9f90cedb41a90375688b200c35dd8928, where
    I failed to notice the difference between setLineId and setNumId,
    and removed setNumId as what I thought was duplicate code.
    (Thanks for pointing that out Mike Kaganski!)
    
    Reviewing the relevant code, setNumId seems to effectively be
    redundant after all. Removing it and just using the LineId value.
    
    There is a slight difference in the code flow, since numId was
    only set if the list didn't exist, but that appears to
    be irrelevant. Lists are not parsed/created until after
    styles are finished, so !pList.get() is implied by IsStyleSheetImport().
    
    Change-Id: I2575966c8f1781bb278c787a2928d2b459867940
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92125
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx
index cca1845d2782..5455bda3a617 100644
--- a/writerfilter/source/dmapper/NumberingManager.cxx
+++ b/writerfilter/source/dmapper/NumberingManager.cxx
@@ -1126,9 +1126,9 @@ AbstractListDef::Pointer ListsManager::GetAbstractList( sal_Int32 nId )
                 const StyleSheetPropertyMap* pStyleSheetProperties =
                     dynamic_cast<const StyleSheetPropertyMap*>(pStyleSheetEntry ? pStyleSheetEntry->pProperties.get() : nullptr);
 
-                if( pStyleSheetProperties && pStyleSheetProperties->GetNumId() >= 0 )
+                if( pStyleSheetProperties && pStyleSheetProperties->GetListId() >= 0 )
                 {
-                    ListDef::Pointer pList = GetList( pStyleSheetProperties->GetNumId() );
+                    ListDef::Pointer pList = GetList( pStyleSheetProperties->GetListId() );
                     if ( pList!=nullptr )
                         return pList->GetAbstractDefinition();
                     else
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index 9d268919f41b..d510bfc8be35 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -1913,7 +1913,6 @@ sal_Int32 SectionPropertyMap::GetPageWidth() const
 StyleSheetPropertyMap::StyleSheetPropertyMap()
     : mnListLevel( -1 )
     , mnOutlineLevel( -1 )
-    , mnNumId( -1 )
 {
 }
 
diff --git a/writerfilter/source/dmapper/PropertyMap.hxx b/writerfilter/source/dmapper/PropertyMap.hxx
index d1a6ea0afdd4..2408b3fc005e 100644
--- a/writerfilter/source/dmapper/PropertyMap.hxx
+++ b/writerfilter/source/dmapper/PropertyMap.hxx
@@ -524,7 +524,6 @@ class StyleSheetPropertyMap
 private:
     sal_Int16 mnListLevel;
     sal_Int16 mnOutlineLevel;
-    sal_Int32 mnNumId;
 
 public:
     explicit StyleSheetPropertyMap();
@@ -534,9 +533,6 @@ public:
 
     sal_Int16 GetOutlineLevel() const             { return mnOutlineLevel; }
     void      SetOutlineLevel( sal_Int16 nLevel ) { if ( nLevel < WW_OUTLINE_MAX ) mnOutlineLevel = nLevel; }
-
-    sal_Int32 GetNumId() const        { return mnNumId; }
-    void      SetNumId(sal_Int32 nId) { mnNumId = nId; }
 };
 
 class ParagraphPropertyMap
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx
index e6704b068ff1..e33a86a9a4a0 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -1112,7 +1112,6 @@ void StyleSheetTable::ApplyStyleSheets( const FontTablePtr& rFontTable )
                                                     = dynamic_cast<StyleSheetPropertyMap&>(*aSheetProps->pProperties);
                                                 pStyleSheetProperties->SetListLevel(rStyleSheetProps.GetListLevel());
                                                 pStyleSheetProperties->SetOutlineLevel(rStyleSheetProps.GetOutlineLevel());
-                                                pStyleSheetProperties->SetNumId(rStyleSheetProps.GetNumId());
                                                 break;
                                             }
                                         }


More information about the Libreoffice-commits mailing list