diff options
-rw-r--r-- | sc/source/ui/cctrl/checklistmenu.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/inc/checklistmenu.hxx | 15 |
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 ); |