basic/source/uno/namecont.cxx |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 88162962222c12c8f75db97ab548d73c1318b98a
Author:     Jim Raykowski <rayk...@gmail.com>
AuthorDate: Fri Oct 18 12:02:25 2024 -0800
Commit:     Andreas Heinisch <andreas.heini...@yahoo.de>
CommitDate: Mon Oct 21 14:09:32 2024 +0200

    Resolves tdf#163515 - Basic Macro Organizer: After renaming a
    
    document macro library the original library also remains
    
    Change-Id: Ife89e1e164d288702d30e6b79f5e703ab9467e4d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175182
    Tested-by: Jenkins
    Reviewed-by: Andreas Heinisch <andreas.heini...@yahoo.de>

diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index 90014a790dc5..a554edb9d8c6 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -2611,9 +2611,6 @@ void SAL_CALL SfxLibraryContainer::renameLibrary( const 
OUString& Name, const OU
 
                 bMovedSuccessful = true;
                 pImplLib->implSetModified( true );
-                // Remove old library from container
-                maNameContainer->removeByName( Name );
-                maModifiable.setModified( true );
             }
         }
         catch(const Exception& )
@@ -2627,7 +2624,10 @@ void SAL_CALL SfxLibraryContainer::renameLibrary( const 
OUString& Name, const OU
     }
     if( bMovedSuccessful )
     {
-           maNameContainer->insertByName( NewName, aLibAny ) ;
+        // Remove the old library from the container and insert it back with 
the new name
+        maNameContainer->removeByName(Name);
+        maNameContainer->insertByName(NewName, aLibAny);
+        maModifiable.setModified(true);
     }
 }
 

Reply via email to