diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2016-04-27 10:59:21 +0200 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2016-05-06 13:26:11 +0000 |
commit | 8d10c23705f30e55f36220a7d9bad86c0c53c66a (patch) | |
tree | ada3d13af6eabde13d03a08003de7b38167daa15 /sd/source | |
parent | 945064c0b7ad4da6e215668ae7e4edb14945f00c (diff) |
tdf#89466: Getting/setting page orientation works now
Change-Id: I1fd2f8cf3985079e9f8d752344646bd3a5769725
Reviewed-on: https://gerrit.libreoffice.org/24657
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Tested-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/ui/sidebar/SlideBackground.cxx | 32 | ||||
-rw-r--r-- | sd/source/ui/sidebar/SlideBackground.hxx | 4 | ||||
-rw-r--r-- | sd/source/ui/view/drviews2.cxx | 1 | ||||
-rw-r--r-- | sd/source/ui/view/drviews7.cxx | 7 |
4 files changed, 38 insertions, 6 deletions
diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx index dd8a972faa0c..370aade1bc2c 100644 --- a/sd/source/ui/sidebar/SlideBackground.cxx +++ b/sd/source/ui/sidebar/SlideBackground.cxx @@ -120,7 +120,8 @@ SlideBackground::SlideBackground( ) : PanelLayout( pParent, "SlideBackgroundPanel", "modules/simpress/ui/sidebarslidebackground.ui", rxFrame ), mrBase( rBase ), - maPaperController(SID_ATTR_PAGE_SIZE, *pBindings, *this), + maPaperSizeController(SID_ATTR_PAGE_SIZE, *pBindings, *this), + maPaperOrientationController(SID_ATTR_PAGE, *pBindings, *this), maBckColorController(SID_ATTR_PAGE_COLOR, *pBindings, *this), maBckGradientController(SID_ATTR_PAGE_GRADIENT, *pBindings, *this), maBckHatchController(SID_ATTR_PAGE_HATCH, *pBindings, *this), @@ -158,7 +159,7 @@ void SlideBackground::Initialize() { lcl_FillPaperSizeListbox( *mpPaperSizeBox ); mpPaperSizeBox->SetSelectHdl(LINK(this,SlideBackground,PaperSizeModifyHdl)); - mpPaperOrientation->SetSelectHdl(LINK(this,SlideBackground,PaperSizeModifyHdl)); + mpPaperOrientation->SetSelectHdl(LINK(this,SlideBackground,PaperOrientationModifyHdl)); ::sd::DrawDocShell* pDocSh = dynamic_cast<::sd::DrawDocShell*>( SfxObjectShell::Current() ); SdDrawDocument* pDoc = pDocSh->GetDoc(); @@ -174,7 +175,7 @@ void SlideBackground::Initialize() } } - meUnit = maPaperController.GetCoreMetric(); + meUnit = maPaperSizeController.GetCoreMetric(); mpMasterSlide->SetSelectHdl(LINK(this, SlideBackground, AssignMasterPage)); @@ -269,7 +270,8 @@ void SlideBackground::dispose() mpDspMasterBackground.clear(); mpDspMasterObjects.clear(); - maPaperController.dispose(); + maPaperSizeController.dispose(); + maPaperOrientationController.dispose(); maBckColorController.dispose(); maBckGradientController.dispose(); maBckHatchController.dispose(); @@ -398,6 +400,18 @@ void SlideBackground::NotifyItemUpdate( } break; + case SID_ATTR_PAGE: + { + if(eState >= SfxItemState::DEFAULT) + { + const SvxPageItem* aPageItem = dynamic_cast< const SvxPageItem* >(pState); + bool bIsLandscape = aPageItem->IsLandscape(); + + mpPaperOrientation->SelectEntryPos( bIsLandscape ? 0 : 1 ); + } + } + break; + case SID_DISPLAY_MASTER_BACKGROUND: { if(eState >= SfxItemState::DEFAULT) @@ -432,6 +446,7 @@ void SlideBackground::NotifyItemUpdate( break; } } + IMPL_LINK_NOARG_TYPED(SlideBackground, FillStyleModifyHdl, ListBox&, void) { const drawing::FillStyle eXFS = (drawing::FillStyle)mpFillStyle->GetSelectEntryPos(); @@ -439,6 +454,7 @@ IMPL_LINK_NOARG_TYPED(SlideBackground, FillStyleModifyHdl, ListBox&, void) Update(); GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_FILLSTYLE, SfxCallMode::RECORD, { &aXFillStyleItem }); } + IMPL_LINK_NOARG_TYPED(SlideBackground, PaperSizeModifyHdl, ListBox&, void) { sal_uInt32 nPos = mpPaperSizeBox->GetSelectEntryPos(); @@ -452,6 +468,14 @@ IMPL_LINK_NOARG_TYPED(SlideBackground, PaperSizeModifyHdl, ListBox&, void) GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_SIZE, SfxCallMode::RECORD, { &aSizeItem }); } +IMPL_LINK_NOARG_TYPED(SlideBackground, PaperOrientationModifyHdl, ListBox&, void) +{ + SvxPageItem aPageItem(SID_ATTR_PAGE); + aPageItem.SetLandscape( mpPaperOrientation->GetSelectEntryPos() == 0 ); + + GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE, SfxCallMode::RECORD,{ &aPageItem }); +} + IMPL_LINK_NOARG_TYPED(SlideBackground, FillColorHdl, ListBox&, void) { const drawing::FillStyle eXFS = (drawing::FillStyle)mpFillStyle->GetSelectEntryPos(); diff --git a/sd/source/ui/sidebar/SlideBackground.hxx b/sd/source/ui/sidebar/SlideBackground.hxx index 29be4612fd35..89a71bad772c 100644 --- a/sd/source/ui/sidebar/SlideBackground.hxx +++ b/sd/source/ui/sidebar/SlideBackground.hxx @@ -79,7 +79,8 @@ private: VclPtr<CheckBox> mpDspMasterBackground; VclPtr<CheckBox> mpDspMasterObjects; - ::sfx2::sidebar::ControllerItem maPaperController; + ::sfx2::sidebar::ControllerItem maPaperSizeController; + ::sfx2::sidebar::ControllerItem maPaperOrientationController; ::sfx2::sidebar::ControllerItem maBckColorController; ::sfx2::sidebar::ControllerItem maBckGradientController; ::sfx2::sidebar::ControllerItem maBckHatchController; @@ -103,6 +104,7 @@ private: DECL_LINK_TYPED(FillBackgroundHdl, ListBox&, void); DECL_LINK_TYPED(FillStyleModifyHdl, ListBox&, void); DECL_LINK_TYPED(PaperSizeModifyHdl, ListBox&, void); + DECL_LINK_TYPED(PaperOrientationModifyHdl, ListBox&, void); DECL_LINK_TYPED(FillColorHdl, ListBox&, void); DECL_LINK_TYPED(AssignMasterPage, ListBox&, void); DECL_LINK_TYPED(DspBackground, Button*, void); diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 7e0b5b798c7d..c71c05b66667 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -1206,6 +1206,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) case SID_ATTR_PAGE_FILLSTYLE: case SID_SELECT_BACKGROUND: case SID_ATTR_PAGE_SIZE: + case SID_ATTR_PAGE: case SID_PAGESETUP: // BASIC ?? { SetCurrentFunction( FuPage::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) ); diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index bd6136774d7d..d2d35bc00042 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -1550,7 +1550,12 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) void DrawViewShell::GetPageProperties( SfxItemSet &rSet ) { - rSet.Put(SvxSizeItem( SID_ATTR_PAGE_SIZE, getCurrentPage()->GetSize())); + SdPage *pPage = getCurrentPage(); + SvxPageItem aPageItem(SID_ATTR_PAGE); + aPageItem.SetLandscape( pPage->GetOrientation() == ORIENTATION_LANDSCAPE ); + + rSet.Put(SvxSizeItem( SID_ATTR_PAGE_SIZE, pPage->GetSize())); + rSet.Put( aPageItem ); } void DrawViewShell::GetModeSwitchingMenuState (SfxItemSet &rSet) |