summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-12-03 23:10:04 +0100
committerMichael Stahl <mstahl@redhat.com>2015-12-04 12:01:14 +0100
commit9e87b8ea8ff4928af4751573585219d4c902d9c9 (patch)
tree498daa9b58a85e13c387836daf42925d8630a0f5 /sfx2
parent19f64ccc8c71b1e63b166c559479ee1c3390f8a0 (diff)
sfx2: replace boost::ptr_map with std::map<std::unique_ptr>
Change-Id: Ic5aed60d40d0e1cd4c227032bc4cf9adbd7be00a
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/inc/pch/precompiled_sfx.hxx1
-rw-r--r--sfx2/source/control/shell.cxx24
2 files changed, 12 insertions, 13 deletions
diff --git a/sfx2/inc/pch/precompiled_sfx.hxx b/sfx2/inc/pch/precompiled_sfx.hxx
index d599a0dc1f89..2365943cd652 100644
--- a/sfx2/inc/pch/precompiled_sfx.hxx
+++ b/sfx2/inc/pch/precompiled_sfx.hxx
@@ -47,7 +47,6 @@
#include <boost/logic/tribool.hpp>
#include <boost/noncopyable.hpp>
#include <boost/optional.hpp>
-#include <boost/ptr_container/ptr_map.hpp>
#include <osl/conditn.hxx>
#include <osl/diagnose.h>
#include <osl/file.hxx>
diff --git a/sfx2/source/control/shell.cxx b/sfx2/source/control/shell.cxx
index a073b46c1bd4..ca82105253fa 100644
--- a/sfx2/source/control/shell.cxx
+++ b/sfx2/source/control/shell.cxx
@@ -45,12 +45,12 @@
#include <sidebar/ContextChangeBroadcaster.hxx>
#include <com/sun/star/ui/dialogs/XSLTFilterDialog.hpp>
-#include <boost/ptr_container/ptr_map.hpp>
-#include <vector>
#include <memory>
+#include <vector>
+#include <map>
// Maps the Which() field to a pointer to a SfxPoolItem
-typedef boost::ptr_map<sal_uInt16, SfxPoolItem> SfxItemPtrMap;
+typedef std::map<sal_uInt16, std::unique_ptr<SfxPoolItem>> SfxItemPtrMap;
using namespace com::sun::star;
@@ -58,7 +58,7 @@ using namespace com::sun::star;
struct SfxShell_Impl: public SfxBroadcaster
{
OUString aObjectName; // Name of Sbx-Objects
- SfxItemPtrMap aItems; // Data exchange on Item level
+ SfxItemPtrMap m_Items; // Data exchange on Item level
SfxViewShell* pViewSh; // SfxViewShell if Shell is
// ViewFrame/ViewShell/SubShell list
SfxViewFrame* pFrame; // Frame, if <UI-active>
@@ -153,9 +153,9 @@ const SfxPoolItem* SfxShell::GetItem
sal_uInt16 nSlotId // Slot-Id of the querying <SfxPoolItem>s
) const
{
- SfxItemPtrMap::const_iterator it = pImp->aItems.find( nSlotId );
- if( it != pImp->aItems.end() )
- return it->second;
+ auto const it = pImp->m_Items.find( nSlotId );
+ if (it != pImp->m_Items.end())
+ return it->second.get();
return nullptr;
}
@@ -174,12 +174,12 @@ void SfxShell::PutItem
SfxPoolItemHint aItemHint( pItem );
sal_uInt16 nWhich = rItem.Which();
- SfxItemPtrMap::iterator it = pImp->aItems.find( nWhich );
- if( it != pImp->aItems.end() )
+ auto const it = pImp->m_Items.find(nWhich);
+ if (it != pImp->m_Items.end())
{
// Replace Item
- pImp->aItems.erase( it );
- pImp->aItems.insert( nWhich, pItem );
+ pImp->m_Items.erase( it );
+ pImp->m_Items.insert(std::make_pair(nWhich, std::unique_ptr<SfxPoolItem>(pItem)));
// if active, notify Bindings
SfxDispatcher *pDispat = GetDispatcher();
@@ -200,7 +200,7 @@ void SfxShell::PutItem
else
{
Broadcast( aItemHint );
- pImp->aItems.insert( nWhich, pItem );
+ pImp->m_Items.insert(std::make_pair(nWhich, std::unique_ptr<SfxPoolItem>(pItem)));
}
}