diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-09-28 13:06:39 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-09-28 13:07:03 +0200 |
commit | d5b87dcce119f0cd69e65873833d98ed1660f9d0 (patch) | |
tree | 8cb637f751eef1225487f7a38fefd84b22b5d44d /sw/source | |
parent | 94ed449247e2256d4163fb4a46b4be2c3f498d60 (diff) |
Return std::unique_ptr from SvTreeListBox::CreateContextMenu
Change-Id: I1e4c32099ec9741c0cab246eb627a2eb3b933e1a
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/uibase/inc/conttree.hxx | 6 | ||||
-rw-r--r-- | sw/source/uibase/utlui/content.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/utlui/glbltree.cxx | 6 |
3 files changed, 9 insertions, 7 deletions
diff --git a/sw/source/uibase/inc/conttree.hxx b/sw/source/uibase/inc/conttree.hxx index aa49b1695c69..4dd8bdca4737 100644 --- a/sw/source/uibase/inc/conttree.hxx +++ b/sw/source/uibase/inc/conttree.hxx @@ -25,6 +25,8 @@ #include "swcont.hxx" #include <map> +#include <memory> + #include <o3tl/enumarray.hxx> class SwWrtShell; @@ -142,7 +144,7 @@ protected: void GotoContent(SwContent* pCnt); static void SetInDrag(bool bSet) {bIsInDrag = bSet;} - virtual PopupMenu* CreateContextMenu() SAL_OVERRIDE; + virtual std::unique_ptr<PopupMenu> CreateContextMenu() SAL_OVERRIDE; virtual void ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry ) SAL_OVERRIDE; public: @@ -305,7 +307,7 @@ protected: static void SetShowShell(const SfxObjectShell*pSet) {pShowShell = pSet;} DECL_STATIC_LINK_TYPED(SwGlobalTree, ShowFrameHdl, void*, void); - virtual PopupMenu* CreateContextMenu() SAL_OVERRIDE; + virtual std::unique_ptr<PopupMenu> CreateContextMenu() SAL_OVERRIDE; virtual void ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry ) SAL_OVERRIDE; public: diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 195771a9d08a..80beca936417 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -1115,9 +1115,9 @@ sal_Int8 SwContentTree::ExecuteDrop( const ExecuteDropEvent& rEvt ) // Handler for Dragging and ContextMenu -PopupMenu* SwContentTree::CreateContextMenu() +std::unique_ptr<PopupMenu> SwContentTree::CreateContextMenu() { - PopupMenu* pPop = new PopupMenu; + std::unique_ptr<PopupMenu> pPop(new PopupMenu); PopupMenu* pSubPop1 = new PopupMenu; PopupMenu* pSubPop2 = new PopupMenu; PopupMenu* pSubPop3 = new PopupMenu; diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx index a92682177d3e..1cf278a958fd 100644 --- a/sw/source/uibase/utlui/glbltree.cxx +++ b/sw/source/uibase/utlui/glbltree.cxx @@ -331,14 +331,14 @@ sal_Int8 SwGlobalTree::AcceptDrop( const AcceptDropEvent& rEvt ) return nRet; } -PopupMenu* SwGlobalTree::CreateContextMenu() +std::unique_ptr<PopupMenu> SwGlobalTree::CreateContextMenu() { - PopupMenu* pPop = 0; + std::unique_ptr<PopupMenu> pPop; if(pActiveShell && !pActiveShell->GetView().GetDocShell()->IsReadOnly()) { const sal_uInt16 nEnableFlags = GetEnableFlags(); - pPop = new PopupMenu; + pPop.reset(new PopupMenu); PopupMenu* pSubPop1 = new PopupMenu; PopupMenu* pSubPop2 = new PopupMenu; |