[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - svx/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Dec 21 15:43:41 UTC 2018


 svx/source/tbxctrls/tbcontrl.cxx |   17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

New commits:
commit 57abe1bb3b56c754db0045a8c55c3a8d3d75803e
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Dec 21 13:16:14 2018 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Dec 21 16:43:14 2018 +0100

    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/65542
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index a379d919f268..3100fc2b567d 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -179,6 +179,7 @@ private:
     static bool     AdjustFontForItemHeight(OutputDevice* pDevice, tools::Rectangle const & rTextRect, long nHeight);
     void            SetOptimalSize();
     DECL_LINK( MenuSelectHdl, Menu *, bool );
+    DECL_STATIC_LINK(SvxStyleBox_Impl, ShowMoreHdl, void*, void);
 };
 
 class SvxFontNameBox_Impl : public FontNameBox
@@ -431,6 +432,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.
@@ -454,11 +465,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;


More information about the Libreoffice-commits mailing list