replace localresource of strings and keys with StringArray

Change-Id: I4bbf5286384905b6201b1a04f161d50f4c9d4aef
This commit is contained in:
Caolán McNamara
2017-02-14 12:07:49 +00:00
parent dfc58d2db7
commit dd355079b8
2 changed files with 19 additions and 51 deletions

View File

@@ -37,35 +37,27 @@
#include <tools/rc.hxx>
#include <tools/resary.hxx>
class ScaResId : public ResId
{
public:
ScaResId( sal_uInt16 nResId, ResMgr& rResMgr );
ScaResId(sal_uInt16 nResId, ResMgr& rResMgr);
};
class ScaResStringLoader : public Resource
class ScaResStringLoader
{
private:
OUString aStr;
public:
inline ScaResStringLoader( sal_uInt16 nResId, sal_uInt16 nStrId, ResMgr& rResMgr );
inline const OUString& GetString() const { return aStr; }
ScaResStringLoader(sal_uInt16 nResId, sal_uInt16 nStrId, ResMgr& rResMgr)
{
ResStringArray aStrArray(ScaResId(nResId, rResMgr));
aStr = aStrArray.GetString(aStrArray.FindIndex(nStrId));
}
const OUString& GetString() const { return aStr; }
};
inline ScaResStringLoader::ScaResStringLoader( sal_uInt16 nResId, sal_uInt16 nStrId, ResMgr& rResMgr ) :
Resource( ScaResId( nResId, rResMgr ) ),
aStr( ScaResId( nStrId, rResMgr ) )
{
FreeResource();
}
class ScaResStringArrLoader : public Resource
{
private:
@@ -84,7 +76,6 @@ inline ScaResStringArrLoader::ScaResStringArrLoader( sal_uInt16 nResId, sal_uInt
FreeResource();
}
class ScaResPublisher : public Resource
{
public:
@@ -94,14 +85,12 @@ public:
using Resource::FreeResource;
};
class ScaFuncRes : public Resource
{
public:
ScaFuncRes( ResId& rResId, ResMgr& rResMgr, sal_uInt16 nIndex, OUString& rRet );
ScaFuncRes(ResId& rResId, ResMgr& rResMgr, sal_uInt16 nIndex, OUString& rRet);
};
enum class ScaCategory
{
DateTime,

View File

@@ -198,39 +198,18 @@ Resource RID_DATE_FUNCTION_DESCRIPTIONS
};
};
Resource RID_DATE_FUNCTION_NAMES
StringArray RID_DATE_FUNCTION_NAMES
{
String DATE_FUNCNAME_DiffWeeks
ItemList [ en-US ] =
{
Text [ en-US ] = "WEEKS";
};
String DATE_FUNCNAME_DiffMonths
{
Text [ en-US ] = "MONTHS";
};
String DATE_FUNCNAME_DiffYears
{
Text [ en-US ] = "YEARS";
};
String DATE_FUNCNAME_IsLeapYear
{
Text [ en-US ] = "ISLEAPYEAR";
};
String DATE_FUNCNAME_DaysInMonth
{
Text [ en-US ] = "DAYSINMONTH";
};
String DATE_FUNCNAME_DaysInYear
{
Text [ en-US ] = "DAYSINYEAR";
};
String DATE_FUNCNAME_WeeksInYear
{
Text [ en-US ] = "WEEKSINYEAR";
};
String DATE_FUNCNAME_Rot13
{
Text [ en-US ] = "ROT13";
< "WEEKS" ; DATE_FUNCNAME_DiffWeeks ; >;
< "MONTHS" ; DATE_FUNCNAME_DiffMonths ; >;
< "YEARS" ; DATE_FUNCNAME_DiffYears ; >;
< "ISLEAPYEAR" ; DATE_FUNCNAME_IsLeapYear ; >;
< "DAYSINMONTH" ; DATE_FUNCNAME_DaysInMonth ; >;
< "DAYSINYEAR" ; DATE_FUNCNAME_DaysInYear ; >;
< "WEEKSINYEAR" ; DATE_FUNCNAME_WeeksInYear ; >;
< "ROT13" ; DATE_FUNCNAME_Rot13 ; >;
};
};