diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-11-30 11:34:54 +0100 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2018-11-30 13:32:55 +0100 |
commit | ca8c0452d98c86a61f69f6700d844135944620ac (patch) | |
tree | a6732db0be92b3736e769db3bee43e91383a3c08 | |
parent | 437adaac0af448ef1ffe48a7f59f1770d2dd2458 (diff) |
tdf#114113: handle quoted sheet names
Change-Id: I569903fc06448fe6ee7f948488319b6b1f1f8fbb
Reviewed-on: https://gerrit.libreoffice.org/64334
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r-- | sc/source/ui/app/inputhdl.cxx | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 36af4bd5979c..ab2d53995fd4 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -325,8 +325,24 @@ void ScInputHandler::InitRangeFinder( const OUString& rFormula ) // Text zwischen Trennern nStart = nPos; handle_r1c1: - while ( nPos<nLen && !ScGlobal::UnicodeStrChr( aDelimiters.getStr(), pChar[nPos] ) ) - ++nPos; + { + bool bSingleQuoted = false; + while (nPos < nLen) + { + // tdf#114113: handle addresses with quoted sheet names like "'Sheet 1'.A1" + // Literal single quotes in sheet names are masked by another single quote + if (pChar[nPos] == '\'') + { + bSingleQuoted = !bSingleQuoted; + } + else if (!bSingleQuoted) // Get everything in single quotes, including separators + { + if (ScGlobal::UnicodeStrChr(aDelimiters.getStr(), pChar[nPos])) + break; + } + ++nPos; + } + } // for R1C1 '-' in R[-]... or C[-]... are not delimiters // Nothing heroic here to ensure that there are '[]' around a negative |