diff options
author | Noel Grandin <noel@peralex.com> | 2012-07-13 14:45:39 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-07-17 15:28:10 +0200 |
commit | ae79f24ce509f6c3cfbdc4cf329f3e04bdc2b017 (patch) | |
tree | 823910b25187964aae2ac26536c234579c954735 /sw | |
parent | 29afbedb685576877d88f550d20572b506048f77 (diff) |
Convert SV_DECL_PTRARR_SORT(SwRedlineDataParentSortArr) to o3tl::sorted_vector
Change-Id: Ia2a213708baf910429be9fd397e0112c80e8cd2d
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/ui/inc/redlndlg.hxx | 4 | ||||
-rw-r--r-- | sw/source/ui/misc/redlndlg.cxx | 17 |
2 files changed, 10 insertions, 11 deletions
diff --git a/sw/source/ui/inc/redlndlg.hxx b/sw/source/ui/inc/redlndlg.hxx index 992b0e74d48e..848e81e25c4d 100644 --- a/sw/source/ui/inc/redlndlg.hxx +++ b/sw/source/ui/inc/redlndlg.hxx @@ -40,6 +40,7 @@ #include <svx/ctredlin.hxx> #include <svx/postattr.hxx> #include <boost/ptr_container/ptr_vector.hpp> +#include <o3tl/sorted_vector.hxx> class SwChildWinWrapper; @@ -63,10 +64,9 @@ struct SwRedlineDataParent { return (pData && pData->GetSeqNo() < rObj.pData->GetSeqNo()); } }; -typedef SwRedlineDataParent* SwRedlineDataParentPtr; typedef boost::ptr_vector<SwRedlineDataParent> SwRedlineDataParentArr; -SV_DECL_PTRARR_SORT(SwRedlineDataParentSortArr, SwRedlineDataParentPtr, 10) +class SwRedlineDataParentSortArr : public o3tl::sorted_vector<SwRedlineDataParent*, o3tl::less_ptr_to<SwRedlineDataParent> > {}; typedef SwRedlineDataChild* SwRedlineDataChildPtr; diff --git a/sw/source/ui/misc/redlndlg.cxx b/sw/source/ui/misc/redlndlg.cxx index 6a3239ad1065..8f6fb5c8db0f 100644 --- a/sw/source/ui/misc/redlndlg.cxx +++ b/sw/source/ui/misc/redlndlg.cxx @@ -67,8 +67,6 @@ SFX_IMPL_MODELESSDIALOG_WITHID( SwRedlineAcceptChild, FN_REDLINE_ACCEPT ) -SV_IMPL_OP_PTRARR_SORT(SwRedlineDataParentSortArr, SwRedlineDataParentPtr) - static sal_uInt16 nSortMode = 0xffff; static sal_Bool bSortDir = sal_True; @@ -257,7 +255,7 @@ void SwRedlineAcceptDlg::Init(sal_uInt16 nStart) { SwWait aWait( *::GetActiveView()->GetDocShell(), sal_False ); pTable->SetUpdateMode(sal_False); - aUsedSeqNo.Remove((sal_uInt16)0, aUsedSeqNo.Count()); + aUsedSeqNo.clear(); if (nStart) RemoveParents(nStart, aRedlineParents.size() - 1); @@ -401,7 +399,7 @@ void SwRedlineAcceptDlg::Activate() SwView *pView = ::GetActiveView(); SwWait aWait( *pView->GetDocShell(), sal_False ); - aUsedSeqNo.Remove((sal_uInt16)0, aUsedSeqNo.Count()); + aUsedSeqNo.clear(); if (!pView) // can happen when switching to another app, when a Listbox in the dialog return; // had the focus previously (actually THs Bug) @@ -582,13 +580,13 @@ void SwRedlineAcceptDlg::InsertChildren(SwRedlineDataParent *pParent, const SwRe bValidParent = bValidParent && pTable->IsValidEntry(&rRedln.GetAuthorString(), &rRedln.GetTimeStamp(), &rRedln.GetComment()); if (nAutoFmt) { - sal_uInt16 nPos; + SwRedlineDataParentSortArr::const_iterator it; - if (pParent->pData->GetSeqNo() && !aUsedSeqNo.Insert(pParent, nPos)) // already there + if ( pParent->pData->GetSeqNo() && (it = aUsedSeqNo.insert(pParent).first) != aUsedSeqNo.end() ) // already there { if (pParent->pTLBParent) { - pTable->SetEntryText(sAutoFormat, aUsedSeqNo[nPos]->pTLBParent, 0); + pTable->SetEntryText(sAutoFormat, (*it)->pTLBParent, 0); pTable->RemoveEntry(pParent->pTLBParent); pParent->pTLBParent = 0; } @@ -645,7 +643,7 @@ void SwRedlineAcceptDlg::InsertChildren(SwRedlineDataParent *pParent, const SwRe pTable->RemoveEntry(pParent->pTLBParent); pParent->pTLBParent = 0; if (nAutoFmt) - aUsedSeqNo.Remove(pParent); + aUsedSeqNo.erase(pParent); } } @@ -738,7 +736,7 @@ void SwRedlineAcceptDlg::InsertParents(sal_uInt16 nStart, sal_uInt16 nEnd) RedlinData *pData; SvLBoxEntry *pParent; - SwRedlineDataParentPtr pRedlineParent; + SwRedlineDataParent* pRedlineParent; const SwRedline* pCurrRedline; if( !nStart && !pTable->FirstSelected() ) { @@ -1245,4 +1243,5 @@ void SwRedlineAcceptDlg::FillInfo(String &rExtraData) const rExtraData += ')'; } + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |