[Libreoffice-commits] core.git: formula/source

Eike Rathke erack at redhat.com
Mon Aug 1 16:13:03 UTC 2016


 formula/source/core/api/FormulaCompiler.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 2e3bc9fcee1c728d9fe91cbdf92b15d090c2b619
Author: Eike Rathke <erack at redhat.com>
Date:   Mon Aug 1 18:09:55 2016 +0200

    refine ISOWEEKNUM vs WEEKNUM_OOO detection
    
    Change-Id: I7cf5d51946235ea1bc6a4d0999fa98e1a3f8a095

diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx
index e9bf222..b317f31 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)


More information about the Libreoffice-commits mailing list