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
65b718da
Kaydet (Commit)
65b718da
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: I8e76a9cc9c06420fde3a1c5564410624ce5a91ec
üst
6013967b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
31 deletions
+27
-31
acceleratorconfiguration.cxx
framework/source/accelerators/acceleratorconfiguration.cxx
+0
-0
documentacceleratorconfiguration.cxx
.../source/accelerators/documentacceleratorconfiguration.cxx
+26
-29
acceleratorconfiguration.hxx
...work/source/inc/accelerators/acceleratorconfiguration.hxx
+1
-2
No files found.
framework/source/accelerators/acceleratorconfiguration.cxx
Dosyayı görüntüle @
65b718da
This diff is collapsed.
Click to expand it.
framework/source/accelerators/documentacceleratorconfiguration.cxx
Dosyayı görüntüle @
65b718da
...
@@ -25,7 +25,6 @@
...
@@ -25,7 +25,6 @@
#include <xml/acceleratorconfigurationwriter.hxx>
#include <xml/acceleratorconfigurationwriter.hxx>
#include <xml/saxnamespacefilter.hxx>
#include <xml/saxnamespacefilter.hxx>
#include <threadhelp/guard.hxx>
#include <acceleratorconst.h>
#include <acceleratorconst.h>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
...
@@ -36,6 +35,7 @@
...
@@ -36,6 +35,7 @@
#include <comphelper/sequenceashashmap.hxx>
#include <comphelper/sequenceashashmap.hxx>
#include <i18nlangtag/languagetag.hxx>
#include <i18nlangtag/languagetag.hxx>
#include <rtl/ref.hxx>
#include <rtl/ref.hxx>
#include <vcl/svapp.hxx>
using
namespace
framework
;
using
namespace
framework
;
...
@@ -115,23 +115,22 @@ DocumentAcceleratorConfiguration::DocumentAcceleratorConfiguration(
...
@@ -115,23 +115,22 @@ DocumentAcceleratorConfiguration::DocumentAcceleratorConfiguration(
const
::
com
::
sun
::
star
::
uno
::
Sequence
<
::
com
::
sun
::
star
::
uno
::
Any
>&
lArguments
)
const
::
com
::
sun
::
star
::
uno
::
Sequence
<
::
com
::
sun
::
star
::
uno
::
Any
>&
lArguments
)
:
DocumentAcceleratorConfiguration_BASE
(
xContext
)
:
DocumentAcceleratorConfiguration_BASE
(
xContext
)
{
{
Guard
aWriteLock
(
m_aLock
);
css
::
uno
::
Reference
<
css
::
embed
::
XStorage
>
xRoot
;
if
(
lArguments
.
getLength
()
==
1
&&
(
lArguments
[
0
]
>>=
xRoot
))
{
m_xDocumentRoot
=
xRoot
;
}
else
{
{
::
comphelper
::
SequenceAsHashMap
lArgs
(
lArguments
);
SolarMutexGuard
g
;
m_xDocumentRoot
=
lArgs
.
getUnpackedValueOrDefault
(
css
::
uno
::
Reference
<
css
::
embed
::
XStorage
>
xRoot
;
OUString
(
"DocumentRoot"
),
if
(
lArguments
.
getLength
()
==
1
&&
(
lArguments
[
0
]
>>=
xRoot
))
css
::
uno
::
Reference
<
css
::
embed
::
XStorage
>
());
{
m_xDocumentRoot
=
xRoot
;
}
else
{
::
comphelper
::
SequenceAsHashMap
lArgs
(
lArguments
);
m_xDocumentRoot
=
lArgs
.
getUnpackedValueOrDefault
(
OUString
(
"DocumentRoot"
),
css
::
uno
::
Reference
<
css
::
embed
::
XStorage
>
());
}
}
}
aWriteLock
.
unlock
();
impl_ts_fillCache
();
impl_ts_fillCache
();
}
}
...
@@ -147,12 +146,12 @@ void SAL_CALL DocumentAcceleratorConfiguration::setStorage(const css::uno::Refer
...
@@ -147,12 +146,12 @@ void SAL_CALL DocumentAcceleratorConfiguration::setStorage(const css::uno::Refer
{
{
// Attention! xStorage must be accepted too, if it's NULL !
// Attention! xStorage must be accepted too, if it's NULL !
// SAFE -> ----------------------------------
sal_Bool
bForgetOldStorages
;
Guard
aWriteLock
(
m_aLock
);
{
sal_Bool
bForgetOldStorages
=
m_xDocumentRoot
.
is
()
;
SolarMutexGuard
g
;
m_xDocumentRoot
=
xStorage
;
bForgetOldStorages
=
m_xDocumentRoot
.
is
()
;
aWriteLock
.
unlock
()
;
m_xDocumentRoot
=
xStorage
;
// <- SAFE ----------------------------------
}
if
(
bForgetOldStorages
)
if
(
bForgetOldStorages
)
impl_ts_clearCache
();
impl_ts_clearCache
();
...
@@ -165,20 +164,18 @@ void SAL_CALL DocumentAcceleratorConfiguration::setStorage(const css::uno::Refer
...
@@ -165,20 +164,18 @@ void SAL_CALL DocumentAcceleratorConfiguration::setStorage(const css::uno::Refer
sal_Bool
SAL_CALL
DocumentAcceleratorConfiguration
::
hasStorage
()
sal_Bool
SAL_CALL
DocumentAcceleratorConfiguration
::
hasStorage
()
throw
(
css
::
uno
::
RuntimeException
,
std
::
exception
)
throw
(
css
::
uno
::
RuntimeException
,
std
::
exception
)
{
{
// SAFE -> ----------------------------------
SolarMutexGuard
g
;
Guard
aReadLock
(
m_aLock
);
return
m_xDocumentRoot
.
is
();
return
m_xDocumentRoot
.
is
();
// <- SAFE ----------------------------------
}
}
void
DocumentAcceleratorConfiguration
::
impl_ts_fillCache
()
void
DocumentAcceleratorConfiguration
::
impl_ts_fillCache
()
{
{
// SAFE -> ----------------------------------
css
::
uno
::
Reference
<
css
::
embed
::
XStorage
>
xDocumentRoot
;
Guard
aReadLock
(
m_aLock
);
{
css
::
uno
::
Reference
<
css
::
embed
::
XStorage
>
xDocumentRoot
=
m_xDocumentRoot
;
SolarMutexGuard
g
;
aReadLock
.
unlock
()
;
xDocumentRoot
=
m_xDocumentRoot
;
// <- SAFE ----------------------------------
}
// Sometimes we must live without a document root.
// Sometimes we must live without a document root.
// E.g. if the document is readonly ...
// E.g. if the document is readonly ...
...
...
framework/source/inc/accelerators/acceleratorconfiguration.hxx
Dosyayı görüntüle @
65b718da
...
@@ -69,8 +69,7 @@ typedef PresetHandler AcceleratorPresets;
...
@@ -69,8 +69,7 @@ typedef PresetHandler AcceleratorPresets;
/**
/**
implements a read/write access to the accelerator configuration.
implements a read/write access to the accelerator configuration.
*/
*/
class
XMLBasedAcceleratorConfiguration
:
protected
ThreadHelpBase
,
// attention! Must be the first base class to guarentee right initialize lock ...
class
XMLBasedAcceleratorConfiguration
:
public
IStorageListener
,
public
IStorageListener
,
public
::
cppu
::
WeakImplHelper2
<
public
::
cppu
::
WeakImplHelper2
<
css
::
form
::
XReset
,
// TODO use XPresetHandler instead if available
css
::
form
::
XReset
,
// TODO use XPresetHandler instead if available
css
::
ui
::
XAcceleratorConfiguration
>
// => css::ui::XUIConfigurationPersistence
css
::
ui
::
XAcceleratorConfiguration
>
// => css::ui::XUIConfigurationPersistence
...
...
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