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
90cee97b
Kaydet (Commit)
90cee97b
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: Id9828f95673d1eaf87e6a1c22bf8f07e6861f2f4
üst
503d8938
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
28 deletions
+16
-28
persistentwindowstate.hxx
framework/inc/helper/persistentwindowstate.hxx
+1
-8
persistentwindowstate.cxx
framework/source/helper/persistentwindowstate.cxx
+15
-20
No files found.
framework/inc/helper/persistentwindowstate.hxx
Dosyayı görüntüle @
90cee97b
...
@@ -20,7 +20,6 @@
...
@@ -20,7 +20,6 @@
#ifndef INCLUDED_FRAMEWORK_INC_HELPER_PERSISTENTWINDOWSTATE_HXX
#ifndef INCLUDED_FRAMEWORK_INC_HELPER_PERSISTENTWINDOWSTATE_HXX
#define INCLUDED_FRAMEWORK_INC_HELPER_PERSISTENTWINDOWSTATE_HXX
#define INCLUDED_FRAMEWORK_INC_HELPER_PERSISTENTWINDOWSTATE_HXX
#include <threadhelp/threadhelpbase.hxx>
#include <macros/xinterface.hxx>
#include <macros/xinterface.hxx>
#include <macros/xtypeprovider.hxx>
#include <macros/xtypeprovider.hxx>
#include <general.h>
#include <general.h>
...
@@ -47,19 +46,13 @@ namespace framework{
...
@@ -47,19 +46,13 @@ namespace framework{
we store its current position and size to the configuration. Every time a new component is
we store its current position and size to the configuration. Every time a new component is
attached to a frame first time(!) we restore this information again.
attached to a frame first time(!) we restore this information again.
@base ThreadHelpBase
guarantee right initialized lock member during startup of instances of this class.
@base OWeakObject
@base OWeakObject
implements ref counting for this class.
implements ref counting for this class.
@devstatus ready
@devstatus ready
@threadsafe yes
@threadsafe yes
*//*-*************************************************************************************************************/
*//*-*************************************************************************************************************/
class
PersistentWindowState
:
// baseclasses (order necessary for right initialization!)
class
PersistentWindowState
:
public
::
cppu
::
WeakImplHelper2
<
private
ThreadHelpBase
,
// interfaces
public
::
cppu
::
WeakImplHelper2
<
css
::
lang
::
XInitialization
,
css
::
lang
::
XInitialization
,
css
::
frame
::
XFrameActionListener
>
// => XEventListener
css
::
frame
::
XFrameActionListener
>
// => XEventListener
{
{
...
...
framework/source/helper/persistentwindowstate.cxx
Dosyayı görüntüle @
90cee97b
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
#include <pattern/window.hxx>
#include <pattern/window.hxx>
#include <helper/persistentwindowstate.hxx>
#include <helper/persistentwindowstate.hxx>
#include <threadhelp/guard.hxx>
#include <macros/generic.hxx>
#include <macros/generic.hxx>
#include <services.h>
#include <services.h>
...
@@ -45,8 +44,7 @@ namespace framework{
...
@@ -45,8 +44,7 @@ namespace framework{
PersistentWindowState
::
PersistentWindowState
(
const
css
::
uno
::
Reference
<
css
::
uno
::
XComponentContext
>&
xContext
)
PersistentWindowState
::
PersistentWindowState
(
const
css
::
uno
::
Reference
<
css
::
uno
::
XComponentContext
>&
xContext
)
:
ThreadHelpBase
(
&
Application
::
GetSolarMutex
())
:
m_xContext
(
xContext
)
,
m_xContext
(
xContext
)
,
m_bWindowStateAlreadySet
(
sal_False
)
,
m_bWindowStateAlreadySet
(
sal_False
)
{
{
}
}
...
@@ -76,12 +74,10 @@ void SAL_CALL PersistentWindowState::initialize(const css::uno::Sequence< css::u
...
@@ -76,12 +74,10 @@ void SAL_CALL PersistentWindowState::initialize(const css::uno::Sequence< css::u
static_cast
<
::
cppu
::
OWeakObject
*
>
(
this
),
static_cast
<
::
cppu
::
OWeakObject
*
>
(
this
),
1
);
1
);
// SAFE -> ----------------------------------
{
Guard
aWriteLock
(
m_aLock
);
SolarMutexGuard
g
;
// hold the frame as weak reference(!) so it can die everytimes :-)
m_xFrame
=
xFrame
;
m_xFrame
=
xFrame
;
}
aWriteLock
.
unlock
();
// <- SAFE ----------------------------------
// start listening
// start listening
xFrame
->
addFrameActionListener
(
this
);
xFrame
->
addFrameActionListener
(
this
);
...
@@ -91,13 +87,15 @@ void SAL_CALL PersistentWindowState::initialize(const css::uno::Sequence< css::u
...
@@ -91,13 +87,15 @@ void SAL_CALL PersistentWindowState::initialize(const css::uno::Sequence< css::u
void
SAL_CALL
PersistentWindowState
::
frameAction
(
const
css
::
frame
::
FrameActionEvent
&
aEvent
)
void
SAL_CALL
PersistentWindowState
::
frameAction
(
const
css
::
frame
::
FrameActionEvent
&
aEvent
)
throw
(
css
::
uno
::
RuntimeException
,
std
::
exception
)
throw
(
css
::
uno
::
RuntimeException
,
std
::
exception
)
{
{
// SAFE -> ----------------------------------
css
::
uno
::
Reference
<
css
::
uno
::
XComponentContext
>
xContext
;
Guard
aReadLock
(
m_aLock
);
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>
xFrame
;
css
::
uno
::
Reference
<
css
::
uno
::
XComponentContext
>
xContext
=
m_xContext
;
sal_Bool
bRestoreWindowState
;
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>
xFrame
(
m_xFrame
.
get
(),
css
::
uno
::
UNO_QUERY
);
{
sal_Bool
bRestoreWindowState
=
!
m_bWindowStateAlreadySet
;
SolarMutexGuard
g
;
aReadLock
.
unlock
();
xContext
=
m_xContext
;
// <- SAFE ----------------------------------
xFrame
.
set
(
m_xFrame
.
get
(),
css
::
uno
::
UNO_QUERY
);
bRestoreWindowState
=
!
m_bWindowStateAlreadySet
;
}
// frame already gone ? We hold it weak only ...
// frame already gone ? We hold it weak only ...
if
(
!
xFrame
.
is
())
if
(
!
xFrame
.
is
())
...
@@ -121,11 +119,8 @@ void SAL_CALL PersistentWindowState::frameAction(const css::frame::FrameActionEv
...
@@ -121,11 +119,8 @@ void SAL_CALL PersistentWindowState::frameAction(const css::frame::FrameActionEv
{
{
OUString
sWindowState
=
PersistentWindowState
::
implst_getWindowStateFromConfig
(
xContext
,
sModuleName
);
OUString
sWindowState
=
PersistentWindowState
::
implst_getWindowStateFromConfig
(
xContext
,
sModuleName
);
PersistentWindowState
::
implst_setWindowStateOnWindow
(
xWindow
,
sWindowState
);
PersistentWindowState
::
implst_setWindowStateOnWindow
(
xWindow
,
sWindowState
);
// SAFE -> ----------------------------------
SolarMutexGuard
g
;
Guard
aWriteLock
(
m_aLock
);
m_bWindowStateAlreadySet
=
sal_True
;
m_bWindowStateAlreadySet
=
sal_True
;
aWriteLock
.
unlock
();
// <- SAFE ----------------------------------
}
}
}
}
break
;
break
;
...
...
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