summaryrefslogtreecommitdiff
path: root/sc/source/core/tool/rangenam.cxx
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2012-09-20 15:05:00 +0100
committerNoel Power <noel.power@suse.com>2012-09-20 15:52:47 +0100
commit7539a695b801b92d10ff30463a8c08672a258442 (patch)
tree29f72c48d4a44f6cc0822f968a73f53e60dcd375 /sc/source/core/tool/rangenam.cxx
parentb5a1db961372b3fa66724ee580726c67e7683dbc (diff)
xlsx fix cyclic referenced defined names partially fixes bnc#780296 bnc#781166
Change-Id: Ibad37ac05c608c0211063bfa73931427d48c11f9
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 )