sfx2/source/doc/objmisc.cxx |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 815c59104ff2f0a3603471b84132f4786a102fbd
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Tue Jan 28 14:59:18 2025 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Tue Jan 28 17:56:39 2025 +0100

    Don't broadcast SfxHintId::TitleChanged if title doesn't change
    
    Change-Id: Id3a0adb8903f269a94fdfb63220305780b96db4d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180842
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 0a58635a2f7d..a0296194e807 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -865,9 +865,14 @@ void SfxObjectShell::InvalidateName()
 
 {
     pImpl->aTitle.clear();
-    SetName( GetTitle( SFX_TITLE_APINAME ) );
 
-    Broadcast( SfxHint(SfxHintId::TitleChanged) );
+    OUString sOldName = GetName();
+    OUString sNewName = GetTitle(SFX_TITLE_APINAME);
+    if (sOldName != sNewName)
+    {
+        SetName(sNewName);
+        Broadcast(SfxHint(SfxHintId::TitleChanged));
+    }
 }
 
 

Reply via email to