summaryrefslogtreecommitdiff
path: root/editeng/source/uno/unoedhlp.cxx
diff options
context:
space:
mode:
authorAugust Sodora <augsod@gmail.com>2011-12-23 02:30:41 -0500
committerAugust Sodora <augsod@gmail.com>2011-12-23 14:52:09 -0500
commit4d4a67748e945d901f320d9c3af753abb3211efc (patch)
tree462db2ccf1ee9c3455837307e98704e3f83ae864 /editeng/source/uno/unoedhlp.cxx
parentb575f4b1a2a2217282cddc995951b350936b47b1 (diff)
SV_DECL_VARARR->std::vector
Diffstat (limited to 'editeng/source/uno/unoedhlp.cxx')
-rw-r--r--editeng/source/uno/unoedhlp.cxx24
1 files changed, 10 insertions, 14 deletions
diff --git a/editeng/source/uno/unoedhlp.cxx b/editeng/source/uno/unoedhlp.cxx
index 03361d733583..306db63440c5 100644
--- a/editeng/source/uno/unoedhlp.cxx
+++ b/editeng/source/uno/unoedhlp.cxx
@@ -132,37 +132,33 @@ void SvxEditSourceHint::SetEndValue( sal_uLong n )
sal_Bool SvxEditSourceHelper::GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, const EditEngine& rEE, sal_uInt16 nPara, sal_uInt16 nIndex )
{
- EECharAttribArray aCharAttribs;
+ std::vector<EECharAttrib> aCharAttribs;
rEE.GetCharAttribs( nPara, aCharAttribs );
// find closest index in front of nIndex
- sal_uInt16 nAttr, nCurrIndex;
- sal_Int32 nClosestStartIndex;
- for( nAttr=0, nClosestStartIndex=0; nAttr<aCharAttribs.Count(); ++nAttr )
+ sal_uInt16 nCurrIndex;
+ sal_Int32 nClosestStartIndex = 0;
+ for(std::vector<EECharAttrib>::iterator i = aCharAttribs.begin(); i < aCharAttribs.end(); ++i)
{
- nCurrIndex = aCharAttribs[nAttr].nStart;
+ nCurrIndex = i->nStart;
if( nCurrIndex > nIndex )
break; // aCharAttribs array is sorted in increasing order for nStart values
-
- if( nCurrIndex > nClosestStartIndex )
+ else if( nCurrIndex > nClosestStartIndex )
{
nClosestStartIndex = nCurrIndex;
}
}
// find closest index behind of nIndex
- sal_Int32 nClosestEndIndex;
- for( nAttr=0, nClosestEndIndex=rEE.GetTextLen(nPara); nAttr<aCharAttribs.Count(); ++nAttr )
+ sal_Int32 nClosestEndIndex = rEE.GetTextLen(nPara);
+ for(std::vector<EECharAttrib>::iterator i = aCharAttribs.begin(); i < aCharAttribs.end(); ++i)
{
- nCurrIndex = aCharAttribs[nAttr].nEnd;
+ nCurrIndex = i->nEnd;
- if( nCurrIndex > nIndex &&
- nCurrIndex < nClosestEndIndex )
- {
+ if( nCurrIndex > nIndex && nCurrIndex < nClosestEndIndex )
nClosestEndIndex = nCurrIndex;
- }
}
nStartIndex = static_cast<sal_uInt16>( nClosestStartIndex );