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
3d07d18a
Kaydet (Commit)
3d07d18a
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: I49b88214bca33add9f9ea3d81870d54e40c5255b
üst
3f1d1539
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
12 deletions
+9
-12
windowcommanddispatch.cxx
framework/source/dispatch/windowcommanddispatch.cxx
+7
-9
windowcommanddispatch.hxx
framework/source/inc/dispatch/windowcommanddispatch.hxx
+2
-3
No files found.
framework/source/dispatch/windowcommanddispatch.cxx
Dosyayı görüntüle @
3d07d18a
...
...
@@ -18,7 +18,6 @@
*/
#include <dispatch/windowcommanddispatch.hxx>
#include <threadhelp/guard.hxx>
#include <targets.h>
#include <services.h>
...
...
@@ -40,8 +39,7 @@ namespace framework{
WindowCommandDispatch
::
WindowCommandDispatch
(
const
css
::
uno
::
Reference
<
css
::
uno
::
XComponentContext
>&
xContext
,
const
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>&
xFrame
)
:
ThreadHelpBase
(
)
,
m_xContext
(
xContext
)
:
m_xContext
(
xContext
)
,
m_xFrame
(
xFrame
)
,
m_xWindow
(
xFrame
->
getContainerWindow
())
{
...
...
@@ -58,9 +56,9 @@ WindowCommandDispatch::~WindowCommandDispatch()
void
WindowCommandDispatch
::
impl_startListening
()
{
Guard
aReadLock
(
m_aLock
);
osl
::
ClearableMutexGuard
aReadLock
(
m_mutex
);
css
::
uno
::
Reference
<
css
::
awt
::
XWindow
>
xWindow
(
m_xWindow
.
get
(),
css
::
uno
::
UNO_QUERY
);
aReadLock
.
unlock
();
aReadLock
.
clear
();
if
(
!
xWindow
.
is
())
return
;
...
...
@@ -78,9 +76,9 @@ void WindowCommandDispatch::impl_startListening()
void
WindowCommandDispatch
::
impl_stopListening
()
{
Guard
aReadLock
(
m_aLock
);
osl
::
ClearableMutexGuard
aReadLock
(
m_mutex
);
css
::
uno
::
Reference
<
css
::
awt
::
XWindow
>
xWindow
(
m_xWindow
.
get
(),
css
::
uno
::
UNO_QUERY
);
aReadLock
.
unlock
();
aReadLock
.
clear
();
if
(
!
xWindow
.
is
())
return
;
...
...
@@ -152,10 +150,10 @@ void WindowCommandDispatch::impl_dispatchCommand(const OUString& sCommand)
try
{
// SYNCHRONIZED ->
Guard
aReadLock
(
m_aLock
);
osl
::
ClearableMutexGuard
aReadLock
(
m_mutex
);
css
::
uno
::
Reference
<
css
::
frame
::
XDispatchProvider
>
xProvider
(
m_xFrame
.
get
(),
css
::
uno
::
UNO_QUERY_THROW
);
css
::
uno
::
Reference
<
css
::
uno
::
XComponentContext
>
xContext
=
m_xContext
;
aReadLock
.
unlock
();
aReadLock
.
clear
();
// <- SYNCHRONIZED
// check provider ... we know it's weak reference only
...
...
framework/source/inc/dispatch/windowcommanddispatch.hxx
Dosyayı görüntüle @
3d07d18a
...
...
@@ -20,8 +20,6 @@
#ifndef INCLUDED_FRAMEWORK_SOURCE_INC_DISPATCH_WINDOWCOMMANDDISPATCH_HXX
#define INCLUDED_FRAMEWORK_SOURCE_INC_DISPATCH_WINDOWCOMMANDDISPATCH_HXX
#include <threadhelp/threadhelpbase.hxx>
#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/lang/XEventListener.hpp>
...
...
@@ -47,9 +45,10 @@ namespace framework{
scenarios. On the other side VCL does not hold us alive (because it doesn't know our UNO reference).
So we register at the VCL level as an event listener and
*/
class
WindowCommandDispatch
:
private
ThreadHelpBase
class
WindowCommandDispatch
{
private
:
osl
::
Mutex
m_mutex
;
/// can be used to create own needed services on demand.
css
::
uno
::
Reference
<
css
::
uno
::
XComponentContext
>
m_xContext
;
...
...
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