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

Justin Luth (via logerrit) logerrit at kemper.freedesktop.org
Mon Apr 13 06:21:42 UTC 2020


 writerfilter/source/dmapper/DomainMapper.cxx     |    9 +--------
 writerfilter/source/dmapper/NumberingManager.cxx |    2 +-
 2 files changed, 2 insertions(+), 9 deletions(-)

New commits:
commit dbd98ebe9f90cedb41a90375688b200c35dd8928
Author:     Justin Luth <justin.luth at collabora.com>
AuthorDate: Fri Apr 10 13:52:39 2020 +0300
Commit:     Justin Luth <justin_luth at sil.org>
CommitDate: Mon Apr 13 08:21:07 2020 +0200

    NFC writerfilter numbering: remove redundant code
    
    Remove duplicated StyleSheetImport section,
    and redundant valid pointer check.
    
    Change-Id: I468733fc627fbdbebb2daf7087ce9e65158751df
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92065
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <justin_luth at sil.org>

diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index e69e3796160b..6eb00b1c8d29 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -1329,14 +1329,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext )
             }
             else
             {
-                if( IsStyleSheetImport() )
-                {
-                    // set the number id for AbstractNum references
-                    StyleSheetPropertyMap* pStyleSheetPropertyMap = dynamic_cast< StyleSheetPropertyMap* >( rContext.get() );
-                    if (pStyleSheetPropertyMap)
-                        pStyleSheetPropertyMap->SetNumId( nIntValue );
-                }
-                else
+                if( !IsStyleSheetImport() )
                 {
                     // eg. disabled numbering using non-existent numId "0"
                     rContext->Insert( PROP_NUMBERING_STYLE_NAME, uno::makeAny( OUString() ) );
diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx
index ef16116c4592..93ba4859ba6b 100644
--- a/writerfilter/source/dmapper/NumberingManager.cxx
+++ b/writerfilter/source/dmapper/NumberingManager.cxx
@@ -464,7 +464,7 @@ OUString ListDef::GetStyleName(sal_Int32 const nId,
     {
         OUString sStyleName = "WWNum" + OUString::number( nId );
 
-        while (xStyles.is() && xStyles->hasByName(sStyleName)) // unique
+        while (xStyles->hasByName(sStyleName)) // unique
         {
             sStyleName += "a";
         }


More information about the Libreoffice-commits mailing list