diff options
author | Thorsten Behrens <tbehrens@suse.com> | 2012-10-10 10:50:17 +0200 |
---|---|---|
committer | Thorsten Behrens <tbehrens@suse.com> | 2012-10-10 12:03:33 +0200 |
commit | 7f69b4a5310667378fcb127795654f410dbaa7c6 (patch) | |
tree | 881798868539a40784f686b36991f1758c76831d /sd | |
parent | d32ee009e07a98e54237872263eeb53d4812e805 (diff) |
Don't (indirectly) call virtual funcs in ctor.
We're not fully constructed at that point.
Change-Id: Ie80874c57000481c4eaa8d71118c8be6f0059164
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/framework/factories/BasicViewFactory.cxx | 14 | ||||
-rw-r--r-- | sd/source/ui/framework/factories/ViewShellWrapper.cxx | 8 |
2 files changed, 13 insertions, 9 deletions
diff --git a/sd/source/ui/framework/factories/BasicViewFactory.cxx b/sd/source/ui/framework/factories/BasicViewFactory.cxx index 9badf15dd459..237dc720c08c 100644 --- a/sd/source/ui/framework/factories/BasicViewFactory.cxx +++ b/sd/source/ui/framework/factories/BasicViewFactory.cxx @@ -368,10 +368,22 @@ void SAL_CALL BasicViewFactory::initialize (const Sequence<Any>& aArguments) pDescriptor->mpViewShell->Init(bIsCenterPane); mpBase->GetViewShellManager()->ActivateViewShell(pDescriptor->mpViewShell.get()); + Reference<awt::XWindow> xWindow(rxPane->getWindow()); pDescriptor->mpWrapper = new ViewShellWrapper( pDescriptor->mpViewShell, rxViewId, - rxPane->getWindow()); + xWindow); + + // register ViewShellWrapper on pane window + if (xWindow.is()) + { + xWindow->addWindowListener(pDescriptor->mpWrapper); + if (pDescriptor->mpViewShell != NULL) + { + pDescriptor->mpViewShell->Resize(); + } + } + pDescriptor->mxView.set( pDescriptor->mpWrapper->queryInterface( XResource::static_type() ), UNO_QUERY_THROW ); } diff --git a/sd/source/ui/framework/factories/ViewShellWrapper.cxx b/sd/source/ui/framework/factories/ViewShellWrapper.cxx index 1108ffe23c58..ad27974b580b 100644 --- a/sd/source/ui/framework/factories/ViewShellWrapper.cxx +++ b/sd/source/ui/framework/factories/ViewShellWrapper.cxx @@ -67,14 +67,6 @@ ViewShellWrapper::ViewShellWrapper ( mxViewId(rxViewId), mxWindow(rxWindow) { - if (rxWindow.is()) - { - rxWindow->addWindowListener(this); - if (pViewShell != NULL) - { - pViewShell->Resize(); - } - } } |