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
61ed9eac
Kaydet (Commit)
61ed9eac
authored
Nis 22, 2013
tarafından
Andre Fischer
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
122095: React asynchronously to context changes to avoid problems in SFX2.
üst
cee337cf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
13 deletions
+21
-13
SidebarController.cxx
sfx2/source/sidebar/SidebarController.cxx
+16
-12
SidebarController.hxx
sfx2/source/sidebar/SidebarController.hxx
+5
-1
No files found.
sfx2/source/sidebar/SidebarController.cxx
Dosyayı görüntüle @
61ed9eac
...
...
@@ -99,6 +99,7 @@ SidebarController::SidebarController (
maCurrentContext
(
OUString
(),
OUString
()),
msCurrentDeckId
(
A2S
(
"PropertyDeck"
)),
maPropertyChangeForwarder
(
::
boost
::
bind
(
&
SidebarController
::
BroadcastPropertyChange
,
this
)),
maContextChangeUpdate
(
::
boost
::
bind
(
&
SidebarController
::
UpdateConfigurations
,
this
)),
mbIsDeckClosed
(
false
),
mnSavedSidebarWidth
(
pParentWindow
->
GetSizePixel
().
Width
())
{
...
...
@@ -175,10 +176,14 @@ void SAL_CALL SidebarController::disposing (void)
void
SAL_CALL
SidebarController
::
notifyContextChangeEvent
(
const
css
::
ui
::
ContextChangeEventObject
&
rEvent
)
throw
(
cssu
::
RuntimeException
)
{
UpdateConfigurations
(
Context
(
rEvent
.
ApplicationName
,
rEvent
.
ContextName
));
// Update to the requested new context asynchronously to avoid
// subtle errors caused by SFX2 which in rare cases can not
// properly handle a synchronous update.
maRequestedContext
=
Context
(
rEvent
.
ApplicationName
,
rEvent
.
ContextName
);
if
(
maRequestedContext
!=
maCurrentContext
)
maContextChangeUpdate
.
RequestCall
();
}
...
...
@@ -285,17 +290,17 @@ void SidebarController::NotifyResize (void)
void
SidebarController
::
UpdateConfigurations
(
const
Context
&
rContext
)
void
SidebarController
::
UpdateConfigurations
(
void
)
{
if
(
maCurrentContext
!=
r
Context
)
if
(
maCurrentContext
!=
maRequested
Context
)
{
maCurrentContext
=
r
Context
;
maCurrentContext
=
maRequested
Context
;
// Notify the tab bar about the updated set of decks.
ResourceManager
::
IdContainer
aDeckIds
;
ResourceManager
::
Instance
().
GetMatchingDecks
(
aDeckIds
,
r
Context
,
maCurrent
Context
,
mxFrame
);
mpTabBar
->
SetDecks
(
aDeckIds
);
...
...
@@ -316,13 +321,13 @@ void SidebarController::UpdateConfigurations (const Context& rContext)
DeckDescriptor
const
*
pDeckDescriptor
=
NULL
;
if
(
!
bCurrentDeckMatches
)
pDeckDescriptor
=
ResourceManager
::
Instance
().
GetBestMatchingDeck
(
r
Context
,
mxFrame
);
pDeckDescriptor
=
ResourceManager
::
Instance
().
GetBestMatchingDeck
(
maCurrent
Context
,
mxFrame
);
else
pDeckDescriptor
=
ResourceManager
::
Instance
().
GetDeckDescriptor
(
msCurrentDeckId
);
if
(
pDeckDescriptor
!=
NULL
)
{
msCurrentDeckId
=
pDeckDescriptor
->
msId
;
SwitchToDeck
(
*
pDeckDescriptor
,
r
Context
);
SwitchToDeck
(
*
pDeckDescriptor
,
maCurrent
Context
);
// Tell the tab bar to highlight the button associated
// with the deck.
...
...
@@ -335,7 +340,7 @@ void SidebarController::UpdateConfigurations (const Context& rContext)
{
DeckTitleBar
*
pTitleBar
=
mpCurrentDeck
->
GetTitleBar
();
if
(
pTitleBar
!=
NULL
)
pTitleBar
->
SetTitle
(
msCurrentDeckTitle
+
A2S
(
" ("
)
+
r
Context
.
msContext
+
A2S
(
")"
));
pTitleBar
->
SetTitle
(
msCurrentDeckTitle
+
A2S
(
" ("
)
+
maCurrent
Context
.
msContext
+
A2S
(
")"
));
}
#endif
}
...
...
@@ -869,7 +874,6 @@ bool SidebarController::CanModifyChildWindowWidth (void) const
SfxSplitWindow
*
pSplitWindow
=
dynamic_cast
<
SfxSplitWindow
*>
(
mpParentWindow
->
GetParent
());
if
(
pSplitWindow
==
NULL
)
{
OSL_ASSERT
(
pSplitWindow
!=
NULL
);
return
0
;
}
...
...
sfx2/source/sidebar/SidebarController.hxx
Dosyayı görüntüle @
61ed9eac
...
...
@@ -111,9 +111,11 @@ private:
::
boost
::
scoped_ptr
<
TabBar
>
mpTabBar
;
cssu
::
Reference
<
css
::
frame
::
XFrame
>
mxFrame
;
Context
maCurrentContext
;
Context
maRequestedContext
;
::
rtl
::
OUString
msCurrentDeckId
;
::
rtl
::
OUString
msCurrentDeckTitle
;
AsynchronousCall
maPropertyChangeForwarder
;
AsynchronousCall
maContextChangeUpdate
;
bool
mbIsDeckClosed
;
/** Before the deck is closed the sidebar width is saved into this variable,
so that it can be restored when the deck is reopended.
...
...
@@ -122,7 +124,9 @@ private:
FocusManager
maFocusManager
;
DECL_LINK
(
WindowEventHandler
,
VclWindowEvent
*
);
void
UpdateConfigurations
(
const
Context
&
rContext
);
/** Make maRequestedContext the current context.
*/
void
UpdateConfigurations
(
void
);
bool
ArePanelSetsEqual
(
const
SharedPanelContainer
&
rCurrentPanels
,
const
ResourceManager
::
PanelContextDescriptorContainer
&
rRequestedPanels
);
...
...
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