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.grandin@collabora.co.uk>
diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx
index 1c75145..8dc3a39 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.