Excel <-> Calc AddIn translation

This commit is contained in:
gt 2001-02-13 13:38:15 +00:00
parent dcbe62695d
commit 8d329ea88d
2 changed files with 59 additions and 4 deletions

View file

@ -2,9 +2,9 @@
*
* $RCSfile: addincol.hxx,v $
*
* $Revision: 1.1.1.1 $
* $Revision: 1.2 $
*
* last change: $Author: hr $ $Date: 2000-09-18 16:44:47 $
* last change: $Author: gt $ $Date: 2001-02-13 14:37:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -83,6 +83,9 @@
#include <com/sun/star/container/XNameAccess.hpp>
#endif
#ifndef _LANG_HXX
#include <tools/lang.hxx>
#endif
class String;
class SfxObjectShell;
@ -130,6 +133,10 @@ public:
long GetFuncCount();
BOOL FillFunctionDesc( long nFunc, ScFuncDesc& rDesc );
BOOL GetExcelName( const String& rCalcName, LanguageType eDestLang, String& rRetExcelName );
BOOL GetCalcName( const String& rExcelName, String& rRetCalcName );
// both leave rRet... unchanged, if no matching name is found
};

View file

@ -2,9 +2,9 @@
*
* $RCSfile: addincol.cxx,v $
*
* $Revision: 1.3 $
* $Revision: 1.4 $
*
* last change: $Author: nn $ $Date: 2000-10-20 09:12:47 $
* last change: $Author: gt $ $Date: 2001-02-13 14:38:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -170,6 +170,10 @@ public:
long GetCallerPos() const { return nCallerPos; }
const String& GetDescription() const { return aDescription; }
USHORT GetCategory() const { return nCategory; }
// dummy implementation
String GetExcelName( LanguageType eDestLang ) const { return aOriginalName; }
BOOL HasFunctionalityOf( const String& rExcelName ) const { return FALSE; }
};
//------------------------------------------------------------------------
@ -294,6 +298,50 @@ void ScUnoAddInCollection::Initialize()
bInitialized = TRUE; // with or without functions
}
BOOL ScUnoAddInCollection::GetExcelName( const String& r, LanguageType e, String& rRet )
{
if (!bInitialized)
Initialize();
if (nFuncCount > 0)
{
ScUnoAddInFuncData* p;
for (long i=0; i<nFuncCount; i++)
{
p = ppFuncData[i];
if ( p && p->GetOriginalName() == r )
{
rRet = p->GetExcelName( e );
return TRUE;
}
}
}
return FALSE;
}
BOOL ScUnoAddInCollection::GetCalcName( const String& r, String& rRet )
{
if (!bInitialized)
Initialize();
if (nFuncCount > 0)
{
ScUnoAddInFuncData* p;
for (long i=0; i<nFuncCount; i++)
{
p = ppFuncData[i];
if ( p && p->HasFunctionalityOf( r ) )
{
rRet = p->GetOriginalName();
return TRUE;
}
}
}
return FALSE;
}
USHORT lcl_GetCategory( const String& rName )
{
for (USHORT i=0; i<SC_FUNCGROUP_COUNT; i++)