sc/source/ui/app/inputhdl.cxx | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-)
New commits: commit ca8c0452d98c86a61f69f6700d844135944620ac Author: Mike Kaganski <[email protected]> AuthorDate: Fri Nov 30 11:34:54 2018 +0100 Commit: Mike Kaganski <[email protected]> CommitDate: Fri Nov 30 13:32:55 2018 +0100 tdf#114113: handle quoted sheet names Change-Id: I569903fc06448fe6ee7f948488319b6b1f1f8fbb Reviewed-on: https://gerrit.libreoffice.org/64334 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> 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 _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
