Kaydet (Commit) abf56d46 authored tarafından Michael Stahl's avatar Michael Stahl

sw: replace boost::ptr_set with std::map<std::unique_ptr>

Change-Id: I2af80c8223ec3074058c013be7302ebf8edad95c
üst 27825a35
...@@ -142,7 +142,7 @@ private: ...@@ -142,7 +142,7 @@ private:
SwFormatNoBalancedColumns m_Balance; SwFormatNoBalancedColumns m_Balance;
SvxFrameDirectionItem m_FrmDirItem; SvxFrameDirectionItem m_FrmDirItem;
SvxLRSpaceItem m_LRSpaceItem; SvxLRSpaceItem m_LRSpaceItem;
size_t m_nArrPos; const size_t m_nArrPos;
// shows, if maybe textcontent is in the region // shows, if maybe textcontent is in the region
bool m_bContent : 1; bool m_bContent : 1;
// for multiselection, mark at first, then work with TreeListBox! // for multiselection, mark at first, then work with TreeListBox!
...@@ -816,9 +816,10 @@ IMPL_LINK_NOARG(SwEditRegionDlg, OkHdl) ...@@ -816,9 +816,10 @@ IMPL_LINK_NOARG(SwEditRegionDlg, OkHdl)
pEntry = m_pTree->Next( pEntry ); 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 ); const size_t nNewPos = rDocFormats.GetPos( pFormat );
if( SIZE_MAX != nNewPos ) if( SIZE_MAX != nNewPos )
rSh.DelSectionFormat( nNewPos ); rSh.DelSectionFormat( nNewPos );
...@@ -930,7 +931,8 @@ IMPL_LINK_NOARG(SwEditRegionDlg, ChangeDismissHdl) ...@@ -930,7 +931,8 @@ IMPL_LINK_NOARG(SwEditRegionDlg, ChangeDismissHdl)
bool bRestart = false; bool bRestart = false;
if(pSectRepr->IsSelected()) 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 ) while( (pChild = m_pTree->FirstChild(pEntry) )!= 0 )
{ {
// because of the repositioning we have to start at the beginning again // because of the repositioning we have to start at the beginning again
......
...@@ -44,7 +44,8 @@ ...@@ -44,7 +44,8 @@
#include <svx/paraprev.hxx> #include <svx/paraprev.hxx>
#include <editeng/lrspitem.hxx> #include <editeng/lrspitem.hxx>
#include <boost/ptr_container/ptr_set.hpp> #include <memory>
#include <map>
class SwWrtShell; class SwWrtShell;
...@@ -56,7 +57,7 @@ namespace sfx2 ...@@ -56,7 +57,7 @@ namespace sfx2
// dialog "edit regions" // dialog "edit regions"
class SectRepr; class SectRepr;
typedef boost::ptr_set<SectRepr> SectReprArr; typedef std::map<size_t, std::unique_ptr<SectRepr>> SectReprs_t;
class SwEditRegionDlg : public SfxModalDialog class SwEditRegionDlg : public SfxModalDialog
{ {
...@@ -91,7 +92,7 @@ class SwEditRegionDlg : public SfxModalDialog ...@@ -91,7 +92,7 @@ class SwEditRegionDlg : public SfxModalDialog
ImageList aImageIL; ImageList aImageIL;
SwWrtShell& rSh; SwWrtShell& rSh;
SectReprArr aSectReprArr; SectReprs_t m_SectReprs;
const SwSection* pCurrSect; const SwSection* pCurrSect;
sfx2::DocumentInserter* m_pDocInserter; sfx2::DocumentInserter* m_pDocInserter;
VclPtr<vcl::Window> m_pOldDefDlgParent; VclPtr<vcl::Window> m_pOldDefDlgParent;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment