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
35c495fd
Kaydet (Commit)
35c495fd
authored
Mar 20, 2014
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use an osl::Mutex directly
Change-Id: I4db0fa34e00364e38ae015d079fee551be7319b3
üst
7f0a6e26
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
20 deletions
+10
-20
dispatchhelper.hxx
framework/inc/services/dispatchhelper.hxx
+3
-3
dispatchhelper.cxx
framework/source/services/dispatchhelper.cxx
+7
-17
No files found.
framework/inc/services/dispatchhelper.hxx
Dosyayı görüntüle @
35c495fd
...
...
@@ -20,7 +20,6 @@
#ifndef INCLUDED_FRAMEWORK_INC_SERVICES_DISPATCHHELPER_HXX
#define INCLUDED_FRAMEWORK_INC_SERVICES_DISPATCHHELPER_HXX
#include <threadhelp/threadhelpbase.hxx>
#include <macros/generic.hxx>
#include <macros/xinterface.hxx>
#include <macros/xtypeprovider.hxx>
...
...
@@ -46,8 +45,7 @@ namespace framework{
All these steps are done inside one method call here.
*/
class
DispatchHelper
:
public
ThreadHelpBase
// must be the first base class!
,
public
::
cppu
::
WeakImplHelper3
<
::
com
::
sun
::
star
::
lang
::
XServiceInfo
,
::
com
::
sun
::
star
::
frame
::
XDispatchHelper
,
::
com
::
sun
::
star
::
frame
::
XDispatchResultListener
>
class
DispatchHelper
:
public
::
cppu
::
WeakImplHelper3
<
::
com
::
sun
::
star
::
lang
::
XServiceInfo
,
::
com
::
sun
::
star
::
frame
::
XDispatchHelper
,
::
com
::
sun
::
star
::
frame
::
XDispatchResultListener
>
{
...
...
@@ -55,6 +53,8 @@ class DispatchHelper : public ThreadHelpBase // must be the
private
:
osl
::
Mutex
m_mutex
;
/** global uno service manager.
Can be used to create own needed services. */
css
::
uno
::
Reference
<
css
::
uno
::
XComponentContext
>
m_xContext
;
...
...
framework/source/services/dispatchhelper.cxx
Dosyayı görüntüle @
35c495fd
...
...
@@ -46,9 +46,7 @@ DEFINE_INIT_SERVICE( DispatchHelper, {} )
@param xSMGR the global uno service manager, which can be used to create own needed services.
*/
DispatchHelper
::
DispatchHelper
(
const
css
::
uno
::
Reference
<
css
::
uno
::
XComponentContext
>&
xContext
)
:
ThreadHelpBase
(
)
// Init member
,
m_xContext
(
xContext
)
:
m_xContext
(
xContext
)
{
}
...
...
@@ -102,9 +100,9 @@ css::uno::Any SAL_CALL DispatchHelper::executeDispatch(
// parse given URL
/* SAFE { */
Guard
aReadLock
(
m_aLock
);
osl
::
ClearableMutexGuard
aReadLock
(
m_mutex
);
css
::
uno
::
Reference
<
css
::
util
::
XURLTransformer
>
xParser
=
css
::
util
::
URLTransformer
::
create
(
m_xContext
);
aReadLock
.
unlock
();
aReadLock
.
clear
();
/* } SAFE */
css
::
util
::
URL
aURL
;
...
...
@@ -129,11 +127,11 @@ css::uno::Any SAL_CALL DispatchHelper::executeDispatch(
// Here we can hope for a result ... instead of the normal dispatch.
css
::
uno
::
Reference
<
css
::
frame
::
XDispatchResultListener
>
xListener
(
xTHIS
,
css
::
uno
::
UNO_QUERY
);
/* SAFE { */
Guard
aWriteLock
(
m_aLock
);
osl
::
ClearableMutexGuard
aWriteLock
(
m_mutex
);
m_xBroadcaster
=
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
(
xNotifyDispatch
,
css
::
uno
::
UNO_QUERY
);
m_aResult
=
css
::
uno
::
Any
();
m_aBlock
.
reset
();
aWriteLock
.
unlock
();
aWriteLock
.
clear
();
/* } SAFE */
// dispatch it and wait for a notification
...
...
@@ -164,14 +162,10 @@ css::uno::Any SAL_CALL DispatchHelper::executeDispatch(
void
SAL_CALL
DispatchHelper
::
dispatchFinished
(
const
css
::
frame
::
DispatchResultEvent
&
aResult
)
throw
(
css
::
uno
::
RuntimeException
,
std
::
exception
)
{
/* SAFE { */
Guard
aWriteLock
(
m_aLock
);
osl
::
MutexGuard
g
(
m_mutex
);
m_aResult
<<=
aResult
;
m_aBlock
.
set
();
m_xBroadcaster
.
clear
();
/* } SAFE */
}
...
...
@@ -184,14 +178,10 @@ void SAL_CALL DispatchHelper::dispatchFinished( const css::frame::DispatchResult
void
SAL_CALL
DispatchHelper
::
disposing
(
const
css
::
lang
::
EventObject
&
)
throw
(
css
::
uno
::
RuntimeException
,
std
::
exception
)
{
/* SAFE { */
Guard
aWriteLock
(
m_aLock
);
osl
::
MutexGuard
g
(
m_mutex
);
m_aResult
.
clear
();
m_aBlock
.
set
();
m_xBroadcaster
.
clear
();
/* } SAFE */
}
}
...
...
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