summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2016-03-10 22:07:54 +0100
committerEike Rathke <erack@redhat.com>2016-03-10 23:29:22 +0100
commit36722b6b02f67826293946c461fb3943ec55e92b (patch)
tree0d043fe6c2adcf516f4cd41325261460e4acfd01 /sc/source/ui
parentcb00ae0a82cb50c7b951d7b3c4fe69339bad16ea (diff)
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
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/cctrl/checklistmenu.cxx2
-rw-r--r--sc/source/ui/inc/checklistmenu.hxx15
2 files changed, 13 insertions, 4 deletions
diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx
index cbf0caabdb24..e8a1ad3acd6c 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 5f280d8a96ea..a75c299254ce 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 );