diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2016-10-06 23:34:36 +0300 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2016-10-06 23:54:22 +0300 |
commit | 44ba8c2b986bb94b8809885bdf7dc97ae7db7398 (patch) | |
tree | 9312689d0111ffc57dae26daaa919ac22b0d1917 /sd | |
parent | 5507e9dda79b769e8bb2c079f725d93931e5c1c5 (diff) |
We pass the controller anyway, so get the frame from it
Change-Id: Idd8fc19b24f4d55cd0f836761d5f155b9310c3ca
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/controller/displaymodecontroller.cxx | 10 | ||||
-rw-r--r-- | sd/source/ui/controller/slidelayoutcontroller.cxx | 17 |
2 files changed, 12 insertions, 15 deletions
diff --git a/sd/source/ui/controller/displaymodecontroller.cxx b/sd/source/ui/controller/displaymodecontroller.cxx index 91b35a8b28ed..a0e848a39b65 100644 --- a/sd/source/ui/controller/displaymodecontroller.cxx +++ b/sd/source/ui/controller/displaymodecontroller.cxx @@ -52,8 +52,7 @@ public: class DisplayModeToolbarMenu : public svtools::ToolbarMenu { public: - DisplayModeToolbarMenu( DisplayModeController& rController, - const Reference< XFrame >& xFrame, vcl::Window* pParent ); + DisplayModeToolbarMenu( DisplayModeController& rController, vcl::Window* pParent ); virtual ~DisplayModeToolbarMenu() override; virtual void dispose() override; @@ -133,9 +132,8 @@ static void fillLayoutValueSet( ValueSet* pValue, const snewfoil_value_info* pIn pValue->SetSizePixel( pValue->CalcWindowSizePixel( aLayoutItemSize ) ); } -DisplayModeToolbarMenu::DisplayModeToolbarMenu( DisplayModeController& rController, - const Reference< XFrame >& xFrame, vcl::Window* pParent ) -: svtools::ToolbarMenu(xFrame, pParent, WB_CLIPCHILDREN ) +DisplayModeToolbarMenu::DisplayModeToolbarMenu( DisplayModeController& rController, vcl::Window* pParent ) +: svtools::ToolbarMenu( rController.getFrameInterface(), pParent, WB_CLIPCHILDREN ) , mrController( rController ) , mpDisplayModeSet1( nullptr ) , mpDisplayModeSet2( nullptr ) @@ -242,7 +240,7 @@ void SAL_CALL DisplayModeController::initialize( const css::uno::Sequence< css:: VclPtr<vcl::Window> DisplayModeController::createPopupWindow( vcl::Window* pParent ) { - return VclPtr<sd::DisplayModeToolbarMenu>::Create( *this, m_xFrame, pParent ); + return VclPtr<sd::DisplayModeToolbarMenu>::Create( *this, pParent ); } void DisplayModeController::setToolboxItemImage( sal_uInt16 nImage ) diff --git a/sd/source/ui/controller/slidelayoutcontroller.cxx b/sd/source/ui/controller/slidelayoutcontroller.cxx index 8191e7b79793..6dd1079094b5 100644 --- a/sd/source/ui/controller/slidelayoutcontroller.cxx +++ b/sd/source/ui/controller/slidelayoutcontroller.cxx @@ -65,7 +65,7 @@ namespace sd class LayoutToolbarMenu : public svtools::ToolbarMenu { public: - LayoutToolbarMenu( SlideLayoutController& rController, const Reference< XFrame >& xFrame, vcl::Window* pParent, const bool bInsertPage ); + LayoutToolbarMenu( SlideLayoutController& rController, vcl::Window* pParent, const bool bInsertPage ); virtual ~LayoutToolbarMenu() override; virtual void dispose() override; @@ -75,7 +75,6 @@ protected: void SelectHdl(void*); private: SlideLayoutController& mrController; - Reference< XFrame > mxFrame; bool mbInsertPage; VclPtr<ValueSet> mpLayoutSet1; VclPtr<ValueSet> mpLayoutSet2; @@ -151,15 +150,15 @@ static void fillLayoutValueSet( ValueSet* pValue, const snewfoil_value_info_layo pValue->SetSizePixel( pValue->CalcWindowSizePixel( aLayoutItemSize ) ); } -LayoutToolbarMenu::LayoutToolbarMenu( SlideLayoutController& rController, const Reference< XFrame >& xFrame, vcl::Window* pParent, const bool bInsertPage ) -: svtools::ToolbarMenu(xFrame, pParent, WB_CLIPCHILDREN ) +LayoutToolbarMenu::LayoutToolbarMenu( SlideLayoutController& rController, vcl::Window* pParent, const bool bInsertPage ) +: svtools::ToolbarMenu( rController.getFrameInterface(), pParent, WB_CLIPCHILDREN ) , mrController( rController ) -, mxFrame(xFrame) , mbInsertPage( bInsertPage ) , mpLayoutSet1( nullptr ) , mpLayoutSet2( nullptr ) { DrawViewMode eMode = DrawViewMode_DRAW; + Reference< XFrame > xFrame( rController.getFrameInterface() ); // find out which view is running if( xFrame.is() ) try @@ -235,17 +234,17 @@ LayoutToolbarMenu::LayoutToolbarMenu( SlideLayoutController& rController, const OUString sSlotStr; Image aSlotImage; - if( mxFrame.is() ) + if( xFrame.is() ) { if( bInsertPage ) sSlotStr = ".uno:DuplicatePage"; else sSlotStr = ".uno:Undo"; - aSlotImage = ::GetImage( mxFrame, sSlotStr, false ); + aSlotImage = ::GetImage( xFrame, sSlotStr, false ); OUString sSlotTitle; if( bInsertPage ) - sSlotTitle = ImplRetrieveLabelFromCommand( mxFrame, sSlotStr ); + sSlotTitle = ImplRetrieveLabelFromCommand( xFrame, sSlotStr ); else sSlotTitle = SD_RESSTR( STR_RESET_LAYOUT ); appendEntry( 2, sSlotTitle, aSlotImage); @@ -358,7 +357,7 @@ void SAL_CALL SlideLayoutController::initialize( const css::uno::Sequence< css:: VclPtr<vcl::Window> SlideLayoutController::createPopupWindow( vcl::Window* pParent ) { - return VclPtr<sd::LayoutToolbarMenu>::Create( *this, m_xFrame, pParent, mbInsertPage ); + return VclPtr<sd::LayoutToolbarMenu>::Create( *this, pParent, mbInsertPage ); } // XServiceInfo |