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

New commits:
commit a2191beab988816efc843a52e837bf3c731f6153
Author:     Mohit Marathe <[email protected]>
AuthorDate: Fri Nov 14 18:22:50 2025 +0530
Commit:     Michael Stahl <[email protected]>
CommitDate: Mon Jan 12 19:37:23 2026 +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]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196702

diff --git a/sd/inc/drawdoc.hxx b/sd/inc/drawdoc.hxx
index 6481b05a34b4..f0afaa39826d 100644
--- a/sd/inc/drawdoc.hxx
+++ b/sd/inc/drawdoc.hxx
@@ -415,6 +415,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 623c413fe60e..eac887aaa650 100644
--- a/sd/source/core/drawdoc2.cxx
+++ b/sd/source/core/drawdoc2.cxx
@@ -1535,6 +1535,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());
@@ -1543,6 +1544,7 @@ void SdDrawDocument::ReshufflePages()
         MovePage(nCurrentPageNum, nTargetPageNum); // Standard page
         MovePage(nCurrentPageNum + 1, nTargetPageNum + 1); // Notes page
     }
+    mbSkipCanvasPreviewUpdates = false;
 }
 
 sal_uInt16 SdDrawDocument::GetOrInsertCanvasPage()
@@ -1644,6 +1646,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