Kaydet (Commit) ca8c0452 authored tarafından Mike Kaganski's avatar Mike Kaganski

tdf#114113: handle quoted sheet names

Change-Id: I569903fc06448fe6ee7f948488319b6b1f1f8fbb
Reviewed-on: https://gerrit.libreoffice.org/64334
Tested-by: Jenkins
Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst 437adaac
...@@ -325,8 +325,24 @@ void ScInputHandler::InitRangeFinder( const OUString& rFormula ) ...@@ -325,8 +325,24 @@ void ScInputHandler::InitRangeFinder( const OUString& rFormula )
// Text zwischen Trennern // Text zwischen Trennern
nStart = nPos; nStart = nPos;
handle_r1c1: 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 // for R1C1 '-' in R[-]... or C[-]... are not delimiters
// Nothing heroic here to ensure that there are '[]' around a negative // Nothing heroic here to ensure that there are '[]' around a negative
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment