summaryrefslogtreecommitdiff
path: root/reportdesign/source
diff options
context:
space:
mode:
Diffstat (limited to 'reportdesign/source')
-rw-r--r--reportdesign/source/ui/inc/FunctionHelper.hxx1
-rw-r--r--reportdesign/source/ui/misc/FunctionHelper.cxx18
2 files changed, 19 insertions, 0 deletions
diff --git a/reportdesign/source/ui/inc/FunctionHelper.hxx b/reportdesign/source/ui/inc/FunctionHelper.hxx
index 73142dd8f48f..2302d757779b 100644
--- a/reportdesign/source/ui/inc/FunctionHelper.hxx
+++ b/reportdesign/source/ui/inc/FunctionHelper.hxx
@@ -72,6 +72,7 @@ public:
virtual OUString getSignature() const override ;
virtual OString getHelpId() const override ;
virtual sal_uInt32 getParameterCount() const override ;
+ virtual sal_uInt32 getVarArgsStart() const override;
virtual OUString getParameterName(sal_uInt32 _nPos) const override ;
virtual OUString getParameterDescription(sal_uInt32 _nPos) const override ;
virtual bool isParameterOptional(sal_uInt32 _nPos) const override ;
diff --git a/reportdesign/source/ui/misc/FunctionHelper.cxx b/reportdesign/source/ui/misc/FunctionHelper.cxx
index d14ee0aa43ba..a92fc499928c 100644
--- a/reportdesign/source/ui/misc/FunctionHelper.cxx
+++ b/reportdesign/source/ui/misc/FunctionHelper.cxx
@@ -198,6 +198,24 @@ sal_uInt32 FunctionDescription::getParameterCount() const
return m_aParameter.getLength();
}
+sal_uInt32 FunctionDescription::getVarArgsStart() const
+{
+ /* XXX there are no variable number of arguments, are there? Nevertheless
+ * consider the varargs handling of the Function Wizard and return a value
+ * within the bounds of parameters. */
+ // 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 nVarArgs = 30; // ugly hard coded VAR_ARGS of formula::ParaWin
+ const sal_uInt32 nPairedVarArgs = 60; // ugly hard coded PAIRED_VAR_ARGS of formula::ParaWin
+ sal_uInt32 nLen = m_aParameter.getLength();
+ if (nLen >= nPairedVarArgs)
+ nLen -= nPairedVarArgs;
+ else if (nLen >= nVarArgs)
+ nLen -= nVarArgs;
+ return nLen ? nLen - 1 : 0;
+}
+
OUString FunctionDescription::getParameterName(sal_uInt32 _nPos) const
{
if ( _nPos < static_cast<sal_uInt32>(m_aParameter.getLength()) )