summaryrefslogtreecommitdiff
path: root/vbahelper/source
diff options
context:
space:
mode:
authorMikhail Voytenko <mav@openoffice.org>2010-08-30 16:48:36 +0200
committerMikhail Voytenko <mav@openoffice.org>2010-08-30 16:48:36 +0200
commitc30f688a8723093f4efc5075eb96350269b2b0bf (patch)
treeb3b9e40c22b80269a6f5727a01331f6497083016 /vbahelper/source
parent74c37f3287f6427eba89f108b8365c98ae617b7a (diff)
mib19: #i163287# workaround setPosSize() problem of toolkit
Diffstat (limited to 'vbahelper/source')
-rw-r--r--vbahelper/source/msforms/vbacontrol.cxx1
-rw-r--r--vbahelper/source/msforms/vbauserform.cxx10
2 files changed, 7 insertions, 4 deletions
diff --git a/vbahelper/source/msforms/vbacontrol.cxx b/vbahelper/source/msforms/vbacontrol.cxx
index 82b68bbd5be7..ed9f83a7c647 100644
--- a/vbahelper/source/msforms/vbacontrol.cxx
+++ b/vbahelper/source/msforms/vbacontrol.cxx
@@ -227,7 +227,6 @@ void SAL_CALL
ScVbaControl::setLeft( double _left ) throw (uno::RuntimeException)
{
mpGeometryHelper->setLeft( _left );
-
}
double SAL_CALL
diff --git a/vbahelper/source/msforms/vbauserform.cxx b/vbahelper/source/msforms/vbauserform.cxx
index 027c6a7384bc..e10c3a373f94 100644
--- a/vbahelper/source/msforms/vbauserform.cxx
+++ b/vbahelper/source/msforms/vbauserform.cxx
@@ -28,6 +28,7 @@
#include "vbauserform.hxx"
#include <com/sun/star/awt/XControl.hpp>
#include <com/sun/star/awt/XControlContainer.hpp>
+#include <com/sun/star/awt/PosSize.hpp>
#include <com/sun/star/beans/PropertyConcept.hpp>
#include <com/sun/star/util/MeasureUnit.hpp>
#include <basic/sbx.hxx>
@@ -69,7 +70,6 @@ ScVbaUserForm::Show( ) throw (uno::RuntimeException)
if ( m_xDialog.is() )
{
- aRet = m_xDialog->execute();
// try to center dialog on model window
if( m_xModel.is() ) try
{
@@ -77,12 +77,16 @@ ScVbaUserForm::Show( ) throw (uno::RuntimeException)
uno::Reference< frame::XFrame > xFrame( xController->getFrame(), uno::UNO_SET_THROW );
uno::Reference< awt::XWindow > xWindow( xFrame->getContainerWindow(), uno::UNO_SET_THROW );
awt::Rectangle aPosSize = xWindow->getPosSize(); // already in pixel
- setLeft( (aPosSize.Width - getWidth()) / 2.0 );
- setTop( (aPosSize.Height - getHeight()) / 2.0 );
+
+ uno::Reference< awt::XControl > xControl( m_xDialog, uno::UNO_QUERY_THROW );
+ uno::Reference< awt::XWindow > xControlWindow( xControl->getPeer(), uno::UNO_QUERY_THROW );
+ xControlWindow->setPosSize( (aPosSize.Width - getWidth()) / 2.0, (aPosSize.Height - getHeight()) / 2.0, 0, 0, awt::PosSize::POS );
}
catch( uno::Exception& )
{
}
+
+ aRet = m_xDialog->execute();
}
OSL_TRACE("ScVbaUserForm::Show() execute returned %d", aRet);
if ( mbDispose )