summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-12-21 13:16:14 +0000
committerAndras Timar <andras.timar@collabora.com>2019-01-17 14:34:31 +0100
commit6de3c4450e8a3d34633ca0865f7186622f14f206 (patch)
tree463ad73a317485c0f02f6dd917342e02c4bf66bb
parente591386ef5afad1229628401b44c4fd3c78bdfd8 (diff)
Resolves: tdf#120885 Crash on choosing 'more styles'
switching to the sidebar destroys the control currently active, just post the event to happen on the next event loop Change-Id: I3e9b629821fa43d8f29e419e72f66ed46d72fdbb Reviewed-on: https://gerrit.libreoffice.org/65543 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de> (cherry picked from commit 93f26a66a4f6a13beb053edbdba9f906370bf968)
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx17
1 files changed, 12 insertions, 5 deletions
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index c5c19346ce3f..a0da3f0d05ec 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -176,6 +176,7 @@ private:
static bool AdjustFontForItemHeight(OutputDevice* pDevice, tools::Rectangle& rTextRect, long nHeight);
void SetOptimalSize();
DECL_LINK( MenuSelectHdl, Menu *, bool );
+ DECL_STATIC_LINK(SvxStyleBox_Impl, ShowMoreHdl, void*, void);
};
class SvxFontNameBox_Impl : public FontNameBox
@@ -428,6 +429,16 @@ IMPL_LINK( SvxStyleBox_Impl, MenuSelectHdl, Menu*, pMenu, bool)
return false;
}
+IMPL_STATIC_LINK_NOARG(SvxStyleBox_Impl, ShowMoreHdl, void*, void)
+{
+ SfxViewFrame* pViewFrm = SfxViewFrame::Current();
+ DBG_ASSERT( pViewFrm, "SvxStyleBox_Impl::Select(): no viewframe" );
+ if (!pViewFrm)
+ return;
+ pViewFrm->ShowChildWindow(SID_SIDEBAR);
+ ::sfx2::sidebar::Sidebar::ShowPanel("StyleListPanel", pViewFrm->GetFrame().GetFrameInterface());
+}
+
void SvxStyleBox_Impl::Select()
{
// Tell base class about selection so that AT get informed about it.
@@ -451,11 +462,7 @@ void SvxStyleBox_Impl::Select()
}
else if( aSearchEntry == aMoreKey && GetSelectedEntryPos() == ( GetEntryCount() - 1 ) )
{
- SfxViewFrame* pViewFrm = SfxViewFrame::Current();
- DBG_ASSERT( pViewFrm, "SvxStyleBox_Impl::Select(): no viewframe" );
- pViewFrm->ShowChildWindow( SID_SIDEBAR );
- ::sfx2::sidebar::Sidebar::ShowPanel("StyleListPanel",
- pViewFrm->GetFrame().GetFrameInterface());
+ Application::PostUserEvent(LINK(nullptr, SvxStyleBox_Impl, ShowMoreHdl));
//tdf#113214 change text back to previous entry
SetText(GetSavedValue());
bDoIt = false;