diff options
author | Eike Rathke <erack@redhat.com> | 2016-05-03 22:48:14 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-05-03 22:58:52 +0200 |
commit | fac5f2af5190e6da9bedfcdf02426be59ad99166 (patch) | |
tree | 3282a2f3d9ed203292796b84450bffd06651374c /sc/source | |
parent | ea3ce0b3073c72f474365e438ddabd19de915b76 (diff) |
NameToken with Sheet instead of boolean Global
... to transport an actual sheet number for other-sheet-local names
within names when importing OOXML.
Change-Id: I00f2ffe07271c1c2a8ce9e10514e10872396f566
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/core/tool/token.cxx | 13 | ||||
-rw-r--r-- | sc/source/ui/unoobj/tokenuno.cxx | 3 |
2 files changed, 6 insertions, 10 deletions
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index fd16ada1fa99..11005eabe596 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -1219,14 +1219,11 @@ bool ScTokenArray::AddFormulaToken( rToken.Data >>= aTokenData; if ( eOpCode == ocName ) { - /* TODO: new token type with sheet number */ - if (aTokenData.Global) - AddRangeName(aTokenData.Index, -1); - else - bError = true; - /* FIXME: resolve the non-global case to the - * current position's sheet as it implicitly was - * before, currently this is broken. */ + SAL_WARN_IF( aTokenData.Sheet < -1 || std::numeric_limits<sal_Int16>::max() < aTokenData.Sheet, + "sc.core", + "ScTokenArray::AddFormulaToken - NameToken.Sheet out of limits: " << aTokenData.Sheet); + sal_Int16 nSheet = static_cast<sal_Int16>(aTokenData.Sheet); + AddRangeName(aTokenData.Index, nSheet); } else if (eOpCode == ocDBArea) AddDBRange(aTokenData.Index); diff --git a/sc/source/ui/unoobj/tokenuno.cxx b/sc/source/ui/unoobj/tokenuno.cxx index b1800ced542e..b8b80de5007d 100644 --- a/sc/source/ui/unoobj/tokenuno.cxx +++ b/sc/source/ui/unoobj/tokenuno.cxx @@ -422,8 +422,7 @@ bool ScTokenConversion::ConvertToTokenSequence( const ScDocument& rDoc, { sheet::NameToken aNameToken; aNameToken.Index = static_cast<sal_Int32>( rToken.GetIndex() ); - /* FIXME: we need a new token with sheet number */ - aNameToken.Global = (rToken.GetSheet() < 0); + aNameToken.Sheet = rToken.GetSheet(); rAPI.Data <<= aNameToken; } break; |