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
85696df0
Kaydet (Commit)
85696df0
authored
Agu 11, 2011
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed a crash due to invalid index for Sequence.
With this, 3.81 sec -> 1.2 sec.
üst
98dc4bb8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
20 deletions
+26
-20
eventattachermgr.cxx
comphelper/source/eventattachermgr/eventattachermgr.cxx
+24
-19
eventattacher.cxx
eventattacher/source/eventattacher.cxx
+2
-1
No files found.
comphelper/source/eventattachermgr/eventattachermgr.cxx
Dosyayı görüntüle @
85696df0
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
#include <com/sun/star/reflection/XIdlMethod.hpp>
#include <com/sun/star/reflection/XIdlMethod.hpp>
#include <com/sun/star/script/XTypeConverter.hpp>
#include <com/sun/star/script/XTypeConverter.hpp>
#include <com/sun/star/script/XEngineListener.hpp>
#include <com/sun/star/script/XEngineListener.hpp>
#include <com/sun/star/script/XEventAttacher.hpp>
#include <com/sun/star/script/XEventAttacher
2
.hpp>
#include <com/sun/star/script/XEventAttacherManager.hpp>
#include <com/sun/star/script/XEventAttacherManager.hpp>
#include <com/sun/star/script/XScriptListener.hpp>
#include <com/sun/star/script/XScriptListener.hpp>
#include <cppuhelper/weak.hxx>
#include <cppuhelper/weak.hxx>
...
@@ -103,7 +103,7 @@ class ImplEventAttacherManager
...
@@ -103,7 +103,7 @@ class ImplEventAttacherManager
// Container fuer die ScriptListener
// Container fuer die ScriptListener
OInterfaceContainerHelper
aScriptListeners
;
OInterfaceContainerHelper
aScriptListeners
;
// EventAttacher-Instanz
// EventAttacher-Instanz
Reference
<
XEventAttacher
>
xAttacher
;
Reference
<
XEventAttacher
2
>
xAttacher
;
Reference
<
XMultiServiceFactory
>
mxSMgr
;
Reference
<
XMultiServiceFactory
>
mxSMgr
;
Reference
<
XIdlReflection
>
mxCoreReflection
;
Reference
<
XIdlReflection
>
mxCoreReflection
;
Reference
<
XIntrospection
>
mxIntrospection
;
Reference
<
XIntrospection
>
mxIntrospection
;
...
@@ -403,7 +403,7 @@ ImplEventAttacherManager::ImplEventAttacherManager( const Reference< XIntrospect
...
@@ -403,7 +403,7 @@ ImplEventAttacherManager::ImplEventAttacherManager( const Reference< XIntrospect
Reference
<
XInterface
>
xIFace
(
rSMgr
->
createInstance
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"com.sun.star.script.EventAttacher"
))
)
);
Reference
<
XInterface
>
xIFace
(
rSMgr
->
createInstance
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"com.sun.star.script.EventAttacher"
))
)
);
if
(
xIFace
.
is
()
)
if
(
xIFace
.
is
()
)
{
{
xAttacher
=
Reference
<
XEventAttacher
>::
query
(
xIFace
);
xAttacher
=
Reference
<
XEventAttacher
2
>::
query
(
xIFace
);
}
}
xIFace
=
rSMgr
->
createInstance
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"com.sun.star.script.Converter"
))
);
xIFace
=
rSMgr
->
createInstance
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"com.sun.star.script.Converter"
))
);
if
(
xIFace
.
is
()
)
if
(
xIFace
.
is
()
)
...
@@ -692,28 +692,33 @@ void SAL_CALL ImplEventAttacherManager::attach(sal_Int32 nIndex, const Reference
...
@@ -692,28 +692,33 @@ void SAL_CALL ImplEventAttacherManager::attach(sal_Int32 nIndex, const Reference
//::std::deque< AttachedObject_Impl >::iterator aObjIt = (*aIt).aObjList.back();
//::std::deque< AttachedObject_Impl >::iterator aObjIt = (*aIt).aObjList.back();
AttachedObject_Impl
&
rCurObj
=
aCurrentPosition
->
aObjList
.
back
();
AttachedObject_Impl
&
rCurObj
=
aCurrentPosition
->
aObjList
.
back
();
rCurObj
.
aAttachedListenerSeq
=
Sequence
<
Reference
<
XEventListener
>
>
(
aCurrentPosition
->
aEventList
.
size
()
);
rCurObj
.
aAttachedListenerSeq
=
Sequence
<
Reference
<
XEventListener
>
>
(
aCurrentPosition
->
aEventList
.
size
()
);
Reference
<
XEventListener
>
*
pArray
=
rCurObj
.
aAttachedListenerSeq
.
getArray
();
::
std
::
deque
<
ScriptEventDescriptor
>::
iterator
aEvtIt
=
aCurrentPosition
->
aEventList
.
begin
();
if
(
!
aCurrentPosition
->
aEventList
.
empty
())
::
std
::
deque
<
ScriptEventDescriptor
>::
iterator
aEvtEnd
=
aCurrentPosition
->
aEventList
.
end
();
sal_Int32
i
=
0
;
while
(
aEvtIt
!=
aEvtEnd
)
{
{
Reference
<
XAllListener
>
xAll
=
Sequence
<
com
::
sun
::
star
::
script
::
EventListener
>
aEvents
(
aCurrentPosition
->
aEventList
.
size
());
new
AttacherAllListener_Impl
(
this
,
(
*
aEvtIt
).
ScriptType
,
(
*
aEvtIt
).
ScriptCode
);
std
::
deque
<
ScriptEventDescriptor
>::
iterator
itr
=
aCurrentPosition
->
aEventList
.
begin
();
Reference
<
XEventListener
>
xAdapter
;
std
::
deque
<
ScriptEventDescriptor
>::
iterator
itrEnd
=
aCurrentPosition
->
aEventList
.
end
();
try
::
com
::
sun
::
star
::
script
::
EventListener
*
p
=
aEvents
.
getArray
();
size_t
i
=
0
;
for
(;
itr
!=
itrEnd
;
++
itr
)
{
{
xAdapter
=
xAttacher
->
attachSingleEventListener
(
rCurObj
.
xTarget
,
xAll
,
com
::
sun
::
star
::
script
::
EventListener
aListener
;
rCurObj
.
aHelper
,
(
*
aEvtIt
).
ListenerType
,
aListener
.
AllListener
=
(
*
aEvtIt
).
AddListenerParam
,
(
*
aEvtIt
).
EventMethod
);
new
AttacherAllListener_Impl
(
this
,
itr
->
ScriptType
,
itr
->
ScriptCode
);
aListener
.
Helper
=
rCurObj
.
aHelper
;
aListener
.
ListenerType
=
itr
->
ListenerType
;
aListener
.
EventMethod
=
itr
->
EventMethod
;
aListener
.
AddListenerParam
=
itr
->
AddListenerParam
;
p
[
i
++
]
=
aListener
;
}
}
catch
(
Exception
&
)
try
{
rCurObj
.
aAttachedListenerSeq
=
xAttacher
->
attachMultipleEventListeners
(
rCurObj
.
xTarget
,
aEvents
);
}
catch
(
const
Exception
&
)
{
{
}
}
pArray
[
i
++
]
=
xAdapter
;
++
aEvtIt
;
}
}
}
}
...
...
eventattacher/source/eventattacher.cxx
Dosyayı görüntüle @
85696df0
...
@@ -743,6 +743,7 @@ Sequence< Reference<XEventListener> > EventAttacherImpl::attachListeners(
...
@@ -743,6 +743,7 @@ Sequence< Reference<XEventListener> > EventAttacherImpl::attachListeners(
return
Sequence
<
Reference
<
XEventListener
>
>
();
return
Sequence
<
Reference
<
XEventListener
>
>
();
Sequence
<
Reference
<
XEventListener
>
>
aRet
(
nCount
);
Sequence
<
Reference
<
XEventListener
>
>
aRet
(
nCount
);
Reference
<
XEventListener
>*
pArray
=
aRet
.
getArray
();
for
(
sal_Int32
i
=
0
;
i
<
nCount
;
++
i
)
for
(
sal_Int32
i
=
0
;
i
<
nCount
;
++
i
)
{
{
...
@@ -846,7 +847,7 @@ Sequence< Reference<XEventListener> > EventAttacherImpl::attachListeners(
...
@@ -846,7 +847,7 @@ Sequence< Reference<XEventListener> > EventAttacherImpl::attachListeners(
// Anything else is not supported
// Anything else is not supported
}
}
}
}
aRet
[
nCount
]
=
xRet
;
pArray
[
i
]
=
xRet
;
}
}
return
aRet
;
return
aRet
;
...
...
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