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

Bjoern Michaelsen (via logerrit) logerrit at kemper.freedesktop.org
Mon Nov 2 20:59:08 UTC 2020


 sw/source/core/layout/atrfrm.cxx |   35 +++++++++++++----------------------
 1 file changed, 13 insertions(+), 22 deletions(-)

New commits:
commit f7428465445851a3ab792b1238c45f08f52e5d31
Author:     Bjoern Michaelsen <bjoern.michaelsen at libreoffice.org>
AuthorDate: Mon Nov 2 19:50:59 2020 +0100
Commit:     Bjoern Michaelsen <bjoern.michaelsen at libreoffice.org>
CommitDate: Mon Nov 2 21:58:28 2020 +0100

    sw/source/core/layout/atrfrm: Remove remaining uses of ModifyNotification
    
    Change-Id: I344ec4b834c52f45c27a88b501c6048853437f36
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105197
    Tested-by: Jenkins
    Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen at libreoffice.org>

diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index 1c4569d15f6c..a7f6d62566c1 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -95,7 +95,6 @@
 
 using namespace ::com::sun::star;
 
-
 namespace sw {
 
 bool GetAtPageRelOrientation(sal_Int16 & rOrientation, bool const isIgnorePrintArea)
@@ -2497,7 +2496,7 @@ void SwFrameFormat::SetName( const OUString& rNewName, bool bBroadcast )
         assert( m_ffList->end() != it );
         SAL_INFO_IF(m_aFormatName == rNewName, "sw.core", "SwFrmFmt not really renamed, as both names are equal");
 
-        SwStringMsgPoolItem aOld( RES_NAME_CHANGED, m_aFormatName );
+        const SwStringMsgPoolItem aOld( RES_NAME_CHANGED, m_aFormatName );
         // As it's a non-unique list, rename should never fail!
         bool const renamed =
             m_ffList->m_PosIndex.modify( it,
@@ -2505,8 +2504,8 @@ void SwFrameFormat::SetName( const OUString& rNewName, bool bBroadcast )
         assert(renamed);
         (void)renamed; // unused in NDEBUG
         if (bBroadcast) {
-            SwStringMsgPoolItem aNew( RES_NAME_CHANGED, rNewName );
-            ModifyNotification( &aOld, &aNew );
+            const SwStringMsgPoolItem aNew( RES_NAME_CHANGED, rNewName );
+            GetNotifier().Broadcast(sw::LegacyModifyHint( &aOld, &aNew ));
         }
     }
     else
@@ -3143,16 +3142,12 @@ void SwFlyFrameFormat::SetObjTitle( const OUString& rTitle, bool bBroadcast )
         return;
     }
 
-    if( bBroadcast )
-    {
-        SwStringMsgPoolItem aOld( RES_TITLE_CHANGED, pMasterObject->GetTitle() );
-        SwStringMsgPoolItem aNew( RES_TITLE_CHANGED, rTitle );
-        pMasterObject->SetTitle( rTitle );
-        ModifyNotification( &aOld, &aNew );
-    }
-    else
+    const SwStringMsgPoolItem aOld(RES_TITLE_CHANGED, pMasterObject->GetTitle());
+    pMasterObject->SetTitle(rTitle);
+    if(bBroadcast)
     {
-        pMasterObject->SetTitle( rTitle );
+        const SwStringMsgPoolItem aNew(RES_TITLE_CHANGED, rTitle);
+        GetNotifier().Broadcast(sw::LegacyModifyHint(&aOld, &aNew));
     }
 }
 
@@ -3180,16 +3175,12 @@ void SwFlyFrameFormat::SetObjDescription( const OUString& rDescription, bool bBr
         return;
     }
 
-    if( bBroadcast )
-    {
-        SwStringMsgPoolItem aOld( RES_DESCRIPTION_CHANGED, pMasterObject->GetDescription() );
-        SwStringMsgPoolItem aNew( RES_DESCRIPTION_CHANGED, rDescription );
-        pMasterObject->SetDescription( rDescription );
-        ModifyNotification( &aOld, &aNew );
-    }
-    else
+    const SwStringMsgPoolItem aOld( RES_DESCRIPTION_CHANGED, pMasterObject->GetDescription() );
+    pMasterObject->SetDescription( rDescription );
+    if(bBroadcast)
     {
-        pMasterObject->SetDescription( rDescription );
+        const SwStringMsgPoolItem aNew( RES_DESCRIPTION_CHANGED, rDescription );
+        GetNotifier().Broadcast(sw::LegacyModifyHint(&aOld, &aNew));
     }
 }
 


More information about the Libreoffice-commits mailing list