summaryrefslogtreecommitdiff
path: root/sc/source/core/tool/rangenam.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/core/tool/rangenam.cxx')
-rw-r--r--sc/source/core/tool/rangenam.cxx36
1 files changed, 24 insertions, 12 deletions
diff --git a/sc/source/core/tool/rangenam.cxx b/sc/source/core/tool/rangenam.cxx
index a2f67a27d986..8a52a71cbd5a 100644
--- a/sc/source/core/tool/rangenam.cxx
+++ b/sc/source/core/tool/rangenam.cxx
@@ -100,18 +100,7 @@ ScRangeData::ScRangeData( ScDocument* pDok,
mnMaxRow (-1),
mnMaxCol (-1)
{
- if( !pCode->GetCodeError() )
- {
- pCode->Reset();
- FormulaToken* p = pCode->GetNextReference();
- if( p ) // exact one reference at first
- {
- if( p->GetType() == svSingleRef )
- eType = eType | RT_ABSPOS;
- else
- eType = eType | RT_ABSAREA;
- }
- }
+ InitCode();
}
ScRangeData::ScRangeData( ScDocument* pDok,
@@ -648,6 +637,29 @@ void ScRangeData::ValidateTabRefs()
}
}
+void ScRangeData::SetCode( ScTokenArray& rArr )
+{
+ ::std::auto_ptr<ScTokenArray> pOldCode( pCode); // old pCode will be deleted
+ pCode = new ScTokenArray( rArr );
+ InitCode();
+}
+
+void ScRangeData::InitCode()
+{
+ if( !pCode->GetCodeError() )
+ {
+ pCode->Reset();
+ FormulaToken* p = pCode->GetNextReference();
+ if( p ) // exact one reference at first
+ {
+ if( p->GetType() == svSingleRef )
+ eType = eType | RT_ABSPOS;
+ else
+ eType = eType | RT_ABSAREA;
+ }
+ }
+}
+
extern "C"
int SAL_CALL ScRangeData_QsortNameCompare( const void* p1, const void* p2 )