[Libreoffice-commits] .: 4 commits - basctl/source cui/source extensions/inc extensions/source extensions/util forms/source
Noel Power
noelp at kemper.freedesktop.org
Wed Oct 13 07:22:32 PDT 2010
basctl/source/basicide/baside3.cxx | 19
basctl/source/basicide/basides3.cxx | 2
basctl/source/basicide/moduldlg.cxx | 4
basctl/source/basicide/scriptdocument.cxx | 10
basctl/source/dlged/dlged.cxx | 9
basctl/source/dlged/dlgedobj.cxx | 132 +++--
basctl/source/inc/dlged.hxx | 5
cui/source/customize/cfg.cxx | 4
cui/source/options/optfltr.cxx | 13
cui/source/options/optfltr.hrc | 1
cui/source/options/optfltr.hxx | 2
cui/source/options/optfltr.src | 17
extensions/inc/propctrlr.hrc | 3
extensions/source/ole/oleobjw.cxx | 415 +++++++++++-------
extensions/source/ole/oleobjw.hxx | 15
extensions/source/propctrlr/defaultforminspection.cxx | 2
extensions/source/propctrlr/formmetadata.cxx | 1
extensions/source/propctrlr/formmetadata.hxx | 1
extensions/source/propctrlr/formres.src | 4
extensions/source/propctrlr/formresid.hrc | 1
extensions/source/propctrlr/formstrings.hxx | 1
extensions/util/hidother.src | 1
forms/source/component/FormComponent.cxx | 4
forms/source/component/GroupManager.cxx | 50 +-
forms/source/component/GroupManager.hxx | 2
forms/source/component/ListBox.cxx | 4
forms/source/component/RadioButton.cxx | 105 ++--
forms/source/component/RadioButton.hxx | 2
forms/source/inc/frm_strings.hxx | 1
forms/source/inc/property.hrc | 3
forms/source/misc/InterfaceContainer.cxx | 9
31 files changed, 550 insertions(+), 292 deletions(-)
New commits:
commit 458440d60f9b87206021d99a6dfb414260c5e9b3
Merge: b4648cb... 4d811aa...
Author: Noel Power <noel.power at novell.com>
Date: Wed Oct 13 15:16:34 2010 +0100
Merge branch 'master' of ssh://noelp@git.freedesktop.org/git/libreoffice/components
commit b4648cb5215c1b0f59c9a740d446031c03a3353b
Merge: ecf31cd... 920a6f8...
Author: Noel Power <noel.power at novell.com>
Date: Wed Oct 13 12:51:15 2010 +0100
Merge commit 'origin/master'
commit ecf31cd7b1a8f623c644566710af1443e092e43d
Merge: ba23e2d... b3c3066...
Author: Noel Power <noel.power at novell.com>
Date: Wed Oct 13 10:17:11 2010 +0100
Merge branch 'vba' fix conflics ( below ), trailing ws and leading tabs
Conflicts:
forms/source/component/RadioButton.cxx
forms/source/inc/property.hrc
diff --cc basctl/source/basicide/baside3.cxx
index fc7038c,fe572e5..d8690a7
--- a/basctl/source/basicide/baside3.cxx
+++ b/basctl/source/basicide/baside3.cxx
@@@ -110,8 -113,16 +111,16 @@@ DialogWindow::DialogWindow( Window* pPa
{
InitSettings( TRUE, TRUE, TRUE );
- pEditor = new DlgEditor();
- pEditor = new DlgEditor( rDocument.isDocument() ? rDocument.getDocument() : Reference< frame::XModel >() );
++ 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() );
- }
++ // 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
@@@ -726,7 -737,7 +735,7 @@@ BOOL DialogWindow::SaveDialog(
Reference< beans::XPropertySet > xProps( ::comphelper::getProcessServiceFactory(), UNO_QUERY );
OSL_ASSERT( xProps.is() );
OSL_VERIFY( xProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext")) ) >>= xContext );
- Reference< XInputStreamProvider > xISP = ::xmlscript::exportDialogModel( xDialogModel, xContext );
- Reference< XInputStreamProvider > xISP = ::xmlscript::exportDialogModel( xDialogModel, xContext, GetDocument().isDocument() ? GetDocument().getDocument() : Reference< frame::XModel >() );
++ Reference< XInputStreamProvider > xISP = ::xmlscript::exportDialogModel( xDialogModel, xContext, GetDocument().isDocument() ? GetDocument().getDocument() : Reference< frame::XModel >() );
Reference< XInputStream > xInput( xISP->createInputStream() );
Reference< XSimpleFileAccess > xSFI( xMSF->createInstance
@@@ -1008,7 -1019,7 +1017,7 @@@ BOOL implImportDialog( Window* pWin, co
Reference< beans::XPropertySet > xProps( xMSF, UNO_QUERY );
OSL_ASSERT( xProps.is() );
OSL_VERIFY( xProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext")) ) >>= xContext );
- ::xmlscript::importDialogModel( xInput, xDialogModel, xContext );
- ::xmlscript::importDialogModel( xInput, xDialogModel, xContext, rDocument.isDocument() ? rDocument.getDocument() : Reference< frame::XModel >() );
++ ::xmlscript::importDialogModel( xInput, xDialogModel, xContext, rDocument.isDocument() ? rDocument.getDocument() : Reference< frame::XModel >() );
String aXmlDlgName;
Reference< beans::XPropertySet > xDialogModelPropSet( xDialogModel, UNO_QUERY );
@@@ -1234,7 -1245,7 +1243,7 @@@
}
}
- Reference< XInputStreamProvider > xISP = ::xmlscript::exportDialogModel( xDialogModel, xContext );
- Reference< XInputStreamProvider > xISP = ::xmlscript::exportDialogModel( xDialogModel, xContext, rDocument.isDocument() ? rDocument.getDocument() : Reference< frame::XModel >() );
++ Reference< XInputStreamProvider > xISP = ::xmlscript::exportDialogModel( xDialogModel, xContext, rDocument.isDocument() ? rDocument.getDocument() : Reference< frame::XModel >() );
bool bSuccess = rDocument.insertDialog( aLibName, aNewDlgName, xISP );
if( bSuccess )
{
@@@ -1344,7 -1355,7 +1353,7 @@@ void DialogWindow::StoreData(
Reference< beans::XPropertySet > xProps( ::comphelper::getProcessServiceFactory(), UNO_QUERY );
OSL_ASSERT( xProps.is() );
OSL_VERIFY( xProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext")) ) >>= xContext );
- Reference< XInputStreamProvider > xISP = ::xmlscript::exportDialogModel( xDialogModel, xContext );
- Reference< XInputStreamProvider > xISP = ::xmlscript::exportDialogModel( xDialogModel, xContext, GetDocument().isDocument() ? GetDocument().getDocument() : Reference< frame::XModel >() );
++ Reference< XInputStreamProvider > xISP = ::xmlscript::exportDialogModel( xDialogModel, xContext, GetDocument().isDocument() ? GetDocument().getDocument() : Reference< frame::XModel >() );
xLib->replaceByName( ::rtl::OUString( GetName() ), makeAny( xISP ) );
}
}
diff --cc basctl/source/basicide/basides3.cxx
index 1b71e43,6ec1dcd..379e14d
--- a/basctl/source/basicide/basides3.cxx
+++ b/basctl/source/basicide/basides3.cxx
@@@ -96,7 -96,7 +96,7 @@@ DialogWindow* BasicIDEShell::CreateDlgW
Reference< beans::XPropertySet > xProps( xMSF, UNO_QUERY );
OSL_ASSERT( xProps.is() );
OSL_VERIFY( xProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext")) ) >>= xContext );
- ::xmlscript::importDialogModel( xInput, xDialogModel, xContext );
- ::xmlscript::importDialogModel( xInput, xDialogModel, xContext, rDocument.isDocument() ? rDocument.getDocument() : Reference< frame::XModel >() );
++ ::xmlscript::importDialogModel( xInput, xDialogModel, xContext, rDocument.isDocument() ? rDocument.getDocument() : Reference< frame::XModel >() );
LocalizationMgr::setStringResourceAtDialog( rDocument, rLibName, aDlgName, xDialogModel );
// new dialog window
diff --cc basctl/source/basicide/moduldlg.cxx
index 3203d86,b00acdd..ff76eb0
--- a/basctl/source/basicide/moduldlg.cxx
+++ b/basctl/source/basicide/moduldlg.cxx
@@@ -308,7 -312,7 +308,7 @@@ void BasicIDEShell::CopyDialogResources
Reference< beans::XPropertySet > xProps( xMSF, UNO_QUERY );
OSL_ASSERT( xProps.is() );
OSL_VERIFY( xProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext")) ) >>= xContext );
- ::xmlscript::importDialogModel( xInput, xDialogModel, xContext );
- ::xmlscript::importDialogModel( xInput, xDialogModel, xContext, rSourceDoc.isDocument() ? rSourceDoc.getDocument() : Reference< frame::XModel >() );
++ ::xmlscript::importDialogModel( xInput, xDialogModel, xContext, rSourceDoc.isDocument() ? rSourceDoc.getDocument() : Reference< frame::XModel >() );
if( xDialogModel.is() )
{
@@@ -325,7 -329,7 +325,7 @@@
{
LocalizationMgr::setResourceIDsForDialog( xDialogModel, xDestMgr );
}
- io_xISP = ::xmlscript::exportDialogModel( xDialogModel, xContext );
- io_xISP = ::xmlscript::exportDialogModel( xDialogModel, xContext, rDestDoc.isDocument() ? rDestDoc.getDocument() : Reference< frame::XModel >() );
++ io_xISP = ::xmlscript::exportDialogModel( xDialogModel, xContext, rDestDoc.isDocument() ? rDestDoc.getDocument() : Reference< frame::XModel >() );
}
}
diff --cc basctl/source/basicide/scriptdocument.cxx
index cfbd761,14d8dc8..67f2be8
--- a/basctl/source/basicide/scriptdocument.cxx
+++ b/basctl/source/basicide/scriptdocument.cxx
@@@ -678,7 -676,7 +676,7 @@@ namespace basct
if ( !_rxExistingDialogModel.is() )
{
Reference< XInputStream > xInput( xISP->createInputStream(), UNO_QUERY_THROW );
- ::xmlscript::importDialogModel( xInput, xDialogModel, aContext.getUNOContext() );
- ::xmlscript::importDialogModel( xInput, xDialogModel, aContext.getUNOContext(), isDocument() ? getDocument() : Reference< XModel >() );
++ ::xmlscript::importDialogModel( xInput, xDialogModel, aContext.getUNOContext(), isDocument() ? getDocument() : Reference< XModel >() );
}
// set new name as property
@@@ -686,7 -684,7 +684,7 @@@
xDlgPSet->setPropertyValue( DLGED_PROP_NAME, makeAny( _rNewName ) );
// export dialog model
- xISP = ::xmlscript::exportDialogModel( xDialogModel, aContext.getUNOContext() );
- xISP = ::xmlscript::exportDialogModel( xDialogModel, aContext.getUNOContext(), isDocument() ? getDocument() : Reference< XModel >() );
++ xISP = ::xmlscript::exportDialogModel( xDialogModel, aContext.getUNOContext(), isDocument() ? getDocument() : Reference< XModel >() );
aElement <<= xISP;
}
diff --cc basctl/source/dlged/dlged.cxx
index 27e119a,020f934..6e4b138
--- a/basctl/source/dlged/dlged.cxx
+++ b/basctl/source/dlged/dlged.cxx
@@@ -225,6 -227,7 +225,7 @@@ DlgEditor::DlgEditor( const ::com::sun:
,bCreateOK(TRUE)
,bDialogModelChanged(FALSE)
,mnPaintGuard(0)
- ,m_xDocument( xModel )
++ ,m_xDocument( xModel )
{
pDlgEdModel = new DlgEdModel();
pDlgEdModel->GetItemPool().FreezeIdRanges();
@@@ -833,7 -836,7 +834,7 @@@ void DlgEditor::Copy(
Reference< beans::XPropertySet > xProps( ::comphelper::getProcessServiceFactory(), UNO_QUERY );
OSL_ASSERT( xProps.is() );
OSL_VERIFY( xProps->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext")) ) >>= xContext );
- Reference< XInputStreamProvider > xISP = ::xmlscript::exportDialogModel( xClipDialogModel, xContext );
- Reference< XInputStreamProvider > xISP = ::xmlscript::exportDialogModel( xClipDialogModel, xContext, m_xDocument );
++ Reference< XInputStreamProvider > xISP = ::xmlscript::exportDialogModel( xClipDialogModel, xContext, m_xDocument );
Reference< XInputStream > xStream( xISP->createInputStream() );
Sequence< sal_Int8 > DialogModelBytes;
implCopyStreamToByteSequence( xStream, DialogModelBytes );
@@@ -866,7 -869,7 +867,7 @@@
uno::Reference< resource::XStringResourceManager >
xStringResourceManager( xStringResourcePersistence, uno::UNO_QUERY );
LocalizationMgr::resetResourceForDialog( xClipDialogModel, xStringResourceManager );
- Reference< XInputStreamProvider > xISP2 = ::xmlscript::exportDialogModel( xClipDialogModel, xContext );
- Reference< XInputStreamProvider > xISP2 = ::xmlscript::exportDialogModel( xClipDialogModel, xContext, m_xDocument );
++ Reference< XInputStreamProvider > xISP2 = ::xmlscript::exportDialogModel( xClipDialogModel, xContext, m_xDocument );
Reference< XInputStream > xStream2( xISP2->createInputStream() );
Sequence< sal_Int8 > NoResourceDialogModelBytes;
implCopyStreamToByteSequence( xStream2, NoResourceDialogModelBytes );
@@@ -1012,7 -1015,7 +1013,7 @@@ void DlgEditor::Paste(
Reference< beans::XPropertySet > xProps( xMSF, UNO_QUERY );
OSL_ASSERT( xProps.is() );
OSL_VERIFY( xProps->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext")) ) >>= xContext );
- ::xmlscript::importDialogModel( ::xmlscript::createInputStream( *((::rtl::ByteSequence*)(&DialogModelBytes)) ) , xClipDialogModel, xContext );
- ::xmlscript::importDialogModel( ::xmlscript::createInputStream( *((::rtl::ByteSequence*)(&DialogModelBytes)) ) , xClipDialogModel, xContext, m_xDocument );
++ ::xmlscript::importDialogModel( ::xmlscript::createInputStream( *((::rtl::ByteSequence*)(&DialogModelBytes)) ) , xClipDialogModel, xContext, m_xDocument );
}
// get control models from clipboard dialog model
diff --cc basctl/source/dlged/dlgedobj.cxx
index 72b08fd,a56985e..248537f
--- a/basctl/source/dlged/dlgedobj.cxx
+++ b/basctl/source/dlged/dlgedobj.cxx
@@@ -1,7 -1,7 +1,7 @@@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-- *
++ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@@ -38,9 -38,11 +38,9 @@@
#include "dlgedview.hxx"
#include "dlgedlist.hxx"
#include <iderid.hxx>
--#include <localizationmgr.hxx>
++#include <localizationmgr.hxx>
-#ifndef _BASCTL_DLGRESID_HRC
#include <dlgresid.hrc>
-#endif
#include <tools/resmgr.hxx>
#include <tools/shl.hxx>
#include <unotools/sharedunocomponent.hxx>
@@@ -72,6 -74,22 +72,22 @@@ 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;
++ 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)
@@@ -83,7 -101,7 +99,7 @@@
//----------------------------------------------------------------------------
--DlgEdObj::DlgEdObj(const ::rtl::OUString& rModelName,
++DlgEdObj::DlgEdObj(const ::rtl::OUString& rModelName,
const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rxSFac)
:SdrUnoObj(rModelName, rxSFac, sal_False)
,bIsListening(sal_False)
@@@ -149,8 -167,8 +165,8 @@@ uno::Reference< awt::XControl > DlgEdOb
//----------------------------------------------------------------------------
--bool DlgEdObj::TransformSdrToControlCoordinates(
-- sal_Int32 nXIn, sal_Int32 nYIn, sal_Int32 nWidthIn, sal_Int32 nHeightIn,
++bool DlgEdObj::TransformSdrToControlCoordinates(
++ sal_Int32 nXIn, sal_Int32 nYIn, sal_Int32 nWidthIn, sal_Int32 nHeightIn,
sal_Int32& nXOut, sal_Int32& nYOut, sal_Int32& nWidthOut, sal_Int32& nHeightOut )
{
// input position and size
@@@ -190,10 -208,11 +206,11 @@@
aPos.Width() -= aDeviceInfo.LeftInset;
aPos.Height() -= aDeviceInfo.TopInset;
}
--
++
// convert pixel to logic units
- aPos = pDevice->PixelToLogic( aPos, MapMode( MAP_APPFONT ) );
- aSize = pDevice->PixelToLogic( aSize, MapMode( MAP_APPFONT ) );
+ MapMode aConvMode = lcl_getMapModeForForm( pForm );
+ aPos = pDevice->PixelToLogic( aPos, aConvMode );
+ aSize = pDevice->PixelToLogic( aSize, aConvMode );
// set out parameters
nXOut = aPos.Width();
@@@ -206,8 -225,8 +223,8 @@@
//----------------------------------------------------------------------------
--bool DlgEdObj::TransformSdrToFormCoordinates(
-- sal_Int32 nXIn, sal_Int32 nYIn, sal_Int32 nWidthIn, sal_Int32 nHeightIn,
++bool DlgEdObj::TransformSdrToFormCoordinates(
++ sal_Int32 nXIn, sal_Int32 nYIn, sal_Int32 nWidthIn, sal_Int32 nHeightIn,
sal_Int32& nXOut, sal_Int32& nYOut, sal_Int32& nWidthOut, sal_Int32& nHeightOut )
{
// input position and size
@@@ -256,8 -275,8 +273,8 @@@
//----------------------------------------------------------------------------
--bool DlgEdObj::TransformControlToSdrCoordinates(
-- sal_Int32 nXIn, sal_Int32 nYIn, sal_Int32 nWidthIn, sal_Int32 nHeightIn,
++bool DlgEdObj::TransformControlToSdrCoordinates(
++ sal_Int32 nXIn, sal_Int32 nYIn, sal_Int32 nWidthIn, sal_Int32 nHeightIn,
sal_Int32& nXOut, sal_Int32& nYOut, sal_Int32& nWidthOut, sal_Int32& nHeightOut )
{
// input position and size
@@@ -318,8 -338,8 +336,8 @@@
//----------------------------------------------------------------------------
--bool DlgEdObj::TransformFormToSdrCoordinates(
-- sal_Int32 nXIn, sal_Int32 nYIn, sal_Int32 nWidthIn, sal_Int32 nHeightIn,
++bool DlgEdObj::TransformFormToSdrCoordinates(
++ sal_Int32 nXIn, sal_Int32 nYIn, sal_Int32 nWidthIn, sal_Int32 nHeightIn,
sal_Int32& nXOut, sal_Int32& nYOut, sal_Int32& nWidthOut, sal_Int32& nHeightOut )
{
// input position and size
@@@ -373,7 -395,7 +393,7 @@@ void DlgEdObj::SetRectFromProps(
// get control position and size from properties
Reference< beans::XPropertySet > xPSet( GetUnoControlModel(), UNO_QUERY );
if ( xPSet.is() )
-- {
++ {
sal_Int32 nXIn = 0, nYIn = 0, nWidthIn = 0, nHeightIn = 0;
xPSet->getPropertyValue( DLGED_PROP_POSITIONX ) >>= nXIn;
xPSet->getPropertyValue( DLGED_PROP_POSITIONY ) >>= nYIn;
@@@ -448,7 -470,7 +468,7 @@@ void DlgEdObj::PositionAndSizeChange( c
{
Reference< beans::XPropertySet > xPSet( GetUnoControlModel(), UNO_QUERY );
if ( xPSet.is() )
-- {
++ {
sal_Int32 nX = 0, nY = 0, nWidth = 0, nHeight = 0;
xPSet->getPropertyValue( DLGED_PROP_POSITIONX ) >>= nX;
xPSet->getPropertyValue( DLGED_PROP_POSITIONY ) >>= nY;
@@@ -499,7 -521,7 +519,7 @@@
}
}
}
--
++
SetRectFromProps();
}
@@@ -519,10 -541,10 +539,10 @@@ void SAL_CALL DlgEdObj::NameChange( con
{
Reference< container::XNameAccess > xNameAcc((GetDlgEdForm()->GetUnoControlModel()), UNO_QUERY);
if ( xNameAcc.is() && xNameAcc->hasByName(aOldName) )
-- {
++ {
if ( !xNameAcc->hasByName(aNewName) && aNewName.getLength() != 0 )
{
-- // remove the control by the old name and insert the control by the new name in the container
++ // remove the control by the old name and insert the control by the new name in the container
Reference< container::XNameContainer > xCont(xNameAcc, UNO_QUERY );
if ( xCont.is() )
{
@@@ -538,7 -560,7 +558,7 @@@
else
pEditor = GetDlgEdForm()->GetDlgEditor();
LocalizationMgr::renameControlResourceIDsForEditorObject( pEditor, aAny, aNewName );
-- }
++ }
}
else
{
@@@ -710,9 -732,9 +730,9 @@@ sal_Bool DlgEdObj::supportsService( con
//----------------------------------------------------------------------------
::rtl::OUString DlgEdObj::GetDefaultName() const
--{
++{
sal_uInt16 nResId = 0;
-- ::rtl::OUString aDefaultName;
++ ::rtl::OUString aDefaultName;
if ( supportsService( "com.sun.star.awt.UnoControlDialogModel" ) )
{
nResId = RID_STR_CLASS_DIALOG;
@@@ -800,12 -822,12 +820,12 @@@
else
{
-- nResId = RID_STR_CLASS_CONTROL;
++ nResId = RID_STR_CLASS_CONTROL;
}
if (nResId)
{
-- aDefaultName = ::rtl::OUString( String(IDEResId(nResId)) );
++ aDefaultName = ::rtl::OUString( String(IDEResId(nResId)) );
}
return aDefaultName;
@@@ -1014,11 -1036,11 +1034,11 @@@ void DlgEdObj::operator= (const SdrObje
void DlgEdObj::NbcMove( const Size& rSize )
{
SdrUnoObj::NbcMove( rSize );
--
++
// stop listening
EndListening(sal_False);
--
-- // set geometry properties
++
++ // set geometry properties
SetPropsFromRect();
// start listening
@@@ -1036,8 -1058,8 +1056,8 @@@ void DlgEdObj::NbcResize(const Point& r
// stop listening
EndListening(sal_False);
--
-- // set geometry properties
++
++ // set geometry properties
SetPropsFromRect();
// start listening
@@@ -1082,7 -1104,7 +1102,7 @@@ void DlgEdObj::SetDefaults(
aUniqueName <<= aOUniqueName;
xPSet->setPropertyValue( DLGED_PROP_NAME, aUniqueName );
-- // set labels
++ // set labels
if ( supportsService( "com.sun.star.awt.UnoControlButtonModel" ) ||
supportsService( "com.sun.star.awt.UnoControlRadioButtonModel" ) ||
supportsService( "com.sun.star.awt.UnoControlCheckBoxModel" ) ||
@@@ -1142,7 -1164,7 +1162,7 @@@
}
}
-- // dialog model changed
++ // dialog model changed
pDlgEdForm->GetDlgEditor()->SetDialogModelChanged( TRUE );
}
}
@@@ -1168,13 -1190,13 +1188,13 @@@ void DlgEdObj::StartListening(
if (!isListening())
{
bIsListening = sal_True;
--
++
// XPropertyChangeListener
Reference< XPropertySet > xControlModel( GetUnoControlModel() , UNO_QUERY );
if (!m_xPropertyChangeListener.is() && xControlModel.is())
{
// create listener
-- m_xPropertyChangeListener = static_cast< ::com::sun::star::beans::XPropertyChangeListener*>( new DlgEdPropListenerImpl( (DlgEdObj*)this ) );
++ m_xPropertyChangeListener = static_cast< ::com::sun::star::beans::XPropertyChangeListener*>( new DlgEdPropListenerImpl( (DlgEdObj*)this ) );
// register listener to properties
xControlModel->addPropertyChangeListener( ::rtl::OUString() , m_xPropertyChangeListener );
@@@ -1185,9 -1207,9 +1205,9 @@@
if( !m_xContainerListener.is() && xEventsSupplier.is() )
{
// create listener
-- m_xContainerListener = static_cast< ::com::sun::star::container::XContainerListener*>( new DlgEdEvtContListenerImpl( (DlgEdObj*)this ) );
++ m_xContainerListener = static_cast< ::com::sun::star::container::XContainerListener*>( new DlgEdEvtContListenerImpl( (DlgEdObj*)this ) );
-- // register listener to script event container
++ // register listener to script event container
Reference< XNameContainer > xEventCont = xEventsSupplier->getEvents();
DBG_ASSERT(xEventCont.is(), "DlgEdObj::StartListening: control model has no script event container!");
Reference< XContainer > xCont( xEventCont , UNO_QUERY );
@@@ -1251,7 -1273,7 +1271,7 @@@ void SAL_CALL DlgEdObj::_propertyChange
// dialog model changed
pDlgEditor->SetDialogModelChanged(TRUE);
--
++
// update position and size
if ( evt.PropertyName == DLGED_PROP_POSITIONX || evt.PropertyName == DLGED_PROP_POSITIONY ||
evt.PropertyName == DLGED_PROP_WIDTH || evt.PropertyName == DLGED_PROP_HEIGHT ||
@@@ -1402,7 -1424,7 +1422,7 @@@ void DlgEdForm::SetRectFromProps(
// get form position and size from properties
Reference< beans::XPropertySet > xPSet( GetUnoControlModel(), UNO_QUERY );
if ( xPSet.is() )
-- {
++ {
sal_Int32 nXIn = 0, nYIn = 0, nWidthIn = 0, nHeightIn = 0;
xPSet->getPropertyValue( DLGED_PROP_POSITIONX ) >>= nXIn;
xPSet->getPropertyValue( DLGED_PROP_POSITIONY ) >>= nYIn;
@@@ -1473,8 -1495,8 +1493,8 @@@ void DlgEdForm::PositionAndSizeChange(
{
DlgEditor* pEditor = GetDlgEditor();
DBG_ASSERT( pEditor, "DlgEdForm::PositionAndSizeChange: no dialog editor!" );
-- if ( pEditor )
-- {
++ if ( pEditor )
++ {
DlgEdPage* pPage_ = pEditor->GetPage();
DBG_ASSERT( pPage_, "DlgEdForm::PositionAndSizeChange: no page!" );
if ( pPage_ )
@@@ -1543,7 -1565,7 +1563,7 @@@
{
Reference< beans::XPropertySet > xPSet( (*aIter)->GetUnoControlModel(), UNO_QUERY );
if ( xPSet.is() )
-- {
++ {
sal_Int32 nX = 0, nY = 0, nWidth = 0, nHeight = 0;
xPSet->getPropertyValue( DLGED_PROP_POSITIONX ) >>= nX;
xPSet->getPropertyValue( DLGED_PROP_POSITIONY ) >>= nY;
@@@ -1616,7 -1638,7 +1636,7 @@@ void DlgEdForm::UpdateStep(
//----------------------------------------------------------------------------
void DlgEdForm::UpdateTabIndices()
--{
++{
// stop listening with all children
::std::vector<DlgEdObj*>::iterator aIter;
for ( aIter = pChilds.begin() ; aIter != pChilds.end() ; ++aIter )
@@@ -1684,7 -1706,7 +1704,7 @@@ void DlgEdForm::UpdateTabOrder(
// #110559#
// When the tabindex of a control model changes, the dialog control is
// notified about those changes. Due to #109067# (bad performance of
-- // dialog editor) the dialog control doesn't activate the tab order
++ // dialog editor) the dialog control doesn't activate the tab order
// in design mode. When the dialog editor has reordered all
// tabindices, this method allows to activate the taborder afterwards.
@@@ -1706,10 -1728,10 +1726,10 @@@ void DlgEdForm::UpdateGroups(
// #110559#
// The grouping of radio buttons in a dialog is done by vcl.
// In the dialog editor we have two views (=controls) for one
-- // radio button model. One control is owned by the dialog control,
++ // radio button model. One control is owned by the dialog control,
// but not visible in design mode. The other control is owned by
// the drawing layer object. Whereas the grouping of the first
-- // control is done by vcl, the grouping of the control in the
++ // control is done by vcl, the grouping of the control in the
// drawing layer has to be done here.
Reference< awt::XTabControllerModel > xTabModel( GetUnoControlModel() , UNO_QUERY );
@@@ -1744,21 -1766,21 +1764,21 @@@
const Reference< awt::XControl > xCtrl( pControls[nControl] );
if ( xCtrl.is() )
{
-- Reference< awt::XControlModel > xCtrlModel( xCtrl->getModel() );
++ Reference< awt::XControlModel > xCtrlModel( xCtrl->getModel() );
if ( (awt::XControlModel*)xCtrlModel.get() == (awt::XControlModel*)pModels[nModel].get() )
{
// get the control peer and insert into the list of peers
aSeqPeers.getArray()[ nModel ] = Reference< awt::XWindow >( xCtrl->getPeer(), UNO_QUERY );
break;
}
-- }
++ }
}
}
// set the group at the dialog peer
Reference< awt::XControl > xDlg( GetControl(), UNO_QUERY );
if ( xDlg.is() )
-- {
++ {
Reference< awt::XVclContainerPeer > xDlgPeer( xDlg->getPeer(), UNO_QUERY );
if ( xDlgPeer.is() )
xDlgPeer->setGroup( aSeqPeers );
@@@ -1780,7 -1802,7 +1800,7 @@@ void DlgEdForm::UpdateTabOrderAndGroups
void DlgEdForm::NbcMove( const Size& rSize )
{
SdrUnoObj::NbcMove( rSize );
--
++
// set geometry properties of form
EndListening(sal_False);
SetPropsFromRect();
diff --cc basctl/source/inc/dlged.hxx
index a8adcda,a2ea57c..cc414d3
--- a/basctl/source/inc/dlged.hxx
+++ b/basctl/source/inc/dlged.hxx
@@@ -128,9 -129,11 +129,11 @@@ protected
BOOL bDialogModelChanged;
Timer aMarkTimer;
long mnPaintGuard;
- ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xDocument;
++ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xDocument;
- DlgEditor(); // not implemented
++ DlgEditor(); // not implemented
public:
- DlgEditor();
- DlgEditor( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel );
++ DlgEditor( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel );
~DlgEditor();
void SetWindow( Window* pWindow );
diff --cc cui/source/options/optfltr.cxx
index 51034c9,229ee76..34a97e0
--- a/cui/source/options/optfltr.cxx
+++ b/cui/source/options/optfltr.cxx
@@@ -54,6 -54,7 +54,7 @@@ OfaMSFilterTabPage::OfaMSFilterTabPage(
: SfxTabPage( pParent, CUI_RES( RID_OFAPAGE_MSFILTEROPT ), rSet ),
aMSWordGB ( this, CUI_RES( GB_WORD ) ),
aWBasicCodeCB ( this, CUI_RES( CB_WBAS_CODE ) ),
- aWBasicWbctblCB ( this, CUI_RES( CB_WBAS_WBCTBL ) ),
++ aWBasicWbctblCB ( this, CUI_RES( CB_WBAS_WBCTBL ) ),
aWBasicStgCB ( this, CUI_RES( CB_WBAS_STG ) ),
aMSExcelGB ( this, CUI_RES( GB_EXCEL ) ),
aEBasicCodeCB ( this, CUI_RES( CB_EBAS_CODE ) ),
diff --cc extensions/source/ole/oleobjw.cxx
index 7a73ed7,aca6e53..8799636
mode 100644,100755..100644
--- a/extensions/source/ole/oleobjw.cxx
+++ b/extensions/source/ole/oleobjw.cxx
@@@ -1,7 -1,7 +1,7 @@@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-- *
++ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@@ -142,7 -143,7 +143,7 @@@ IUnknownWrapper_Impl::~IUnknownWrapper_
#if OSL_DEBUG_LEVEL > 0
fprintf(stderr,"[automation bridge] ComPtrToWrapperMap contains: %i \n",
ComPtrToWrapperMap.size());
--#endif
++#endif
}
Any IUnknownWrapper_Impl::queryInterface(const Type& t)
@@@ -163,7 -164,7 +164,7 @@@ Reference<XIntrospectionAccess> SAL_CAL
throw (RuntimeException )
{
Reference<XIntrospectionAccess> ret;
--
++
return ret;
}
@@@ -181,7 -237,7 +237,7 @@@ Any SAL_CALL IUnknownWrapper_Impl::invo
OUSTR("[automation bridge] The object does not have an IDispatch interface"),
Reference<XInterface>());
}
--
++
Any ret;
try
@@@ -210,9 -266,13 +266,13 @@@
throw;
}
catch (CannotConvertException &)
- {
- throw;
- }
- catch (InvocationTargetException &)
+ {
+ throw;
+ }
++ catch (InvocationTargetException &)
+ {
+ throw;
+ }
catch (BridgeRuntimeError & e)
{
throw RuntimeException(e.message, Reference<XInterface>());
@@@ -260,7 -320,7 +320,7 @@@ void SAL_CALL IUnknownWrapper_Impl::set
OUSTR("\" is not supported"));
throw UnknownPropertyException(msg, Reference<XInterface>());
}
--
++
if ( (! aDescPut && aDescGet) || aVarDesc
&& aVarDesc->wVarFlags == VARFLAG_FREADONLY )
{
@@@ -280,14 -340,14 +340,14 @@@
CComVariant varResult;
ExcepInfo excepinfo;
unsigned int uArgErr;
--
++
// converting UNO value to OLE variant
DISPID dispidPut= DISPID_PROPERTYPUT;
dispparams.rgdispidNamedArgs = &dispidPut;
dispparams.cArgs = 1;
dispparams.cNamedArgs = 1;
dispparams.rgvarg = & varArg;
--
++
OSL_ASSERT(aDescPut || aVarDesc);
VARTYPE vt = 0;
@@@ -305,7 -365,7 +365,7 @@@
{
vt = getElementTypeDesc( & aVarDesc->elemdescVar.tdesc);
dispid = aVarDesc->memid;
-- if (vt == VT_UNKNOWN || vt == VT_DISPATCH ||
++ if (vt == VT_UNKNOWN || vt == VT_DISPATCH ||
(vt & VT_ARRAY) || (vt & VT_BYREF))
{
invkind = INVOKE_PROPERTYPUTREF;
@@@ -331,8 -391,8 +391,8 @@@
// call to IDispatch
hr = m_spDispatch->Invoke(dispid, IID_NULL, LOCALE_USER_DEFAULT, ::sal::static_int_cast< WORD, INVOKEKIND >( invkind ),
&dispparams, & varResult, & excepinfo, &uArgErr);
--
-- // lookup error code
++
++ // lookup error code
switch (hr)
{
case S_OK:
@@@ -377,7 -437,7 +437,7 @@@
default:
throw RuntimeException();
break;
-- }
++ }
}
catch (CannotConvertException &)
{
@@@ -423,27 -483,27 +483,27 @@@ Any SAL_CALL IUnknownWrapper_Impl::getV
ITypeInfo * pInfo = getTypeInfo();
// I was going to implement an XServiceInfo interface to allow the type
// of the automation object to be exposed.. but it seems
-- // from looking at comments in the code that it is possible for
++ // from looking at comments in the code that it is possible for
// this object to actually wrap an UNO object ( I guess if automation is
// used from MSO to create Openoffice objects ) Therefore, those objects
// will more than likely already have their own XServiceInfo interface.
// Instead here I chose a name that should be illegal both in COM and
// UNO ( from an IDL point of view ) therefore I think this is a safe
// hack
-- if ( aPropertyName.equals( rtl::OUString::createFromAscii("$GetTypeName") ))
++ if ( aPropertyName.equals( rtl::OUString::createFromAscii("$GetTypeName") ))
{
if ( pInfo && m_sTypeName.getLength() == 0 )
{
m_sTypeName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IDispatch") );
CComBSTR sName;
--
++
if ( SUCCEEDED( pInfo->GetDocumentation( -1, &sName, NULL, NULL, NULL ) ) )
{
rtl::OUString sTmp( reinterpret_cast<const sal_Unicode*>(LPCOLESTR(sName)));
if ( sTmp.indexOf('_') == 0 )
sTmp = sTmp.copy(1);
// do we own the memory for pTypeLib, msdn doco is vague
-- // I'll assume we do
++ // I'll assume we do
CComPtr< ITypeLib > pTypeLib;
unsigned int index;
if ( SUCCEEDED( pInfo->GetContainingTypeLib( &pTypeLib.p, &index )) )
@@@ -452,11 -512,11 +512,11 @@@
{
rtl::OUString sLibName( reinterpret_cast<const sal_Unicode*>(LPCOLESTR(sName)));
m_sTypeName = sLibName.concat( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(".") ) ).concat( sTmp );
--
++
}
}
}
--
++
}
ret <<= m_sTypeName;
return ret;
@@@ -474,7 -534,7 +534,7 @@@
}
// write-only should not be possible
OSL_ASSERT( aDescGet || ! aDescPut);
--
++
HRESULT hr;
DISPPARAMS dispparams = {0, 0, 0, 0};
CComVariant varResult;
@@@ -487,20 -547,20 +547,20 @@@
dispid = aVarDesc->memid;
else
dispid = aDescPut->memid;
--
-- hr = m_spDispatch->Invoke(dispid,
++
++ hr = m_spDispatch->Invoke(dispid,
IID_NULL,
-- LOCALE_USER_DEFAULT,
++ LOCALE_USER_DEFAULT,
DISPATCH_PROPERTYGET,
-- &dispparams,
-- &varResult,
++ &dispparams,
++ &varResult,
&excepinfo,
&uArgErr);
// converting return value and out parameter back to UNO
if (hr == S_OK)
{
-- // If the com object implements uno interfaces then we have
++ // If the com object implements uno interfaces then we have
// to convert the attribute into the expected type.
TypeDescription attrInfo;
getAttributeInfo(aPropertyName, attrInfo);
@@@ -509,8 -569,8 +569,8 @@@
else
variantToAny(&varResult, ret);
}
--
-- // lookup error code
++
++ // lookup error code
switch (hr)
{
case S_OK:
@@@ -607,7 -667,7 +667,7 @@@ sal_Bool SAL_CALL IUnknownWrapper_Impl:
FuncDesc aDesc(pInfo);
getFuncDesc(aName, & aDesc);
// Automation properties can have arguments. Those are treated as methods and
-- //are called through XInvocation::invoke.
++ //are called through XInvocation::invoke.
if ( ! aDesc)
{
FuncDesc aDescGet(pInfo);
@@@ -619,7 -679,7 +679,7 @@@
ret = sal_True;
}
else
-- ret = sal_True;
++ ret = sal_True;
}
catch (BridgeRuntimeError& e)
{
@@@ -658,12 -718,16 +718,16 @@@ sal_Bool SAL_CALL IUnknownWrapper_Impl:
FuncDesc aDescPut(pInfo);
VarDesc aVarDesc(pInfo);
getPropDesc(aName, & aDescGet, & aDescPut, & aVarDesc);
- // Automation properties can have parameters. If so, we access them through
- // XInvocation::invoke. Thas is, hasProperty must return false for such a
- // property
+
- // we should probably just check the funckind
++ // we should probably just check the funckind
+ // basic has been modified to handle properties ( 'get' ) props at
- // least with paramaters
- // additionally you can call invoke(Get|Set)Property on the bridge
- // you can determine if a property has parameter is hasMethod
- // returns true for the name
++ // least with paramaters
++ // additionally you can call invoke(Get|Set)Property on the bridge
++ // you can determine if a property has parameter is hasMethod
++ // returns true for the name
if (aVarDesc
- || aDescPut && aDescPut->cParams == 0
- || aDescGet && aDescGet->cParams == 0)
- || aDescPut
++ || aDescPut
+ || aDescGet )
{
ret = sal_True;
}
@@@ -678,7 -742,7 +742,7 @@@
"IUnknownWrapper_Impl::hasProperty ! Message : \n") +
e.Message, Reference<XInterface>());
-- }
++ }
catch (...)
{
throw RuntimeException(OUSTR("[automation bridge] unexpected exception in "
@@@ -769,7 -833,7 +833,7 @@@ Any IUnknownWrapper_Impl::invokeWithDi
sarParams.reset(new CComVariant[ parameterCount]);
pVarParams = sarParams.get();
}
--
++
// Create the Array for the out an in/out parameter. These values
// are referenced by the VT_BYREF VARIANTs in DISPPARAMS.
// We need to find out the number of out and in/out parameter.
@@@ -786,7 -850,7 +850,7 @@@
// build up the parameters for IDispatch::Invoke
sal_Int32 outParamIndex=0;
int i = 0;
-- try
++ try
{
for( i= 0; i < parameterCount; i++)
{
@@@ -924,7 -988,7 +988,7 @@@
outParamIndex++;
} // end else if
} // end for
-- }
++ }
catch (IllegalArgumentException & e)
{
e.ArgumentPosition = ::sal::static_int_cast< sal_Int16, int >( i );
@@@ -1020,16 -1084,16 +1084,16 @@@
// Get the DISPID
FuncDesc aDesc(getTypeInfo());
getFuncDesc(sFunctionName, & aDesc);
-- // invoking OLE method
-- hr = m_spDispatch->Invoke(aDesc->memid,
++ // invoking OLE method
++ hr = m_spDispatch->Invoke(aDesc->memid,
IID_NULL,
-- LOCALE_USER_DEFAULT,
++ LOCALE_USER_DEFAULT,
DISPATCH_METHOD,
-- &dispparams,
-- &varResult,
++ &dispparams,
++ &varResult,
&excepinfo,
&uArgErr);
--
++
// converting return value and out parameter back to UNO
if (hr == S_OK)
{
@@@ -1046,10 -1110,10 +1110,10 @@@
if( pMethod->pParams[i].bOut )
{
OutParamIndex[outIndex]= (sal_Int16) i;
-- Any outAny;
++ Any outAny;
if( !bJScriptObject)
{
-- variantToAny( &pVarParamsRef[outIndex], outAny,
++ variantToAny( &pVarParamsRef[outIndex], outAny,
Type(pMethod->pParams[i].pTypeRef), sal_False);
OutParam[outIndex++]= outAny;
}
@@@ -1063,7 -1127,7 +1127,7 @@@
CComVariant varOut;
if( SUCCEEDED( pDisp.GetPropertyByName( L"0", &varOut)))
{
-- variantToAny( &varOut, outAny,
++ variantToAny( &varOut, outAny,
Type(pMethod->pParams[parameterCount - 1 - i].pTypeRef), sal_False);
OutParam[outParameterCount - 1 - outIndex++]= outAny;
}
@@@ -1117,11 -1181,11 +1181,11 @@@
}
}
}
--
++
if( !bConvRet) // conversion of return or out parameter failed
throw CannotConvertException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Call to COM object failed. Conversion of return or out value failed")),
Reference<XInterface>( static_cast<XWeak*>(this), UNO_QUERY ), TypeClass_UNKNOWN,
-- FailReason::UNKNOWN, 0);// lookup error code
++ FailReason::UNKNOWN, 0);// lookup error code
// conversion of return or out parameter failed
switch (hr)
{
@@@ -1167,10 -1231,10 +1231,10 @@@
default:
throw RuntimeException();
break;
-- }
++ }
return ret;
--}
++}
@@@ -1180,10 -1244,10 +1244,10 @@@ void SAL_CALL IUnknownWrapper_Impl::ini
{
// 1.parameter is IUnknown
// 2.parameter is a boolean which indicates if the the COM pointer was a IUnknown or IDispatch
-- // 3.parameter is a Sequence<Type>
++ // 3.parameter is a Sequence<Type>
o2u_attachCurrentThread();
OSL_ASSERT(aArguments.getLength() == 3);
--
++
m_spUnknown= *(IUnknown**) aArguments[0].getValue();
#ifdef __MINGW32__
m_spUnknown->QueryInterface(IID_IDispatch, reinterpret_cast<LPVOID*>( & m_spDispatch.p));
@@@ -1191,7 -1255,7 +1255,7 @@@
m_spUnknown.QueryInterface( & m_spDispatch.p);
#endif
-- aArguments[1] >>= m_bOriginalDispatch;
++ aArguments[1] >>= m_bOriginalDispatch;
aArguments[2] >>= m_seqTypes;
ITypeInfo* pType = NULL;
@@@ -1226,15 -1290,15 +1290,15 @@@
{
getFuncDesc( usName, &aDescGet );
if ( !aDescGet )
-- throw BridgeRuntimeError( OUSTR("[automation bridge]IUnknownWrapper_Impl::initialize() Failed to get Function or Property desc. for " ) + usName );
++ throw BridgeRuntimeError( OUSTR("[automation bridge]IUnknownWrapper_Impl::initialize() Failed to get Function or Property desc. for " ) + usName );
}
// now for some funny heuristics to make basic understand what to do
-- // a single aDescGet ( that doesn't take any params ) would be
++ // a single aDescGet ( that doesn't take any params ) would be
// a read only ( defaultmember ) property e.g. this object
// should implement XDefaultProperty
// a single aDescGet ( that *does* ) take params is basically a
// default method e.g. implement XDefaultMethod
--
++
// a DescPut ( I guess we only really support a default param with '1' param ) as a setValue ( but I guess we can leave it through, the object will fail if we don't get it right anyway )
if ( aDescPut || ( aDescGet && aDescGet->cParams == 0 ) )
m_bHasDfltProperty = true;
@@@ -1277,7 -1341,7 +1341,7 @@@ Reference< XInterface > IUnknownWrapper
}
Reference<XInterface> IUnknownWrapper_Impl::createComWrapperInstance()
{
-- Reference<XWeak> xWeak= static_cast<XWeak*>( new IUnknownWrapper_Impl(
++ Reference<XWeak> xWeak= static_cast<XWeak*>( new IUnknownWrapper_Impl(
m_smgr, m_nUnoWrapperClass, m_nComWrapperClass));
return Reference<XInterface>( xWeak, UNO_QUERY);
}
@@@ -1326,7 -1390,7 +1390,7 @@@ TypeDescription IUnknownWrapper_Impl::g
typelib_TypeDescription* pDescMember= NULL;
TYPELIB_DANGER_GET( &pDescMember, pTypeRefMember)
-- typelib_InterfaceMemberTypeDescription* pInterfaceMember=
++ typelib_InterfaceMemberTypeDescription* pInterfaceMember=
(typelib_InterfaceMemberTypeDescription*) pDescMember;
if( OUString( pInterfaceMember->pMemberName) == sName)
{
@@@ -1378,7 -1442,7 +1442,7 @@@ sal_Bool IUnknownWrapper_Impl::isJScrip
/** @internal
The function ultimately calls IDispatch::Invoke on the wrapped COM object.
-- The COM object does not implement UNO Interfaces ( via IDispatch). This
++ The COM object does not implement UNO Interfaces ( via IDispatch). This
is the case when the OleObjectFactory service has been used to create a
component.
@exception IllegalArgumentException
@@@ -1388,9 -1452,22 +1452,22 @@@
@BridgeRuntimeError
*/
Any IUnknownWrapper_Impl::invokeWithDispIdComTlb(const OUString& sFuncName,
-- const Sequence< Any >& Params,
-- Sequence< sal_Int16 >& OutParamIndex,
-- Sequence< Any >& OutParam)
++ const Sequence< Any >& Params,
++ Sequence< sal_Int16 >& OutParamIndex,
++ Sequence< Any >& OutParam)
+ {
+ // Get type info for the call. It can be a method call or property put or
+ // property get operation.
+ FuncDesc aFuncDesc(getTypeInfo());
+ getFuncDescForInvoke(sFuncName, Params, & aFuncDesc);
- return invokeWithDispIdComTlb( aFuncDesc, sFuncName, Params, OutParamIndex, OutParam );
++ return invokeWithDispIdComTlb( aFuncDesc, sFuncName, Params, OutParamIndex, OutParam );
+ }
+
-Any IUnknownWrapper_Impl::invokeWithDispIdComTlb(FuncDesc& aFuncDesc,
++Any IUnknownWrapper_Impl::invokeWithDispIdComTlb(FuncDesc& aFuncDesc,
+ const OUString& sFuncName,
- const Sequence< Any >& Params,
- Sequence< sal_Int16 >& OutParamIndex,
- Sequence< Any >& OutParam)
++ const Sequence< Any >& Params,
++ Sequence< sal_Int16 >& OutParamIndex,
++ Sequence< Any >& OutParam)
{
Any ret;
HRESULT result;
@@@ -1420,7 -1493,7 +1493,7 @@@
if (aFuncDesc->invkind == INVOKE_PROPERTYPUT
|| aFuncDesc->invkind == INVOKE_PROPERTYPUTREF)
dispparams.rgdispidNamedArgs = & idPropertyPut;
--
++
//Determine the number of named arguments
for (int iParam = 0; iParam < nUnoArgs; iParam ++)
{
@@@ -1435,7 -1508,7 +1508,7 @@@
if (aFuncDesc->invkind == DISPATCH_PROPERTYPUT
|| aFuncDesc->invkind == DISPATCH_PROPERTYPUTREF)
dispparams.cNamedArgs ++;
--
++
//Determine the number of all arguments and named arguments
if (aFuncDesc->cParamsOpt == -1)
{
@@@ -1445,7 -1518,7 +1518,7 @@@
}
else
{
-- //If there are namesd arguments, then the dispparams.cArgs
++ //If there are namesd arguments, then the dispparams.cArgs
//is the number of supplied args, otherwise it is the expected number.
if (dispparams.cNamedArgs)
dispparams.cArgs = nUnoArgs;
@@@ -1461,7 -1534,7 +1534,7 @@@
throw IllegalArgumentException( buf.makeStringAndClear(),
Reference<XInterface>(), (sal_Int16) dispparams.cArgs);
}
--
++
//Set up the array of DISPIDs (DISPPARAMS::rgdispidNamedArgs)
//for the named arguments.
//If there is only one named arg and if it is because of a property put
@@@ -1482,7 -1555,7 +1555,7 @@@
{
nSizeAr = dispparams.cNamedArgs; //counts the DISID_PROPERTYPUT
}
--
++
scoped_array<OLECHAR*> saNames(new OLECHAR*[nSizeAr]);
OLECHAR ** arNames = saNames.get();
arNames[0] = const_cast<OLECHAR*>(reinterpret_cast<LPCOLESTR>(sFuncName.getStr()));
@@@ -1500,12 -1573,12 +1573,12 @@@
arNames[nSizeAr - 1 - cNamedArg++] = const_cast<OLECHAR*>(reinterpret_cast<LPCOLESTR>(arg.Name.getStr()));
}
}
--
++
//Prepare the array of DISPIDs for ITypeInfo::GetIDsOfNames
//it must be big enough to contain the DISPIDs of the member + parameters
-- arDispidNamedArgs.reset(new DISPID[nSizeAr]);
++ arDispidNamedArgs.reset(new DISPID[nSizeAr]);
HRESULT hr = getTypeInfo()->GetIDsOfNames(arNames, nSizeAr,
-- arDispidNamedArgs.get());
++ arDispidNamedArgs.get());
if ( hr == E_NOTIMPL )
hr = m_spDispatch->GetIDsOfNames(IID_NULL, arNames, nSizeAr, LOCALE_USER_DEFAULT, arDispidNamedArgs.get() );
@@@ -1559,7 -1632,7 +1632,7 @@@
Any anyArg;
if ( i < nUnoArgs)
anyArg= Params.getConstArray()[i];
--
++
//Test if the current parameter is a "vararg" parameter.
if (bVarargParam || (aFuncDesc->cParamsOpt == -1 &&
aFuncDesc->cParams == (i + 1)))
@@@ -1567,7 -1640,7 +1640,7 @@@
//type info available, except that it must be a VARIANT
bVarargParam = true;
}
--
++
unsigned short paramFlags = PARAMFLAG_FOPT | PARAMFLAG_FIN;
VARTYPE varType = VT_VARIANT;
if ( ! bVarargParam)
@@@ -1591,7 -1664,7 +1664,7 @@@
throw IllegalArgumentException( buf.makeStringAndClear(),
Reference<XInterface>(), (sal_Int16) i);
}
-- //make sure we get no void any for an in parameter. In StarBasic
++ //make sure we get no void any for an in parameter. In StarBasic
//this may be caused by
// Dim arg
// obj.func(arg)
@@@ -1600,7 -1673,7 +1673,7 @@@
&& (i < nUnoArgs) && (paramFlags & PARAMFLAG_FIN) &&
Params.getConstArray()[i].getValueTypeClass() == TypeClass_VOID)
{
-- OUStringBuffer buf(256);
++ OUStringBuffer buf(256);
buf.appendAscii("ole automation bridge: The argument at position: ");
buf.append(OUString::valueOf((sal_Int32) i));
buf.appendAscii(" (index starts with 0) is uninitialized.");
@@@ -1629,7 -1702,7 +1702,7 @@@
VARTYPE type = ::sal::static_int_cast< VARTYPE, int >( varType ^ VT_BYREF );
if (i < nUnoArgs)
{
-- arRefArgs[revIndex].vt= type;
++ arRefArgs[revIndex].vt= type;
}
else
{
@@@ -1676,9 -1749,9 +1749,9 @@@
arRefArgs[revIndex].vt = VT_ERROR;
arRefArgs[revIndex].scode = DISP_E_PARAMNOTFOUND;
}
--
++
// Set the converted arguments in the array which will be
-- // DISPPARAMS::rgvarg
++ // DISPPARAMS::rgvarg
// byref arg VT_XXX |VT_BYREF
arArgs[revIndex].vt = varType;
if (revIndex == 0 && aFuncDesc->invkind == INVOKE_PROPERTYPUT)
@@@ -1727,7 -1800,7 +1800,7 @@@
}
}
}
-- }
++ }
catch (IllegalArgumentException & e)
{
e.ArgumentPosition = ::sal::static_int_cast< sal_Int16, sal_Int32 >( i );
@@@ -1741,19 -1814,19 +1814,19 @@@
dispparams.rgvarg= arArgs;
// invoking OLE method
DWORD localeId = LOCALE_USER_DEFAULT;
-- result = m_spDispatch->Invoke(aFuncDesc->memid,
++ result = m_spDispatch->Invoke(aFuncDesc->memid,
IID_NULL,
-- localeId,
++ localeId,
::sal::static_int_cast< WORD, INVOKEKIND >( aFuncDesc->invkind ),
-- &dispparams,
-- &varResult,
++ &dispparams,
++ &varResult,
&excepinfo,
&uArgErr);
// converting return value and out parameter back to UNO
if (result == S_OK)
{
--
++
// allocate space for the out param Sequence and indices Sequence
int outParamsCount= 0; // includes in/out parameter
for (int i = 0; i < aFuncDesc->cParams; i++)
@@@ -1781,14 -1854,14 +1854,14 @@@
//of named args list to index of parameter list
realParamIndex = dispparams.rgdispidNamedArgs[revParamIndex];
}
--
++
// no named arg, always come before named args
if (! (aFuncDesc->lprgelemdescParam[realParamIndex].paramdesc.wParamFlags
& PARAMFLAG_FOUT))
continue;
Any outAny;
// variantToAny is called with the "reduce range" parameter set to sal_False.
-- // That causes VT_I4 values not to be converted down to a "lower" type. That
++ // That causes VT_I4 values not to be converted down to a "lower" type. That
// feature exist for JScript only because it only uses VT_I4 for integer types.
try
{
@@@ -1807,14 -1880,14 +1880,14 @@@
OutParam[outParamIndex] = outAny;
OutParamIndex[outParamIndex] = ::sal::static_int_cast< sal_Int16, int >( paramIndex );
outParamIndex++;
-- }
++ }
OutParam.realloc(outParamIndex);
OutParamIndex.realloc(outParamIndex);
}
-- // Return value
++ // Return value
variantToAny(&varResult, ret, sal_False);
}
--
++
// map error codes to exceptions
OUString message;
switch (result)
@@@ -1832,18 -1905,31 +1905,31 @@@
"DISP_E_BADVARTYPE."), 0);
break;
case DISP_E_EXCEPTION:
- {
++ {
message = OUSTR("[automation bridge]: ");
-- message += OUString(reinterpret_cast<const sal_Unicode*>(excepinfo.bstrDescription),
++ message += OUString(reinterpret_cast<const sal_Unicode*>(excepinfo.bstrDescription),
::SysStringLen(excepinfo.bstrDescription));
- throw InvocationTargetException(message, Reference<XInterface>(), Any());
+
- // Add for VBA, to throw an exception with the correct error code and message.
- sal_Int32 nErrorCode = excepinfo.wCode;
- if ( nErrorCode == 0 )
- {
- // The low 16-bit of scode describing the error or warning.
- nErrorCode = ( excepinfo.scode & 0xFFFF );
- }
- BasicErrorException aBasicErrExp(message, Reference<XInterface>(), nErrorCode, message);
- throw InvocationTargetException(message, Reference<XInterface>(), makeAny(aBasicErrExp));
- // End add
++ // Add for VBA, to throw an exception with the correct error code and message.
++ sal_Int32 nErrorCode = excepinfo.wCode;
++ if ( nErrorCode == 0 )
++ {
++ // The low 16-bit of scode describing the error or warning.
++ nErrorCode = ( excepinfo.scode & 0xFFFF );
++ }
++ BasicErrorException aBasicErrExp(message, Reference<XInterface>(), nErrorCode, message);
++ throw InvocationTargetException(message, Reference<XInterface>(), makeAny(aBasicErrExp));
++ // End add
+
break;
- }
++ }
case DISP_E_MEMBERNOTFOUND:
message = OUSTR("[automation bridge]: A function with the name \"")
+ sFuncName + OUSTR("\" is not supported. Object returned "
-- "DISP_E_MEMBERNOTFOUND.");
++ "DISP_E_MEMBERNOTFOUND.");
throw IllegalArgumentException(message, 0, 0);
break;
-- case DISP_E_NONAMEDARGS:
++ case DISP_E_NONAMEDARGS:
throw IllegalArgumentException(OUSTR("[automation bridge] Object "
"returned DISP_E_NONAMEDARGS"),0, ::sal::static_int_cast< sal_Int16, unsigned int >( uArgErr ));
break;
@@@ -1855,7 -1941,7 +1941,7 @@@
case DISP_E_PARAMNOTFOUND:
throw IllegalArgumentException(OUSTR("[automation bridge]Call failed."
"Object returned DISP_E_PARAMNOTFOUND."),
-- 0, ::sal::static_int_cast< sal_Int16, unsigned int >( uArgErr ));
++ 0, ::sal::static_int_cast< sal_Int16, unsigned int >( uArgErr ));
break;
case DISP_E_TYPEMISMATCH:
throw CannotConvertException(OUSTR("[automation bridge] Call failed. "
@@@ -1880,10 -1966,10 +1966,10 @@@
default:
throw RuntimeException();
break;
-- }
--
++ }
++
return ret;
--}
++}
void IUnknownWrapper_Impl::getFuncDescForInvoke(const OUString & sFuncName,
const Sequence<Any> & seqArgs,
@@@ -1913,7 -1999,7 +1999,7 @@@
OUSTR("[automation bridge] The object does not have a writeable property: ")
+ sFuncName, Reference<XInterface>(), 0);
}
-- *pFuncDesc = aDescPut.Detach();
++ *pFuncDesc = aDescPut.Detach();
}
else
{ // DISPATCH_METHOD
@@@ -1961,31 -2047,37 +2047,37 @@@ void IUnknownWrapper_Impl::getFuncDesc(
DISPID id;
if (getDispid(sFuncName, &id))
{
-- CComBSTR memberName;
++ CComBSTR memberName;
unsigned int pcNames=0;
// get the case sensitive name
if( SUCCEEDED(getTypeInfo()->GetNames( id, & memberName, 1, &pcNames)))
{
//get the associated index and add an entry to the map
-- //with the name sFuncName which differs in the casing of the letters to
++ //with the name sFuncName which differs in the casing of the letters to
//the actual name as obtained from ITypeInfo
- cit itOrg = m_mapComFunc.find(OUString(reinterpret_cast<const sal_Unicode*>(LPCOLESTR(memberName))));
- OUString sRealName(reinterpret_cast<const sal_Unicode*>(LPCOLESTR(memberName)));
- cit itOrg = m_mapComFunc.find(sRealName);
++ OUString sRealName(reinterpret_cast<const sal_Unicode*>(LPCOLESTR(memberName)));
++ cit itOrg = m_mapComFunc.find(sRealName);
OSL_ASSERT(itOrg != m_mapComFunc.end());
- // maybe this is a property, if so we need
- // to store either both id's ( put/get ) or
- // just the get. Storing both is more consistent
- pair<cit, cit> pItems = m_mapComFunc.equal_range( sRealName );
- for ( ;pItems.first != pItems.second; ++pItems.first )
- m_mapComFunc.insert( TLBFuncIndexMap::value_type ( make_pair(sFuncName, pItems.first->second ) ));
++ // maybe this is a property, if so we need
++ // to store either both id's ( put/get ) or
++ // just the get. Storing both is more consistent
++ pair<cit, cit> pItems = m_mapComFunc.equal_range( sRealName );
++ for ( ;pItems.first != pItems.second; ++pItems.first )
++ m_mapComFunc.insert( TLBFuncIndexMap::value_type ( make_pair(sFuncName, pItems.first->second ) ));
itIndex =
- m_mapComFunc.insert( TLBFuncIndexMap::value_type
- ( make_pair(sFuncName, itOrg->second ) ));
- m_mapComFunc.find( sFuncName );
++ m_mapComFunc.find( sFuncName );
}
}
}
--
--#if OSL_DEBUG_LEVEL >= 1
++
++#if OSL_DEBUG_LEVEL >= 1
// There must only be one entry if sFuncName represents a function or two
// if it is a property
pair<cit, cit> p = m_mapComFunc.equal_range(sFuncName.toAsciiLowerCase());
int numEntries = 0;
for ( ;p.first != p.second; p.first ++, numEntries ++);
OSL_ASSERT( ! (numEntries > 3) );
--#endif
++#endif
if( itIndex != m_mapComFunc.end())
{
ITypeInfo* pType= getTypeInfo();
@@@ -2023,13 -2115,13 +2115,13 @@@ void IUnknownWrapper_Impl::getPropDesc(
DISPID id;
if (getDispid(sFuncName, &id))
{
-- CComBSTR memberName;
++ CComBSTR memberName;
unsigned int pcNames=0;
// get the case sensitive name
if( SUCCEEDED(getTypeInfo()->GetNames( id, & memberName, 1, &pcNames)))
{
//As opposed to getFuncDesc, we do not add the value because we would
-- // need to find the get and set description for the property. This would
++ // need to find the get and set description for the property. This would
//mean to iterate over all FUNCDESCs again.
p = m_mapComFunc.equal_range(OUString(reinterpret_cast<const sal_Unicode*>(LPCOLESTR(memberName))));
}
@@@ -2043,7 -2135,7 +2135,7 @@@
ITypeInfo* pType= getTypeInfo();
FUNCDESC * pFuncDesc = NULL;
if (SUCCEEDED( pType->GetFuncDesc(p.first->second, & pFuncDesc)))
-- {
++ {
if (pFuncDesc->invkind == INVOKE_PROPERTYGET)
{
(*pFuncDescGet) = pFuncDesc;
@@@ -2077,45 -2169,32 +2169,32 @@@
if (SUCCEEDED(pType->GetVarDesc(p.first->second, & pVD)))
(*pVarDesc) = pVD;
}
-- //else no entry for sFuncName, pFuncDesc will not be filled in
++ //else no entry for sFuncName, pFuncDesc will not be filled in
}
- VARTYPE IUnknownWrapper_Impl::getElementTypeDesc(const TYPEDESC *desc)
+ VARTYPE IUnknownWrapper_Impl::getUserDefinedElementType( ITypeInfo* pTypeInfo, const DWORD nHrefType )
{
VARTYPE _type( VT_NULL );
-
- if (desc->vt == VT_PTR)
+ if ( pTypeInfo )
{
- _type = getElementTypeDesc(desc->lptdesc);
- _type |= VT_BYREF;
- }
- else if (desc->vt == VT_SAFEARRAY)
- {
- _type = getElementTypeDesc(desc->lptdesc);
- _type |= VT_ARRAY;
- }
- else if (desc->vt == VT_USERDEFINED)
- {
- ITypeInfo* thisInfo = getTypeInfo(); //kept by this instance
- CComPtr<ITypeInfo> spRefInfo;
- thisInfo->GetRefTypeInfo(desc->hreftype, & spRefInfo.p);
- if (spRefInfo)
+ CComPtr<ITypeInfo> spRefInfo;
+ pTypeInfo->GetRefTypeInfo( nHrefType, &spRefInfo.p );
+ if ( spRefInfo )
{
- TypeAttr attr(spRefInfo);
- spRefInfo->GetTypeAttr( & attr);
- if (attr->typekind == TKIND_ENUM)
+ TypeAttr attr( spRefInfo );
+ spRefInfo->GetTypeAttr( &attr );
+ if ( attr->typekind == TKIND_ENUM )
{
- //We use the type of the first enum value.
- if (attr->cVars == 0)
+ // We use the type of the first enum value.
+ if ( attr->cVars == 0 )
{
- throw BridgeRuntimeError(OUSTR("[automation bridge] Could "
- "not obtain type description"));
+ throw BridgeRuntimeError(OUSTR("[automation bridge] Could not obtain type description"));
}
- VarDesc var(spRefInfo);
- spRefInfo->GetVarDesc(0, & var);
- _type = var->lpvarValue->vt;
+ VarDesc var( spRefInfo );
+ spRefInfo->GetVarDesc( 0, &var );
+ _type = var->lpvarValue->vt;
}
- else if (attr->typekind == TKIND_INTERFACE)
+ else if ( attr->typekind == TKIND_INTERFACE )
{
_type = VT_UNKNOWN;
}
@@@ -2130,6 -2213,28 +2213,28 @@@
}
}
}
+ return _type;
+ }
+
+ VARTYPE IUnknownWrapper_Impl::getElementTypeDesc(const TYPEDESC *desc)
+ {
+ VARTYPE _type( VT_NULL );
+
+ if (desc->vt == VT_PTR)
+ {
+ _type = getElementTypeDesc(desc->lptdesc);
+ _type |= VT_BYREF;
+ }
+ else if (desc->vt == VT_SAFEARRAY)
+ {
+ _type = getElementTypeDesc(desc->lptdesc);
+ _type |= VT_ARRAY;
+ }
+ else if (desc->vt == VT_USERDEFINED)
+ {
+ ITypeInfo* thisInfo = getTypeInfo(); //kept by this instance
- _type = getUserDefinedElementType( thisInfo, desc->hreftype );
++ _type = getUserDefinedElementType( thisInfo, desc->hreftype );
+ }
else
{
_type = desc->vt;
@@@ -2155,7 -2260,7 +2260,7 @@@ void IUnknownWrapper_Impl::buildComTlbI
FuncDesc funcDesc(pType);
if( SUCCEEDED( pType->GetFuncDesc( i, &funcDesc)))
{
-- CComBSTR memberName;
++ CComBSTR memberName;
unsigned int pcNames=0;
if( SUCCEEDED(pType->GetNames( funcDesc->memid, & memberName, 1, &pcNames)))
{
@@@ -2172,15 -2277,15 +2277,15 @@@
sError = OUSTR("[automation bridge] IUnknownWrapper_Impl::buildComTlbIndex, " \
"ITypeInfo::GetFuncDesc failed.");
}
--
-- //If we create an Object in JScript and a a property then it
++
++ //If we create an Object in JScript and a a property then it
//has VARDESC instead of FUNCDESC
for (long i = 0; i < typeAttr->cVars; i++)
{
VarDesc varDesc(pType);
if (SUCCEEDED(pType->GetVarDesc(i, & varDesc)))
{
-- CComBSTR memberName;
++ CComBSTR memberName;
unsigned int pcNames = 0;
if (SUCCEEDED(pType->GetNames(varDesc->memid, & memberName, 1, &pcNames)))
{
@@@ -2200,7 -2305,7 +2305,7 @@@
else
sError = OUSTR("[automation bridge] IUnknownWrapper_Impl::buildComTlbIndex, " \
"ITypeInfo::GetVarDesc failed.");
--
++
}
}
else
@@@ -2211,7 -2316,7 +2316,7 @@@
{
throw BridgeRuntimeError(sError);
}
--
++
m_bComTlbIndexInit = true;
}
}
@@@ -2241,8 -2346,8 +2346,8 @@@ ITypeInfo* IUnknownWrapper_Impl::getTyp
TypeAttr typeAttr(spType.p);
if( SUCCEEDED(spType->GetTypeAttr( &typeAttr)))
{
-- if (typeAttr->typekind == TKIND_INTERFACE &&
-- typeAttr->wTypeFlags & TYPEFLAG_FDUAL)
++ if (typeAttr->typekind == TKIND_INTERFACE &&
++ typeAttr->wTypeFlags & TYPEFLAG_FDUAL)
{
HREFTYPE refDispatch;
if (SUCCEEDED(spType->GetRefTypeOfImplType(::sal::static_int_cast< UINT, int >( -1 ), &refDispatch)))
diff --cc extensions/source/ole/oleobjw.hxx
index 334fb18,31cc54b..13c8efb
--- a/extensions/source/ole/oleobjw.hxx
+++ b/extensions/source/ole/oleobjw.hxx
@@@ -145,6 -149,12 +149,12 @@@ protected
Sequence< sal_Int16 >& OutParamIndex,
Sequence< Any >& OutParam);
+ Any IUnknownWrapper_Impl::invokeWithDispIdComTlb(FuncDesc& aFuncDesc,
- const OUString& sFuncName,
- const Sequence< Any >& Params,
- Sequence< sal_Int16 >& OutParamIndex,
- Sequence< Any >& OutParam);
++ const OUString& sFuncName,
++ const Sequence< Any >& Params,
++ Sequence< sal_Int16 >& OutParamIndex,
++ Sequence< Any >& OutParam);
+
// virtual void setValueWithDispId(DISPID dispID, const Any& Value);
// virtual Any getValueWithDispId(const OUString& sName, DISPID dispID);
@@@ -188,7 -198,10 +198,10 @@@
/** Returns the DISPID for a function or property name. If true is returned then
id contains a valid DISPID.
*/
+
bool getDispid(const OUString& sFuncName, DISPID * id);
+
- VARTYPE getUserDefinedElementType( ITypeInfo* pTypeInfo, const DWORD nHrefType );
++ VARTYPE getUserDefinedElementType( ITypeInfo* pTypeInfo, const DWORD nHrefType );
/** Gets the element type in a VARIANT like style. E.g. if desc->lptdesc contains
a VT_PTR than it is replaced by VT_BYREF and VT_SAFEARRAY is replaced by VT_ARRAY
diff --cc extensions/source/propctrlr/formmetadata.hxx
index 76ff9f5,c11797a..cc61afe
--- a/extensions/source/propctrlr/formmetadata.hxx
+++ b/extensions/source/propctrlr/formmetadata.hxx
@@@ -161,6 -163,7 +161,7 @@@ namespace pc
#define PROPERTY_ID_ALLOWADDITIONS 20
#define PROPERTY_ID_ALLOWEDITS 21
#define PROPERTY_ID_ALLOWDELETIONS 22
- #define PROPERTY_ID_GROUP_NAME 23
++ #define PROPERTY_ID_GROUP_NAME 23
#define PROPERTY_ID_NAVIGATION 24
#define PROPERTY_ID_CYCLE 25
#define PROPERTY_ID_HIDDEN_VALUE 26
diff --cc extensions/source/propctrlr/formres.src
index c853723,11c08c0..1170c89
--- a/extensions/source/propctrlr/formres.src
+++ b/extensions/source/propctrlr/formres.src
@@@ -231,6 -231,10 +231,10 @@@ String RID_STR_NAM
{
Text [ en-US ] = "Name" ;
};
+ String RID_STR_GROUP_NAME
+ {
- Text [ en-US ] = "Group name" ;
++ Text [ en-US ] = "Group name" ;
+ };
String RID_STR_TABINDEX
{
Text [ en-US ] = "Tab order" ;
diff --cc extensions/source/propctrlr/formstrings.hxx
index b338653,95a57b1..04d9de1
--- a/extensions/source/propctrlr/formstrings.hxx
+++ b/extensions/source/propctrlr/formstrings.hxx
@@@ -48,6 -48,7 +48,7 @@@ namespace pc
PCR_CONSTASCII_STRING( PROPERTY_WHEEL_BEHAVIOR, "MouseWheelBehavior");
PCR_CONSTASCII_STRING( PROPERTY_TAG, "Tag");
PCR_CONSTASCII_STRING( PROPERTY_NAME, "Name");
- PCR_CONSTASCII_STRING( PROPERTY_GROUP_NAME, "GroupName");
++ PCR_CONSTASCII_STRING( PROPERTY_GROUP_NAME, "GroupName");
PCR_CONSTASCII_STRING( PROPERTY_VALUE, "Value");
PCR_CONSTASCII_STRING( PROPERTY_TEXT, "Text");
PCR_CONSTASCII_STRING( PROPERTY_NAVIGATION, "NavigationBarMode");
diff --cc forms/source/component/GroupManager.cxx
index dfc679d,c4c8224..3ce5ad6
--- a/forms/source/component/GroupManager.cxx
+++ b/forms/source/component/GroupManager.cxx
@@@ -318,7 -317,8 +317,8 @@@ void OGroupManager::removeFromGroupMap(
aFind->second.RemoveComponent( _xSet );
// Wenn Anzahl der Gruppenelemente == 1 ist, Gruppe deaktivieren
- if ( aFind->second.Count() == 1 )
- sal_Int32 nCount = aFind->second.Count();
- if ( nCount == 1 || nCount == 0 )
++ sal_Int32 nCount = aFind->second.Count();
++ if ( nCount == 1 || nCount == 0 )
{
OActiveGroups::iterator aActiveFind = ::std::find(
m_aActiveGroupMap.begin(),
@@@ -338,6 -338,8 +338,8 @@@
// Bei Component als PropertyChangeListener abmelden
_xSet->removePropertyChangeListener( PROPERTY_NAME, this );
- if (hasProperty(PROPERTY_GROUP_NAME, _xSet))
- _xSet->removePropertyChangeListener( PROPERTY_GROUP_NAME, this );
++ if (hasProperty(PROPERTY_GROUP_NAME, _xSet))
++ _xSet->removePropertyChangeListener( PROPERTY_GROUP_NAME, this );
if (hasProperty(PROPERTY_TABINDEX, _xSet))
_xSet->removePropertyChangeListener( PROPERTY_TABINDEX, this );
}
@@@ -348,10 -350,23 +350,23 @@@ void SAL_CALL OGroupManager::propertyCh
// Component aus Gruppe entfernen
::rtl::OUString sGroupName;
- if (evt.PropertyName == PROPERTY_NAME)
- if (hasProperty( PROPERTY_GROUP_NAME, xSet ))
- xSet->getPropertyValue( PROPERTY_GROUP_NAME ) >>= sGroupName;
- if (evt.PropertyName == PROPERTY_NAME) {
- if (sGroupName.getLength() > 0)
- return; // group hasn't changed; ignore this name change.
- // no GroupName; use Name as GroupNme
++ if (hasProperty( PROPERTY_GROUP_NAME, xSet ))
++ xSet->getPropertyValue( PROPERTY_GROUP_NAME ) >>= sGroupName;
++ if (evt.PropertyName == PROPERTY_NAME) {
++ if (sGroupName.getLength() > 0)
++ return; // group hasn't changed; ignore this name change.
++ // no GroupName; use Name as GroupNme
+ evt.OldValue >>= sGroupName;
- }
- else if (evt.PropertyName == PROPERTY_GROUP_NAME) {
- evt.OldValue >>= sGroupName;
- if (sGroupName.getLength() == 0) {
- // No prior GroupName; fallback to Nme
- xSet->getPropertyValue( PROPERTY_NAME ) >>= sGroupName;
- }
- }
++ }
++ else if (evt.PropertyName == PROPERTY_GROUP_NAME) {
+ evt.OldValue >>= sGroupName;
++ if (sGroupName.getLength() == 0) {
++ // No prior GroupName; fallback to Nme
++ xSet->getPropertyValue( PROPERTY_NAME ) >>= sGroupName;
++ }
++ }
else
- xSet->getPropertyValue( PROPERTY_NAME ) >>= sGroupName;
- sGroupName = GetGroupName( xSet );
++ sGroupName = GetGroupName( xSet );
removeFromGroupMap(sGroupName,xSet);
@@@ -434,8 -449,7 +449,7 @@@ void OGroupManager::InsertElement( cons
m_pCompGroup->InsertComponent( xSet );
// Component in Gruppe aufnehmen
- ::rtl::OUString sGroupName;
- xSet->getPropertyValue( PROPERTY_NAME ) >>= sGroupName;
- ::rtl::OUString sGroupName( GetGroupName( xSet ) );
++ ::rtl::OUString sGroupName( GetGroupName( xSet ) );
OGroupArr::iterator aFind = m_aGroupArr.find(sGroupName);
@@@ -473,6 -487,8 +487,8 @@@
// Bei Component als PropertyChangeListener anmelden
xSet->addPropertyChangeListener( PROPERTY_NAME, this );
- if (hasProperty(PROPERTY_GROUP_NAME, xSet))
- xSet->addPropertyChangeListener( PROPERTY_GROUP_NAME, this );
++ if (hasProperty(PROPERTY_GROUP_NAME, xSet))
++ xSet->addPropertyChangeListener( PROPERTY_GROUP_NAME, this );
// Tabindex muss nicht jeder unterstuetzen
if (hasProperty(PROPERTY_TABINDEX, xSet))
@@@ -489,8 -505,7 +505,7 @@@ void OGroupManager::RemoveElement( cons
return;
// Component aus Gruppe entfernen
- ::rtl::OUString sGroupName;
- xSet->getPropertyValue( PROPERTY_NAME ) >>= sGroupName;
- ::rtl::OUString sGroupName( GetGroupName( xSet ) );
++ ::rtl::OUString sGroupName( GetGroupName( xSet ) );
removeFromGroupMap(sGroupName,xSet);
}
diff --cc forms/source/component/GroupManager.hxx
index f514771f,2143c76..002f056
--- a/forms/source/component/GroupManager.hxx
+++ b/forms/source/component/GroupManager.hxx
@@@ -217,6 -217,8 +217,8 @@@ public
void getGroup(sal_Int32 nGroup, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel> >& _rGroup, ::rtl::OUString& Name);
void getGroupByName(const ::rtl::OUString& Name, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel> >& _rGroup);
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel> > getControlModels();
+
- static ::rtl::OUString GetGroupName( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> xComponent );
++ static ::rtl::OUString GetGroupName( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> xComponent );
};
diff --cc forms/source/component/RadioButton.cxx
index a3d93de,05e9bb6..2968078
--- a/forms/source/component/RadioButton.cxx
+++ b/forms/source/component/RadioButton.cxx
@@@ -28,8 -28,11 +28,9 @@@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_forms.hxx"
#include "RadioButton.hxx"
+ #include "GroupManager.hxx"
#include "property.hxx"
-#ifndef _FRM_PROPERTY_HRC_
#include "property.hrc"
-#endif
#include "services.hxx"
#include <tools/debug.hxx>
#include <comphelper/extract.hxx>
@@@ -117,6 -120,7 +118,7 @@@ ORadioButtonModel::ORadioButtonModel(co
m_nClassId = FormComponentType::RADIOBUTTON;
m_aLabelServiceName = FRM_SUN_COMPONENT_GROUPBOX;
initValueProperty( PROPERTY_STATE, PROPERTY_ID_STATE );
- startAggregatePropertyListening( PROPERTY_GROUP_NAME );
++ startAggregatePropertyListening( PROPERTY_GROUP_NAME );
}
//------------------------------------------------------------------
@@@ -163,8 -167,12 +165,12 @@@ StringSequence SAL_CALL ORadioButtonMod
//------------------------------------------------------------------------------
void ORadioButtonModel::SetSiblingPropsTo(const ::rtl::OUString& rPropName, const Any& rValue)
{
- // mein Name
+ // my name
- ::rtl::OUString sMyName(m_aName);
+ ::rtl::OUString sMyGroup;
+ if (hasProperty(PROPERTY_GROUP_NAME, this))
+ this->getPropertyValue(PROPERTY_GROUP_NAME) >>= sMyGroup;
+ if (sMyGroup.getLength() == 0)
+ sMyGroup = m_aName;
// meine Siblings durchiterieren
Reference<XIndexAccess> xIndexAccess(getParent(), UNO_QUERY);
@@@ -172,8 -180,9 +178,9 @@@
{
Reference<XPropertySet> xMyProps;
query_interface(static_cast<XWeak*>(this), xMyProps);
- ::rtl::OUString sCurrentName;
- for (sal_Int32 i=0; i<xIndexAccess->getCount(); ++i)
- ::rtl::OUString sCurrentGroup;
- sal_Int32 nNumSiblings = xIndexAccess->getCount();
- for (sal_Int32 i=0; i<nNumSiblings; ++i)
++ ::rtl::OUString sCurrentGroup;
++ sal_Int32 nNumSiblings = xIndexAccess->getCount();
++ for (sal_Int32 i=0; i<nNumSiblings; ++i)
{
Reference<XPropertySet> xSiblingProperties(*(InterfaceRef*)xIndexAccess->getByIndex(i).getValue(), UNO_QUERY);
if (!xSiblingProperties.is())
@@@ -190,8 -199,8 +197,8 @@@
continue;
// das 'zur selben Gruppe gehoeren' wird am Namen festgemacht
- xSiblingProperties->getPropertyValue(PROPERTY_NAME) >>= sCurrentName;
- if (sCurrentName == sMyName)
- sCurrentGroup = OGroupManager::GetGroupName( xSiblingProperties );
- if (sCurrentGroup == sMyGroup)
++ sCurrentGroup = OGroupManager::GetGroupName( xSiblingProperties );
++ if (sCurrentGroup == sMyGroup)
xSiblingProperties->setPropertyValue(rPropName, rValue);
}
}
diff --cc forms/source/inc/property.hrc
index 3eddaa3,5c44b93..c3656b8
--- a/forms/source/inc/property.hrc
+++ b/forms/source/inc/property.hrc
@@@ -60,8 -60,9 +60,11 @@@ namespace fr
#define PROPERTY_ID_INPUT_REQUIRED (PROPERTY_ID_START + 19)
#define PROPERTY_ID_WRITING_MODE (PROPERTY_ID_START + 20)
#define PROPERTY_ID_CONTEXT_WRITING_MODE (PROPERTY_ID_START + 21)
-#define PROPERTY_ID_GROUP_NAME (PROPERTY_ID_START + 22)
-#define PROPERTY_ID_VERTICAL_ALIGN (PROPERTY_ID_START + 23)
+#define PROPERTY_ID_VERTICAL_ALIGN (PROPERTY_ID_START + 22)
+#define PROPERTY_ID_GRAPHIC (PROPERTY_ID_START + 23)
++#define PROPERTY_ID_GROUP_NAME (PROPERTY_ID_START + 24)
++#define PROPERTY_ID_VERTICAL_ALIGN (PROPERTY_ID_START + 25)
+ // free
// free
// free
// free
diff --cc forms/source/misc/InterfaceContainer.cxx
index d0deb50,c2616fd..62f9001
--- a/forms/source/misc/InterfaceContainer.cxx
+++ b/forms/source/misc/InterfaceContainer.cxx
@@@ -154,9 -154,16 +154,16 @@@ void OInterfaceContainer::impl_addVbEve
xProps->getPropertyValue( rtl::OUString::createFromAscii("DefaultControl" ) ) >>= sServiceName;
Reference< ooo::vba::XVBAToOOEventDescGen > xDescSupplier( m_xServiceFactory->createInstance( rtl::OUString::createFromAscii( "ooo.vba.VBAToOOEventDesc" ) ), UNO_QUERY_THROW );
- Sequence< ScriptEventDescriptor > vbaEvents = xDescSupplier->getEventDescriptions( m_xServiceFactory->createInstance( sServiceName ), sCodeName );
- Reference< XInterface > xInterface = m_xServiceFactory->createInstance( sServiceName );
- Sequence< ScriptEventDescriptor > vbaEvents = xDescSupplier->getEventDescriptions( xInterface, sCodeName );
++ Reference< XInterface > xInterface = m_xServiceFactory->createInstance( sServiceName );
++ Sequence< ScriptEventDescriptor > vbaEvents = xDescSupplier->getEventDescriptions( xInterface, sCodeName );
// register the vba script events
m_xEventAttacher->registerScriptEvents( i_nIndex, vbaEvents );
+
- Reference< XComponent > xComponent( xInterface, UNO_QUERY );
- if ( xComponent.is() )
- {
- xComponent->dispose();
- }
++ Reference< XComponent > xComponent( xInterface, UNO_QUERY );
++ if ( xComponent.is() )
++ {
++ xComponent->dispose();
++ }
}
while ( false );
}
commit b3c30660b2a2c4d93f99d0b22ae192d928a23005
Author: Noel Power <noel.power at novell.com>
Date: Wed Oct 6 10:16:13 2010 +0100
initial commit for vba blob ( not including container_control stuff )
diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx
index e307720..fe572e5 100644
--- a/basctl/source/basicide/baside3.cxx
+++ b/basctl/source/basicide/baside3.cxx
@@ -82,6 +82,7 @@
#include <com/sun/star/resource/XStringResourceResolver.hpp>
#include <com/sun/star/resource/StringResourceWithLocation.hpp>
#include <com/sun/star/task/XInteractionHandler.hpp>
+#include <com/sun/star/script/vba/XVBACompatibility.hpp>
using namespace comphelper;
using namespace ::com::sun::star;
@@ -112,8 +113,16 @@ DialogWindow::DialogWindow( Window* pParent, const ScriptDocument& rDocument, St
{
InitSettings( TRUE, TRUE, TRUE );
- pEditor = new DlgEditor();
+ 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
@@ -728,7 +737,7 @@ BOOL DialogWindow::SaveDialog()
Reference< beans::XPropertySet > xProps( ::comphelper::getProcessServiceFactory(), UNO_QUERY );
OSL_ASSERT( xProps.is() );
OSL_VERIFY( xProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext")) ) >>= xContext );
- Reference< XInputStreamProvider > xISP = ::xmlscript::exportDialogModel( xDialogModel, xContext );
+ Reference< XInputStreamProvider > xISP = ::xmlscript::exportDialogModel( xDialogModel, xContext, GetDocument().isDocument() ? GetDocument().getDocument() : Reference< frame::XModel >() );
Reference< XInputStream > xInput( xISP->createInputStream() );
Reference< XSimpleFileAccess > xSFI( xMSF->createInstance
@@ -1010,7 +1019,7 @@ BOOL implImportDialog( Window* pWin, const String& rCurPath, const ScriptDocumen
Reference< beans::XPropertySet > xProps( xMSF, UNO_QUERY );
OSL_ASSERT( xProps.is() );
OSL_VERIFY( xProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext")) ) >>= xContext );
- ::xmlscript::importDialogModel( xInput, xDialogModel, xContext );
+ ::xmlscript::importDialogModel( xInput, xDialogModel, xContext, rDocument.isDocument() ? rDocument.getDocument() : Reference< frame::XModel >() );
String aXmlDlgName;
Reference< beans::XPropertySet > xDialogModelPropSet( xDialogModel, UNO_QUERY );
@@ -1236,7 +1245,7 @@ BOOL implImportDialog( Window* pWin, const String& rCurPath, const ScriptDocumen
}
}
- Reference< XInputStreamProvider > xISP = ::xmlscript::exportDialogModel( xDialogModel, xContext );
+ Reference< XInputStreamProvider > xISP = ::xmlscript::exportDialogModel( xDialogModel, xContext, rDocument.isDocument() ? rDocument.getDocument() : Reference< frame::XModel >() );
bool bSuccess = rDocument.insertDialog( aLibName, aNewDlgName, xISP );
if( bSuccess )
{
@@ -1346,7 +1355,7 @@ void DialogWindow::StoreData()
Reference< beans::XPropertySet > xProps( ::comphelper::getProcessServiceFactory(), UNO_QUERY );
OSL_ASSERT( xProps.is() );
OSL_VERIFY( xProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext")) ) >>= xContext );
- Reference< XInputStreamProvider > xISP = ::xmlscript::exportDialogModel( xDialogModel, xContext );
+ Reference< XInputStreamProvider > xISP = ::xmlscript::exportDialogModel( xDialogModel, xContext, GetDocument().isDocument() ? GetDocument().getDocument() : Reference< frame::XModel >() );
xLib->replaceByName( ::rtl::OUString( GetName() ), makeAny( xISP ) );
}
}
diff --git a/basctl/source/basicide/basides3.cxx b/basctl/source/basicide/basides3.cxx
index 1b71e43..6ec1dcd 100644
--- a/basctl/source/basicide/basides3.cxx
+++ b/basctl/source/basicide/basides3.cxx
@@ -96,7 +96,7 @@ DialogWindow* BasicIDEShell::CreateDlgWin( const ScriptDocument& rDocument, cons
Reference< beans::XPropertySet > xProps( xMSF, UNO_QUERY );
OSL_ASSERT( xProps.is() );
OSL_VERIFY( xProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext")) ) >>= xContext );
- ::xmlscript::importDialogModel( xInput, xDialogModel, xContext );
+ ::xmlscript::importDialogModel( xInput, xDialogModel, xContext, rDocument.isDocument() ? rDocument.getDocument() : Reference< frame::XModel >() );
LocalizationMgr::setStringResourceAtDialog( rDocument, rLibName, aDlgName, xDialogModel );
// new dialog window
diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx
index e2a2377..b00acdd 100644
--- a/basctl/source/basicide/moduldlg.cxx
+++ b/basctl/source/basicide/moduldlg.cxx
@@ -312,7 +312,7 @@ void BasicIDEShell::CopyDialogResources( Reference< io::XInputStreamProvider >&
Reference< beans::XPropertySet > xProps( xMSF, UNO_QUERY );
OSL_ASSERT( xProps.is() );
OSL_VERIFY( xProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext")) ) >>= xContext );
- ::xmlscript::importDialogModel( xInput, xDialogModel, xContext );
+ ::xmlscript::importDialogModel( xInput, xDialogModel, xContext, rSourceDoc.isDocument() ? rSourceDoc.getDocument() : Reference< frame::XModel >() );
if( xDialogModel.is() )
{
@@ -329,7 +329,7 @@ void BasicIDEShell::CopyDialogResources( Reference< io::XInputStreamProvider >&
{
LocalizationMgr::setResourceIDsForDialog( xDialogModel, xDestMgr );
}
- io_xISP = ::xmlscript::exportDialogModel( xDialogModel, xContext );
+ io_xISP = ::xmlscript::exportDialogModel( xDialogModel, xContext, rDestDoc.isDocument() ? rDestDoc.getDocument() : Reference< frame::XModel >() );
}
}
diff --git a/basctl/source/basicide/scriptdocument.cxx b/basctl/source/basicide/scriptdocument.cxx
index cfbd761..14d8dc8 100644
--- a/basctl/source/basicide/scriptdocument.cxx
+++ b/basctl/source/basicide/scriptdocument.cxx
@@ -453,14 +453,12 @@ namespace basctl
bool ScriptDocument_Impl::isInVBAMode() const
{
bool bResult = false;
-#ifdef FUTURE_VBA_CWS
if ( !isApplication() )
{
Reference< XVBACompatibility > xVBACompat( getLibraryContainer( E_SCRIPTS ), UNO_QUERY );
if ( xVBACompat.is() )
bResult = xVBACompat->getVBACompatibilityMode();
}
-#endif
return bResult;
}
@@ -678,7 +676,7 @@ namespace basctl
if ( !_rxExistingDialogModel.is() )
{
Reference< XInputStream > xInput( xISP->createInputStream(), UNO_QUERY_THROW );
- ::xmlscript::importDialogModel( xInput, xDialogModel, aContext.getUNOContext() );
+ ::xmlscript::importDialogModel( xInput, xDialogModel, aContext.getUNOContext(), isDocument() ? getDocument() : Reference< XModel >() );
}
// set new name as property
@@ -686,12 +684,12 @@ namespace basctl
xDlgPSet->setPropertyValue( DLGED_PROP_NAME, makeAny( _rNewName ) );
// export dialog model
- xISP = ::xmlscript::exportDialogModel( xDialogModel, aContext.getUNOContext() );
+ xISP = ::xmlscript::exportDialogModel( xDialogModel, aContext.getUNOContext(), isDocument() ? getDocument() : Reference< XModel >() );
aElement <<= xISP;
}
// insert element by new name in container
- else if ( _eType == E_SCRIPTS )
+ if ( _eType == E_SCRIPTS )
{
Reference< XVBAModuleInfo > xVBAModuleInfo( xLib, UNO_QUERY );
if ( xVBAModuleInfo->hasModuleInfo( _rOldName ) )
@@ -798,7 +796,7 @@ namespace basctl
xDlgPSet->setPropertyValue( DLGED_PROP_NAME, makeAny( _rDialogName ) );
// export dialog model
- _out_rDialogProvider = ::xmlscript::exportDialogModel( xDialogModel, aContext.getUNOContext() );
+ _out_rDialogProvider = ::xmlscript::exportDialogModel( xDialogModel, aContext.getUNOContext(), isDocument() ? getDocument() : Reference< XModel >() );
// insert dialog into library
xLib->insertByName( _rDialogName, makeAny( _out_rDialogProvider ) );
diff --git a/basctl/source/dlged/dlged.cxx b/basctl/source/dlged/dlged.cxx
index 04bc7e5..020f934 100644
--- a/basctl/source/dlged/dlged.cxx
+++ b/basctl/source/dlged/dlged.cxx
@@ -205,7 +205,7 @@ BOOL DlgEditor::RemarkDialog()
//----------------------------------------------------------------------------
-DlgEditor::DlgEditor()
+DlgEditor::DlgEditor( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel )
:pHScroll(NULL)
,pVScroll(NULL)
,pDlgEdModel(NULL)
@@ -227,6 +227,7 @@ DlgEditor::DlgEditor()
,bCreateOK(TRUE)
,bDialogModelChanged(FALSE)
,mnPaintGuard(0)
+ ,m_xDocument( xModel )
{
pDlgEdModel = new DlgEdModel();
pDlgEdModel->GetItemPool().FreezeIdRanges();
@@ -835,7 +836,7 @@ void DlgEditor::Copy()
Reference< beans::XPropertySet > xProps( ::comphelper::getProcessServiceFactory(), UNO_QUERY );
OSL_ASSERT( xProps.is() );
OSL_VERIFY( xProps->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext")) ) >>= xContext );
- Reference< XInputStreamProvider > xISP = ::xmlscript::exportDialogModel( xClipDialogModel, xContext );
+ Reference< XInputStreamProvider > xISP = ::xmlscript::exportDialogModel( xClipDialogModel, xContext, m_xDocument );
Reference< XInputStream > xStream( xISP->createInputStream() );
Sequence< sal_Int8 > DialogModelBytes;
implCopyStreamToByteSequence( xStream, DialogModelBytes );
@@ -868,7 +869,7 @@ void DlgEditor::Copy()
uno::Reference< resource::XStringResourceManager >
xStringResourceManager( xStringResourcePersistence, uno::UNO_QUERY );
LocalizationMgr::resetResourceForDialog( xClipDialogModel, xStringResourceManager );
- Reference< XInputStreamProvider > xISP2 = ::xmlscript::exportDialogModel( xClipDialogModel, xContext );
+ Reference< XInputStreamProvider > xISP2 = ::xmlscript::exportDialogModel( xClipDialogModel, xContext, m_xDocument );
Reference< XInputStream > xStream2( xISP2->createInputStream() );
Sequence< sal_Int8 > NoResourceDialogModelBytes;
implCopyStreamToByteSequence( xStream2, NoResourceDialogModelBytes );
@@ -1014,7 +1015,7 @@ void DlgEditor::Paste()
Reference< beans::XPropertySet > xProps( xMSF, UNO_QUERY );
OSL_ASSERT( xProps.is() );
OSL_VERIFY( xProps->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext")) ) >>= xContext );
- ::xmlscript::importDialogModel( ::xmlscript::createInputStream( *((::rtl::ByteSequence*)(&DialogModelBytes)) ) , xClipDialogModel, xContext );
+ ::xmlscript::importDialogModel( ::xmlscript::createInputStream( *((::rtl::ByteSequence*)(&DialogModelBytes)) ) , xClipDialogModel, xContext, m_xDocument );
}
// get control models from clipboard dialog model
diff --git a/basctl/source/dlged/dlgedobj.cxx b/basctl/source/dlged/dlgedobj.cxx
index 50b54c6..a56985e 100644
--- a/basctl/source/dlged/dlgedobj.cxx
+++ b/basctl/source/dlged/dlgedobj.cxx
@@ -74,6 +74,22 @@ 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)
@@ -194,8 +210,9 @@ bool DlgEdObj::TransformSdrToControlCoordinates(
}
// convert pixel to logic units
- aPos = pDevice->PixelToLogic( aPos, MapMode( MAP_APPFONT ) );
- aSize = pDevice->PixelToLogic( aSize, MapMode( MAP_APPFONT ) );
+ MapMode aConvMode = lcl_getMapModeForForm( pForm );
+ aPos = pDevice->PixelToLogic( aPos, aConvMode );
+ aSize = pDevice->PixelToLogic( aSize, aConvMode );
// set out parameters
nXOut = aPos.Width();
@@ -242,10 +259,10 @@ 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, MapMode( MAP_APPFONT ) );
- aSize = pDevice->PixelToLogic( aSize, MapMode( MAP_APPFONT ) );
+ aPos = pDevice->PixelToLogic( aPos, aConvMode );
+ aSize = pDevice->PixelToLogic( aSize, aConvMode );
// set out parameters
nXOut = aPos.Width();
@@ -287,9 +304,10 @@ bool DlgEdObj::TransformControlToSdrCoordinates(
DBG_ASSERT( pDevice, "DlgEdObj::TransformControlToSdrCoordinates: missing default device!" );
if ( !pDevice )
return false;
- aPos = pDevice->LogicToPixel( aPos, MapMode( MAP_APPFONT ) );
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list