diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-05-07 14:12:22 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-05-07 14:13:05 +0100 |
commit | 15532c9a1f8259d258acd1329661c0c920736662 (patch) | |
tree | 7d5ae83e13d0fa47e07f87cfd6ccb0c849196756 /sd | |
parent | a3deb4866890ca6d4a41df0f08107eb75b132716 (diff) |
VclPtr: clicking on sidebar impress navigator crashes
not sure how this ever worked, the callback is called
at the end of the ctor and the callback is in the parent
obj which dereferences the pointer to this obj before
that pointer has been set.
Just split the ctor into a ctor and a follow up
post ctor init method.
Change-Id: I04855c8ac95592801f2ebf0b974a9a7b597d0327
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/dlg/NavigatorChildWindow.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/dlg/navigatr.cxx | 15 | ||||
-rw-r--r-- | sd/source/ui/inc/navigatr.hxx | 4 | ||||
-rw-r--r-- | sd/source/ui/sidebar/NavigatorWrapper.cxx | 4 |
4 files changed, 17 insertions, 10 deletions
diff --git a/sd/source/ui/dlg/NavigatorChildWindow.cxx b/sd/source/ui/dlg/NavigatorChildWindow.cxx index 0beb6d1f38e0..e1b8306e7170 100644 --- a/sd/source/ui/dlg/NavigatorChildWindow.cxx +++ b/sd/source/ui/dlg/NavigatorChildWindow.cxx @@ -57,7 +57,9 @@ NavigatorChildWindow::NavigatorChildWindow ( pParent, this, SdResId( FLT_NAVIGATOR ), - pBindings, + pBindings); + + pNavWin->SetUpdateRequestFunctor( ::boost::bind(RequestNavigatorUpdate, pBindings)); SetWindow( pNavWin ); diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx index 987818b84751..ec19ebfc2104 100644 --- a/sd/source/ui/dlg/navigatr.cxx +++ b/sd/source/ui/dlg/navigatr.cxx @@ -65,8 +65,7 @@ SdNavigatorWin::SdNavigatorWin( vcl::Window* pParent, ::sd::NavigatorChildWindow* pChWinCtxt, const SdResId& rSdResId, - SfxBindings* pInBindings, - const UpdateRequestFunctor& rUpdateRequest) + SfxBindings* pInBindings) : vcl::Window( pParent, rSdResId ) , maToolbox ( VclPtr<ToolBox>::Create( this, SdResId( 1 ) ) ) , maTlbObjects( VclPtr<SdPageObjsTLB>::Create( this, SdResId( TLB_OBJECTS ) ) ) @@ -76,6 +75,8 @@ SdNavigatorWin::SdNavigatorWin( // On changes of the DragType: adjust SelectionMode of TLB! , meDragType ( NAVIGATOR_DRAGTYPE_EMBEDDED ) , mpBindings ( pInBindings ) + , mpNavigatorCtrlItem( 0 ) + , mpPageNameCtrlItem( 0 ) , maImageList ( SdResId( IL_NAVIGATR ) ) { maTlbObjects->SetViewFrame( mpBindings->GetDispatcher()->GetFrame() ); @@ -84,9 +85,6 @@ SdNavigatorWin::SdNavigatorWin( maTlbObjects->SetAccessibleName(SD_RESSTR(STR_OBJECTS_TREE)); - mpNavigatorCtrlItem = new SdNavigatorControllerItem( SID_NAVIGATOR_STATE, this, mpBindings, rUpdateRequest); - mpPageNameCtrlItem = new SdPageNameControllerItem( SID_NAVIGATOR_PAGENAME, this, mpBindings, rUpdateRequest); - ApplyImageList(); // load images *before* calculating sizes to get something useful !!! Size aTbxSize( maToolbox->CalcWindowSizePixel() ); @@ -145,6 +143,13 @@ SdNavigatorWin::SdNavigatorWin( if (pDockingParent != NULL) pDockingParent->SetMinOutputSizePixel( maMinSize ); +} + +void SdNavigatorWin::SetUpdateRequestFunctor(const UpdateRequestFunctor& rUpdateRequest) +{ + mpNavigatorCtrlItem = new SdNavigatorControllerItem( SID_NAVIGATOR_STATE, this, mpBindings, rUpdateRequest); + mpPageNameCtrlItem = new SdPageNameControllerItem( SID_NAVIGATOR_PAGENAME, this, mpBindings, rUpdateRequest); + // InitTlb; is initiated over Slot if (rUpdateRequest) rUpdateRequest(); diff --git a/sd/source/ui/inc/navigatr.hxx b/sd/source/ui/inc/navigatr.hxx index ed682fdd9254..77b7a7e6313a 100644 --- a/sd/source/ui/inc/navigatr.hxx +++ b/sd/source/ui/inc/navigatr.hxx @@ -95,8 +95,8 @@ public: vcl::Window* pParent, ::sd::NavigatorChildWindow* pChildWinContext, const SdResId& rSdResId, - SfxBindings* pBindings, - const UpdateRequestFunctor& rUpdateRequest); + SfxBindings* pBindings); + void SetUpdateRequestFunctor(const UpdateRequestFunctor& rUpdateRequest); virtual ~SdNavigatorWin(); virtual void dispose() SAL_OVERRIDE; diff --git a/sd/source/ui/sidebar/NavigatorWrapper.cxx b/sd/source/ui/sidebar/NavigatorWrapper.cxx index 376d22b9152a..972a737ac707 100644 --- a/sd/source/ui/sidebar/NavigatorWrapper.cxx +++ b/sd/source/ui/sidebar/NavigatorWrapper.cxx @@ -37,9 +37,9 @@ NavigatorWrapper::NavigatorWrapper ( this, (::sd::NavigatorChildWindow*)NULL, SdResId(FLT_NAVIGATOR), - pBindings, - ::boost::bind(&NavigatorWrapper::UpdateNavigator, this))) + pBindings)) { + maNavigator->SetUpdateRequestFunctor(::boost::bind(&NavigatorWrapper::UpdateNavigator, this)); maNavigator->SetPosSizePixel( Point(0,0), GetSizePixel()); |