sd/source/ui/unoidl/unopage.cxx | 50 ++++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 22 deletions(-)
New commits: commit ca1a396c89d1ee3dc8ab355fb3cb07470cff3245 Author: Mohit Marathe <[email protected]> AuthorDate: Fri Sep 12 21:19:17 2025 +0530 Commit: Mohit Marathe <[email protected]> CommitDate: Tue Sep 30 14:49:23 2025 +0200 sd: don't force all the master pages to have same size while importing This will allow supporting multiple slide sizes in Impress. Change-Id: Ia41f5a672623dabb486ce8d9fa9b8fc5eb0c51ec Signed-off-by: Mohit Marathe <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190937 Tested-by: Jenkins Reviewed-by: Michael Stahl <[email protected]> diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index 0fb3a191c221..40e48670955c 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -1820,20 +1820,23 @@ void SdGenericDrawPage::SetWidth( sal_Int32 nWidth ) SdDrawDocument& rDoc(static_cast< SdDrawDocument& >(GetPage()->getSdrModelFromSdrPage())); const PageKind ePageKind = GetPage()->GetPageKind(); - sal_uInt16 i, nPageCnt = rDoc.GetMasterSdPageCount(ePageKind); - for (i = 0; i < nPageCnt; i++) + SdPage* pPage = GetPage(); + if (pPage->TRG_HasMasterPage()) { - SdPage* pPage = rDoc.GetMasterSdPage(i, ePageKind); - pPage->SetSize(aSize); - } - - nPageCnt = rDoc.GetSdPageCount(ePageKind); + SdPage* pMasterPage = static_cast<SdPage*>(&pPage->TRG_GetMasterPage()); + pMasterPage->SetSize(aSize); - for (i = 0; i < nPageCnt; i++) - { - SdPage* pPage = rDoc.GetSdPage(i, ePageKind); - pPage->SetSize(aSize); + sal_uInt32 nPageCnt = rDoc.GetSdPageCount(ePageKind); + for (sal_uInt32 i = 0; i < nPageCnt; i++) + { + pPage = rDoc.GetSdPage(i, ePageKind); + if (pPage->TRG_HasMasterPage() && + static_cast<SdPage*>(&pPage->TRG_GetMasterPage()) == pMasterPage) + pPage->SetSize(aSize); + } } + else + pPage->SetSize(aSize); refreshpage( &rDoc, ePageKind ); } @@ -1849,20 +1852,23 @@ void SdGenericDrawPage::SetHeight( sal_Int32 nHeight ) SdDrawDocument& rDoc(static_cast< SdDrawDocument& >(GetPage()->getSdrModelFromSdrPage())); const PageKind ePageKind = GetPage()->GetPageKind(); - sal_uInt16 i, nPageCnt = rDoc.GetMasterSdPageCount(ePageKind); - for (i = 0; i < nPageCnt; i++) + SdPage* pPage = GetPage(); + if (pPage->TRG_HasMasterPage()) { - SdPage* pPage = rDoc.GetMasterSdPage(i, ePageKind); - pPage->SetSize(aSize); - } - - nPageCnt = rDoc.GetSdPageCount(ePageKind); + SdPage* pMasterPage = static_cast<SdPage*>(&pPage->TRG_GetMasterPage()); + pMasterPage->SetSize(aSize); - for (i = 0; i < nPageCnt; i++) - { - SdPage* pPage = rDoc.GetSdPage(i, ePageKind); - pPage->SetSize(aSize); + sal_uInt32 nPageCnt = rDoc.GetSdPageCount(ePageKind); + for (sal_uInt32 i = 0; i < nPageCnt; i++) + { + pPage = rDoc.GetSdPage(i, ePageKind); + if (pPage->TRG_HasMasterPage() && + static_cast<SdPage*>(&pPage->TRG_GetMasterPage()) == pMasterPage) + pPage->SetSize(aSize); + } } + else + pPage->SetSize(aSize); refreshpage( &rDoc, ePageKind ); }
