sd/source/ui/sidebar/SlideBackground.cxx | 20 ++++++++++++-------- sd/source/ui/sidebar/SlideBackground.hxx | 9 +++++---- 2 files changed, 17 insertions(+), 12 deletions(-)
New commits: commit e2325c8e15a92fff2cffa45d30485a50428ac1bc Author: Susobhan Ghosh <[email protected]> Date: Sat Aug 20 19:18:32 2016 +0530 tdf#89466: Fix slide orientation Change-Id: I19d8e56154cd36bc0e50fe08674d3f3566c133fb Reviewed-on: https://gerrit.libreoffice.org/28261 Tested-by: Yousuf Philips <[email protected]> Reviewed-by: Katarina Behrens <[email protected]> diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx index 0a5caa1..370f27a 100644 --- a/sd/source/ui/sidebar/SlideBackground.cxx +++ b/sd/source/ui/sidebar/SlideBackground.cxx @@ -102,6 +102,7 @@ SlideBackground::SlideBackground( maDspObjController(SID_DISPLAY_MASTER_OBJECTS, *pBindings, *this), maMetricController(SID_ATTR_METRIC, *pBindings, *this), maCloseMasterController(SID_CLOSE_MASTER_VIEW, *pBindings, *this), + mpPageItem( new SvxPageItem(SID_ATTR_PAGE) ), mpColorItem(), mpGradientItem(), mpHatchItem(), @@ -530,6 +531,10 @@ void SlideBackground::dispose() maMetricController.dispose(); maCloseMasterController.dispose(); + mpPageItem.reset(); + mpColorItem.reset(); + mpHatchItem.reset(); + mpBitmapItem.reset(); PanelLayout::dispose(); } @@ -726,13 +731,11 @@ void SlideBackground::NotifyItemUpdate( case SID_ATTR_PAGE: { - const SvxPageItem* pPageItem = nullptr; - if (eState >= SfxItemState::DEFAULT) - pPageItem = dynamic_cast< const SvxPageItem* >(pState); - if (pPageItem) + if (eState >= SfxItemState::DEFAULT && + pState && dynamic_cast< const SvxPageItem *>( pState ) != nullptr) { - bool bIsLandscape = pPageItem->IsLandscape(); - + mpPageItem.reset( static_cast<SvxPageItem*>(pState->Clone()) ); + bool bIsLandscape = mpPageItem->IsLandscape(); mpPaperOrientation->SelectEntryPos( bIsLandscape ? 0 : 1 ); } } @@ -828,8 +831,9 @@ IMPL_LINK_NOARG_TYPED(SlideBackground, PaperSizeModifyHdl, ListBox&, void) if(mpPaperOrientation->GetSelectEntryPos() == 0) Swap(aSize); - SvxSizeItem aSizeItem(SID_ATTR_PAGE_SIZE,aSize); - GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_SIZE, SfxCallMode::RECORD, { &aSizeItem }); + mpPageItem->SetLandscape(mpPaperOrientation->GetSelectEntryPos() == 0); + SvxSizeItem aSizeItem(SID_ATTR_PAGE_SIZE, aSize); + GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_SIZE, SfxCallMode::RECORD, { &aSizeItem, mpPageItem.get() }); } IMPL_LINK_NOARG_TYPED(SlideBackground, FillColorHdl, ListBox&, void) diff --git a/sd/source/ui/sidebar/SlideBackground.hxx b/sd/source/ui/sidebar/SlideBackground.hxx index 6bdac4a..0f3d491 100644 --- a/sd/source/ui/sidebar/SlideBackground.hxx +++ b/sd/source/ui/sidebar/SlideBackground.hxx @@ -101,10 +101,11 @@ private: ::sfx2::sidebar::ControllerItem maMetricController; ::sfx2::sidebar::ControllerItem maCloseMasterController; - std::unique_ptr< XFillColorItem > mpColorItem; - std::unique_ptr< XFillGradientItem > mpGradientItem; - std::unique_ptr< XFillHatchItem > mpHatchItem; - std::unique_ptr< XFillBitmapItem > mpBitmapItem; + std::unique_ptr< SvxPageItem > mpPageItem; + std::unique_ptr< XFillColorItem > mpColorItem; + std::unique_ptr< XFillGradientItem > mpGradientItem; + std::unique_ptr< XFillHatchItem > mpHatchItem; + std::unique_ptr< XFillBitmapItem > mpBitmapItem; bool mbEditModeChangePending; _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
