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
43ed93b2
Kaydet (Commit)
43ed93b2
authored
Mar 18, 2014
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use SolarMutexGuard directly
Change-Id: Ia8c994a86f1693dd1f06b2f1183f392e0ba4bdd2
üst
445ec65a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
19 deletions
+12
-19
interceptionhelper.hxx
framework/inc/dispatch/interceptionhelper.hxx
+1
-4
interceptionhelper.cxx
framework/source/dispatch/interceptionhelper.cxx
+11
-15
No files found.
framework/inc/dispatch/interceptionhelper.hxx
Dosyayı görüntüle @
43ed93b2
...
@@ -20,7 +20,6 @@
...
@@ -20,7 +20,6 @@
#ifndef INCLUDED_FRAMEWORK_INC_DISPATCH_INTERCEPTIONHELPER_HXX
#ifndef INCLUDED_FRAMEWORK_INC_DISPATCH_INTERCEPTIONHELPER_HXX
#define INCLUDED_FRAMEWORK_INC_DISPATCH_INTERCEPTIONHELPER_HXX
#define INCLUDED_FRAMEWORK_INC_DISPATCH_INTERCEPTIONHELPER_HXX
#include <threadhelp/threadhelpbase.hxx>
#include <macros/xinterface.hxx>
#include <macros/xinterface.hxx>
#include <macros/generic.hxx>
#include <macros/generic.hxx>
#include <general.h>
#include <general.h>
...
@@ -48,9 +47,7 @@ namespace framework{
...
@@ -48,9 +47,7 @@ namespace framework{
@attention Don't use this class as direct member - use it dynamicly. Do not derive from this class.
@attention Don't use this class as direct member - use it dynamicly. Do not derive from this class.
We hold a weakreference to ouer owner not to ouer superclass.
We hold a weakreference to ouer owner not to ouer superclass.
*/
*/
class
InterceptionHelper
:
// order of base classes is important for right initialization of mutex member!
class
InterceptionHelper
:
public
::
cppu
::
WeakImplHelper3
<
private
ThreadHelpBase
,
public
::
cppu
::
WeakImplHelper3
<
css
::
frame
::
XDispatchProvider
,
css
::
frame
::
XDispatchProvider
,
css
::
frame
::
XDispatchProviderInterception
,
css
::
frame
::
XDispatchProviderInterception
,
css
::
lang
::
XEventListener
>
css
::
lang
::
XEventListener
>
...
...
framework/source/dispatch/interceptionhelper.cxx
Dosyayı görüntüle @
43ed93b2
...
@@ -18,7 +18,6 @@
...
@@ -18,7 +18,6 @@
*/
*/
#include <dispatch/interceptionhelper.hxx>
#include <dispatch/interceptionhelper.hxx>
#include <threadhelp/guard.hxx>
#include <com/sun/star/frame/XInterceptorInfo.hpp>
#include <com/sun/star/frame/XInterceptorInfo.hpp>
...
@@ -34,10 +33,7 @@ sal_Bool InterceptionHelper::m_bPreferrFirstInterceptor = sal_True;
...
@@ -34,10 +33,7 @@ sal_Bool InterceptionHelper::m_bPreferrFirstInterceptor = sal_True;
InterceptionHelper
::
InterceptionHelper
(
const
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>&
xOwner
,
InterceptionHelper
::
InterceptionHelper
(
const
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>&
xOwner
,
const
css
::
uno
::
Reference
<
css
::
frame
::
XDispatchProvider
>&
xSlave
)
const
css
::
uno
::
Reference
<
css
::
frame
::
XDispatchProvider
>&
xSlave
)
// Init baseclasses first
:
m_xOwnerWeak
(
xOwner
)
:
ThreadHelpBase
(
&
Application
::
GetSolarMutex
())
// Init member
,
m_xOwnerWeak
(
xOwner
)
,
m_xSlave
(
xSlave
)
,
m_xSlave
(
xSlave
)
{
{
}
}
...
@@ -52,7 +48,7 @@ css::uno::Reference< css::frame::XDispatch > SAL_CALL InterceptionHelper::queryD
...
@@ -52,7 +48,7 @@ css::uno::Reference< css::frame::XDispatch > SAL_CALL InterceptionHelper::queryD
throw
(
css
::
uno
::
RuntimeException
,
std
::
exception
)
throw
(
css
::
uno
::
RuntimeException
,
std
::
exception
)
{
{
// SAFE {
// SAFE {
Guard
aReadLock
(
m_aLock
)
;
SolarMutexClearableGuard
aReadLock
;
// a) first search an interceptor, which match to this URL by it's URL pattern registration
// a) first search an interceptor, which match to this URL by it's URL pattern registration
// Note: if it return NULL - it does not mean an empty interceptor list automaticly!
// Note: if it return NULL - it does not mean an empty interceptor list automaticly!
...
@@ -78,7 +74,7 @@ css::uno::Reference< css::frame::XDispatch > SAL_CALL InterceptionHelper::queryD
...
@@ -78,7 +74,7 @@ css::uno::Reference< css::frame::XDispatch > SAL_CALL InterceptionHelper::queryD
if
(
!
xInterceptor
.
is
()
&&
m_xSlave
.
is
())
if
(
!
xInterceptor
.
is
()
&&
m_xSlave
.
is
())
xInterceptor
=
m_xSlave
;
xInterceptor
=
m_xSlave
;
aReadLock
.
unlock
();
aReadLock
.
clear
();
// } SAFE
// } SAFE
css
::
uno
::
Reference
<
css
::
frame
::
XDispatch
>
xReturn
;
css
::
uno
::
Reference
<
css
::
frame
::
XDispatch
>
xReturn
;
...
@@ -125,7 +121,7 @@ void SAL_CALL InterceptionHelper::registerDispatchProviderInterceptor(const css:
...
@@ -125,7 +121,7 @@ void SAL_CALL InterceptionHelper::registerDispatchProviderInterceptor(const css:
}
}
// SAFE {
// SAFE {
Guard
aWriteLock
(
m_aLock
)
;
SolarMutexClearableGuard
aWriteLock
;
// a) no interceptor at all - set this instance as master for given interceptor
// a) no interceptor at all - set this instance as master for given interceptor
// and set our slave as it's slave - and put this interceptor to the list.
// and set our slave as it's slave - and put this interceptor to the list.
...
@@ -172,7 +168,7 @@ void SAL_CALL InterceptionHelper::registerDispatchProviderInterceptor(const css:
...
@@ -172,7 +168,7 @@ void SAL_CALL InterceptionHelper::registerDispatchProviderInterceptor(const css:
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>
xOwner
(
m_xOwnerWeak
.
get
(),
css
::
uno
::
UNO_QUERY
);
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>
xOwner
(
m_xOwnerWeak
.
get
(),
css
::
uno
::
UNO_QUERY
);
aWriteLock
.
unlock
();
aWriteLock
.
clear
();
// } SAFE
// } SAFE
// Don't forget to send a frame action event "context changed".
// Don't forget to send a frame action event "context changed".
...
@@ -190,7 +186,7 @@ void SAL_CALL InterceptionHelper::releaseDispatchProviderInterceptor(const css::
...
@@ -190,7 +186,7 @@ void SAL_CALL InterceptionHelper::releaseDispatchProviderInterceptor(const css::
throw
css
::
uno
::
RuntimeException
(
"NULL references not allowed as in parameter"
,
xThis
);
throw
css
::
uno
::
RuntimeException
(
"NULL references not allowed as in parameter"
,
xThis
);
// SAFE {
// SAFE {
Guard
aWriteLock
(
m_aLock
)
;
SolarMutexClearableGuard
aWriteLock
;
// search this interceptor ...
// search this interceptor ...
// If it could be located inside cache -
// If it could be located inside cache -
...
@@ -219,7 +215,7 @@ void SAL_CALL InterceptionHelper::releaseDispatchProviderInterceptor(const css::
...
@@ -219,7 +215,7 @@ void SAL_CALL InterceptionHelper::releaseDispatchProviderInterceptor(const css::
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>
xOwner
(
m_xOwnerWeak
.
get
(),
css
::
uno
::
UNO_QUERY
);
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>
xOwner
(
m_xOwnerWeak
.
get
(),
css
::
uno
::
UNO_QUERY
);
aWriteLock
.
unlock
();
aWriteLock
.
clear
();
// } SAFE
// } SAFE
// Don't forget to send a frame action event "context changed".
// Don't forget to send a frame action event "context changed".
...
@@ -234,7 +230,7 @@ void SAL_CALL InterceptionHelper::disposing(const css::lang::EventObject& aEvent
...
@@ -234,7 +230,7 @@ void SAL_CALL InterceptionHelper::disposing(const css::lang::EventObject& aEvent
{
{
#ifdef FORCE_DESTRUCTION_OF_INTERCEPTION_CHAIN
#ifdef FORCE_DESTRUCTION_OF_INTERCEPTION_CHAIN
// SAFE ->
// SAFE ->
Guard
aReadLock
(
m_aLock
)
;
SolarMutexResettableGuard
aReadLock
;
// check calli ... we accept such disposing call's only from our onwer frame.
// check calli ... we accept such disposing call's only from our onwer frame.
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>
xOwner
(
m_xOwnerWeak
.
get
(),
css
::
uno
::
UNO_QUERY
);
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>
xOwner
(
m_xOwnerWeak
.
get
(),
css
::
uno
::
UNO_QUERY
);
...
@@ -250,7 +246,7 @@ void SAL_CALL InterceptionHelper::disposing(const css::lang::EventObject& aEvent
...
@@ -250,7 +246,7 @@ void SAL_CALL InterceptionHelper::disposing(const css::lang::EventObject& aEvent
// Because this vetor will be influenced by every deregistered interceptor.
// Because this vetor will be influenced by every deregistered interceptor.
InterceptionHelper
::
InterceptorList
aCopy
=
m_lInterceptionRegs
;
InterceptionHelper
::
InterceptorList
aCopy
=
m_lInterceptionRegs
;
aReadLock
.
unlock
();
aReadLock
.
clear
();
// <- SAFE
// <- SAFE
InterceptionHelper
::
InterceptorList
::
iterator
pIt
;
InterceptionHelper
::
InterceptorList
::
iterator
pIt
;
...
@@ -271,10 +267,10 @@ void SAL_CALL InterceptionHelper::disposing(const css::lang::EventObject& aEvent
...
@@ -271,10 +267,10 @@ void SAL_CALL InterceptionHelper::disposing(const css::lang::EventObject& aEvent
#if OSL_DEBUG_LEVEL > 0
#if OSL_DEBUG_LEVEL > 0
// SAFE ->
// SAFE ->
aReadLock
.
lock
();
aReadLock
.
reset
();
if
(
!
m_lInterceptionRegs
.
empty
()
)
if
(
!
m_lInterceptionRegs
.
empty
()
)
OSL_FAIL
(
"There are some pending interceptor objects, which seems to be registered during (!) the destruction of a frame."
);
OSL_FAIL
(
"There are some pending interceptor objects, which seems to be registered during (!) the destruction of a frame."
);
aReadLock
.
unlock
();
aReadLock
.
clear
();
// <- SAFE
// <- SAFE
#endif // ODL_DEBUG_LEVEL>0
#endif // ODL_DEBUG_LEVEL>0
...
...
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