sd/source/core/drawdoc4.cxx |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 5f62629af6d12d505b029db85c276daedf5017b1
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Sun Mar 10 10:10:05 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sun Mar 10 10:11:17 2024 +0100

    tdf#158773 avoid Reindex() until we are done renaming
    
    shaves 10% off load time
    
    Change-Id: I93dfb4422a3e470013b6ddc5a9ae9e9868e3ddf7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164609
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx
index 1c75145818b3..8dc3a394b1e7 100644
--- a/sd/source/core/drawdoc4.cxx
+++ b/sd/source/core/drawdoc4.cxx
@@ -1043,11 +1043,12 @@ void SdDrawDocument::RenameLayoutTemplate(const 
OUString& rOldLayoutName, const
             aReplData.aNewName   = aSheetName;
             aReplList.push_back(aReplData);
 
-            pSheet->SetName(aSheetName);
+            pSheet->SetName(aSheetName, /*bReindexNow*/false);
         }
 
         pSheet = aIter.Next();
     }
+    mxStyleSheetPool->Reindex();
 
     // Now set the layout name of the drawing and the notes page, as well as
     // their master pages.
commit 36db6678a2c131658d17c9e80fcd7c31c427023c
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Sun Mar 10 09:55:55 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sun Mar 10 10:11:06 2024 +0100

    inline aSep variable
    
    Change-Id: Ic547a6f13e7a1a3cade70547d029721ce8054567
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164608
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx
index ed87499a7554..1c75145818b3 100644
--- a/sd/source/core/drawdoc4.cxx
+++ b/sd/source/core/drawdoc4.cxx
@@ -1016,13 +1016,12 @@ OUString SdDrawDocument::CreatePageNumValue(sal_uInt16 
nNum) const
 // (including ~LT~). This is unlike rNewName.
 void SdDrawDocument::RenameLayoutTemplate(const OUString& rOldLayoutName, 
const OUString& rNewName)
 {
-    OUString aSep(SD_LT_SEPARATOR);
     OUString aOldName(rOldLayoutName);
-    sal_Int32 nPos = aOldName.indexOf( aSep );
+    sal_Int32 nPos = aOldName.indexOf( SD_LT_SEPARATOR );
 
     // erase everything after '~LT~'
     if (nPos != -1)
-        aOldName = aOldName.copy(0, nPos + aSep.getLength());
+        aOldName = aOldName.copy(0, nPos + SD_LT_SEPARATOR.getLength());
 
     std::vector<StyleReplaceData> aReplList;
     SfxStyleSheetIterator aIter(mxStyleSheetPool.get(), SfxStyleFamily::Page);
@@ -1035,7 +1034,7 @@ void SdDrawDocument::RenameLayoutTemplate(const OUString& 
rOldLayoutName, const
         // if the sheetname starts with aOldName + "~LT~"
         if (aSheetName.startsWith(aOldName))
         {
-            aSheetName = aSheetName.replaceAt(0, aOldName.getLength() - 
aSep.getLength(), rNewName);
+            aSheetName = aSheetName.replaceAt(0, aOldName.getLength() - 
SD_LT_SEPARATOR.getLength(), rNewName);
 
             StyleReplaceData aReplData;
             aReplData.nFamily     = pSheet->GetFamily();
@@ -1052,7 +1051,7 @@ void SdDrawDocument::RenameLayoutTemplate(const OUString& 
rOldLayoutName, const
 
     // Now set the layout name of the drawing and the notes page, as well as
     // their master pages.
-    OUString aPageLayoutName = rNewName + aSep + STR_LAYOUT_OUTLINE;
+    OUString aPageLayoutName = rNewName + SD_LT_SEPARATOR + STR_LAYOUT_OUTLINE;
 
     // Inform all text objects on pages that use the renamed layout and set the
     // new name.

Reply via email to