strip second parameter from ISOWEEKNUM if literal double != 1.0

For other arguments convert to WEEKNUM_OOO, which now can be saved as
ORG.LIBREOFFICE.WEEKNUM_OOO.

Change-Id: I63fd3df1ec4ccaa535a1437200854d8734544a2c
This commit is contained in:
Eike Rathke
2016-07-14 23:16:41 +02:00
parent 77ccf8a9ca
commit fc305bb6d6

View File

@@ -1412,12 +1412,6 @@ void FormulaCompiler::Factor()
pFacToken->SetByte( nSepCount ); pFacToken->SetByte( nSepCount );
if (nSepCount == 2) if (nSepCount == 2)
{ {
/* XXX TODO FIXME: activate this conversion to ISOWEEKNUM
* when at least two releases can actually handle the real
* ISOWEEKNUM with one parameter, i.e. for 5.3 or 5.2 if
* 5.0.5 is patched. Until then unconditionally use the
* WEEKNUM_OOO compatibility function. */
#if 0
// An old mode!=1 indicates ISO week, remove argument if // An old mode!=1 indicates ISO week, remove argument if
// literal double value and keep function. Anything else // literal double value and keep function. Anything else
// can not be resolved, there exists no "like ISO but week // can not be resolved, there exists no "like ISO but week
@@ -1440,11 +1434,6 @@ void FormulaCompiler::Factor()
// compatibility function. // compatibility function.
pFacToken->NewOpCode( ocWeeknumOOo, FormulaToken::PrivateAccess()); pFacToken->NewOpCode( ocWeeknumOOo, FormulaToken::PrivateAccess());
} }
#else
(void) nSepPos;
// Use compatibility function.
pFacToken->NewOpCode( ocWeeknumOOo, FormulaToken::PrivateAccess());
#endif
} }
PutCode( pFacToken ); PutCode( pFacToken );
} }