diff options
-rw-r--r-- | include/formula/funcvarargs.h | 2 | ||||
-rw-r--r-- | reportbuilder/java/org/libreoffice/report/pentaho/StarFunctionDescription.java | 2 | ||||
-rw-r--r-- | reportdesign/source/ui/misc/FunctionHelper.cxx | 14 |
3 files changed, 12 insertions, 6 deletions
diff --git a/include/formula/funcvarargs.h b/include/formula/funcvarargs.h index 1be68692fe41..ed529ee98680 100644 --- a/include/formula/funcvarargs.h +++ b/include/formula/funcvarargs.h @@ -32,7 +32,7 @@ functionDescription.isInfiniteParameterCount() which though looks like it could be easily adapted. */ -#define VAR_ARGS 30 +#define VAR_ARGS 255 /** Used to indicate a variable number of paired parameters for the Function Wizard. diff --git a/reportbuilder/java/org/libreoffice/report/pentaho/StarFunctionDescription.java b/reportbuilder/java/org/libreoffice/report/pentaho/StarFunctionDescription.java index 96c4346e9989..2eddaf307ae9 100644 --- a/reportbuilder/java/org/libreoffice/report/pentaho/StarFunctionDescription.java +++ b/reportbuilder/java/org/libreoffice/report/pentaho/StarFunctionDescription.java @@ -153,7 +153,7 @@ public final class StarFunctionDescription extends WeakBase if (infinite) { // Identical value as VAR_ARGS from formula/funcvarargs.h - count = 30; + count = 255; } final FunctionArgument[] args = new FunctionArgument[count]; for (int i = 0; i < args.length; i++) 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; |