diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2011-03-28 17:00:24 +0200 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2011-03-28 17:00:24 +0200 |
commit | b2863c6cd0e9804e3435a8d07fc96ab7a5f0cb64 (patch) | |
tree | c6194901daf5f7ccfb8209dcaa105ed3c8ed5918 /toolkit | |
parent | 2b03086e2e34909791b51f106b0d356a517ce137 (diff) | |
parent | 3c86157dcd78c3dfcef84a9aa5ed0cfb97ac7a11 (diff) |
CWS-TOOLING: integrate CWS fwk167
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/awt/vclxtoolkit.cxx | 9 | ||||
-rw-r--r-- | toolkit/source/controls/dialogcontrol.cxx | 5 | ||||
-rw-r--r-- | toolkit/source/helper/unowrapper.cxx | 10 |
3 files changed, 18 insertions, 6 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: diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx index 556acbf5d0d2..069e1d497324 100644 --- a/toolkit/source/controls/dialogcontrol.cxx +++ b/toolkit/source/controls/dialogcontrol.cxx @@ -338,7 +338,10 @@ throw (::com::sun::star::uno::RuntimeException) Reference< XControl > xDialogControl( *this, UNO_QUERY_THROW ); Reference< XDevice > xDialogDevice( xDialogControl->getPeer(), UNO_QUERY ); OSL_ENSURE( xDialogDevice.is(), "UnoDialogControl::windowResized: no peer, but a windowResized event?" ); - if ( xDialogDevice.is() ) + + // #i87592 In design mode the drawing layer works with sizes with decoration. + // Therefore we have to substract them before writing back to the properties (model). + if ( xDialogDevice.is() && mbDesignMode ) { DeviceInfo aDeviceInfo( xDialogDevice->getInfo() ); aAppFontSize.Width() -= aDeviceInfo.LeftInset + aDeviceInfo.RightInset; diff --git a/toolkit/source/helper/unowrapper.cxx b/toolkit/source/helper/unowrapper.cxx index 943723ea5910..9612e450ee81 100644 --- a/toolkit/source/helper/unowrapper.cxx +++ b/toolkit/source/helper/unowrapper.cxx @@ -179,11 +179,13 @@ void UnoWrapper::SetWindowInterface( Window* pWindow, ::com::sun::star::uno::Ref DBG_ASSERT( pVCLXWindow, "SetComponentInterface - unsupported type" ); if ( pVCLXWindow ) { - if( pWindow->GetWindowPeer() ) + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer> xPeer = pWindow->GetWindowPeer(); + if( xPeer.is() ) { - int i = 0; - i++; - // DBG_ERROR( "UnoWrapper::SetWindowInterface: there already *is* a WindowInterface for this window!" ); + bool bSameInstance( pVCLXWindow == dynamic_cast< VCLXWindow* >( xPeer.get() )); + DBG_ASSERT( bSameInstance, "UnoWrapper::SetWindowInterface: there already *is* a WindowInterface for this window!" ); + if ( bSameInstance ) + return; } pVCLXWindow->SetWindow( pWindow ); pWindow->SetWindowPeer( xIFace, pVCLXWindow ); |