sd/inc/drawdoc.hxx          |    2 ++
 sd/source/core/drawdoc2.cxx |    4 ++++
 2 files changed, 6 insertions(+)

New commits:
commit a80b3818d2160ed84fe023042e9d9d50aa4c3445
Author:     Mohit Marathe <[email protected]>
AuthorDate: Fri Nov 14 18:22:50 2025 +0530
Commit:     Mohit Marathe <[email protected]>
CommitDate: Wed Nov 19 04:38:54 2025 +0100

    sd: don't update the previews while re-ordering pages
    
    Signed-off-by: Mohit Marathe <[email protected]>
    Change-Id: Ide0f7672076e8ed5eb7f9cdaee1278c869f51e8b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194025
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Michael Stahl <[email protected]>

diff --git a/sd/inc/drawdoc.hxx b/sd/inc/drawdoc.hxx
index 46cf1007113c..64d1b78bbc1b 100644
--- a/sd/inc/drawdoc.hxx
+++ b/sd/inc/drawdoc.hxx
@@ -434,6 +434,8 @@ private:
 
     rtl::Reference<SdPage> mpCanvasPage;
 
+    bool mbSkipCanvasPreviewUpdates = false;
+
     SAL_DLLPRIVATE virtual css::uno::Reference< css::frame::XModel > 
createUnoModel() override;
 
 public:
diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx
index f267ab2f5201..ef0ca363ca8e 100644
--- a/sd/source/core/drawdoc2.cxx
+++ b/sd/source/core/drawdoc2.cxx
@@ -1536,6 +1536,7 @@ void SdDrawDocument::ReshufflePages()
         rowStart = rowEnd;
     }
 
+    mbSkipCanvasPreviewUpdates = true;
     for (size_t i = 0; i < aPageOrder.size(); i++)
     {
         SdPage* pPage = 
static_cast<SdPage*>(aPageOrder[i]->GetReferencedPage());
@@ -1544,6 +1545,7 @@ void SdDrawDocument::ReshufflePages()
         MovePage(nCurrentPageNum, nTargetPageNum); // Standard page
         MovePage(nCurrentPageNum + 1, nTargetPageNum + 1); // Notes page
     }
+    mbSkipCanvasPreviewUpdates = false;
 }
 
 sal_uInt16 SdDrawDocument::GetOrInsertCanvasPage()
@@ -1645,6 +1647,8 @@ void SdDrawDocument::populatePagePreviewsGrid()
 
 void SdDrawDocument::updatePagePreviewsGrid(SdPage* pPage)
 {
+    if (mbSkipCanvasPreviewUpdates)
+        return;
     SdrObjList* pObjList = mpCanvasPage.get();
     sal_uInt16 nTotalPreviews = 0;
     sal_uInt16 nPageCnt = GetSdPageCount(PageKind::Standard) - 1; // do not 
count canvas page

Reply via email to