summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-09-28 13:06:39 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-09-28 13:07:03 +0200
commitd5b87dcce119f0cd69e65873833d98ed1660f9d0 (patch)
tree8cb637f751eef1225487f7a38fefd84b22b5d44d /sfx2
parent94ed449247e2256d4163fb4a46b4be2c3f498d60 (diff)
Return std::unique_ptr from SvTreeListBox::CreateContextMenu
Change-Id: I1e4c32099ec9741c0cab246eb627a2eb3b933e1a
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/dialog/templdlg.cxx8
-rw-r--r--sfx2/source/inc/templdgi.hxx10
2 files changed, 11 insertions, 7 deletions
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 251990c9b62d..992f1be9f162 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -332,7 +332,7 @@ void SfxActionListBox::Recalc()
}
}
-PopupMenu* SfxActionListBox::CreateContextMenu()
+std::unique_ptr<PopupMenu> SfxActionListBox::CreateContextMenu()
{
if( !( GetSelectionCount() > 0 ) )
@@ -421,7 +421,7 @@ void StyleTreeListBox_Impl::MakeExpanded_Impl(ExpandedEntries_t& rEntries) const
}
}
-PopupMenu* StyleTreeListBox_Impl::CreateContextMenu()
+std::unique_ptr<PopupMenu> StyleTreeListBox_Impl::CreateContextMenu()
{
return pDialog->CreateContextMenu();
}
@@ -2191,7 +2191,7 @@ void SfxCommonTemplateDialog_Impl::EnableExample_Impl(sal_uInt16 nId, bool bEnab
EnableItem(nId, bEnable);
}
-PopupMenu* SfxCommonTemplateDialog_Impl::CreateContextMenu()
+std::unique_ptr<PopupMenu> SfxCommonTemplateDialog_Impl::CreateContextMenu()
{
if ( bBindingUpdate )
{
@@ -2199,7 +2199,7 @@ PopupMenu* SfxCommonTemplateDialog_Impl::CreateContextMenu()
pBindings->Update( SID_STYLE_NEW );
bBindingUpdate = false;
}
- PopupMenu* pMenu = new PopupMenu( SfxResId( MN_CONTEXT_TEMPLDLG ) );
+ std::unique_ptr<PopupMenu> pMenu(new PopupMenu( SfxResId( MN_CONTEXT_TEMPLDLG ) ));
pMenu->SetSelectHdl( LINK( this, SfxCommonTemplateDialog_Impl, MenuSelectHdl ) );
pMenu->EnableItem( ID_EDIT, bCanEdit );
pMenu->EnableItem( ID_DELETE, bCanDel );
diff --git a/sfx2/source/inc/templdgi.hxx b/sfx2/source/inc/templdgi.hxx
index 040645165623..afa26b5be746 100644
--- a/sfx2/source/inc/templdgi.hxx
+++ b/sfx2/source/inc/templdgi.hxx
@@ -21,6 +21,10 @@
class SfxTemplateControllerItem;
+#include <sal/config.h>
+
+#include <memory>
+
#include <vcl/button.hxx>
#include <vcl/toolbox.hxx>
#include <vcl/lstbox.hxx>
@@ -137,7 +141,7 @@ public:
}
void MakeExpanded_Impl(ExpandedEntries_t& rEntries) const;
- virtual PopupMenu* CreateContextMenu() SAL_OVERRIDE;
+ virtual std::unique_ptr<PopupMenu> CreateContextMenu() SAL_OVERRIDE;
};
class SfxActionListBox : public DropListBox_Impl
@@ -146,7 +150,7 @@ protected:
public:
SfxActionListBox( SfxCommonTemplateDialog_Impl* pParent, WinBits nWinBits );
- virtual PopupMenu* CreateContextMenu() SAL_OVERRIDE;
+ virtual std::unique_ptr<PopupMenu> CreateContextMenu() SAL_OVERRIDE;
void Recalc();
};
@@ -332,7 +336,7 @@ public:
}
// normally for derivates from SvTreeListBoxes, but in this case the dialog handles context menus
- PopupMenu* CreateContextMenu();
+ std::unique_ptr<PopupMenu> CreateContextMenu();
};
class DropToolBox_Impl : public ToolBox, public DropTargetHelper