summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--toolkit/source/awt/vclxtoolkit.cxx9
-rw-r--r--toolkit/source/controls/dialogcontrol.cxx5
-rw-r--r--toolkit/source/helper/unowrapper.cxx10
-rw-r--r--vcl/source/window/seleng.cxx6
4 files changed, 19 insertions, 11 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 );
diff --git a/vcl/source/window/seleng.cxx b/vcl/source/window/seleng.cxx
index 9d7727493490..c92d9dd4130a 100644
--- a/vcl/source/window/seleng.cxx
+++ b/vcl/source/window/seleng.cxx
@@ -200,11 +200,7 @@ void SelectionEngine::CursorPosChanging( sal_Bool bShift, sal_Bool bMod1 )
sal_Bool SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt )
{
nFlags &= (~SELENG_CMDEVT);
- if ( !pFunctionSet || !pWin )
- return sal_False;
- const bool bRightClickCursorPositioning =
- rMEvt.IsRight() && rMEvt.GetClicks() == 1 && !IsInSelection();
- if ( (rMEvt.GetClicks() > 1 || rMEvt.IsRight()) && !bRightClickCursorPositioning )
+ if ( !pFunctionSet || !pWin || rMEvt.GetClicks() > 1 || rMEvt.IsRight() )
return sal_False;
sal_uInt16 nModifier = rMEvt.GetModifier() | nLockedMods;