summaryrefslogtreecommitdiff
path: root/sc/source/ui/docshell/docfunc.cxx
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2011-03-04 22:30:39 -0500
committerKohei Yoshida <kyoshida@novell.com>2011-03-05 15:21:08 -0500
commit726a7d3893d49214ca5ef955beb30dcd49b67dd0 (patch)
tree5a987b7544125138cd24d8d490a41837dfe1e58b /sc/source/ui/docshell/docfunc.cxx
parente40df3cb083c365d542395b4b48f575ff287b277 (diff)
More on adjusting for ScRangeName's new API.
Diffstat (limited to 'sc/source/ui/docshell/docfunc.cxx')
-rw-r--r--sc/source/ui/docshell/docfunc.cxx22
1 files changed, 9 insertions, 13 deletions
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index ea2722675ee8..5add28194215 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -4691,17 +4691,13 @@ BOOL ScDocFunc::InsertNameList( const ScAddress& rStartPos, BOOL bApi )
ScRangeName* pList = pDoc->GetRangeName();
USHORT nValidCount = 0;
- USHORT i;
- USHORT nCount = pList->size();
-#if NEW_RANGE_NAME
-#else
- for (i=0; i<nCount; i++)
+ ScRangeName::iterator itrBeg = pList->begin(), itrEnd = pList->end();
+ for (ScRangeName::iterator itr = itrBeg; itr != itrEnd; ++itr)
{
- ScRangeData* pData = (*pList)[i];
- if ( !pData->HasType( RT_DATABASE ) && !pData->HasType( RT_SHARED ) )
+ const ScRangeData& r = *itr;
+ if (r.HasType(RT_DATABASE && !r.HasType(RT_SHARED)))
++nValidCount;
}
-#endif
if (nValidCount)
{
@@ -4725,11 +4721,11 @@ BOOL ScDocFunc::InsertNameList( const ScAddress& rStartPos, BOOL bApi )
ScRangeData** ppSortArray = new ScRangeData* [ nValidCount ];
USHORT j = 0;
- for (i=0; i<nCount; i++)
+ for (ScRangeName::iterator itr = itrBeg; itr != itrEnd; ++itr)
{
- ScRangeData* pData = (*pList)[i];
- if ( !pData->HasType( RT_DATABASE ) && !pData->HasType( RT_SHARED ) )
- ppSortArray[j++] = pData;
+ ScRangeData& r = *itr;
+ if (!r.HasType(RT_DATABASE) && !r.HasType(RT_SHARED))
+ ppSortArray[j++] = &r;
}
#ifndef ICC
qsort( (void*)ppSortArray, nValidCount, sizeof(ScRangeData*),
@@ -4772,7 +4768,7 @@ BOOL ScDocFunc::InsertNameList( const ScAddress& rStartPos, BOOL bApi )
if (!AdjustRowHeight(ScRange(0,nStartRow,nTab,MAXCOL,nEndRow,nTab)))
rDocShell.PostPaint( nStartCol,nStartRow,nTab, nEndCol,nEndRow,nTab, PAINT_GRID );
-//! rDocShell.UpdateOle(GetViewData());
+
aModificator.SetDocumentModified();
bDone = TRUE;
}