summaryrefslogtreecommitdiff
path: root/scripting
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2011-05-27 20:46:20 +0200
committerJan Holesovsky <kendy@suse.cz>2011-05-27 20:46:20 +0200
commit9df8682ced86258da76a730ecf354c788fffc1f2 (patch)
tree590af31bfe3d5cfd0d4de4812a0bd696b9415d2b /scripting
parentb41941a81473b48e895ab3a30905986b029facc4 (diff)
parenta79c69155ec42ce6817980b6c875f9b39041d2d4 (diff)
Merge remote-tracking branch 'origin/integration/dev300_m106'
Conflicts: basic/source/classes/sbunoobj.cxx basic/source/inc/runtime.hxx basic/source/runtime/step1.cxx desktop/source/deployment/dp_services.cxx drawinglayer/prj/d.lst drawinglayer/source/primitive2d/makefile.mk sfx2/source/appl/appinit.cxx sfx2/source/appl/appquit.cxx sfx2/source/inc/appdata.hxx sfx2/source/view/viewfrm.cxx svx/source/fmcomp/gridctrl.cxx vbahelper/source/vbahelper/vbahelper.cxx
Diffstat (limited to 'scripting')
-rw-r--r--scripting/source/dlgprov/dlgevtatt.cxx25
1 files changed, 11 insertions, 14 deletions
diff --git a/scripting/source/dlgprov/dlgevtatt.cxx b/scripting/source/dlgprov/dlgevtatt.cxx
index 02eb6495b464..608b437a1814 100644
--- a/scripting/source/dlgprov/dlgevtatt.cxx
+++ b/scripting/source/dlgprov/dlgevtatt.cxx
@@ -47,14 +47,13 @@
#include <com/sun/star/script/provider/XScriptProvider.hpp>
#include <com/sun/star/script/provider/XScriptProviderFactory.hpp>
#include <com/sun/star/script/provider/XScriptProviderSupplier.hpp>
+#include <com/sun/star/script/vba/XVBACompatibility.hpp>
#include <com/sun/star/lang/NoSuchMethodException.hpp>
#include <com/sun/star/reflection/XIdlMethod.hpp>
#include <com/sun/star/beans/MethodConcept.hpp>
#include <com/sun/star/beans/XMaterialHolder.hpp>
#include <ooo/vba/XVBAToOOEventDescGen.hpp>
-#include <com/sun/star/lang/XUnoTunnel.hpp>
-#include <vbahelper/vbaaccesshelper.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::awt;
@@ -178,19 +177,17 @@ namespace dlgprov
// handler for Script & ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.UNO:"))
listernersForTypes[ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.UNO")) ] = new DialogUnoScriptListenerImpl( rxContext, rxModel, rxControl, rxHandler, rxIntrospect, bProviderMode );
listernersForTypes[ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.script")) ] = new DialogSFScriptListenerImpl( rxContext, rxModel );
- // Note: in a future cws ( npower13_ObjectModule ) it will be possible
- // to determine the vba mode from the basiclibrary container, the tunnel hack
- // below can then be replaced
- SfxObjectShell* pFoundShell = NULL;
- if ( rxModel.is() )
+
+ // determine the VBA compatibility mode from the Basic library container
+ try
+ {
+ uno::Reference< beans::XPropertySet > xModelProps( rxModel, uno::UNO_QUERY_THROW );
+ uno::Reference< script::vba::XVBACompatibility > xVBACompat(
+ xModelProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BasicLibraries" ) ) ), uno::UNO_QUERY_THROW );
+ mbUseFakeVBAEvents = xVBACompat->getVBACompatibilityMode();
+ }
+ catch( uno::Exception& )
{
- uno::Reference< lang::XUnoTunnel > xObjShellTunnel( rxModel, uno::UNO_QUERY );
- if ( xObjShellTunnel.is() )
- {
- pFoundShell = reinterpret_cast<SfxObjectShell*>( xObjShellTunnel->getSomething(SfxObjectShell::getUnoTunnelId()));
- if ( pFoundShell )
- mbUseFakeVBAEvents = ooo::vba::isAlienExcelDoc( *pFoundShell ) || ooo::vba::isAlienWordDoc( *pFoundShell ) ;
- }
}
if ( mbUseFakeVBAEvents )
listernersForTypes[ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VBAInterop")) ] = new DialogVBAScriptListenerImpl( rxContext, rxControl, rxModel, sDialogLibName );