diff options
-rw-r--r-- | formula/source/ui/dlg/FormulaHelper.cxx | 1 | ||||
-rw-r--r-- | include/formula/IFunctionDescription.hxx | 1 | ||||
-rw-r--r-- | reportdesign/source/ui/inc/FunctionHelper.hxx | 1 | ||||
-rw-r--r-- | reportdesign/source/ui/misc/FunctionHelper.cxx | 5 | ||||
-rw-r--r-- | sc/inc/funcdesc.hxx | 8 | ||||
-rw-r--r-- | sc/source/core/data/funcdesc.cxx | 15 | ||||
-rw-r--r-- | sc/source/ui/src/scfuncs.src | 16 |
7 files changed, 40 insertions, 7 deletions
diff --git a/formula/source/ui/dlg/FormulaHelper.cxx b/formula/source/ui/dlg/FormulaHelper.cxx index b2ff0c4eb90a..a1f98e5b228f 100644 --- a/formula/source/ui/dlg/FormulaHelper.cxx +++ b/formula/source/ui/dlg/FormulaHelper.cxx @@ -44,6 +44,7 @@ namespace formula virtual void initArgumentInfo() const override {} virtual OUString getSignature() const override { return OUString(); } virtual OString getHelpId() const override { return ""; } + virtual bool isHidden() const override { return false; } virtual sal_uInt32 getParameterCount() const override { return 0; } virtual sal_uInt32 getVarArgsStart() const override { return 0; } virtual OUString getParameterName(sal_uInt32 ) const override { return OUString(); } diff --git a/include/formula/IFunctionDescription.hxx b/include/formula/IFunctionDescription.hxx index bed71cd06302..7fb02c5120a7 100644 --- a/include/formula/IFunctionDescription.hxx +++ b/include/formula/IFunctionDescription.hxx @@ -88,6 +88,7 @@ namespace formula virtual void initArgumentInfo() const = 0; virtual OUString getSignature() const = 0; virtual OString getHelpId() const = 0; + virtual bool isHidden() const = 0; // parameter virtual sal_uInt32 getParameterCount() const = 0; diff --git a/reportdesign/source/ui/inc/FunctionHelper.hxx b/reportdesign/source/ui/inc/FunctionHelper.hxx index 2302d757779b..df18ed34cb36 100644 --- a/reportdesign/source/ui/inc/FunctionHelper.hxx +++ b/reportdesign/source/ui/inc/FunctionHelper.hxx @@ -71,6 +71,7 @@ public: virtual void initArgumentInfo() const override; virtual OUString getSignature() const override ; virtual OString getHelpId() const override ; + virtual bool isHidden() const override; virtual sal_uInt32 getParameterCount() const override ; virtual sal_uInt32 getVarArgsStart() const override; virtual OUString getParameterName(sal_uInt32 _nPos) const override ; diff --git a/reportdesign/source/ui/misc/FunctionHelper.cxx b/reportdesign/source/ui/misc/FunctionHelper.cxx index a92fc499928c..00c3ae9bd3e5 100644 --- a/reportdesign/source/ui/misc/FunctionHelper.cxx +++ b/reportdesign/source/ui/misc/FunctionHelper.cxx @@ -193,6 +193,11 @@ OString FunctionDescription::getHelpId() const return OString(); } +bool FunctionDescription::isHidden() const +{ + return false; +} + sal_uInt32 FunctionDescription::getParameterCount() const { return m_aParameter.getLength(); diff --git a/sc/inc/funcdesc.hxx b/sc/inc/funcdesc.hxx index 1c2bccda5bc6..b078644cac28 100644 --- a/sc/inc/funcdesc.hxx +++ b/sc/inc/funcdesc.hxx @@ -102,6 +102,13 @@ public: */ virtual OString getHelpId() const override ; + /** Returns whether function is hidden and not offered in the Function + Wizard unless used in an expression. + + @return flag whether function is hidden + */ + virtual bool isHidden() const override; + /** Returns number of arguments @@ -216,6 +223,7 @@ public: OString sHelpId; /**< HelpId of function */ bool bIncomplete :1; /**< Incomplete argument info (set for add-in info from configuration) */ bool bHasSuppressedArgs :1; /**< Whether there is any suppressed parameter. */ + bool mbHidden :1; /**< Whether function is hidden */ }; /** diff --git a/sc/source/core/data/funcdesc.cxx b/sc/source/core/data/funcdesc.cxx index 729590b07694..10c070b8275b 100644 --- a/sc/source/core/data/funcdesc.cxx +++ b/sc/source/core/data/funcdesc.cxx @@ -69,7 +69,8 @@ ScFuncDesc::ScFuncDesc() : nArgCount (0), nVarArgsStart (0), bIncomplete (false), - bHasSuppressedArgs(false) + bHasSuppressedArgs(false), + mbHidden (false) {} ScFuncDesc::~ScFuncDesc() @@ -105,6 +106,7 @@ void ScFuncDesc::Clear() sHelpId.clear(); bIncomplete = false; bHasSuppressedArgs = false; + mbHidden = false; } OUString ScFuncDesc::GetParamList() const @@ -354,6 +356,11 @@ OString ScFuncDesc::getHelpId() const return sHelpId; } +bool ScFuncDesc::isHidden() const +{ + return mbHidden; +} + sal_uInt32 ScFuncDesc::getParameterCount() const { return nArgCount; @@ -799,7 +806,11 @@ sal_Unicode ScFunctionMgr::getSingleToken(const formula::IFunctionManager::EToke ScFuncRes::ScFuncRes( ResId &aRes, ScFuncDesc* pDesc, bool & rbSuppressed ) : Resource(aRes) { - rbSuppressed = (bool)GetNum(); + sal_uInt16 nFunctionFlags = GetNum(); + // Bit 1: entirely suppressed + // Bit 2: hidden unless used + rbSuppressed = ((nFunctionFlags & 1) != 0); + pDesc->mbHidden = ((nFunctionFlags & 2) != 0); pDesc->nCategory = GetNum(); pDesc->sHelpId = ReadByteStringRes(); pDesc->nArgCount = GetNum(); diff --git a/sc/source/ui/src/scfuncs.src b/sc/source/ui/src/scfuncs.src index 122815fdd713..632cd4317877 100644 --- a/sc/source/ui/src/scfuncs.src +++ b/sc/source/ui/src/scfuncs.src @@ -31,11 +31,17 @@ * * ExtraData block with: * - * Boolean flag whether function is suppressed. Usually 0. This may be - * used to add UI string resources before UI freeze if implementation - * isn't ready yet without displaying them in the function wizard, - * most recent used list and other UI elements. Also not available via - * API then. + * 16-bit value: + * + * Bit 1: boolean flag whether function is suppressed. Usually 0. This + * may be used to add UI string resources before UI freeze if + * implementation isn't ready yet without displaying them in the + * function wizard, most recent used list and other UI elements. Also + * not available via API then. + * + * Bit 2: boolean flag whether function is hidden in the Function + * Wizard unless used in an expression. + * * * Function group (text, math, ...), one of ID_FUNCTION_GRP_... * |