sd/source/core/drawdoc2.cxx |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit c48e9bec93d3ffdf886ec98235c5998765cba600
Author:     Mohit Marathe <[email protected]>
AuthorDate: Wed Nov 19 11:31:19 2025 +0530
Commit:     Mohit Marathe <[email protected]>
CommitDate: Thu Nov 20 13:00:08 2025 +0100

    sd: remove previous page's background from the canvas page
    
    Signed-off-by: Mohit Marathe <[email protected]>
    Change-Id: I1d4e97281953a5df0b3c3a78cf8292e040f7f509
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194183
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Michael Stahl <[email protected]>

diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx
index ef0ca363ca8e..89c79994afc8 100644
--- a/sd/source/core/drawdoc2.cxx
+++ b/sd/source/core/drawdoc2.cxx
@@ -1559,7 +1559,7 @@ sal_uInt16 SdDrawDocument::GetOrInsertCanvasPage()
     sal_uInt16 nCanvasPageNum = CreatePage(pLastStandardPage, 
PageKind::Standard,
                                            u"Canvas Page"_ustr, u"Canvas notes 
page"_ustr,
                                            AutoLayout::AUTOLAYOUT_NONE, 
AutoLayout::AUTOLAYOUT_NONE,
-                                           false, true, 
pLastStandardPage->GetPageNum() + 2);
+                                           false, false, 
pLastStandardPage->GetPageNum() + 2);
 
     SdPage* pCanvasPage = GetSdPage(nCanvasPageNum, PageKind::Standard);
     if (!pCanvasPage)
@@ -1574,6 +1574,12 @@ sal_uInt16 SdDrawDocument::GetOrInsertCanvasPage()
     SdPage* pMasterCanvas = 
static_cast<SdPage*>(&pCanvasPage->TRG_GetMasterPage());
     pMasterCanvas->SetCanvasMasterPage();
 
+    // Remove all objects inherited from previous page's master page
+    while (pMasterCanvas->GetObjCount() > 0)
+    {
+        pMasterCanvas->NbcRemoveObject(0);
+    }
+
     populatePagePreviewsGrid();
 
     return pCanvasPage->GetPageNum() / 2;

Reply via email to