sc/source/ui/cctrl/checklistmenu.cxx |    2 +-
 sc/source/ui/inc/checklistmenu.hxx   |   15 ++++++++++++---
 2 files changed, 13 insertions(+), 4 deletions(-)

New commits:
commit 36722b6b02f67826293946c461fb3943ec55e92b
Author: Eike Rathke <er...@redhat.com>
Date:   Thu Mar 10 22:07:54 2016 +0100

    wrap vcl::window* pointer members in VclPtr, tdf#97344 follow-up
    
    Trying to satisfy loplugin:vclwidgets
    
    sc/source/ui/inc/checklistmenu.hxx:199:28: error: OutputDevice subclass 
'ScCheckListMenuWindow *' declared as a pointer member, should be wrapped in 
VclPtr [loplugin:vclwidgets]
        ScCheckListMenuWindow* mpMenuWindow;
        ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
    sc/source/ui/inc/checklistmenu.hxx:200:21: error: OutputDevice subclass 
'ControlToPosMap' (aka 'unordered_map<vcl::Window *, size_t>') declared as a 
pointer member, should be wrapped in VclPtr [loplugin:vclwidgets]
        ControlToPosMap maControlToPos;
        ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
    sc/source/ui/inc/checklistmenu.hxx:201:31: error: OutputDevice subclass 
'std::vector<vcl::Window *>' declared as a pointer member, should be wrapped in 
VclPtr [loplugin:vclwidgets]
        std::vector<vcl::Window*> maControls;
        ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
    
    Change-Id: I47ba432fd76899681ec0afd852c71b584629eeb9

diff --git a/sc/source/ui/cctrl/checklistmenu.cxx 
b/sc/source/ui/cctrl/checklistmenu.cxx
index cbf0caa..e8a1ad3 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -916,6 +916,7 @@ ScCheckListMenuWindow::~ScCheckListMenuWindow()
 
 void ScCheckListMenuWindow::dispose()
 {
+    maTabStops.clear();
     maEdSearch.disposeAndClear();
     maChecks.disposeAndClear();
     maChkToggleAll.disposeAndClear();
@@ -923,7 +924,6 @@ void ScCheckListMenuWindow::dispose()
     maBtnUnselectSingle.disposeAndClear();
     maBtnOk.disposeAndClear();
     maBtnCancel.disposeAndClear();
-    maTabStops.clear();
     ScMenuFloatingWindow::dispose();
 }
 
diff --git a/sc/source/ui/inc/checklistmenu.hxx 
b/sc/source/ui/inc/checklistmenu.hxx
index 5f280d8..a75c299 100644
--- a/sc/source/ui/inc/checklistmenu.hxx
+++ b/sc/source/ui/inc/checklistmenu.hxx
@@ -192,13 +192,22 @@ private:
 
 class ScCheckListMenuWindow;
 
+template <class T> struct VclPtr_hash;
+template <> struct VclPtr_hash< VclPtr<vcl::Window> >
+{
+    size_t operator()( const VclPtr<vcl::Window>& r ) const
+    {
+        return reinterpret_cast<size_t>(r.get());
+    }
+};
+
 class ScTabStops
 {
 private:
-    typedef std::unordered_map<vcl::Window*, size_t> ControlToPosMap;
-    ScCheckListMenuWindow* mpMenuWindow;
+    typedef std::unordered_map< VclPtr<vcl::Window>, size_t, 
VclPtr_hash<VclPtr<vcl::Window>> > ControlToPosMap;
+    VclPtr<ScCheckListMenuWindow> mpMenuWindow;
     ControlToPosMap maControlToPos;
-    std::vector<vcl::Window*> maControls;
+    std::vector<VclPtr<vcl::Window>> maControls;
     size_t mnCurTabStop;
 public:
     ScTabStops( ScCheckListMenuWindow* mpMenuWin );
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to