Kaydet (Commit) 6de3c445 authored tarafından Caolán McNamara's avatar Caolán McNamara Kaydeden (comit) Andras Timar

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: 's avatarMichael Stahl <Michael.Stahl@cib.de>
(cherry picked from commit 93f26a66)
üst e591386e
...@@ -176,6 +176,7 @@ private: ...@@ -176,6 +176,7 @@ private:
static bool AdjustFontForItemHeight(OutputDevice* pDevice, tools::Rectangle& rTextRect, long nHeight); static bool AdjustFontForItemHeight(OutputDevice* pDevice, tools::Rectangle& rTextRect, long nHeight);
void SetOptimalSize(); void SetOptimalSize();
DECL_LINK( MenuSelectHdl, Menu *, bool ); DECL_LINK( MenuSelectHdl, Menu *, bool );
DECL_STATIC_LINK(SvxStyleBox_Impl, ShowMoreHdl, void*, void);
}; };
class SvxFontNameBox_Impl : public FontNameBox class SvxFontNameBox_Impl : public FontNameBox
...@@ -428,6 +429,16 @@ IMPL_LINK( SvxStyleBox_Impl, MenuSelectHdl, Menu*, pMenu, bool) ...@@ -428,6 +429,16 @@ IMPL_LINK( SvxStyleBox_Impl, MenuSelectHdl, Menu*, pMenu, bool)
return false; 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() void SvxStyleBox_Impl::Select()
{ {
// Tell base class about selection so that AT get informed about it. // Tell base class about selection so that AT get informed about it.
...@@ -451,11 +462,7 @@ void SvxStyleBox_Impl::Select() ...@@ -451,11 +462,7 @@ void SvxStyleBox_Impl::Select()
} }
else if( aSearchEntry == aMoreKey && GetSelectedEntryPos() == ( GetEntryCount() - 1 ) ) else if( aSearchEntry == aMoreKey && GetSelectedEntryPos() == ( GetEntryCount() - 1 ) )
{ {
SfxViewFrame* pViewFrm = SfxViewFrame::Current(); Application::PostUserEvent(LINK(nullptr, SvxStyleBox_Impl, ShowMoreHdl));
DBG_ASSERT( pViewFrm, "SvxStyleBox_Impl::Select(): no viewframe" );
pViewFrm->ShowChildWindow( SID_SIDEBAR );
::sfx2::sidebar::Sidebar::ShowPanel("StyleListPanel",
pViewFrm->GetFrame().GetFrameInterface());
//tdf#113214 change text back to previous entry //tdf#113214 change text back to previous entry
SetText(GetSavedValue()); SetText(GetSavedValue());
bDoIt = false; bDoIt = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment