[Libreoffice-commits] core.git: formula/source include/formula sc/inc sc/source
Eike Rathke
erack at redhat.com
Tue Jul 4 11:05:24 UTC 2017
formula/source/ui/dlg/parawin.cxx | 3 --
include/formula/funcvarargs.h | 46 ++++++++++++++++++++++++++++++++++++++
sc/inc/sc.hrc | 3 --
sc/source/core/data/funcdesc.cxx | 1
sc/source/core/tool/addincol.cxx | 1
sc/source/core/tool/parclass.cxx | 2 -
sc/source/ui/app/inputhdl.cxx | 1
sc/source/ui/formdlg/dwfunctr.cxx | 1
sc/source/ui/unoobj/appluno.cxx | 1
9 files changed, 53 insertions(+), 6 deletions(-)
New commits:
commit a5bff392177d2355a428d9d53a048500230e06c9
Author: Eike Rathke <erack at redhat.com>
Date: Tue Jul 4 13:04:38 2017 +0200
Move definition of VAR_ARGS and PAIRED_VAR_ARGS to formula/funcvarargs.h
... to have it at one central place instead of two. And add comments why
changing the value is not just easily done.
Change-Id: I266ea55c79c02a653a0704c33f9fa712bbcd104e
diff --git a/formula/source/ui/dlg/parawin.cxx b/formula/source/ui/dlg/parawin.cxx
index f10343a3a5d4..b5fe5d0059be 100644
--- a/formula/source/ui/dlg/parawin.cxx
+++ b/formula/source/ui/dlg/parawin.cxx
@@ -25,12 +25,11 @@
#include "parawin.hxx"
#include "formula/formdata.hxx"
#include "formula/IFunctionDescription.hxx"
+#include <formula/funcvarargs.h>
#include "ModuleHelper.hxx"
#include "ForResId.hrc"
#include "bitmaps.hlst"
-#define VAR_ARGS 30
-#define PAIRED_VAR_ARGS (VAR_ARGS + VAR_ARGS)
namespace formula
{
diff --git a/include/formula/funcvarargs.h b/include/formula/funcvarargs.h
new file mode 100644
index 000000000000..c0836a55a1e4
--- /dev/null
+++ b/include/formula/funcvarargs.h
@@ -0,0 +1,46 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_FORMULA_FUNCVARARGS_H
+#define INCLUDED_FORMULA_FUNCVARARGS_H
+
+/** Used to indicate a variable number of parameters for the Function Wizard.
+
+ VAR_ARGS if variable number of parameters, or VAR_ARGS+number if number of
+ fixed parameters and variable arguments following.
+
+ @see formula::ParaWin
+ @see ScFuncDescCore
+
+ @NOTE: the value can't be easily changed. If changed then
+ reportdesign/source/ui/misc/FunctionHelper.cxx
+ FunctionDescription::getVarArgsStart() has to provide some backward
+ compatibility for implicit API stability.
+
+ @NOTE: also
+ reportbuilder/java/org/libreoffice/report/pentaho/StarFunctionDescription.java
+ uses a hard coded value in StarFunctionDescription::getArguments() for
+ functionDescription.isInfiniteParameterCount() which though looks like it
+ could be easily adapted.
+ */
+#define VAR_ARGS 30
+
+/** Used to indicate a variable number of paired parameters for the Function Wizard.
+
+ PAIRED_VAR_ARGS if variable number of paired parameters, or
+ PAIRED_VAR_ARGS+number if number of fixed parameters and variable paired
+ arguments following.
+
+ @see VAR_ARGS
+ */
+#define PAIRED_VAR_ARGS (VAR_ARGS + VAR_ARGS)
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index a90facc28466..23e4094193ea 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -26,9 +26,6 @@
#include "svx/svxcommands.h"
#include "helpids.h"
-#define VAR_ARGS 30 // variable Parameter in scfuncs.src
-#define PAIRED_VAR_ARGS (VAR_ARGS + VAR_ARGS)
-
// areas
#define SC_VIEW_START (SID_SC_START)
diff --git a/sc/source/core/data/funcdesc.cxx b/sc/source/core/data/funcdesc.cxx
index 012308cc99bc..916264fd9fd9 100644
--- a/sc/source/core/data/funcdesc.cxx
+++ b/sc/source/core/data/funcdesc.cxx
@@ -34,6 +34,7 @@
#include <tools/resid.hxx>
#include <tools/resmgr.hxx>
#include <unotools/collatorwrapper.hxx>
+#include <formula/funcvarargs.h>
#include <memory>
#include <numeric>
diff --git a/sc/source/core/tool/addincol.cxx b/sc/source/core/tool/addincol.cxx
index 82a464737af6..67252a1b22a0 100644
--- a/sc/source/core/tool/addincol.cxx
+++ b/sc/source/core/tool/addincol.cxx
@@ -44,6 +44,7 @@
#include "scmatrix.hxx"
#include "addinlis.hxx"
#include <formula/errorcodes.hxx>
+#include <formula/funcvarargs.h>
#include "scfuncs.hrc"
#include "optutil.hxx"
#include "addincfg.hxx"
diff --git a/sc/source/core/tool/parclass.cxx b/sc/source/core/tool/parclass.cxx
index 3835af788984..c0ee514fed9e 100644
--- a/sc/source/core/tool/parclass.cxx
+++ b/sc/source/core/tool/parclass.cxx
@@ -32,8 +32,8 @@
// the documentation thingy
#include <com/sun/star/sheet/FormulaLanguage.hpp>
#include <rtl/strbuf.hxx>
+#include <formula/funcvarargs.h>
#include "compiler.hxx"
-#include "sc.hrc"
#endif
using namespace formula;
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index a8982a130c75..4bf371ca1305 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -54,6 +54,7 @@
#include <tools/urlobj.hxx>
#include <comphelper/string.hxx>
#include <formula/formulahelper.hxx>
+#include <formula/funcvarargs.h>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <comphelper/lok.hxx>
#include <o3tl/make_unique.hxx>
diff --git a/sc/source/ui/formdlg/dwfunctr.cxx b/sc/source/ui/formdlg/dwfunctr.cxx
index 8ca99aac6171..973dcd8f7d0c 100644
--- a/sc/source/ui/formdlg/dwfunctr.cxx
+++ b/sc/source/ui/formdlg/dwfunctr.cxx
@@ -23,6 +23,7 @@
#include <sfx2/dispatch.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/viewsh.hxx>
+#include <formula/funcvarargs.h>
#include "sc.hrc"
#include "global.hxx"
diff --git a/sc/source/ui/unoobj/appluno.cxx b/sc/source/ui/unoobj/appluno.cxx
index d37c2cc38710..b641142ccba1 100644
--- a/sc/source/ui/unoobj/appluno.cxx
+++ b/sc/source/ui/unoobj/appluno.cxx
@@ -21,6 +21,7 @@
#include <sal/types.h>
#include <osl/diagnose.h>
#include <cppuhelper/factory.hxx>
+#include <formula/funcvarargs.h>
#include <sfx2/app.hxx>
#include <sfx2/sfxmodelfactory.hxx>
More information about the Libreoffice-commits
mailing list