Kaydet (Commit) 6485258b authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Michael Stahl

Convert Svptrarr to std::deque<const SwTxtAttr*>

Change-Id: I527814582214401a1f7dd9c192e6aa96e45f7819
üst 457a537b
......@@ -21,9 +21,9 @@
#include <tools/solar.h>
#include <sal/types.h>
#include <svl/svarray.hxx>
#include <editeng/langitem.hxx>
#include <hintids.hxx>
#include <deque>
class String;
class SwTxtNode;
......@@ -53,7 +53,7 @@ public:
class SwTxtAttrIterator
{
SwScriptIterator aSIter;
SvPtrarr aStack;
std::deque<const SwTxtAttr*> aStack;
const SwTxtNode& rTxtNd;
const SfxPoolItem *pParaItem, *pCurItem;
xub_StrLen nChgPos;
......
......@@ -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 )
{
......
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