summaryrefslogtreecommitdiff
path: root/toolkit/source/awt/vclxtoolkit.cxx
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2011-03-28 17:00:24 +0200
committerIvo Hinkelmann <ihi@openoffice.org>2011-03-28 17:00:24 +0200
commitb2863c6cd0e9804e3435a8d07fc96ab7a5f0cb64 (patch)
treec6194901daf5f7ccfb8209dcaa105ed3c8ed5918 /toolkit/source/awt/vclxtoolkit.cxx
parent2b03086e2e34909791b51f106b0d356a517ce137 (diff)
parent3c86157dcd78c3dfcef84a9aa5ed0cfb97ac7a11 (diff)
CWS-TOOLING: integrate CWS fwk167
Diffstat (limited to 'toolkit/source/awt/vclxtoolkit.cxx')
-rw-r--r--toolkit/source/awt/vclxtoolkit.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index dd6e28807bc6..1c2df22e56a7 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -786,7 +786,14 @@ Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp,
if ( (pParent == NULL ) && ( rDescriptor.ParentIndex == -1 ) )
pParent = DIALOG_NO_PARENT;
pNewWindow = new Dialog( pParent, nWinBits );
- *ppNewComp = new VCLXDialog;
+ // #i70217# Don't always create a new component object. It's possible that VCL has called
+ // GetComponentInterface( sal_True ) in the Dialog ctor itself (see Window::IsTopWindow() )
+ // which creates a component object.
+ css::uno::Reference< css::awt::XWindowPeer > xWinPeer = pNewWindow->GetComponentInterface( sal_False );
+ if ( xWinPeer.is() )
+ *ppNewComp = dynamic_cast< VCLXDialog* >( xWinPeer.get() );
+ else
+ *ppNewComp = new VCLXDialog;
}
break;
case WINDOW_MOREBUTTON: