summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2018-02-02 15:39:58 +0100
committerEike Rathke <erack@redhat.com>2018-02-02 15:40:05 +0100
commite6ced1496da9580cf885cce1a2fc9f67528c3a0e (patch)
tree66771f45b84957363c88175ffea813e3fc95f111 /sc
parent329d39c9f42b4f388b3c418fee60c29308e579d7 (diff)
Do not force non-existent parameters into the TokenPool, ofz-related
Change-Id: I2fa0ae81b987af592c14486040077c9ff157fab9
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/lotus/lotform.cxx21
1 files changed, 16 insertions, 5 deletions
diff --git a/sc/source/filter/lotus/lotform.cxx b/sc/source/filter/lotus/lotform.cxx
index 7bb0f453602b..3ab1e020d1af 100644
--- a/sc/source/filter/lotus/lotform.cxx
+++ b/sc/source/filter/lotus/lotform.cxx
@@ -193,12 +193,23 @@ void LotusToSc::DoFunc( DefTokenId eOc, sal_uInt8 nCnt, const sal_Char* pExtStri
sal_Int16 nLast = nCnt - 1;
if( eOc == ocPMT )
- { // special case ocPMT, ignore (negate?) last parameter!
+ { // special case ocPMT, negate last parameter!
// additionally: 1. -> 3., 3. -> 2., 2. -> 1.
- SAL_WARN_IF( nCnt != 3, "sc",
- "+LotusToSc::DoFunc(): ocPMT needs 3 parameters!" );
- aPool << eParam[ 1 ] << ocSep << eParam[ 0 ] << ocSep
- << ocNegSub << eParam[ 2 ];
+ SAL_WARN_IF( nCnt != 3, "sc", "+LotusToSc::DoFunc(): ocPMT needs 3 parameters!" );
+ // There should be at least 3 arguments, but with binary crap may not..
+ switch (nCnt)
+ {
+ case 1:
+ aPool << eParam[ 1 ];
+ break;
+ case 2:
+ aPool << eParam[ 1 ] << ocSep << eParam[ 0 ];
+ break;
+ default:
+ case 3:
+ aPool << eParam[ 1 ] << ocSep << eParam[ 0 ] << ocSep << ocNegSub << eParam[ 2 ];
+ break;
+ }
}
else
{ // default