diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-12-03 23:36:50 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-12-04 12:01:14 +0100 |
commit | b1ff7054a0d7c12e0961c7a78bb2626b33c7f0d1 (patch) | |
tree | 20d63f5f501d209ac2cb54d0e77a630169465009 /svtools | |
parent | de25d1d0f5f50a05e40f687224379e97b701bcae (diff) |
svtools: replace boost::ptr_map with std::map<std::unique_ptr>
Change-Id: Ic61b2b9a472431e5443c74eb8b319ff8796e1672
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/inc/pch/precompiled_svt.hxx | 1 | ||||
-rw-r--r-- | svtools/source/contnr/imivctl.hxx | 8 | ||||
-rw-r--r-- | svtools/source/contnr/imivctl1.cxx | 24 |
3 files changed, 17 insertions, 16 deletions
diff --git a/svtools/inc/pch/precompiled_svt.hxx b/svtools/inc/pch/precompiled_svt.hxx index bcd65e5ec164..b7c9b0d9c89f 100644 --- a/svtools/inc/pch/precompiled_svt.hxx +++ b/svtools/inc/pch/precompiled_svt.hxx @@ -53,7 +53,6 @@ #include <boost/intrusive_ptr.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/endian.h> diff --git a/svtools/source/contnr/imivctl.hxx b/svtools/source/contnr/imivctl.hxx index 31272b7b249b..e35e5bec8354 100644 --- a/svtools/source/contnr/imivctl.hxx +++ b/svtools/source/contnr/imivctl.hxx @@ -32,7 +32,9 @@ #include <limits.h> #include <svtools/ivctrl.hxx> -#include <boost/ptr_container/ptr_map.hpp> + +#include <memory> +#include <map> class IcnCursor_Impl; class SvtIconChoiceCtrl; @@ -150,7 +152,7 @@ public: // Implementation-class of IconChoiceCtrl -typedef boost::ptr_map<sal_uInt16, SvxIconChoiceCtrlColumnInfo> SvxIconChoiceCtrlColumnInfoMap; +typedef std::map<sal_uInt16, std::unique_ptr<SvxIconChoiceCtrlColumnInfo>> SvxIconChoiceCtrlColumnInfoMap; typedef std::vector<SvxIconChoiceCtrlEntry*> SvxIconChoiceCtrlEntryPtrVec; class SvxIconChoiceCtrl_Impl @@ -182,7 +184,7 @@ class SvxIconChoiceCtrl_Impl long nMaxVirtWidth; // max. width aVirtOutputSize for ALIGN_TOP long nMaxVirtHeight; // max. height aVirtOutputSize for ALIGN_LEFT SvxIconChoiceCtrlEntryList_impl* pZOrderList; - SvxIconChoiceCtrlColumnInfoMap* pColumns; + SvxIconChoiceCtrlColumnInfoMap* m_pColumns; VclPtr<IcnViewEdit_Impl> pEdit; WinBits nWinBits; long nMaxBoundHeight; // height of highest BoundRects diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx index f7ea4cf05502..5d80be7daacb 100644 --- a/svtools/source/contnr/imivctl1.cxx +++ b/svtools/source/contnr/imivctl1.cxx @@ -95,7 +95,7 @@ SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl( aHorSBar( VclPtr<ScrollBar>::Create(pCurView, WB_DRAG | WB_HSCROLL) ), aScrBarBox( VclPtr<ScrollBarBox>::Create(pCurView) ), aImageSize( 32, 32 ), - pColumns( nullptr ) + m_pColumns( nullptr ) { bChooseWithCursor = false; pEntryPaintDev = nullptr; @@ -227,7 +227,7 @@ void SvxIconChoiceCtrl_Impl::SetStyle( WinBits nWinStyle ) nWinBits |= WB_ALIGN_LEFT; if( (nWinStyle & WB_DETAILS)) { - if( !pColumns ) + if (!m_pColumns) SetColumn( 0, SvxIconChoiceCtrlColumnInfo( 0, 100, IcnViewAlignLeft )); } } @@ -3501,20 +3501,20 @@ bool SvxIconChoiceCtrl_Impl::RequestHelp( const HelpEvent& rHEvt ) void SvxIconChoiceCtrl_Impl::ClearColumnList() { - if( !pColumns ) + if (!m_pColumns) return; - pColumns->clear(); - DELETEZ(pColumns); + m_pColumns->clear(); + DELETEZ(m_pColumns); } void SvxIconChoiceCtrl_Impl::SetColumn( sal_uInt16 nIndex, const SvxIconChoiceCtrlColumnInfo& rInfo) { - if( !pColumns ) - pColumns = new SvxIconChoiceCtrlColumnInfoMap; + if (!m_pColumns) + m_pColumns = new SvxIconChoiceCtrlColumnInfoMap; SvxIconChoiceCtrlColumnInfo* pInfo = new SvxIconChoiceCtrlColumnInfo( rInfo ); - pColumns->insert( nIndex, pInfo ); + m_pColumns->insert(std::make_pair(nIndex, std::unique_ptr<SvxIconChoiceCtrlColumnInfo>(pInfo))); // HACK: Detail mode is not yet fully implemented, this workaround makes it // fly with a single column @@ -3527,12 +3527,12 @@ void SvxIconChoiceCtrl_Impl::SetColumn( sal_uInt16 nIndex, const SvxIconChoiceCt const SvxIconChoiceCtrlColumnInfo* SvxIconChoiceCtrl_Impl::GetColumn( sal_uInt16 nIndex ) const { - if (!pColumns) + if (!m_pColumns) return nullptr; - SvxIconChoiceCtrlColumnInfoMap::const_iterator it = pColumns->find( nIndex ); - if( it == pColumns->end() ) + auto const it = m_pColumns->find( nIndex ); + if (it == m_pColumns->end()) return nullptr; - return it->second; + return it->second.get(); } void SvxIconChoiceCtrl_Impl::DrawHighlightFrame(vcl::RenderContext& rRenderContext, const Rectangle& rBmpRect, bool bHide) |