diff options
author | Eike Rathke <erack@redhat.com> | 2016-01-08 19:04:50 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-01-09 13:33:30 +0100 |
commit | 077cc9fbaa29d1440f930c3ae4be86db73ee30a8 (patch) | |
tree | e34ef3f3a5ab07e2bb005d74b937e71180b9a948 /sc | |
parent | 31bc9a228ed02dfa082e3a59c20b0ce106d5c75c (diff) |
prepare for hidden flag in function description for Function Wizard
Change-Id: Ic018ea5b962a66b6543e57d9cc1d44711e51de6e
Diffstat (limited to 'sc')
-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 |
3 files changed, 32 insertions, 7 deletions
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_... * |