diff options
author | Noel Power <noel.power@suse.com> | 2012-09-20 15:05:00 +0100 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-09-25 10:42:54 -0400 |
commit | 3a4ebb1fcc0ade5cbc88e0a29304bbd5e440c0d2 (patch) | |
tree | 7c8ae861f3d538a7897544caed9b28a0761d4a44 /sc/source/core | |
parent | 3223ae5224ee17a501f251ba88ea3e4debb18e07 (diff) |
xlsx fix cyclic referenced defined names partially fixes bnc#780296 bnc#781166
Use scoped_ptr instead of deprecated auto_ptr
Change-Id: I8dcae78d6faab29c3889e97185839d41cbc3e402
Signed-off-by: Kohei Yoshida <kohei.yoshida@gmail.com>
Diffstat (limited to 'sc/source/core')
-rw-r--r-- | sc/source/core/tool/rangenam.cxx | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/sc/source/core/tool/rangenam.cxx b/sc/source/core/tool/rangenam.cxx index e671585ad91f..d9eea0091056 100644 --- a/sc/source/core/tool/rangenam.cxx +++ b/sc/source/core/tool/rangenam.cxx @@ -32,6 +32,7 @@ #include <string.h> #include <memory> +#include <boost/scoped_ptr.hpp> #include <unotools/collatorwrapper.hxx> #include <unotools/transliterationwrapper.hxx> #include <com/sun/star/sheet/NamedRangeFlag.hpp> @@ -110,18 +111,7 @@ ScRangeData::ScRangeData( ScDocument* pDok, mnMaxRow (-1), mnMaxCol (-1) { - if( !pCode->GetCodeError() ) - { - pCode->Reset(); - FormulaToken* p = pCode->GetNextReference(); - if( p )// genau eine Referenz als erstes - { - if( p->GetType() == svSingleRef ) - eType = eType | RT_ABSPOS; - else - eType = eType | RT_ABSAREA; - } - } + InitCode(); } ScRangeData::ScRangeData( ScDocument* pDok, @@ -684,6 +674,29 @@ void ScRangeData::ValidateTabRefs() } } +void ScRangeData::SetCode( ScTokenArray& rArr ) +{ + boost::scoped_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 ) |