prepare for hidden flag in function description for Function Wizard

Change-Id: Ic018ea5b962a66b6543e57d9cc1d44711e51de6e
This commit is contained in:
Eike Rathke 2016-01-08 19:04:50 +01:00
parent 31bc9a228e
commit 077cc9fbaa
7 changed files with 40 additions and 7 deletions

View File

@ -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(); }

View File

@ -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;

View File

@ -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 ;

View File

@ -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();

View File

@ -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 */
};
/**

View File

@ -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();

View File

@ -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_...
*