summaryrefslogtreecommitdiff
path: root/vbahelper
diff options
context:
space:
mode:
authorMikhail Voytenko <mav@openoffice.org>2010-08-27 15:51:26 +0200
committerMikhail Voytenko <mav@openoffice.org>2010-08-27 15:51:26 +0200
commit99523481ef58307f6d0cd849a712905e619f584c (patch)
tree5f2044c830d43553af2a793387df539bb9d4e3a0 /vbahelper
parent6e9b786ff6a7f2efca0b8ff4db9215202878a8ca (diff)
mib19: #i163287# fix the dialog position handling, change position after the dialog has been started
Diffstat (limited to 'vbahelper')
-rw-r--r--vbahelper/source/msforms/vbauserform.cxx2
-rw-r--r--vbahelper/source/vbahelper/vbahelper.cxx60
2 files changed, 3 insertions, 59 deletions
diff --git a/vbahelper/source/msforms/vbauserform.cxx b/vbahelper/source/msforms/vbauserform.cxx
index ae0ecce0a955..027c6a7384bc 100644
--- a/vbahelper/source/msforms/vbauserform.cxx
+++ b/vbahelper/source/msforms/vbauserform.cxx
@@ -69,6 +69,7 @@ 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
{
@@ -82,7 +83,6 @@ ScVbaUserForm::Show( ) throw (uno::RuntimeException)
catch( uno::Exception& )
{
}
- aRet = m_xDialog->execute();
}
OSL_TRACE("ScVbaUserForm::Show() execute returned %d", aRet);
if ( mbDispose )
diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx
index fa80e8dc9234..cfac3642c60b 100644
--- a/vbahelper/source/vbahelper/vbahelper.cxx
+++ b/vbahelper/source/vbahelper/vbahelper.cxx
@@ -1004,81 +1004,25 @@ UserFormGeometryHelper::UserFormGeometryHelper( const uno::Reference< uno::XComp
//---------------------------------------------
double UserFormGeometryHelper::getLeft()
{
- if ( mbDialog )
- {
- const Window* pWindow = VCLUnoHelper::GetWindow( mxWindow );
- if ( pWindow )
- {
- // get the size with decoration
- Rectangle aResult = pWindow->GetWindowExtentsRelative( NULL );
- return aResult.getX();
- }
- }
-
return mxWindow->getPosSize().X;
}
//---------------------------------------------
void UserFormGeometryHelper::setLeft( double nLeft )
{
- sal_Int64 nNewLeft = nLeft;
- if ( mbDialog )
- {
- const Window* pWindow = VCLUnoHelper::GetWindow( mxWindow );
- if ( pWindow )
- {
- // set the size with decoration
- Rectangle aRDecor = pWindow->GetWindowExtentsRelative( NULL );
- if ( !aRDecor.IsEmpty() )
- {
- sal_Int64 nDecor = aRDecor.getX();
- sal_Int64 nUnDecor = mxWindow->getPosSize().X;
- nNewLeft = nLeft + nUnDecor - nDecor;
- }
- }
- }
-
- mxWindow->setPosSize( nNewLeft, 0, 0, 0, awt::PosSize::X );
+ mxWindow->setPosSize( nLeft, 0, 0, 0, awt::PosSize::X );
}
//---------------------------------------------
double UserFormGeometryHelper::getTop()
{
- if ( mbDialog )
- {
- const Window* pWindow = VCLUnoHelper::GetWindow( mxWindow );
- if ( pWindow )
- {
- // get the size with decoration
- Rectangle aResult = pWindow->GetWindowExtentsRelative( NULL );
- return aResult.getY();
- }
- }
-
return mxWindow->getPosSize().Y;
}
//---------------------------------------------
void UserFormGeometryHelper::setTop( double nTop )
{
- sal_Int64 nNewTop = nTop;
- if ( mbDialog )
- {
- const Window* pWindow = VCLUnoHelper::GetWindow( mxWindow );
- if ( pWindow )
- {
- // set the size with decoration
- Rectangle aRDecor = pWindow->GetWindowExtentsRelative( NULL );
- if ( !aRDecor.IsEmpty() )
- {
- sal_Int64 nDecor = aRDecor.getY();
- sal_Int64 nUnDecor = mxWindow->getPosSize().Y;
- nNewTop = nTop + nUnDecor - nDecor;
- }
- }
- }
-
- mxWindow->setPosSize( 0, nNewTop, 0, 0, awt::PosSize::Y );
+ mxWindow->setPosSize( 0, nTop, 0, 0, awt::PosSize::Y );
}
//---------------------------------------------