summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2016-09-01 12:17:36 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-09-02 02:34:21 +0000
commitd8879103a152c7db6ba420af9cda87790996fee8 (patch)
tree9f34a07f083b9031c17574821988cafb8f267b6b /sc
parent92b384b197b8f6c85127e277b10e09936d0c6021 (diff)
exclude also single quoted strings from function name suggestion
These may be sheet names or label names, but never function names. For example, typing ='e should not suggest "[EASTERSUNDAY], EDATE, ..." Change-Id: I818b91b533b868ccb6d2eb1eef74112162d2fe3d (cherry picked from commit b9a2c849a657bdb9d5953b96f60409cb877b0005) Reviewed-on: https://gerrit.libreoffice.org/28586 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/app/inputhdl.cxx17
1 files changed, 12 insertions, 5 deletions
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index e7cd682deda8..f268dbf574a2 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -1242,14 +1242,21 @@ void ScInputHandler::UseFormulaData()
miAutoPosFormula = findTextAll(*pFormulaData, miAutoPosFormula, aText, aNewVec, false);
if (miAutoPosFormula != pFormulaData->end())
{
- // check if partial function name is not Between quotes
- bool bBetweenQuotes = false;
+ // check if partial function name is not between quotes
+ sal_Unicode cBetweenQuotes = 0;
for ( int n = 0; n < aSelText.getLength(); n++ )
{
- if ( aSelText[ n ] == '"' )
- bBetweenQuotes = !bBetweenQuotes;
+ if (cBetweenQuotes)
+ {
+ if (aSelText[n] == cBetweenQuotes)
+ cBetweenQuotes = 0;
+ }
+ else if ( aSelText[ n ] == '"' )
+ cBetweenQuotes = '"';
+ else if ( aSelText[ n ] == '\'' )
+ cBetweenQuotes = '\'';
}
- if ( bBetweenQuotes )
+ if ( cBetweenQuotes )
return; // we're between quotes
ShowFuncList(aNewVec);