sd/source/core/drawdoc2.cxx |    2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 5c5c90ab9f735301f23220e2ba6a215863610f47
Author:     Mohit Marathe <[email protected]>
AuthorDate: Tue Jan 6 11:37:24 2026 +0530
Commit:     Michael Stahl <[email protected]>
CommitDate: Tue Jan 13 11:56:36 2026 +0100

    sd: delete the master page when canvas page is deleted
    
    since it is not shared by any other page.
    
    Signed-off-by: Mohit Marathe <[email protected]>
    Change-Id: I9564dc2dadc5d78b8fca31700cc0f44967c753c3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196589
    Reviewed-by: Michael Stahl <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx
index df48c0231fe4..15d1f30ea475 100644
--- a/sd/source/core/drawdoc2.cxx
+++ b/sd/source/core/drawdoc2.cxx
@@ -516,6 +516,8 @@ rtl::Reference<SdrPage> 
SdDrawDocument::RemovePage(sal_uInt16 nPgNum)
     auto pSdPage = static_cast<SdPage*>(pPage.get());
     if (pSdPage->IsCanvasPage())
     {
+        SdrPage* pMPage = &pPage->TRG_GetMasterPage();
+        RemoveMasterPage(pMPage->GetPageNum());
         if (comphelper::LibreOfficeKit::isActive())
         {
             DrawViewShell* pDrawViewSh = 
dynamic_cast<DrawViewShell*>(mpDocSh->GetViewShell());

Reply via email to