summaryrefslogtreecommitdiff
path: root/sw/source/core/txtnode
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-06-25 15:05:31 +0200
committerMichael Stahl <mstahl@redhat.com>2012-07-04 23:23:20 +0200
commit6485258bc00de0bc1db9a0b146437a08c93970aa (patch)
treef2fcd1caa4c5e424b940ba58c2bccdfc5e6725b5 /sw/source/core/txtnode
parent457a537bdb24ff67a9bfc3d7426678ac6829d821 (diff)
Convert Svptrarr to std::deque<const SwTxtAttr*>
Change-Id: I527814582214401a1f7dd9c192e6aa96e45f7819
Diffstat (limited to 'sw/source/core/txtnode')
-rw-r--r--sw/source/core/txtnode/txatritr.cxx25
1 files changed, 12 insertions, 13 deletions
diff --git a/sw/source/core/txtnode/txatritr.cxx b/sw/source/core/txtnode/txatritr.cxx
index d51dbf532259..53912958df97 100644
--- a/sw/source/core/txtnode/txatritr.cxx
+++ b/sw/source/core/txtnode/txatritr.cxx
@@ -109,25 +109,25 @@ sal_Bool SwTxtAttrIterator::Next()
if( nChgPos < aSIter.GetText().Len() )
{
bRet = sal_True;
- if( aStack.Count() )
+ if( !aStack.empty() )
{
do {
- const SwTxtAttr* pHt = (SwTxtAttr*)aStack[ 0 ];
+ const SwTxtAttr* pHt = aStack.front();
sal_uInt16 nEndPos = *pHt->GetEnd();
if( nChgPos >= nEndPos )
- aStack.Remove( 0 );
+ aStack.pop_front();
else
break;
- } while( aStack.Count() );
+ } while( !aStack.empty() );
}
- if( aStack.Count() )
+ if( !aStack.empty() )
{
sal_uInt16 nSavePos = nAttrPos;
SearchNextChg();
- if( aStack.Count() )
+ if( !aStack.empty() )
{
- const SwTxtAttr* pHt = (SwTxtAttr*)aStack[ 0 ];
+ const SwTxtAttr* pHt = aStack.front();
sal_uInt16 nEndPos = *pHt->GetEnd();
if( nChgPos >= nEndPos )
{
@@ -144,7 +144,7 @@ sal_Bool SwTxtAttrIterator::Next()
else
pCurItem = &pHt->GetAttr();
- aStack.Remove( 0 );
+ aStack.pop_front();
}
}
}
@@ -156,13 +156,12 @@ sal_Bool SwTxtAttrIterator::Next()
void SwTxtAttrIterator::AddToStack( const SwTxtAttr& rAttr )
{
- void* pAdd = (void*)&rAttr;
sal_uInt16 nIns = 0, nEndPos = *rAttr.GetEnd();
- for( ; nIns < aStack.Count(); ++nIns )
- if( *((SwTxtAttr*)aStack[ nIns ] )->GetEnd() > nEndPos )
+ for( ; nIns < aStack.size(); ++nIns )
+ if( *aStack[ nIns ]->GetEnd() > nEndPos )
break;
- aStack.Insert( pAdd, nIns );
+ aStack.insert( aStack.begin() + nIns, &rAttr );
}
void SwTxtAttrIterator::SearchNextChg()
@@ -175,7 +174,7 @@ void SwTxtAttrIterator::SearchNextChg()
nAttrPos = 0; // must be restart at the beginning, because
// some attributes can start before or inside
// the current scripttype!
- aStack.Remove( 0, aStack.Count() );
+ aStack.clear();
}
if( !pParaItem )
{