sd/source/core/drawdoc2.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
New commits: commit 965b55f569c7e8b57d3ded84297fc3a0acecdf7a Author: Mohit Marathe <[email protected]> AuthorDate: Mon Dec 15 15:08:43 2025 +0530 Commit: Mohit Marathe <[email protected]> CommitDate: Tue Jan 13 08:57:19 2026 +0100 sd: add page count check in SdDrawDocument::connectPagePreviews return early if the document has only one non-canvas page Signed-off-by: Mohit Marathe <[email protected]> Change-Id: I79cb8277f5ed62a1f683c1c6a4b18844267dddf6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195651 Reviewed-by: Michael Stahl <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196721 diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx index bdcee964fcf1..4aeac609f78f 100644 --- a/sd/source/core/drawdoc2.cxx +++ b/sd/source/core/drawdoc2.cxx @@ -1776,7 +1776,8 @@ void SdDrawDocument::connectPagePreviews() if (!HasCanvasPage()) return; SdrObjList* pObjList = mpCanvasPage.get(); - std::vector<SdrPageObj*> aPageOrder(GetSdPageCount(PageKind::Standard) - 1, nullptr); + sal_uInt16 nPageCount = GetSdPageCount(PageKind::Standard); + std::vector<SdrPageObj*> aPageOrder(nPageCount - 1, nullptr); SdrObjListIter aIter(pObjList, SdrIterMode::Flat); for (SdrObject* pObj = aIter.Next(); pObj; pObj = aIter.Next()) @@ -1795,6 +1796,10 @@ void SdDrawDocument::connectPagePreviews() } } + // return if the document has only one non-canvas page + if (nPageCount == 2) + return; + for (size_t i = 0; i < aPageOrder.size() - 1; i++) { SdrPageObj* pPageObj1 = aPageOrder[i]; commit 789066f069ddd2544f1d4a79c248655390d9de13 Author: Mohit Marathe <[email protected]> AuthorDate: Tue Dec 16 19:23:14 2025 +0530 Commit: Mohit Marathe <[email protected]> CommitDate: Tue Jan 13 08:57:08 2026 +0100 sd: do not call updatePagePreviewsGrid for notes page Signed-off-by: Mohit Marathe <[email protected]> Change-Id: Ia50627ee3df36f4b1843109a0a62426ed7f3cdd4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195718 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Michael Stahl <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196720 diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx index ac90a44986d3..bdcee964fcf1 100644 --- a/sd/source/core/drawdoc2.cxx +++ b/sd/source/core/drawdoc2.cxx @@ -536,7 +536,7 @@ rtl::Reference<SdrPage> SdDrawDocument::RemovePage(sal_uInt16 nPgNum) SfxLokHelper::notifyDocumentSizeChangedAllViews(pDoc); } - if (HasCanvasPage() && !mbDestroying) + if (HasCanvasPage() && pSdPage->GetPageKind() == PageKind::Standard && !mbDestroying) { updatePagePreviewsGrid(pSdPage); }
