[Libreoffice-commits] core.git: 2 commits - sw/source

Maxim Monastirsky momonasmon at gmail.com
Thu Oct 27 22:23:23 UTC 2016


 sw/source/uibase/ribbar/workctrl.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit eb07ae8fc52378d9b59bcb6a7df8bb022b8b9cc0
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date:   Fri Oct 28 01:18:53 2016 +0300

    Don't crash under gen
    
    In gtk there is apparently GtkSalMenu which increases
    the refcount.
    
    Change-Id: I5c52c7b40d0a854e0007362a32a55f0ffed668c1

diff --git a/sw/source/uibase/ribbar/workctrl.cxx b/sw/source/uibase/ribbar/workctrl.cxx
index a03a4d7..3e51a78 100644
--- a/sw/source/uibase/ribbar/workctrl.cxx
+++ b/sw/source/uibase/ribbar/workctrl.cxx
@@ -96,7 +96,7 @@ VclPtr<SfxPopupWindow> SwTbxAutoTextCtrl::CreatePopupWindow()
                 sal_uInt16 nIndex = static_cast<sal_uInt16>(100*i);
                 // but insert without extension
                 pPopup->InsertItem( i, sTitle);
-                PopupMenu* pSub = VclPtr<PopupMenu>::Create();
+                VclPtrInstance<PopupMenu> pSub;
                 pSub->SetSelectHdl(aLnk);
                 pPopup->SetPopupMenu(i, pSub);
                 for(sal_uInt16 j = 0; j < nBlockCount; j++)
commit 03d6174919657a0e52e65d31fbc4b9a26db5d51e
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date:   Fri Oct 28 01:18:17 2016 +0300

    Reduce scope
    
    Change-Id: I06695b310d016751ec80f1aacbba8567a70088a5

diff --git a/sw/source/uibase/ribbar/workctrl.cxx b/sw/source/uibase/ribbar/workctrl.cxx
index 8007a50..a03a4d7 100644
--- a/sw/source/uibase/ribbar/workctrl.cxx
+++ b/sw/source/uibase/ribbar/workctrl.cxx
@@ -78,13 +78,13 @@ SwTbxAutoTextCtrl::~SwTbxAutoTextCtrl()
 
 VclPtr<SfxPopupWindow> SwTbxAutoTextCtrl::CreatePopupWindow()
 {
-    ScopedVclPtrInstance<PopupMenu> pPopup;
     SwView* pView = ::GetActiveView();
     if(pView && !pView->GetDocShell()->IsReadOnly() &&
        !pView->GetWrtShell().HasReadonlySel() )
     {
         Link<Menu*,bool> aLnk = LINK(this, SwTbxAutoTextCtrl, PopupHdl);
 
+        ScopedVclPtrInstance<PopupMenu> pPopup;
         SwGlossaryList* pGlossaryList = ::GetGlossaryList();
         const size_t nGroupCount = pGlossaryList->GetGroupCount();
         for(size_t i = 1; i <= nGroupCount; ++i)


More information about the Libreoffice-commits mailing list