summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2016-04-23 15:44:13 +0200
committerCaolán McNamara <caolanm@redhat.com>2016-05-03 09:32:58 +0000
commitb8d78268d1c58557122f99d6134a3b1eda7fe6c3 (patch)
tree8ba3f7e956be39ae961bff939253c4aa1e21ab70 /sc
parentf6d54d43fc9c7b353a97162d026d58402bfbab20 (diff)
Resolves: tdf#96426 significant whitespace as intersection in Excel syntax
Also when reading/writing OOXML, so change SC_OPCODE_INTERSECT of RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML accordingly to " ", where previously "!" was expected and written, which was plain wrong. (cherry picked from commit 26adceb098134d918f6d57c8687ab057e24adc39) simplify the ReplaceToken() offset logic to absolute offsets (cherry picked from commit f41257dc9913cd6020a3a37bf425c20b51e18ece) fully check for adjacent RPN end, tdf#96426 follow-up (cherry picked from commit b0992e11905e36a64edeb92a13acfde5837c1878) narrow down where a space could be an intersection, tdf#96426 follow-up (cherry picked from commit e0875f8e348a3aca036bc0cc629fb038fabc8062) Adapted to backport. more differentiated significant whitespace recognition, tdf#96426 follow-up (cherry picked from commit 0f8a8332a52cd03b43aaab86e0c232e0964d7111) first range can be anywhere before second at RPN end, tdf#96426 follow-up ... not just adjacent to the one at the end. So we actually can handle INDIRECT("A2:C2") INDIRECT("B1:B3") (cherry picked from commit 0c5663cfb13f4f55e246d42ac464d5e2c2f23099) check presence of token, tdf#96426 follow-up (cherry picked from commit edd4370f5ba49a26a526995b6a28f623d68041ce) 4c368dfd113b02d208013b4ba79dff606769a150 8d02fb63bc0c5cb48aabaf7a8800f5f9ac95cbf5 886e559c6f6041bf4889fdd6d89c12a10be70e5f c53a4a0d19a11298895efb28e2786e48a071e72b 081409a82a9ff64f163115bf4597afbb9b2f5fa6 e8030ebc13bb1ae2246611f5722da97970b8c544 Change-Id: Ic0cfd7afc657f07bfd8e37de61b3621cc68685ff Reviewed-on: https://gerrit.libreoffice.org/24374 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/tool/compiler.cxx4
-rw-r--r--sc/source/core/tool/token.cxx4
2 files changed, 4 insertions, 4 deletions
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 5f258dfcc0d6..9d272197c06d 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -4281,8 +4281,8 @@ ScTokenArray* ScCompiler::CompileString( const OUString& rFormula )
FormulaToken* pTableRefToken = new ScTableRefToken( pPrev->GetIndex(), ScTableRefToken::TABLE);
maTableRefs.push_back( TableRefEntry( pTableRefToken));
// pPrev may be dead hereafter.
- static_cast<ScTokenArray*>(pArr)->ReplaceToken( 1, pTableRefToken,
- FormulaTokenArray::ReplaceMode::BACKWARD_CODE_ONLY);
+ static_cast<ScTokenArray*>(pArr)->ReplaceToken( nIdx, pTableRefToken,
+ FormulaTokenArray::ReplaceMode::CODE_ONLY);
}
}
switch (eOp)
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index d73d8d71da1c..1a8305153524 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -2402,7 +2402,7 @@ void ScTokenArray::ReadjustAbsolute3DReferences( const ScDocument* pOldDoc, cons
OUString aTabName;
sal_uInt16 nFileId;
GetExternalTableData(pOldDoc, pNewDoc, rRef1.Tab(), aTabName, nFileId);
- ReplaceToken( j, new ScExternalDoubleRefToken(nFileId, aTabName, rRef), FORWARD_CODE_AND_RPN);
+ ReplaceToken( j, new ScExternalDoubleRefToken(nFileId, aTabName, rRef), CODE_AND_RPN);
// ATTENTION: rRef can't be used after this point
}
}
@@ -2419,7 +2419,7 @@ void ScTokenArray::ReadjustAbsolute3DReferences( const ScDocument* pOldDoc, cons
OUString aTabName;
sal_uInt16 nFileId;
GetExternalTableData(pOldDoc, pNewDoc, rRef.Tab(), aTabName, nFileId);
- ReplaceToken( j, new ScExternalSingleRefToken(nFileId, aTabName, rRef), FORWARD_CODE_AND_RPN);
+ ReplaceToken( j, new ScExternalSingleRefToken(nFileId, aTabName, rRef), CODE_AND_RPN);
// ATTENTION: rRef can't be used after this point
}
}