diff options
author | Eike Rathke <erack@redhat.com> | 2017-07-05 13:44:08 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2017-07-05 13:47:55 +0200 |
commit | 91287c7456b1bc7060a0f1f08902960eb7a868dc (patch) | |
tree | ebacd895ab46cf9a984d438b12f552359b92047f /reportdesign | |
parent | ddf8d9a150e3e1725de65577c48d47918b4b11a8 (diff) |
Enable the Formula Wizard to display 255 argument fields
Previously it was, for example for SUM,
1
2
3
...
28
29
30,31,32,33,...,253,254,255
ie. for more than 30 parameters the exceeding ones were crammed into the last
(30th) edit field. The expression still worked, but this was ugly, and
selecting the last field it was easy to overwrite all remaining arguments at
once.
Change-Id: I6b27a20e7f07d3a6b4752855f04d6239e6375418
Diffstat (limited to 'reportdesign')
-rw-r--r-- | reportdesign/source/ui/misc/FunctionHelper.cxx | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/reportdesign/source/ui/misc/FunctionHelper.cxx b/reportdesign/source/ui/misc/FunctionHelper.cxx index 9c9c7450f03e..b001bf39440d 100644 --- a/reportdesign/source/ui/misc/FunctionHelper.cxx +++ b/reportdesign/source/ui/misc/FunctionHelper.cxx @@ -212,16 +212,22 @@ sal_uInt32 FunctionDescription::getVarArgsStart() const // Don't use defines/constants that could change in future, parameter count // could be part of an implicit stable API. // offapi/com/sun/star/report/meta/XFunctionDescription.idl doesn't tell. - const sal_uInt32 nVarArgs30 = 30; // ugly hard coded VAR_ARGS of formula::ParaWin - const sal_uInt32 nPairedVarArgs60 = 60; // ugly hard coded PAIRED_VAR_ARGS of formula::ParaWin + const sal_uInt32 nVarArgs30 = 30; // ugly hard coded old VAR_ARGS of formula::ParaWin + const sal_uInt32 nPairedVarArgs60 = 60; // ugly hard coded old PAIRED_VAR_ARGS of formula::ParaWin + const sal_uInt32 nVarArgs255 = 255; // ugly hard coded new VAR_ARGS of formula::ParaWin + const sal_uInt32 nPairedVarArgs510 = 510; // ugly hard coded new PAIRED_VAR_ARGS of formula::ParaWin sal_uInt32 nLen = m_aParameter.getLength(); // If the value of VAR_ARGS changes then adapt *and* maintain implicit API // stability, ie. old code using the old VAR_ARGS and PAIRED_VAR_ARGS // values must still be handled. It is *not* sufficient to simply change // the values here. - static_assert(nVarArgs30 == VAR_ARGS && nPairedVarArgs60 == PAIRED_VAR_ARGS, + static_assert(nVarArgs255 == VAR_ARGS && nPairedVarArgs510 == PAIRED_VAR_ARGS, "VAR_ARGS or PAIRED_VAR_ARGS has unexpected value"); - if (nLen >= nPairedVarArgs60) + if (nLen >= nPairedVarArgs510) + nLen -= nPairedVarArgs510; + else if (nLen >= nVarArgs255) + nLen -= nVarArgs255; + else if (nLen >= nPairedVarArgs60) nLen -= nPairedVarArgs60; else if (nLen >= nVarArgs30) nLen -= nVarArgs30; |