diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-07-27 15:14:49 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-07-27 17:05:33 +0200 |
commit | abf56d46be1b11973fce1fa48e40b82820d66e58 (patch) | |
tree | 862ca250c0b2d26f93cad15b37b55eb86f19c961 | |
parent | 27825a355edc79ac62f16b3ea8554ea834bed514 (diff) |
sw: replace boost::ptr_set with std::map<std::unique_ptr>
Change-Id: I2af80c8223ec3074058c013be7302ebf8edad95c
-rw-r--r-- | sw/source/ui/dialog/uiregionsw.cxx | 10 | ||||
-rw-r--r-- | sw/source/uibase/inc/regionsw.hxx | 7 |
2 files changed, 10 insertions, 7 deletions
diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx index 711462e481d2..601be954f569 100644 --- a/sw/source/ui/dialog/uiregionsw.cxx +++ b/sw/source/ui/dialog/uiregionsw.cxx @@ -142,7 +142,7 @@ private: SwFormatNoBalancedColumns m_Balance; SvxFrameDirectionItem m_FrmDirItem; SvxLRSpaceItem m_LRSpaceItem; - size_t m_nArrPos; + const size_t m_nArrPos; // shows, if maybe textcontent is in the region bool m_bContent : 1; // for multiselection, mark at first, then work with TreeListBox! @@ -816,9 +816,10 @@ IMPL_LINK_NOARG(SwEditRegionDlg, OkHdl) pEntry = m_pTree->Next( pEntry ); } - for (SectReprArr::reverse_iterator aI = aSectReprArr.rbegin(), aEnd = aSectReprArr.rend(); aI != aEnd; ++aI) + for (SectReprs_t::reverse_iterator it = m_SectReprs.rbegin(), aEnd = m_SectReprs.rend(); it != aEnd; ++it) { - SwSectionFormat* pFormat = aOrigArray[ aI->GetArrPos() ]; + assert(it->first == it->second->GetArrPos()); + SwSectionFormat* pFormat = aOrigArray[ it->second->GetArrPos() ]; const size_t nNewPos = rDocFormats.GetPos( pFormat ); if( SIZE_MAX != nNewPos ) rSh.DelSectionFormat( nNewPos ); @@ -930,7 +931,8 @@ IMPL_LINK_NOARG(SwEditRegionDlg, ChangeDismissHdl) bool bRestart = false; if(pSectRepr->IsSelected()) { - aSectReprArr.insert( pSectRepr ); + m_SectReprs.insert(std::make_pair(pSectRepr->GetArrPos(), + std::unique_ptr<SectRepr>(pSectRepr))); while( (pChild = m_pTree->FirstChild(pEntry) )!= 0 ) { // because of the repositioning we have to start at the beginning again diff --git a/sw/source/uibase/inc/regionsw.hxx b/sw/source/uibase/inc/regionsw.hxx index d74e06af479a..7b4d1dec3c61 100644 --- a/sw/source/uibase/inc/regionsw.hxx +++ b/sw/source/uibase/inc/regionsw.hxx @@ -44,7 +44,8 @@ #include <svx/paraprev.hxx> #include <editeng/lrspitem.hxx> -#include <boost/ptr_container/ptr_set.hpp> +#include <memory> +#include <map> class SwWrtShell; @@ -56,7 +57,7 @@ namespace sfx2 // dialog "edit regions" class SectRepr; -typedef boost::ptr_set<SectRepr> SectReprArr; +typedef std::map<size_t, std::unique_ptr<SectRepr>> SectReprs_t; class SwEditRegionDlg : public SfxModalDialog { @@ -91,7 +92,7 @@ class SwEditRegionDlg : public SfxModalDialog ImageList aImageIL; SwWrtShell& rSh; - SectReprArr aSectReprArr; + SectReprs_t m_SectReprs; const SwSection* pCurrSect; sfx2::DocumentInserter* m_pDocInserter; VclPtr<vcl::Window> m_pOldDefDlgParent; |