Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
00ef2d50
Kaydet (Commit)
00ef2d50
authored
Haz 17, 2009
tarafından
Andreas Bregas
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#i102261# OLE control event handler support
üst
4dc94a51
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
338 additions
and
42 deletions
+338
-42
XVBAToOOEventDescGen.idl
oovbaapi/ooo/vba/XVBAToOOEventDescGen.idl
+2
-2
build.lst
scripting/prj/build.lst
+3
-2
dlgevtatt.cxx
scripting/source/dlgprov/dlgevtatt.cxx
+21
-5
dlgevtatt.hxx
scripting/source/dlgprov/dlgevtatt.hxx
+4
-1
eventhelper.cxx
scripting/source/vbaevents/eventhelper.cxx
+0
-0
makefile.mk
scripting/source/vbaevents/makefile.mk
+60
-0
service.cxx
scripting/source/vbaevents/service.cxx
+101
-0
vbaevents.map
scripting/source/vbaevents/vbaevents.map
+9
-0
vbaevents.xml
scripting/source/vbaevents/vbaevents.xml
+26
-0
fmscriptingenv.cxx
svx/source/form/fmscriptingenv.cxx
+5
-0
fmtools.cxx
svx/source/form/fmtools.cxx
+3
-31
fmundo.cxx
svx/source/form/fmundo.cxx
+99
-0
makefile.mk
svx/source/form/makefile.mk
+4
-0
fmundo.hxx
svx/source/inc/fmundo.hxx
+1
-1
No files found.
oovbaapi/ooo/vba/XVBAToOOEventDescGen.idl
Dosyayı görüntüle @
00ef2d50
...
@@ -41,8 +41,8 @@
...
@@ -41,8 +41,8 @@
module
ooo
{
module
vba
{
module
ooo
{
module
vba
{
interface
XVBAToOOEventDescGen
:
com
::
sun
::
star
::
uno
::
XInterface
interface
XVBAToOOEventDescGen
:
com
::
sun
::
star
::
uno
::
XInterface
{
{
sequence
<
com
::
sun
::
star
::
script
::
ScriptEventDescriptor
>
getEventDescriptions
(
[
in
]
com
::
sun
::
star
::
uno
::
XInterface
xControl
,
[
in
]
string
s
LibModName
,
[
in
]
sequence
<
string
>
handlerExts
)
;
sequence
<
com
::
sun
::
star
::
script
::
ScriptEventDescriptor
>
getEventDescriptions
(
[
in
]
com
::
sun
::
star
::
uno
::
XInterface
xControl
,
[
in
]
string
s
CodeName
)
;
com
::
sun
::
star
::
script
::
XScriptEventsSupplier
getEventSupplier
(
[
in
]
com
::
sun
::
star
::
uno
::
XInterface
xControl
)
;
com
::
sun
::
star
::
script
::
XScriptEventsSupplier
getEventSupplier
(
[
in
]
com
::
sun
::
star
::
uno
::
XInterface
xControl
,
[
in
]
string
sCodeName
)
;
}
;
}
;
}
; };
}
; };
...
...
scripting/prj/build.lst
Dosyayı görüntüle @
00ef2d50
tc scripting : bridges rdbmaker vcl xmlscript basic sfx2 rhino BSH:beanshell javaunohelper NULL
tc scripting :
oovbaapi
bridges rdbmaker vcl xmlscript basic sfx2 rhino BSH:beanshell javaunohelper NULL
tc scripting usr1 - all tc1_mkout NULL
tc scripting usr1 - all tc1_mkout NULL
tc scripting\inc nmake - all tc1_inc NULL
tc scripting\inc nmake - all tc1_inc NULL
tc scripting\source\provider nmake - all tc1_scriptingprovider tc1_inc NULL
tc scripting\source\provider nmake - all tc1_scriptingprovider tc1_inc NULL
tc scripting\source\basprov nmake - all tc1_scriptingbasprov tc1_inc NULL
tc scripting\source\basprov nmake - all tc1_scriptingbasprov tc1_inc NULL
tc scripting\source\vbaevents nmake - all tc1_scriptingvbaevents tc1_inc NULL
tc scripting\source\dlgprov nmake - all tc1_scriptingdlgprov tc1_inc NULL
tc scripting\source\dlgprov nmake - all tc1_scriptingdlgprov tc1_inc NULL
tc scripting\source\stringresource nmake - all tc1_scriptingstringresource tc1_inc NULL
tc scripting\source\stringresource nmake - all tc1_scriptingstringresource tc1_inc NULL
tc scripting\source\pyprov nmake - all tc1_scriptingpyprov tc1_inc NULL
tc scripting\source\pyprov nmake - all tc1_scriptingpyprov tc1_inc NULL
...
@@ -10,4 +11,4 @@ tc scripting\source\protocolhandler nmake - all tc1_scriptingprotocolhandler t
...
@@ -10,4 +11,4 @@ tc scripting\source\protocolhandler nmake - all tc1_scriptingprotocolhandler t
tc scripting\java nmake - all tc1_scriptingjava tc1_scriptingprovider tc1_scriptingprotocolhandler NULL
tc scripting\java nmake - all tc1_scriptingjava tc1_scriptingprovider tc1_scriptingprotocolhandler NULL
tc scripting\examples\java nmake - all tc1_scriptingexamplesjava tc1_scriptingjava NULL
tc scripting\examples\java nmake - all tc1_scriptingexamplesjava tc1_scriptingjava NULL
tc scripting\examples nmake - all tc1_scriptingexamples tc1_scriptingexamplesjava tc1_inc NULL
tc scripting\examples nmake - all tc1_scriptingexamples tc1_scriptingexamplesjava tc1_inc NULL
tc scripting\util nmake - all tc1_scriptingutil tc1_scriptingprovider tc1_scriptingprotocolhandler tc1_scriptingbasprov tc1_scriptingstringresource tc1_scriptingpyprov tc1_scriptingjava tc1_scriptingexamplesjava tc1_scriptingexamples NULL
tc scripting\util nmake - all tc1_scriptingutil tc1_scriptingprovider tc1_scriptingprotocolhandler tc1_scriptingbasprov tc1_scriptingstringresource tc1_scripting
vbaevents tc1_scripting
pyprov tc1_scriptingjava tc1_scriptingexamplesjava tc1_scriptingexamples NULL
scripting/source/dlgprov/dlgevtatt.cxx
Dosyayı görüntüle @
00ef2d50
...
@@ -121,18 +121,20 @@ namespace dlgprov
...
@@ -121,18 +121,20 @@ namespace dlgprov
DialogVBAScriptListenerImpl
::
DialogVBAScriptListenerImpl
(
const
Reference
<
XComponentContext
>&
rxContext
,
const
Reference
<
awt
::
XControl
>&
rxControl
,
const
Reference
<
frame
::
XModel
>&
xModel
)
:
DialogScriptListenerImpl
(
rxContext
)
DialogVBAScriptListenerImpl
::
DialogVBAScriptListenerImpl
(
const
Reference
<
XComponentContext
>&
rxContext
,
const
Reference
<
awt
::
XControl
>&
rxControl
,
const
Reference
<
frame
::
XModel
>&
xModel
)
:
DialogScriptListenerImpl
(
rxContext
)
{
{
Reference
<
XMultiComponentFactory
>
xSMgr
(
m_xContext
->
getServiceManager
()
);
Reference
<
XMultiComponentFactory
>
xSMgr
(
m_xContext
->
getServiceManager
()
);
Sequence
<
Any
>
args
(
1
);
if
(
xSMgr
.
is
()
)
if
(
xSMgr
.
is
()
)
{
{
Sequence
<
Any
>
args
(
1
);
args
[
0
]
<<=
xModel
;
args
[
0
]
<<=
xModel
;
mxListener
=
Reference
<
XScriptListener
>
(
xSMgr
->
createInstanceWithArgumentsAndContext
(
::
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"ooo.vba.EventListener"
)
),
args
,
m_xContext
),
UNO_QUERY
);
mxListener
=
Reference
<
XScriptListener
>
(
xSMgr
->
createInstanceWithArgumentsAndContext
(
::
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"ooo.vba.EventListener"
)
),
args
,
m_xContext
),
UNO_QUERY
);
}
}
if
(
rxControl
.
is
()
)
if
(
rxControl
.
is
()
)
{
{
Reference
<
XPropertySet
>
xProps
(
rxControl
->
getModel
(),
UNO_QUERY
);
try
try
{
{
Reference
<
XPropertySet
>
xProps
(
rxControl
->
getModel
(),
UNO_QUERY_THROW
);
xProps
->
getPropertyValue
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Name"
)
)
)
>>=
msDialogCodeName
;
xProps
->
getPropertyValue
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Name"
)
)
)
>>=
msDialogCodeName
;
xProps
.
set
(
mxListener
,
UNO_QUERY_THROW
);
xProps
->
setPropertyValue
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Model"
)
),
args
[
0
]
);
}
}
catch
(
Exception
&
)
{}
catch
(
Exception
&
)
{}
}
}
...
@@ -193,7 +195,7 @@ namespace dlgprov
...
@@ -193,7 +195,7 @@ namespace dlgprov
return
it
->
second
;
return
it
->
second
;
}
}
#ifdef FAKE_VBA_EVENT_SUPPORT
#ifdef FAKE_VBA_EVENT_SUPPORT
Reference
<
XScriptEventsSupplier
>
DialogEventsAttacherImpl
::
getFakeVbaEventsSupplier
(
const
Reference
<
XControl
>&
xControl
)
Reference
<
XScriptEventsSupplier
>
DialogEventsAttacherImpl
::
getFakeVbaEventsSupplier
(
const
Reference
<
XControl
>&
xControl
,
rtl
::
OUString
&
sControlName
)
{
{
Reference
<
XScriptEventsSupplier
>
xEventsSupplier
;
Reference
<
XScriptEventsSupplier
>
xEventsSupplier
;
Reference
<
XMultiComponentFactory
>
xSMgr
(
m_xContext
->
getServiceManager
()
);
Reference
<
XMultiComponentFactory
>
xSMgr
(
m_xContext
->
getServiceManager
()
);
...
@@ -201,7 +203,7 @@ namespace dlgprov
...
@@ -201,7 +203,7 @@ namespace dlgprov
{
{
Reference
<
ooo
::
vba
::
XVBAToOOEventDescGen
>
xVBAToOOEvtDesc
(
xSMgr
->
createInstanceWithContext
(
::
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"ooo.vba.VBAToOOEventDesc"
)
),
m_xContext
),
UNO_QUERY
);
Reference
<
ooo
::
vba
::
XVBAToOOEventDescGen
>
xVBAToOOEvtDesc
(
xSMgr
->
createInstanceWithContext
(
::
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"ooo.vba.VBAToOOEventDesc"
)
),
m_xContext
),
UNO_QUERY
);
if
(
xVBAToOOEvtDesc
.
is
()
)
if
(
xVBAToOOEvtDesc
.
is
()
)
xEventsSupplier
.
set
(
xVBAToOOEvtDesc
->
getEventSupplier
(
xControl
),
UNO_QUERY
);
xEventsSupplier
.
set
(
xVBAToOOEvtDesc
->
getEventSupplier
(
xControl
,
sControlName
),
UNO_QUERY
);
}
}
return
xEventsSupplier
;
return
xEventsSupplier
;
...
@@ -324,6 +326,20 @@ namespace dlgprov
...
@@ -324,6 +326,20 @@ namespace dlgprov
// go over all objects
// go over all objects
const
Reference
<
XInterface
>*
pObjects
=
Objects
.
getConstArray
();
const
Reference
<
XInterface
>*
pObjects
=
Objects
.
getConstArray
();
sal_Int32
nObjCount
=
Objects
.
getLength
();
sal_Int32
nObjCount
=
Objects
.
getLength
();
#ifdef FAKE_VBA_EVENT_SUPPORT
Reference
<
awt
::
XControl
>
xDlgControl
(
Objects
[
nObjCount
-
1
],
uno
::
UNO_QUERY
);
// last object is the dialog
rtl
::
OUString
sDialogCodeName
;
if
(
xDlgControl
.
is
()
)
{
Reference
<
XPropertySet
>
xProps
(
xDlgControl
->
getModel
(),
UNO_QUERY
);
try
{
xProps
->
getPropertyValue
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Name"
)
)
)
>>=
sDialogCodeName
;
}
catch
(
Exception
&
){}
}
#endif
for
(
sal_Int32
i
=
0
;
i
<
nObjCount
;
++
i
)
for
(
sal_Int32
i
=
0
;
i
<
nObjCount
;
++
i
)
{
{
// We know that we have to do with instances of XControl.
// We know that we have to do with instances of XControl.
...
@@ -338,7 +354,7 @@ namespace dlgprov
...
@@ -338,7 +354,7 @@ namespace dlgprov
Reference
<
XScriptEventsSupplier
>
xEventsSupplier
(
xControlModel
,
UNO_QUERY
);
Reference
<
XScriptEventsSupplier
>
xEventsSupplier
(
xControlModel
,
UNO_QUERY
);
attachEventsToControl
(
xControl
,
xEventsSupplier
,
Helper
);
attachEventsToControl
(
xControl
,
xEventsSupplier
,
Helper
);
#ifdef FAKE_VBA_EVENT_SUPPORT
#ifdef FAKE_VBA_EVENT_SUPPORT
xEventsSupplier
.
set
(
getFakeVbaEventsSupplier
(
xControl
)
);
xEventsSupplier
.
set
(
getFakeVbaEventsSupplier
(
xControl
,
sDialogCodeName
)
);
attachEventsToControl
(
xControl
,
xEventsSupplier
,
Helper
);
attachEventsToControl
(
xControl
,
xEventsSupplier
,
Helper
);
#endif
#endif
}
}
...
...
scripting/source/dlgprov/dlgevtatt.hxx
Dosyayı görüntüle @
00ef2d50
...
@@ -46,6 +46,9 @@
...
@@ -46,6 +46,9 @@
#include <com/sun/star/script/XScriptEventsSupplier.hpp>
#include <com/sun/star/script/XScriptEventsSupplier.hpp>
#include <hash_map>
#include <hash_map>
#define FAKE_VBA_EVENT_SUPPORT 1
//.........................................................................
//.........................................................................
namespace
dlgprov
namespace
dlgprov
{
{
...
@@ -71,7 +74,7 @@ namespace dlgprov
...
@@ -71,7 +74,7 @@ namespace dlgprov
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
script
::
XEventAttacher
>
m_xEventAttacher
;
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
script
::
XEventAttacher
>
m_xEventAttacher
;
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
script
::
XScriptListener
>
getScriptListenerForKey
(
const
rtl
::
OUString
&
sScriptName
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
script
::
XScriptListener
>
getScriptListenerForKey
(
const
rtl
::
OUString
&
sScriptName
)
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
#ifdef FAKE_VBA_EVENT_SUPPORT
#ifdef FAKE_VBA_EVENT_SUPPORT
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
script
::
XScriptEventsSupplier
>
getFakeVbaEventsSupplier
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
awt
::
XControl
>&
xControl
);
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
script
::
XScriptEventsSupplier
>
getFakeVbaEventsSupplier
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
awt
::
XControl
>&
xControl
,
rtl
::
OUString
&
sCodeName
);
#endif
#endif
void
SAL_CALL
attachEventsToControl
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
awt
::
XControl
>&
xControl
,
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
script
::
XScriptEventsSupplier
>&
events
,
const
::
com
::
sun
::
star
::
uno
::
Any
&
Helper
);
void
SAL_CALL
attachEventsToControl
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
awt
::
XControl
>&
xControl
,
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
script
::
XScriptEventsSupplier
>&
events
,
const
::
com
::
sun
::
star
::
uno
::
Any
&
Helper
);
public
:
public
:
...
...
scripting/source/vbaevents/eventhelper.cxx
0 → 100755
Dosyayı görüntüle @
00ef2d50
This diff is collapsed.
Click to expand it.
scripting/source/vbaevents/makefile.mk
0 → 100755
Dosyayı görüntüle @
00ef2d50
PRJ
=
..
$/
..
PRJNAME
=
scripting
TARGET
=
vbaevents
.IF
"$(ENABLE_VBA)"
!=
"YES"
dummy
:
@echo
"not building vbaevents..."
.ENDIF
VISIBILITY_HIDDEN
=
TRUE
NO_BSYMBOLIC
=
TRUE
ENABLE_EXCEPTIONS
=
TRUE
COMP1TYPELIST
=
$(TARGET)
COMPRDB
=
$(SOLARBINDIR)$/
types.rdb
# --- Settings -----------------------------------------------------
.INCLUDE
:
settings.mk
DLLPRE
=
# ------------------------------------------------------------------
#.INCLUDE : ..$/cppumaker.mk
SLOFILES
=
\
$(SLO)$/
service.obj
\
$(SLO)$/
eventhelper.obj
SHL1TARGET
=
$(TARGET)$(DLLPOSTFIX)
.uno
SHL1IMPLIB
=
i
$(TARGET)
SHL1VERSIONMAP
=
$(TARGET)
.map
SHL1DEF
=
$(MISC)$/$(SHL1TARGET)
.def
DEF1NAME
=
$(SHL1TARGET)
SHL1STDLIBS
=
\
$(CPPUHELPERLIB)
\
$(BASICLIB)
\
$(COMPHELPERLIB)
\
$(SFXLIB)
\
$(CPPULIB)
\
$(TOOLSLIB)
\
$(SALLIB)
SHL1DEPN
=
SHL1LIBS
=
$(SLB)$/$(TARGET)
.lib
# --- Targets ------------------------------------------------------
.INCLUDE
:
target.mk
# ------------------------------------------------------------------
ALLTAR
:
\
$(MISC)$/$(TARGET).don
\
$(SLOTARGET)
$(MISC)$/$(TARGET).don
:
$(SOLARBINDIR)$/oovbaapi.rdb
+$(CPPUMAKER)
-O$(OUT)$/inc
-BUCR
$(SOLARBINDIR)$/oovbaapi.rdb
-X$(SOLARBINDIR)$/types.rdb
&&
echo
>
$@
echo
$@
scripting/source/vbaevents/service.cxx
0 → 100755
Dosyayı görüntüle @
00ef2d50
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_scripting.hxx"
#include "cppuhelper/implementationentry.hxx"
#include "com/sun/star/lang/XMultiServiceFactory.hpp"
#include "com/sun/star/registry/XRegistryKey.hpp"
// =============================================================================
// component exports
// =============================================================================
using
namespace
::
com
::
sun
::
star
;
using
namespace
::
com
::
sun
::
star
::
uno
;
namespace
evtlstner
{
// =============================================================================
// component operations
// =============================================================================
uno
::
Reference
<
XInterface
>
SAL_CALL
create
(
Reference
<
XComponentContext
>
const
&
xContext
)
SAL_THROW
(
()
);
// -----------------------------------------------------------------------------
::
rtl
::
OUString
SAL_CALL
getImplementationName
();
Sequence
<
::
rtl
::
OUString
>
SAL_CALL
getSupportedServiceNames
();
Reference
<
XInterface
>
SAL_CALL
create
(
Sequence
<
Any
>
const
&
,
Reference
<
XComponentContext
>
const
&
);
}
// end evtlstner
namespace
ooevtdescgen
{
// =============================================================================
// component operations
// =============================================================================
uno
::
Reference
<
XInterface
>
SAL_CALL
create
(
Reference
<
XComponentContext
>
const
&
xContext
)
SAL_THROW
(
()
);
// -----------------------------------------------------------------------------
::
rtl
::
OUString
SAL_CALL
getImplementationName
();
Sequence
<
::
rtl
::
OUString
>
SAL_CALL
getSupportedServiceNames
();
Reference
<
XInterface
>
SAL_CALL
create
(
Sequence
<
Any
>
const
&
,
Reference
<
XComponentContext
>
const
&
);
}
// end ooevtdescgen
// =============================================================================
const
::
cppu
::
ImplementationEntry
s_component_entries
[]
=
{
{
::
evtlstner
::
create
,
::
evtlstner
::
getImplementationName
,
::
evtlstner
::
getSupportedServiceNames
,
::
cppu
::
createSingleComponentFactory
,
0
,
0
},
{
::
ooevtdescgen
::
create
,
::
ooevtdescgen
::
getImplementationName
,
::
ooevtdescgen
::
getSupportedServiceNames
,
::
cppu
::
createSingleComponentFactory
,
0
,
0
},
{
0
,
0
,
0
,
0
,
0
,
0
}
};
extern
"C"
{
void
SAL_CALL
component_getImplementationEnvironment
(
const
sal_Char
**
ppEnvTypeName
,
uno_Environment
**
)
{
OSL_TRACE
(
"In component_getImplementationEnv"
);
*
ppEnvTypeName
=
CPPU_CURRENT_LANGUAGE_BINDING_NAME
;
}
sal_Bool
SAL_CALL
component_writeInfo
(
lang
::
XMultiServiceFactory
*
pServiceManager
,
registry
::
XRegistryKey
*
pRegistryKey
)
{
OSL_TRACE
(
"In component_writeInfo"
);
if
(
::
cppu
::
component_writeInfoHelper
(
pServiceManager
,
pRegistryKey
,
s_component_entries
)
)
return
sal_True
;
return
sal_False
;
}
void
*
SAL_CALL
component_getFactory
(
const
sal_Char
*
pImplName
,
lang
::
XMultiServiceFactory
*
pServiceManager
,
registry
::
XRegistryKey
*
pRegistryKey
)
{
OSL_TRACE
(
"In component_getFactory"
);
return
::
cppu
::
component_getFactoryHelper
(
pImplName
,
pServiceManager
,
pRegistryKey
,
s_component_entries
);
}
}
scripting/source/vbaevents/vbaevents.map
0 → 100755
Dosyayı görüntüle @
00ef2d50
OOO_1.1 {
global:
component_getImplementationEnvironment;
component_getFactory;
component_writeInfo;
local:
*;
};
scripting/source/vbaevents/vbaevents.xml
0 → 100755
Dosyayı görüntüle @
00ef2d50
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd">
<module-description
xmlns:xlink=
"http://www.w3.org/1999/xlink"
>
<module-name>
vbaevents
</module-name>
<component-description>
<author>
Noel Power
</author>
<name>
ooo.vba.EventListener
</name>
<description>
Event listener to handle ooo events and to translate them to calls to basic macros ala Button_Click etc.
</description>
<loader-name>
com.sun.star.loader.SharedLibrary
</loader-name>
<language>
c++
</language>
<status
value=
"drafts"
/>
<supported-service>
ooo.vba.EventListener
</supported-service>
<type>
com.sun.star.uno.XComponentContext
</type>
</component-description>
<project-build-dependency>
cppuhelper
</project-build-dependency>
<project-build-dependency>
cppu
</project-build-dependency>
<project-build-dependency>
sal
</project-build-dependency>
<runtime-module-dependency>
cppuhelper3$(COM)
</runtime-module-dependency>
<runtime-module-dependency>
cppu3
</runtime-module-dependency>
<runtime-module-dependency>
sal3
</runtime-module-dependency>
</module-description>
svx/source/form/fmscriptingenv.cxx
Dosyayı görüntüle @
00ef2d50
...
@@ -236,6 +236,11 @@ namespace svxform
...
@@ -236,6 +236,11 @@ namespace svxform
void
SAL_CALL
FormScriptListener
::
firing
(
const
ScriptEvent
&
_rEvent
)
throw
(
RuntimeException
)
void
SAL_CALL
FormScriptListener
::
firing
(
const
ScriptEvent
&
_rEvent
)
throw
(
RuntimeException
)
{
{
::
osl
::
ClearableMutexGuard
aGuard
(
m_aMutex
);
::
osl
::
ClearableMutexGuard
aGuard
(
m_aMutex
);
static
const
::
rtl
::
OUString
vbaInterOp
=
::
rtl
::
OUString
::
createFromAscii
(
"VBAInterop"
);
if
(
_rEvent
.
ScriptType
.
equals
(
vbaInterOp
)
)
return
;
// not handled here
if
(
impl_isDisposed_nothrow
()
)
if
(
impl_isDisposed_nothrow
()
)
return
;
return
;
...
...
svx/source/form/fmtools.cxx
Dosyayı görüntüle @
00ef2d50
...
@@ -105,6 +105,7 @@
...
@@ -105,6 +105,7 @@
#include <comphelper/uno3.hxx>
#include <comphelper/uno3.hxx>
#include <connectivity/dbexception.hxx>
#include <connectivity/dbexception.hxx>
#include <comphelper/extract.hxx>
#include <comphelper/extract.hxx>
#include <comphelper/evtmethodhelper.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <algorithm>
#include <algorithm>
...
@@ -718,36 +719,6 @@ sal_Int16 getControlTypeByObject(const Reference< ::com::sun::star::lang::XServi
...
@@ -718,36 +719,6 @@ sal_Int16 getControlTypeByObject(const Reference< ::com::sun::star::lang::XServi
}
}
return
::
rtl
::
OUString
();
return
::
rtl
::
OUString
();
}
}
//------------------------------------------------------------------------------
Sequence
<
::
rtl
::
OUString
>
getEventMethods
(
const
Type
&
type
)
{
typelib_InterfaceTypeDescription
*
pType
=
0
;
type
.
getDescription
(
(
typelib_TypeDescription
**
)
&
pType
);
if
(
!
pType
)
return
Sequence
<
::
rtl
::
OUString
>
();
Sequence
<
::
rtl
::
OUString
>
aNames
(
pType
->
nMembers
);
::
rtl
::
OUString
*
pNames
=
aNames
.
getArray
();
for
(
sal_Int32
i
=
0
;
i
<
pType
->
nMembers
;
i
++
,
++
pNames
)
{
// the decription reference
typelib_TypeDescriptionReference
*
pMemberDescriptionReference
=
pType
->
ppMembers
[
i
];
// the description for the reference
typelib_TypeDescription
*
pMemberDescription
=
NULL
;
typelib_typedescriptionreference_getDescription
(
&
pMemberDescription
,
pMemberDescriptionReference
);
if
(
pMemberDescription
)
{
typelib_InterfaceMemberTypeDescription
*
pRealMemberDescription
=
reinterpret_cast
<
typelib_InterfaceMemberTypeDescription
*>
(
pMemberDescription
);
*
pNames
=
pRealMemberDescription
->
pMemberName
;
}
}
typelib_typedescription_release
(
(
typelib_TypeDescription
*
)
pType
);
return
aNames
;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
TransferEventScripts
(
const
Reference
<
::
com
::
sun
::
star
::
awt
::
XControlModel
>&
xModel
,
const
Reference
<
::
com
::
sun
::
star
::
awt
::
XControl
>&
xControl
,
void
TransferEventScripts
(
const
Reference
<
::
com
::
sun
::
star
::
awt
::
XControlModel
>&
xModel
,
const
Reference
<
::
com
::
sun
::
star
::
awt
::
XControl
>&
xControl
,
const
Sequence
<
::
com
::
sun
::
star
::
script
::
ScriptEventDescriptor
>&
rTransferIfAvailable
)
const
Sequence
<
::
com
::
sun
::
star
::
script
::
ScriptEventDescriptor
>&
rTransferIfAvailable
)
...
@@ -821,7 +792,8 @@ void TransferEventScripts(const Reference< ::com::sun::star::awt::XControlModel>
...
@@ -821,7 +792,8 @@ void TransferEventScripts(const Reference< ::com::sun::star::awt::XControlModel>
continue
;
continue
;
// now check the methods
// now check the methods
Sequence
<
::
rtl
::
OUString
>
aMethodsNames
=
getEventMethods
(
*
pCurrentListeners
);
Sequence
<
::
rtl
::
OUString
>
aMethodsNames
=
::
comphelper
::
getEventMethodsForType
(
*
pCurrentListeners
);
const
::
rtl
::
OUString
*
pMethodsNames
=
aMethodsNames
.
getConstArray
();
const
::
rtl
::
OUString
*
pMethodsNames
=
aMethodsNames
.
getConstArray
();
for
(
k
=
0
;
k
<
aMethodsNames
.
getLength
();
++
k
,
++
pMethodsNames
)
for
(
k
=
0
;
k
<
aMethodsNames
.
getLength
();
++
k
,
++
pMethodsNames
)
{
{
...
...
svx/source/form/fmundo.cxx
Dosyayı görüntüle @
00ef2d50
...
@@ -86,6 +86,90 @@ using namespace ::com::sun::star::reflection;
...
@@ -86,6 +86,90 @@ using namespace ::com::sun::star::reflection;
using
namespace
::
com
::
sun
::
star
::
form
::
binding
;
using
namespace
::
com
::
sun
::
star
::
form
::
binding
;
using
namespace
::
svxform
;
using
namespace
::
svxform
;
#include <com/sun/star/script/XScriptListener.hdl>
#include <comphelper/processfactory.hxx>
#include <cppuhelper/implbase1.hxx>
typedef
cppu
::
WeakImplHelper1
<
XScriptListener
>
ScriptEventListener_BASE
;
class
ScriptEventListenerWrapper
:
public
ScriptEventListener_BASE
{
public
:
ScriptEventListenerWrapper
(
FmFormModel
&
_rModel
)
throw
(
RuntimeException
)
:
pModel
(
&
_rModel
)
{
Reference
<
XPropertySet
>
xProps
(
::
comphelper
::
getProcessServiceFactory
(),
UNO_QUERY
);
if
(
xProps
.
is
()
)
{
Reference
<
XComponentContext
>
xCtx
(
xProps
->
getPropertyValue
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"DefaultContext"
))),
UNO_QUERY
);
if
(
xCtx
.
is
()
)
{
Reference
<
XMultiComponentFactory
>
xMFac
(
xCtx
->
getServiceManager
(),
UNO_QUERY
);
if
(
xMFac
.
is
()
)
{
m_vbaListener
.
set
(
xMFac
->
createInstanceWithContext
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"ooo.vba.EventListener"
)
),
xCtx
),
UNO_QUERY_THROW
);
}
}
}
}
// XEventListener
virtual
void
SAL_CALL
disposing
(
const
EventObject
&
)
throw
(
RuntimeException
){}
// XScriptListener
virtual
void
SAL_CALL
firing
(
const
ScriptEvent
&
evt
)
throw
(
RuntimeException
)
{
setModel
();
if
(
m_vbaListener
.
is
()
)
{
m_vbaListener
->
firing
(
evt
);
}
}
virtual
Any
SAL_CALL
approveFiring
(
const
ScriptEvent
&
evt
)
throw
(
com
::
sun
::
star
::
reflection
::
InvocationTargetException
,
RuntimeException
)
{
setModel
();
if
(
m_vbaListener
.
is
()
)
{
return
m_vbaListener
->
approveFiring
(
evt
);
}
return
Any
();
}
private
:
void
setModel
()
{
Reference
<
XPropertySet
>
xProps
(
m_vbaListener
,
UNO_QUERY
);
if
(
xProps
.
is
()
)
{
try
{
SfxObjectShellRef
xObjSh
=
pModel
->
GetObjectShell
();
if
(
xObjSh
.
Is
()
&&
m_vbaListener
.
is
()
)
{
Any
aVal
;
aVal
<<=
xObjSh
->
GetModel
();
xProps
->
setPropertyValue
(
::
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Model"
)
),
aVal
);
}
}
catch
(
Exception
&
)
{
//swallow any errors
}
}
}
FmFormModel
*
pModel
;
Reference
<
XScriptListener
>
m_vbaListener
;
};
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// some helper structs for caching property infos
// some helper structs for caching property infos
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
...
@@ -128,6 +212,13 @@ FmXUndoEnvironment::FmXUndoEnvironment(FmFormModel& _rModel)
...
@@ -128,6 +212,13 @@ FmXUndoEnvironment::FmXUndoEnvironment(FmFormModel& _rModel)
,
m_bDisposed
(
false
)
,
m_bDisposed
(
false
)
{
{
DBG_CTOR
(
FmXUndoEnvironment
,
NULL
);
DBG_CTOR
(
FmXUndoEnvironment
,
NULL
);
try
{
m_vbaListener
=
new
ScriptEventListenerWrapper
(
_rModel
);
}
catch
(
Exception
&
)
{
}
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
...
@@ -752,9 +843,17 @@ void FmXUndoEnvironment::switchListening( const Reference< XIndexContainer >& _r
...
@@ -752,9 +843,17 @@ void FmXUndoEnvironment::switchListening( const Reference< XIndexContainer >& _r
if
(
xManager
.
is
()
)
if
(
xManager
.
is
()
)
{
{
if
(
_bStartListening
)
if
(
_bStartListening
)
{
m_pScriptingEnv
->
registerEventAttacherManager
(
xManager
);
m_pScriptingEnv
->
registerEventAttacherManager
(
xManager
);
if
(
m_vbaListener
.
is
()
)
xManager
->
addScriptListener
(
m_vbaListener
);
}
else
else
{
m_pScriptingEnv
->
revokeEventAttacherManager
(
xManager
);
m_pScriptingEnv
->
revokeEventAttacherManager
(
xManager
);
if
(
m_vbaListener
.
is
()
)
xManager
->
removeScriptListener
(
m_vbaListener
);
}
}
}
// also handle all children of this element
// also handle all children of this element
...
...
svx/source/form/makefile.mk
Dosyayı görüntüle @
00ef2d50
...
@@ -43,6 +43,10 @@ ENABLE_EXCEPTIONS=TRUE
...
@@ -43,6 +43,10 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files --------------------------------------------------------
# --- Files --------------------------------------------------------
.IF
"$(ENABLE_VBA)"
==
"YES"
CDEFS
+=
-DENABLE_VBA
.ENDIF
SRS1NAME
=
form
SRS1NAME
=
form
SRC1FILES
=
\
SRC1FILES
=
\
fmexpl.src
\
fmexpl.src
\
...
...
svx/source/inc/fmundo.hxx
Dosyayı görüntüle @
00ef2d50
...
@@ -213,7 +213,7 @@ private:
...
@@ -213,7 +213,7 @@ private:
void
switchListening
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
container
::
XIndexContainer
>&
_rxContainer
,
bool
_bStartListening
)
SAL_THROW
(());
void
switchListening
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
container
::
XIndexContainer
>&
_rxContainer
,
bool
_bStartListening
)
SAL_THROW
(());
void
switchListening
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
uno
::
XInterface
>&
_rxObject
,
bool
_bStartListening
)
SAL_THROW
(());
void
switchListening
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
uno
::
XInterface
>&
_rxObject
,
bool
_bStartListening
)
SAL_THROW
(());
::
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
script
::
XScriptListener
>
m_vbaListener
;
public
:
public
:
// Methoden zur Zuordnung von Controls zu Forms,
// Methoden zur Zuordnung von Controls zu Forms,
// werden von der Seite und der UndoUmgebung genutzt
// werden von der Seite und der UndoUmgebung genutzt
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment