summaryrefslogtreecommitdiff
path: root/formula
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2016-08-01 18:09:55 +0200
committerEike Rathke <erack@redhat.com>2016-08-01 18:12:29 +0200
commit2e3bc9fcee1c728d9fe91cbdf92b15d090c2b619 (patch)
treef07c9feacb732a2382ee385d96eedd997f687c14 /formula
parentb7b951a90b210bdec5215f2ad09f8a10757a1b2a (diff)
refine ISOWEEKNUM vs WEEKNUM_OOO detection
Change-Id: I7cf5d51946235ea1bc6a4d0999fa98e1a3f8a095
Diffstat (limited to 'formula')
-rw-r--r--formula/source/core/api/FormulaCompiler.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx
index e9bf222b878a..b317f31abe7f 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -1417,7 +1417,10 @@ void FormulaCompiler::Factor()
// can not be resolved, there exists no "like ISO but week
// starts on Sunday" mode in WEEKNUM and for an expression
// we can't determine.
- if (pc >= 2 && pArr->nIndex == nSepPos + 3 &&
+ // Current index is nSepPos+3 if expression stops, or
+ // nSepPos+4 if expression continues after the call because
+ // we just called NextToken() to move away from it.
+ if (pc >= 2 && (pArr->nIndex == nSepPos + 3 || pArr->nIndex == nSepPos + 4) &&
pArr->pCode[nSepPos+1]->GetType() == svDouble &&
pArr->pCode[nSepPos+1]->GetDouble() != 1.0 &&
pArr->RemoveToken( nSepPos, 2) == 2)