[Libreoffice-commits] .: basctl/source
Noel Power
noelp at kemper.freedesktop.org
Fri Oct 15 05:11:18 PDT 2010
basctl/source/basicide/baside3.cxx | 8 -------
basctl/source/dlged/dlgedobj.cxx | 38 ++++++++-----------------------------
2 files changed, 9 insertions(+), 37 deletions(-)
New commits:
commit f99ac70389ce3f060ff084c6e70797ad695e9fde
Author: Noel Power <noel.power at novell.com>
Date: Fri Oct 15 12:46:47 2010 +0100
fix fdo#30856 remove VBAForm property and associated geometry hack
diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx
index e3c43f8..df0b7db 100644
--- a/basctl/source/basicide/baside3.cxx
+++ b/basctl/source/basicide/baside3.cxx
@@ -114,14 +114,6 @@ DialogWindow::DialogWindow( Window* pParent, const ScriptDocument& rDocument, St
pEditor = new DlgEditor( rDocument.isDocument() ? rDocument.getDocument() : Reference< frame::XModel >() );
pEditor->SetWindow( this );
- // set vba mode on DialogModel ( allows it to work in 100thmm instead of MAP_APPFONT )
- if ( rDocument.isDocument() && rDocument.getDocument().is() )
- {
- uno::Reference< script::vba::XVBACompatibility > xDocVBAMode( rDocument.getLibraryContainer( E_SCRIPTS ), uno::UNO_QUERY );
- uno::Reference< script::vba::XVBACompatibility > xDialogModelVBAMode( xDialogModel, uno::UNO_QUERY );
- if ( xDocVBAMode.is() && xDialogModelVBAMode.is() )
- xDialogModelVBAMode->setVBACompatibilityMode( xDocVBAMode->getVBACompatibilityMode() );
- }
pEditor->SetDialog( xDialogModel );
// Undo einrichten
diff --git a/basctl/source/dlged/dlgedobj.cxx b/basctl/source/dlged/dlgedobj.cxx
index 8b69593..f956f81 100644
--- a/basctl/source/dlged/dlgedobj.cxx
+++ b/basctl/source/dlged/dlgedobj.cxx
@@ -73,22 +73,6 @@ TYPEINIT1(DlgEdObj, SdrUnoObj);
DBG_NAME(DlgEdObj);
//----------------------------------------------------------------------------
-MapMode lcl_getMapModeForForm( DlgEdForm* pForm )
-{
- MapMode aMode( MAP_APPFONT ); //Default
- try
- {
- uno::Reference< beans::XPropertySet > xProps( pForm ? pForm->GetUnoControlModel() : NULL, uno::UNO_QUERY_THROW );
- sal_Bool bVBAForm = sal_False;
- xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("VBAForm") ) ) >>= bVBAForm;
- if ( bVBAForm )
- aMode = MapMode( MAP_100TH_MM );
- }
- catch ( Exception& )
- {
- }
- return aMode;
-}
DlgEdObj::DlgEdObj()
:SdrUnoObj(String(), sal_False)
@@ -209,9 +193,8 @@ bool DlgEdObj::TransformSdrToControlCoordinates(
}
// convert pixel to logic units
- MapMode aConvMode = lcl_getMapModeForForm( pForm );
- aPos = pDevice->PixelToLogic( aPos, aConvMode );
- aSize = pDevice->PixelToLogic( aSize, aConvMode );
+ aPos = pDevice->PixelToLogic( aPos, MAP_APPFONT );
+ aSize = pDevice->PixelToLogic( aSize, MAP_APPFONT );
// set out parameters
nXOut = aPos.Width();
@@ -258,10 +241,9 @@ bool DlgEdObj::TransformSdrToFormCoordinates(
aSize.Width() -= aDeviceInfo.LeftInset + aDeviceInfo.RightInset;
aSize.Height() -= aDeviceInfo.TopInset + aDeviceInfo.BottomInset;
}
- MapMode aConvMode = lcl_getMapModeForForm( pForm );
// convert pixel to logic units
- aPos = pDevice->PixelToLogic( aPos, aConvMode );
- aSize = pDevice->PixelToLogic( aSize, aConvMode );
+ aPos = pDevice->PixelToLogic( aPos, MAP_APPFONT );
+ aSize = pDevice->PixelToLogic( aSize, MAP_APPFONT );
// set out parameters
nXOut = aPos.Width();
@@ -303,10 +285,9 @@ bool DlgEdObj::TransformControlToSdrCoordinates(
DBG_ASSERT( pDevice, "DlgEdObj::TransformControlToSdrCoordinates: missing default device!" );
if ( !pDevice )
return false;
- MapMode aConvMode = lcl_getMapModeForForm( pForm );
- aPos = pDevice->LogicToPixel( aPos, aConvMode );
- aSize = pDevice->LogicToPixel( aSize, aConvMode );
- aFormPos = pDevice->LogicToPixel( aFormPos, aConvMode );
+ aPos = pDevice->LogicToPixel( aPos, MAP_APPFONT );
+ aSize = pDevice->LogicToPixel( aSize, MAP_APPFONT );
+ aFormPos = pDevice->LogicToPixel( aFormPos, MAP_APPFONT );
// add form position
aPos.Width() += aFormPos.Width();
@@ -356,9 +337,8 @@ bool DlgEdObj::TransformFormToSdrCoordinates(
if ( !lcl_getDlgEdForm( this, pForm ) )
return false;
- MapMode aConvMode = lcl_getMapModeForForm( pForm );
- aPos = pDevice->LogicToPixel( aPos, aConvMode );
- aSize = pDevice->LogicToPixel( aSize, aConvMode );
+ aPos = pDevice->LogicToPixel( aPos, MAP_APPFONT );
+ aSize = pDevice->LogicToPixel( aSize, MAP_APPFONT );
// take window borders into account
Reference< beans::XPropertySet > xPSetForm( pForm->GetUnoControlModel(), UNO_QUERY );
More information about the Libreoffice-commits
mailing list