Hi
Attached four patches:
0001: adding comments to ScFunctionMgr and ScFunctionList in sc/inc/funcdesc.hxx
0002: removing duplicate implementation of
ScFunctionMgr::fillLastRecentlyUsedFunctions
0003: adding comments to ScFunctionCategory in sc/inc/funcdesc.hxx
0004: cleaning up comments and spacing, and minor translations in
sc/source/core/data/funcdesc.cxx
please apply
Best regards
Sören Möller
(LGPLv3+ / MPL)
From d6b6a1abbb2afa70a0fb5d45bb7dd19f57c60f91 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20M=C3=B6ller?= <soerenmoeller2001@gmail.com>
Date: Sat, 22 Jan 2011 21:06:03 +0100
Subject: [PATCH 1/4] Added doxygen style comments to ScFunctionMgr and ScFunctionList
---
sc/inc/funcdesc.hxx | 173 ++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 136 insertions(+), 37 deletions(-)
diff --git a/sc/inc/funcdesc.hxx b/sc/inc/funcdesc.hxx
index 05c71e9..3b51fce 100644
--- a/sc/inc/funcdesc.hxx
+++ b/sc/inc/funcdesc.hxx
@@ -50,7 +50,7 @@ class ScFunctionMgr;
/**
Stores and generates human readable descriptions for spreadsheet-functions,
- e.g. functions used in formulas in calc
+ e.g.\ functions used in formulas in calc
*/
class ScFuncDesc : public formula::IFunctionDescription
{
@@ -190,31 +190,37 @@ public:
*/
struct ParameterFlags
{
- bool bOptional :1; // Parameter is optional
- bool bSuppress :1; // Suppress parameter in UI because not implemented yet
+ bool bOptional :1; /**< Parameter is optional */
+ bool bSuppress :1; /**< Suppress parameter in UI because not implemented yet */
ParameterFlags() : bOptional(false), bSuppress(false) {}
};
- ::rtl::OUString *pFuncName; // Function name
- ::rtl::OUString *pFuncDesc; // Description of function
- ::rtl::OUString **ppDefArgNames; // Parameter name(s)
- ::rtl::OUString **ppDefArgDescs; // Description(s) of parameter(s)
- ParameterFlags *pDefArgFlags; // Flags for each parameter
- sal_uInt16 nFIndex; // Unique function index
- sal_uInt16 nCategory; // Function category
- sal_uInt16 nArgCount; // All parameter count, suppressed and
unsuppressed
- sal_uInt16 nHelpId; // 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.
+ ::rtl::OUString *pFuncName; /**< Function name */
+ ::rtl::OUString *pFuncDesc; /**< Description of function */
+ ::rtl::OUString **ppDefArgNames; /**< Parameter name(s) */
+ ::rtl::OUString **ppDefArgDescs; /**< Description(s) of parameter(s) */
+ ParameterFlags *pDefArgFlags; /**< Flags for each parameter */
+ sal_uInt16 nFIndex; /**< Unique function index */
+ sal_uInt16 nCategory; /**< Function category */
+ sal_uInt16 nArgCount; /**< All parameter count, suppressed and
unsuppressed */
+ sal_uInt16 nHelpId; /**< 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.
*/
};
-
-
-//============================================================================
-
+/**
+ List of spreadsheet functions.
+ Generated by retrieving functions from resources, AddIns and StarOne AddIns,
+ and storing these in one linked list. Functions can be retrieved by index and
+ by iterating through the list, starting at the First element, and retrieving
+ the Next elements one by one.
+
+ The length of the longest function name can be retrieved for easier
+ processing (i.e printing a function list).
+*/
class ScFunctionList
{
public:
@@ -240,11 +246,13 @@ public:
{ return nMaxFuncNameLen; }
private:
- List aFunctionList;
- xub_StrLen nMaxFuncNameLen;
+ List aFunctionList; /**< List of functions */
+ xub_StrLen nMaxFuncNameLen; /**< Length of longest function name */
};
-//============================================================================
+/**
+ Category of spreadsheet functions.
+*/
class ScFunctionCategory : public formula::IFunctionCategory
{
ScFunctionMgr* m_pMgr;
@@ -260,34 +268,125 @@ public:
virtual sal_uInt32 getNumber() const;
virtual ::rtl::OUString getName() const;
};
-//============================================================================
+
#define SC_FUNCGROUP_COUNT ID_FUNCTION_GRP_ADDINS
+/**
+ Stores spreadsheet functions in categories, including a cumulative ('All') category and makes
them accessible.
+*/
class ScFunctionMgr : public formula::IFunctionManager
{
public:
+ /**
+ Retrieves all calc functions, generates cumulative ('All') category, and the categories.
+
+ The function lists of the categories are sorted by (case insensitive) function name
+ */
ScFunctionMgr();
virtual ~ScFunctionMgr();
- static ::rtl::OUString GetCategoryName(sal_uInt32 _nCategoryNumber );
+ /**
+ Returns name of category.
+
+ @param _nCategoryNumber
+ index of category
+
+ @return name of the category specified by _nCategoryNumber, empty string if _nCategoryNumber
out of bounds
+ */
+ static ::rtl::OUString GetCategoryName(sal_uInt32 _nCategoryNumber );
+
+ /**
+ Returns function by name.
+
+ Searches for a function with the function name rFName, while ignoring case.
+
+ @param rFName
+ name of the function
+
+ @return pointer to function with the name rFName, null if no such function was found.
+ */
+ const ScFuncDesc* Get( const ::rtl::OUString& rFName ) const;
+
+ /**
+ Returns function by index.
+
+ Searches for a function with the function index nFIndex.
+
+ @param nFIndex
+ index of the function
+
+ @return pointer to function with the index nFIndex, null if no such function was found.
+ */
+ const ScFuncDesc* Get( sal_uInt16 nFIndex ) const;
+
+ /**
+ Returns the first function in category nCategory.
- const ScFuncDesc* Get( const ::rtl::OUString& rFName ) const;
- const ScFuncDesc* Get( sal_uInt16 nFIndex ) const;
- const ScFuncDesc* First( sal_uInt16 nCategory = 0 ) const;
- const ScFuncDesc* Next() const;
+ Selects nCategory as current category and returns first element of this.
+
+ @param nCategory
+ index of requested category
+
+ @return pointer to first element in current category, null if nCategory out of bounds
+ */
+ const ScFuncDesc* First( sal_uInt16 nCategory = 0 ) const;
+
+ /**
+ Returns the next function of the current category.
+
+ @return pointer to the next function in current category, null if current category not set.
+ */
+ const ScFuncDesc* Next() const;
+
+ /**
+ @return number of categories, not counting the cumulative category ('All')
+ */
+ virtual sal_uInt32 getCount() const;
+
+ /**
+ Returns a category.
+
+ Creates an IFunctionCategory object from a category specified by nPos.
+
+ @param nPos
+ the index of the category, note that 0 maps to the first category not the cumulative ('All')
category.
+
+ @return pointer to an IFunctionCategory object, null if nPos out of bounds.
+ */
+ virtual const formula::IFunctionCategory* getCategory(sal_uInt32 nPos) const;
+
+ /**
+ Appends the last recently used functions.
+
+ Takes the last recently used functions, but maximal LRU_MAX, and appends them to the given
vector _rLastRUFunctions.
+
+ @param _rLastRUFunctions
+ a vector of pointer to IFunctionDescription, by reference.
+ */
+ virtual void fillLastRecentlyUsedFunctions(::std::vector< const
formula::IFunctionDescription*>& _rLastRUFunctions) const;
+
+ /**
+ Implemented because of inheritance \see ScFunctionMgr::Get(const ::rtl::OUString&) const
+ */
+ virtual const formula::IFunctionDescription* getFunctionByName(const ::rtl::OUString&
_sFunctionName) const;
+
+ /**
+ Maps Etoken to character
+
+ Used for retrieving characters for parantheses and separators.
+
+ @param _eToken
+ token for which, the corresponding character is retrieved
+
+ @return character
+ */
+ virtual sal_Unicode getSingleToken(const formula::IFunctionManager::EToken _eToken) const;
- // formula::IFunctionManager
- virtual sal_uInt32 getCount() const;
- virtual const formula::IFunctionCategory* getCategory(sal_uInt32 nPos) const;
- virtual void fillLastRecentlyUsedFunctions(::std::vector<
const formula::IFunctionDescription*>& _rLastRUFunctions) const;
- virtual const formula::IFunctionDescription* getFunctionByName(const ::rtl::OUString&
_sFunctionName) const;
- virtual sal_Unicode getSingleToken(const
formula::IFunctionManager::EToken _eToken) const;
private:
- ScFunctionList* pFuncList;
- List* aCatLists[MAX_FUNCCAT];
- mutable List* pCurCatList;
+ ScFunctionList* pFuncList; /**< list of all calc functions */
+ List* aCatLists[MAX_FUNCCAT]; /**< array of all categories, 0 is the cumulative
('All') category */
+ mutable List* pCurCatList; /**< pointer to current category */
};
-//============================================================================
#endif // SC_FUNCDESC_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
--
1.7.0.4
From d7d1d808d95c48e442092b9a77d2565ec5e94dc3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20M=C3=B6ller?= <soerenmoeller2001@gmail.com>
Date: Sun, 23 Jan 2011 17:58:14 +0100
Subject: [PATCH 2/4] Removed local duplicate implementation and used ScFuntionMgr's instead
Removed a duplicate of ScFuntionMgr's fillLastRecentlyUsedFunctions
in ScFunctionDockWin and replaced its uses by use of ScFuntionMgr's
implementation. Moved definition of LRU_MAX to header file
---
sc/inc/funcdesc.hxx | 1 +
sc/source/core/data/funcdesc.cxx | 2 --
sc/source/ui/formdlg/dwfunctr.cxx | 19 ++++---------------
sc/source/ui/inc/dwfunctr.hxx | 5 +----
4 files changed, 6 insertions(+), 21 deletions(-)
diff --git a/sc/inc/funcdesc.hxx b/sc/inc/funcdesc.hxx
index 3b51fce..c864555 100644
--- a/sc/inc/funcdesc.hxx
+++ b/sc/inc/funcdesc.hxx
@@ -42,6 +42,7 @@
#include <rtl/ustring.hxx>
#define MAX_FUNCCAT 12 /* maximum number of categories for functions */
+#define LRU_MAX 10 /* maximal number of last recently used functions */
class ScFuncDesc;
class ScFunctionList;
diff --git a/sc/source/core/data/funcdesc.cxx b/sc/source/core/data/funcdesc.cxx
index 79be4f4..d5c662e 100644
--- a/sc/source/core/data/funcdesc.cxx
+++ b/sc/source/core/data/funcdesc.cxx
@@ -736,8 +736,6 @@ const formula::IFunctionDescription* ScFunctionMgr::getFunctionByName(const ::rt
// -----------------------------------------------------------------------------
void ScFunctionMgr::fillLastRecentlyUsedFunctions(::std::vector< const
formula::IFunctionDescription*>& _rLastRUFunctions) const
{
-#define LRU_MAX 10
-
const ScAppOptions& rAppOpt = SC_MOD()->GetAppOptions();
sal_uInt16 nLRUFuncCount = Min( rAppOpt.GetLRUFuncListCount(), (sal_uInt16)LRU_MAX );
sal_uInt16* pLRUListIds = rAppOpt.GetLRUFuncList();
diff --git a/sc/source/ui/formdlg/dwfunctr.cxx b/sc/source/ui/formdlg/dwfunctr.cxx
index c3f9897..3175e9a 100644
--- a/sc/source/ui/formdlg/dwfunctr.cxx
+++ b/sc/source/ui/formdlg/dwfunctr.cxx
@@ -203,20 +203,9 @@ ScFunctionDockWin::~ScFunctionDockWin()
void ScFunctionDockWin::InitLRUList()
{
- const ScAppOptions& rAppOpt = SC_MOD()->GetAppOptions();
- USHORT nLRUFuncCount = Min( rAppOpt.GetLRUFuncListCount(), (USHORT)LRU_MAX );
- USHORT* pLRUListIds = rAppOpt.GetLRUFuncList();
+ ScFunctionMgr* pFuncMgr = ScGlobal::GetStarCalcFunctionMgr();
+ pFuncMgr->fillLastRecentlyUsedFunctions(aLRUList);
- USHORT i;
- for ( i=0; i<LRU_MAX; i++ )
- aLRUList[i] = NULL;
-
- if ( pLRUListIds )
- {
- ScFunctionMgr* pFuncMgr = ScGlobal::GetStarCalcFunctionMgr();
- for ( i=0; i<nLRUFuncCount; i++ )
- aLRUList[i] = pFuncMgr->Get( pLRUListIds[i] );
- }
USHORT nSelPos = aCatBox.GetSelectEntryPos();
@@ -827,9 +816,9 @@ void ScFunctionDockWin::UpdateFunctionList()
}
else // LRU-Liste
{
- for ( USHORT i=0; i<LRU_MAX && aLRUList[i]; i++ )
+ for(::std::vector<const formula::IFunctionDescription*>::iterator
iter=aLRUList.begin();iter!=aLRUList.end();iter++)
{
- const ScFuncDesc* pDesc = aLRUList[i];
+ const ScFuncDesc* pDesc = static_cast<const ScFuncDesc*>(*iter);
pAllFuncList->SetEntryData(
pAllFuncList->InsertEntry( *(pDesc->pFuncName) ),
(void*)pDesc );
diff --git a/sc/source/ui/inc/dwfunctr.hxx b/sc/source/ui/inc/dwfunctr.hxx
index 6522e33..b542958 100644
--- a/sc/source/ui/inc/dwfunctr.hxx
+++ b/sc/source/ui/inc/dwfunctr.hxx
@@ -43,9 +43,6 @@
#include "privsplt.hxx"
#include "funcdesc.hxx"
-#ifndef LRU_MAX
-#define LRU_MAX 10
-#endif
/*************************************************************************
|*
|* Ableitung vom SfxChildWindow als "Behaelter" fuer Controller
@@ -96,7 +93,7 @@ private:
String** pArgArr;
- const ScFuncDesc* aLRUList[LRU_MAX];
+ ::std::vector< const formula::IFunctionDescription*> aLRUList;
void UpdateFunctionList();
void UpdateLRUList();
--
1.7.0.4
From ba74b6c9700126d61a6ea673f294e43fbe8d1c3e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20M=C3=B6ller?= <soerenmoeller2001@gmail.com>
Date: Sun, 23 Jan 2011 18:32:50 +0100
Subject: [PATCH 3/4] Added doxygen style comments to ScFunctionCategory.
---
sc/inc/funcdesc.hxx | 43 +++++++++++++++++++++++++++++++++----------
1 files changed, 33 insertions(+), 10 deletions(-)
diff --git a/sc/inc/funcdesc.hxx b/sc/inc/funcdesc.hxx
index c864555..562f84c 100644
--- a/sc/inc/funcdesc.hxx
+++ b/sc/inc/funcdesc.hxx
@@ -253,21 +253,44 @@ private:
/**
Category of spreadsheet functions.
+
+ Contains the name, index and function manager of a category,
+ as well as a list of functions in the category
*/
class ScFunctionCategory : public formula::IFunctionCategory
{
- ScFunctionMgr* m_pMgr;
- List* m_pCategory;
- mutable ::rtl::OUString m_sName;
- sal_uInt32 m_nCategory;
public:
- ScFunctionCategory(ScFunctionMgr* _pMgr,List* _pCategory,sal_uInt32 _nCategory) :
m_pMgr(_pMgr),m_pCategory(_pCategory),m_nCategory(_nCategory){}
+ ScFunctionCategory(ScFunctionMgr* _pMgr,List* _pCategory,sal_uInt32 _nCategory)
+ : m_pMgr(_pMgr),m_pCategory(_pCategory),m_nCategory(_nCategory){}
virtual ~ScFunctionCategory(){}
- virtual sal_uInt32 getCount() const;
- virtual const formula::IFunctionManager* getFunctionManager() const;
- virtual const formula::IFunctionDescription* getFunction(sal_uInt32 _nPos) const;
- virtual sal_uInt32 getNumber() const;
- virtual ::rtl::OUString getName() const;
+
+ /**
+ @return count of functions in this category
+ */
+ virtual sal_uInt32 getCount() const;
+ virtual const formula::IFunctionManager* getFunctionManager() const;
+
+ /**
+ Gives the _nPos'th function in this category.
+
+ @param _nPos
+ position of function in this category.
+
+ @return function at the _nPos postion in this category, null if _nPos out of bounds.
+ */
+ virtual const formula::IFunctionDescription* getFunction(sal_uInt32 _nPos) const;
+
+ /**
+ @return index number of this category.
+ */
+ virtual sal_uInt32 getNumber() const;
+ virtual ::rtl::OUString getName() const;
+
+private:
+ ScFunctionMgr* m_pMgr; /**< function manager for this category */
+ List* m_pCategory; /**< list of functions in this category */
+ mutable ::rtl::OUString m_sName; /**< name of this category */
+ sal_uInt32 m_nCategory; /**< index number of this category */
};
#define SC_FUNCGROUP_COUNT ID_FUNCTION_GRP_ADDINS
--
1.7.0.4
From 6d33e1e57abad59c2755d635d4f3269bcbd70881 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20M=C3=B6ller?= <soerenmoeller2001@gmail.com>
Date: Sun, 23 Jan 2011 18:47:48 +0100
Subject: [PATCH 4/4] Cleaned up spacing and comments in funcdesc.cxx
Additionally translated some german debug messages
---
sc/source/core/data/funcdesc.cxx | 87 ++++++++++++--------------------------
1 files changed, 27 insertions(+), 60 deletions(-)
diff --git a/sc/source/core/data/funcdesc.cxx b/sc/source/core/data/funcdesc.cxx
index d5c662e..e58cbe4 100644
--- a/sc/source/core/data/funcdesc.cxx
+++ b/sc/source/core/data/funcdesc.cxx
@@ -71,6 +71,7 @@ public:
//========================================================================
// class ScFuncDesc:
+//========================================================================
ScFuncDesc::ScFuncDesc() :
pFuncName (NULL),
@@ -86,15 +87,11 @@ ScFuncDesc::ScFuncDesc() :
bHasSuppressedArgs(false)
{}
-//------------------------------------------------------------------------
-
ScFuncDesc::~ScFuncDesc()
{
Clear();
}
-//------------------------------------------------------------------------
-
void ScFuncDesc::Clear()
{
sal_uInt16 nArgs = nArgCount;
@@ -128,8 +125,6 @@ void ScFuncDesc::Clear()
bHasSuppressedArgs = false;
}
-//------------------------------------------------------------------------
-
::rtl::OUString ScFuncDesc::GetParamList() const
{
::rtl::OUString sep(ScCompiler::GetNativeSymbol(ocSep));
@@ -193,8 +188,6 @@ void ScFuncDesc::Clear()
return aSig.makeStringAndClear();
}
-//------------------------------------------------------------------------
-
::rtl::OUString ScFuncDesc::getSignature() const
{
::rtl::OUStringBuffer aSig;
@@ -218,8 +211,6 @@ void ScFuncDesc::Clear()
return aSig.makeStringAndClear();
}
-//------------------------------------------------------------------------
-
::rtl::OUString ScFuncDesc::getFormula( const ::std::vector< ::rtl::OUString >& _aArguments ) const
{
::rtl::OUString sep = ScCompiler::GetNativeSymbol(ocSep);
@@ -257,8 +248,6 @@ void ScFuncDesc::Clear()
return aFormula.makeStringAndClear();
}
-//------------------------------------------------------------------------
-
sal_uInt16 ScFuncDesc::GetSuppressedArgCount() const
{
if (!bHasSuppressedArgs || !pDefArgFlags)
@@ -278,8 +267,6 @@ sal_uInt16 ScFuncDesc::GetSuppressedArgCount() const
return nCount;
}
-//------------------------------------------------------------------------
-
::rtl::OUString ScFuncDesc::getFunctionName() const
{
::rtl::OUString sRet;
@@ -287,12 +274,12 @@ sal_uInt16 ScFuncDesc::GetSuppressedArgCount() const
sRet = *pFuncName;
return sRet;
}
-// -----------------------------------------------------------------------------
+
const formula::IFunctionCategory* ScFuncDesc::getCategory() const
{
return ScGlobal::GetStarCalcFunctionMgr()->getCategory(nCategory);
}
-// -----------------------------------------------------------------------------
+
::rtl::OUString ScFuncDesc::getDescription() const
{
::rtl::OUString sRet;
@@ -300,14 +287,12 @@ const formula::IFunctionCategory* ScFuncDesc::getCategory() const
sRet = *pFuncDesc;
return sRet;
}
-// -----------------------------------------------------------------------------
-// GetSuppressedArgCount
+
xub_StrLen ScFuncDesc::getSuppressedArgumentCount() const
{
return GetSuppressedArgCount();
}
-// -----------------------------------------------------------------------------
-//
+
void ScFuncDesc::fillVisibleArgumentMapping(::std::vector<sal_uInt16>& _rArguments) const
{
if (!bHasSuppressedArgs || !pDefArgFlags)
@@ -326,7 +311,7 @@ void ScFuncDesc::fillVisibleArgumentMapping(::std::vector<sal_uInt16>& _rArgumen
_rArguments.push_back(i);
}
}
-// -----------------------------------------------------------------------------
+
void ScFuncDesc::initArgumentInfo() const
{
// get the full argument description
@@ -352,36 +337,31 @@ void ScFuncDesc::initArgumentInfo() const
}
}
}
-// -----------------------------------------------------------------------------
+
long ScFuncDesc::getHelpId() const
{
return (long)nHelpId;
}
-// -----------------------------------------------------------------------------
-// parameter
sal_uInt32 ScFuncDesc::getParameterCount() const
{
return nArgCount;
}
-// -----------------------------------------------------------------------------
+
::rtl::OUString ScFuncDesc::getParameterName(sal_uInt32 _nPos) const
{
return *(ppDefArgNames[_nPos]);
}
-// -----------------------------------------------------------------------------
+
::rtl::OUString ScFuncDesc::getParameterDescription(sal_uInt32 _nPos) const
{
return *(ppDefArgDescs[_nPos]);
}
-// -----------------------------------------------------------------------------
+
bool ScFuncDesc::isParameterOptional(sal_uInt32 _nPos) const
{
return pDefArgFlags[_nPos].bOptional;
}
-// -----------------------------------------------------------------------------
-
-
//===================================================================
// class ScFunctionList:
@@ -565,8 +545,6 @@ ScFunctionList::ScFunctionList() :
}
}
-//------------------------------------------------------------------------
-
ScFunctionList::~ScFunctionList()
{
const ScFuncDesc* pDesc = First();
@@ -577,27 +555,23 @@ ScFunctionList::~ScFunctionList()
}
}
-
-
-
-// -----------------------------------------------------------------------------
sal_uInt32 ScFunctionCategory::getCount() const
{
return m_pCategory->Count();
}
-// -----------------------------------------------------------------------------
+
const formula::IFunctionManager* ScFunctionCategory::getFunctionManager() const
{
return m_pMgr;
}
-// -----------------------------------------------------------------------------
+
::rtl::OUString ScFunctionCategory::getName() const
{
if ( !m_sName.getLength() )
m_sName = ScFunctionMgr::GetCategoryName(m_nCategory+1);
return m_sName;
}
-// -----------------------------------------------------------------------------
+
const formula::IFunctionDescription* ScFunctionCategory::getFunction(sal_uInt32 _nPos) const
{
const ScFuncDesc* pDesc = NULL;
@@ -606,22 +580,21 @@ const formula::IFunctionDescription*
ScFunctionCategory::getFunction(sal_uInt32
;
return pDesc;
}
-// -----------------------------------------------------------------------------
+
sal_uInt32 ScFunctionCategory::getNumber() const
{
return m_nCategory;
}
-// -----------------------------------------------------------------------------
-
//========================================================================
// class ScFunctionMgr:
+//========================================================================
ScFunctionMgr::ScFunctionMgr() :
pFuncList( ScGlobal::GetStarCalcFunctionList() ),
pCurCatList( NULL )
{
- DBG_ASSERT( pFuncList, "Funktionsliste nicht gefunden." );
+ DBG_ASSERT( pFuncList, "Functionlist not found." );
sal_uInt32 nCount = pFuncList->GetCount();
ScFuncDesc* pDesc;
List* pRootList;
@@ -639,7 +612,6 @@ ScFunctionMgr::ScFunctionMgr() :
for (nTmpCnt = 0; nTmpCnt < n; nTmpCnt++)
{
// it's case sensitiv, but special characters have to be put the right place
-
const ScFuncDesc* pTmpDesc = static_cast<const ScFuncDesc*>(
pRootList->GetObject(nTmpCnt));
if ( pCaseCollator->compareString(*pDesc->pFuncName, *pTmpDesc->pFuncName ) ==
COMPARE_LESS )
@@ -651,22 +623,18 @@ ScFunctionMgr::ScFunctionMgr() :
for ( n=0; n<nCount; n++ ) // copy to group list
{
pDesc = static_cast<ScFuncDesc*>(pRootList->GetObject(n));
- DBG_ASSERT((pDesc->nCategory) < MAX_FUNCCAT, "Unbekannte Kategorie");
+ DBG_ASSERT((pDesc->nCategory) < MAX_FUNCCAT, "Unknown category");
if ((pDesc->nCategory) < MAX_FUNCCAT)
aCatLists[pDesc->nCategory]->Insert(static_cast<void*>(pDesc), LIST_APPEND);
}
}
-//------------------------------------------------------------------------
-
ScFunctionMgr::~ScFunctionMgr()
{
for (sal_uInt16 i = 0; i < MAX_FUNCCAT; ++i)
delete aCatLists[i];
}
-//------------------------------------------------------------------------
-
const ScFuncDesc* ScFunctionMgr::Get( const ::rtl::OUString& rFName ) const
{
const ScFuncDesc* pDesc = NULL;
@@ -677,8 +645,6 @@ const ScFuncDesc* ScFunctionMgr::Get( const ::rtl::OUString& rFName ) const
return pDesc;
}
-//------------------------------------------------------------------------
-
const ScFuncDesc* ScFunctionMgr::Get( sal_uInt16 nFIndex ) const
{
const ScFuncDesc* pDesc;
@@ -688,8 +654,6 @@ const ScFuncDesc* ScFunctionMgr::Get( sal_uInt16 nFIndex ) const
return pDesc;
}
-//------------------------------------------------------------------------
-
const ScFuncDesc* ScFunctionMgr::First( sal_uInt16 nCategory ) const
{
DBG_ASSERT( nCategory < MAX_FUNCCAT, "Unbekannte Kategorie" );
@@ -706,8 +670,6 @@ const ScFuncDesc* ScFunctionMgr::First( sal_uInt16 nCategory ) const
}
}
-//------------------------------------------------------------------------
-
const ScFuncDesc* ScFunctionMgr::Next() const
{
if ( pCurCatList )
@@ -715,10 +677,12 @@ const ScFuncDesc* ScFunctionMgr::Next() const
else
return NULL;
}
+
sal_uInt32 ScFunctionMgr::getCount() const
{
return MAX_FUNCCAT - 1;
}
+
const formula::IFunctionCategory* ScFunctionMgr::getCategory(sal_uInt32 nCategory) const
{
formula::IFunctionCategory* pRet = NULL;
@@ -728,12 +692,12 @@ const formula::IFunctionCategory* ScFunctionMgr::getCategory(sal_uInt32
nCategor
}
return pRet;
}
-// -----------------------------------------------------------------------------
+
const formula::IFunctionDescription* ScFunctionMgr::getFunctionByName(const ::rtl::OUString&
_sFunctionName) const
{
return Get(_sFunctionName);
}
-// -----------------------------------------------------------------------------
+
void ScFunctionMgr::fillLastRecentlyUsedFunctions(::std::vector< const
formula::IFunctionDescription*>& _rLastRUFunctions) const
{
const ScAppOptions& rAppOpt = SC_MOD()->GetAppOptions();
@@ -746,7 +710,7 @@ void ScFunctionMgr::fillLastRecentlyUsedFunctions(::std::vector< const formula::
_rLastRUFunctions.push_back( Get( pLRUListIds[i] ) );
}
}
-// -----------------------------------------------------------------------------
+
::rtl::OUString ScFunctionMgr::GetCategoryName(sal_uInt32 _nCategoryNumber )
{
if ( _nCategoryNumber > SC_FUNCGROUP_COUNT )
@@ -758,6 +722,7 @@ void ScFunctionMgr::fillLastRecentlyUsedFunctions(::std::vector< const formula::
::std::auto_ptr<ScResourcePublisher> pCategories( new ScResourcePublisher( ScResId(
RID_FUNCTION_CATEGORIES ) ) );
return ResId::toString(ScResId(static_cast<sal_uInt16>(_nCategoryNumber)));
}
+
sal_Unicode ScFunctionMgr::getSingleToken(const formula::IFunctionManager::EToken _eToken) const
{
switch(_eToken)
@@ -776,6 +741,10 @@ sal_Unicode ScFunctionMgr::getSingleToken(const
formula::IFunctionManager::EToke
return 0;
}
+//========================================================================
+// class ScFuncRes:
+//========================================================================
+
ScFuncRes::ScFuncRes( ResId &aRes, ScFuncDesc* pDesc, bool & rbSuppressed )
: Resource(aRes)
{
@@ -846,8 +815,6 @@ ScFuncRes::ScFuncRes( ResId &aRes, ScFuncDesc* pDesc, bool & rbSuppressed )
FreeResource();
}
-//------------------------------------------------------------------------
-
sal_uInt16 ScFuncRes::GetNum()
{
return ReadShortRes();
--
1.7.0.4
Context
- [Libreoffice] [PATCH] Some comments and basic cleanup in sc · Soeren Moeller
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.