summaryrefslogtreecommitdiff
path: root/svx
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 /svx
parent94ed449247e2256d4163fb4a46b4be2c3f498d60 (diff)
Return std::unique_ptr from SvTreeListBox::CreateContextMenu
Change-Id: I1e4c32099ec9741c0cab246eb627a2eb3b933e1a
Diffstat (limited to 'svx')
-rw-r--r--svx/source/form/datanavi.cxx10
-rw-r--r--svx/source/inc/datanavi.hxx4
2 files changed, 10 insertions, 4 deletions
diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx
index 1ad38717937d..a49e23b1dcf2 100644
--- a/svx/source/form/datanavi.cxx
+++ b/svx/source/form/datanavi.cxx
@@ -17,6 +17,9 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <memory>
#include <sal/macros.h>
#include "datanavi.hxx"
@@ -217,9 +220,10 @@ namespace svxform
pTransferable->StartDrag( this, DND_ACTION_COPY );
}
- PopupMenu* DataTreeListBox::CreateContextMenu()
+ std::unique_ptr<PopupMenu> DataTreeListBox::CreateContextMenu()
{
- PopupMenu* pMenu = new PopupMenu( SVX_RES( RID_MENU_DATANAVIGATOR ) );
+ std::unique_ptr<PopupMenu> pMenu(
+ new PopupMenu( SVX_RES( RID_MENU_DATANAVIGATOR ) ));
if ( DGTInstance == m_eGroup )
pMenu->RemoveItem( pMenu->GetItemPos( m_nAddId ) );
else
@@ -240,7 +244,7 @@ namespace svxform
pMenu->SetItemText( m_nRemoveId, SVX_RESSTR( RID_STR_DATANAV_REMOVE_BINDING ) );
}
}
- m_pXFormsPage->EnableMenuItems( pMenu );
+ m_pXFormsPage->EnableMenuItems( pMenu.get() );
return pMenu;
}
diff --git a/svx/source/inc/datanavi.hxx b/svx/source/inc/datanavi.hxx
index dbb1180f6902..b5a7867de8a4 100644
--- a/svx/source/inc/datanavi.hxx
+++ b/svx/source/inc/datanavi.hxx
@@ -52,6 +52,8 @@
#include <com/sun/star/xml/dom/events/XEventTarget.hpp>
#include "datalistener.hxx"
+
+#include <memory>
#include <vector>
class FmFormShell;
@@ -131,7 +133,7 @@ namespace svxform
virtual ~DataTreeListBox();
virtual void dispose() SAL_OVERRIDE;
- virtual PopupMenu* CreateContextMenu() SAL_OVERRIDE;
+ virtual std::unique_ptr<PopupMenu> CreateContextMenu() SAL_OVERRIDE;
virtual void ExcecuteContextMenuAction( sal_uInt16 _nSelectedPopupEntry ) SAL_OVERRIDE;
virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) SAL_OVERRIDE;
virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ) SAL_OVERRIDE;