diff options
Diffstat (limited to 'svx/source/svdraw/svdpage.cxx')
-rw-r--r-- | svx/source/svdraw/svdpage.cxx | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx index 1ebfe6cad4ac..7167f69c5c12 100644 --- a/svx/source/svdraw/svdpage.cxx +++ b/svx/source/svdraw/svdpage.cxx @@ -1287,7 +1287,26 @@ void SdrPageProperties::SetStyleSheet(SfxStyleSheet* pStyleSheet) ImpPageChange(*mpSdrPage); } -void SdrPageProperties::SetTheme(std::unique_ptr<svx::Theme> pTheme) { mpTheme = std::move(pTheme); } +void SdrPageProperties::SetTheme(std::unique_ptr<svx::Theme> pTheme) +{ + mpTheme = std::move(pTheme); + + if (mpTheme && mpSdrPage->IsMasterPage()) + { + SdrModel& rModel = mpSdrPage->getSdrModelFromSdrPage(); + sal_uInt16 nPageCount = rModel.GetPageCount(); + for (sal_uInt16 nPage = 0; nPage < nPageCount; ++nPage) + { + SdrPage* pPage = rModel.GetPage(nPage); + if (!pPage->TRG_HasMasterPage() || &pPage->TRG_GetMasterPage() != mpSdrPage) + { + continue; + } + + mpTheme->UpdateSdrPage(pPage); + } + } +} svx::Theme* SdrPageProperties::GetTheme() { return mpTheme.get(); } |