summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Power <noel.power@novell.com>2010-10-13 10:51:50 +0100
committerNoel Power <noel.power@novell.com>2010-10-13 10:51:50 +0100
commit606a57481911e111dfab950cd7fb90ae80aed014 (patch)
tree62e85311b32105e6d4e165d60c9d4bbdb80c03bc /svx
parenta4d7dbf897e41a1afda6c2b6f0e5cc35920a1cf3 (diff)
parented49568618442960781b63c3a47ddc65031b2fa0 (diff)
Merge branch 'vba' fix conflics, trailing ws & tab issues
also removed some old headers ( which I need to add new ones for ) Conflicts: basic/source/classes/sbunoobj.cxx basic/source/classes/sbxmod.cxx xmloff/inc/xmlnmspe.hxx xmloff/inc/xmloff/xmltoken.hxx xmlscript/inc/xmlscript/xmldlg_imexp.hxx
Diffstat (limited to 'svx')
-rw-r--r--svx/source/form/fmscriptingenv.cxx20
-rw-r--r--svx/source/form/makefile.mk4
2 files changed, 22 insertions, 2 deletions
diff --git a/svx/source/form/fmscriptingenv.cxx b/svx/source/form/fmscriptingenv.cxx
index 74d9585087..c14d2f169f 100644
--- a/svx/source/form/fmscriptingenv.cxx
+++ b/svx/source/form/fmscriptingenv.cxx
@@ -36,6 +36,8 @@
#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
#include <com/sun/star/reflection/XInterfaceMethodTypeDescription.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
+#include <com/sun/star/lang/EventObject.hpp>
+#include <com/sun/star/awt/XControl.hpp>
/** === end UNO includes === **/
#include <tools/diagnose_ex.h>
#include <cppuhelper/implbase1.hxx>
@@ -71,6 +73,9 @@ namespace svxform
using ::com::sun::star::uno::Exception;
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::lang::EventObject;
+ using ::com::sun::star::awt::XControl;
+ using ::com::sun::star::beans::XPropertySet;
/** === end UNO using === **/
class FormScriptingEnvironment;
@@ -413,8 +418,19 @@ namespace svxform
{
Sequence< sal_Int16 > aOutArgsIndex;
Sequence< Any > aOutArgs;
-
- m_rObjectShell.CallXScript( m_sScriptCode, _rArguments, _rSynchronousResult, aOutArgsIndex, aOutArgs );
+ EventObject aEvent;
+ Any aCaller;
+ if ( ( _rArguments.getLength() > 0 ) && ( _rArguments[ 0 ] >>= aEvent ) )
+ {
+ try
+ {
+ Reference< XControl > xControl( aEvent.Source, UNO_QUERY_THROW );
+ Reference< XPropertySet > xProps( xControl->getModel(), UNO_QUERY_THROW );
+ aCaller = xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Name") ) );
+ }
+ catch( Exception& ) {}
+ }
+ m_rObjectShell.CallXScript( m_sScriptCode, _rArguments, _rSynchronousResult, aOutArgsIndex, aOutArgs, true, aCaller.hasValue() ? &aCaller : 0 );
}
//................................................................
diff --git a/svx/source/form/makefile.mk b/svx/source/form/makefile.mk
index d6dc1bd653..44bcd53d23 100644
--- a/svx/source/form/makefile.mk
+++ b/svx/source/form/makefile.mk
@@ -44,6 +44,10 @@ ENABLE_EXCEPTIONS=TRUE
CDEFS+=-DENABLE_VBA
.ENDIF
+.IF "$(ENABLE_VBA)"=="YES"
+ CDEFS+=-DENABLE_VBA
+.ENDIF
+
SRS1NAME=form
SRC1FILES= \
fmexpl.src \