Kaydet (Commit) 15532c9a authored tarafından Caolán McNamara's avatar Caolán McNamara

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
üst a3deb486
......@@ -57,7 +57,9 @@ NavigatorChildWindow::NavigatorChildWindow (
pParent,
this,
SdResId( FLT_NAVIGATOR ),
pBindings,
pBindings);
pNavWin->SetUpdateRequestFunctor(
::boost::bind(RequestNavigatorUpdate, pBindings));
SetWindow( pNavWin );
......
......@@ -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();
......
......@@ -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;
......
......@@ -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());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment