summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2020-10-30 16:57:16 +0100
committerEike Rathke <erack@redhat.com>2020-10-31 11:46:43 +0100
commitfc92e4e8c51cee379781b15670507e72510a9f60 (patch)
tree92b6fb435f1599c85f7b37d66f855746fdefd935
parent5f0f3c09230daa40cbe3d0c7f5a1f193c2ccad8c (diff)
Let INDIRECT() bail out early on empty string
e.g. if obtained from yet empty cell. Change-Id: I18597b86b37d5d216213f9a101e8b84b307b2a34 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105090 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
-rw-r--r--sc/source/core/tool/interpr1.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 3268efdf2015..321f80328095 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -8084,11 +8084,18 @@ void ScInterpreter::ScIndirect()
bTryXlA1 = false;
}
+ OUString sRefStr = GetString().getString();
+ if (sRefStr.isEmpty())
+ {
+ // Bail out early for empty cells, rely on "we do have a string" below.
+ PushError( FormulaError::NoRef);
+ return;
+ }
const ScAddress::Details aDetails( bTryXlA1 ? FormulaGrammar::CONV_OOO : eConv, aPos );
const ScAddress::Details aDetailsXlA1( FormulaGrammar::CONV_XL_A1, aPos );
SCTAB nTab = aPos.Tab();
- OUString sRefStr = GetString().getString();
+
ScRefAddress aRefAd, aRefAd2;
ScAddress::ExternalInfo aExtInfo;
if ( ConvertDoubleRef(mrDoc, sRefStr, nTab, aRefAd, aRefAd2, aDetails, &aExtInfo) ||