Kaydet (Commit) 60933220 authored tarafından Caolán McNamara's avatar Caolán McNamara

replace localresource of strings and keys with StringArray

Change-Id: I369de4213c4cb38013b984d1c2784ad68e25793c
üst 99d35740
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <svl/zforlist.hxx> #include <svl/zforlist.hxx>
#include <tools/rc.hxx> #include <tools/rc.hxx>
#include <tools/rcid.h> #include <tools/rcid.h>
#include <tools/resary.hxx>
#include <com/sun/star/sheet/FormulaOpCodeMapEntry.hpp> #include <com/sun/star/sheet/FormulaOpCodeMapEntry.hpp>
#include <com/sun/star/sheet/FormulaMapGroup.hpp> #include <com/sun/star/sheet/FormulaMapGroup.hpp>
#include <com/sun/star/sheet/FormulaMapGroupSpecialOffset.hpp> #include <com/sun/star/sheet/FormulaMapGroupSpecialOffset.hpp>
...@@ -141,7 +142,7 @@ void lclPushOpCodeMapEntries( ::std::vector< sheet::FormulaOpCodeMapEntry >& rVe ...@@ -141,7 +142,7 @@ void lclPushOpCodeMapEntries( ::std::vector< sheet::FormulaOpCodeMapEntry >& rVe
lclPushOpCodeMapEntry( rVec, pTable, *pnOpCodes ); lclPushOpCodeMapEntry( rVec, pTable, *pnOpCodes );
} }
class OpCodeList : public Resource // temp object for resource class OpCodeList
{ {
public: public:
...@@ -154,12 +155,13 @@ private: ...@@ -154,12 +155,13 @@ private:
private: private:
FormulaCompiler::SeparatorType meSepType; FormulaCompiler::SeparatorType meSepType;
ResStringArray maStringList;
}; };
OpCodeList::OpCodeList( sal_uInt16 nRID, FormulaCompiler::NonConstOpCodeMapPtr xMap, OpCodeList::OpCodeList( sal_uInt16 nRID, FormulaCompiler::NonConstOpCodeMapPtr xMap,
FormulaCompiler::SeparatorType eSepType ) : FormulaCompiler::SeparatorType eSepType )
Resource( ResId( nRID, *ResourceManager::getResManager())) : meSepType(eSepType)
, meSepType( eSepType) , maStringList(ResId(nRID, *ResourceManager::getResManager()))
{ {
SvtSysLocale aSysLocale; SvtSysLocale aSysLocale;
const CharClass* pCharClass = (xMap->isEnglish() ? nullptr : aSysLocale.GetCharClassPtr()); const CharClass* pCharClass = (xMap->isEnglish() ? nullptr : aSysLocale.GetCharClassPtr());
...@@ -181,8 +183,6 @@ OpCodeList::OpCodeList( sal_uInt16 nRID, FormulaCompiler::NonConstOpCodeMapPtr x ...@@ -181,8 +183,6 @@ OpCodeList::OpCodeList( sal_uInt16 nRID, FormulaCompiler::NonConstOpCodeMapPtr x
putDefaultOpCode( xMap, i, pCharClass); putDefaultOpCode( xMap, i, pCharClass);
} }
} }
FreeResource();
} }
bool OpCodeList::getOpCodeString( OUString& rStr, sal_uInt16 nOp ) bool OpCodeList::getOpCodeString( OUString& rStr, sal_uInt16 nOp )
...@@ -239,10 +239,9 @@ bool OpCodeList::getOpCodeString( OUString& rStr, sal_uInt16 nOp ) ...@@ -239,10 +239,9 @@ bool OpCodeList::getOpCodeString( OUString& rStr, sal_uInt16 nOp )
void OpCodeList::putDefaultOpCode( const FormulaCompiler::NonConstOpCodeMapPtr& xMap, sal_uInt16 nOp, void OpCodeList::putDefaultOpCode( const FormulaCompiler::NonConstOpCodeMapPtr& xMap, sal_uInt16 nOp,
const CharClass* pCharClass ) const CharClass* pCharClass )
{ {
ResId aRes( nOp, *ResourceManager::getResManager()); sal_uInt32 nIndex = maStringList.FindIndex(nOp);
aRes.SetRT( RSC_STRING); if (nIndex != RESARRAY_INDEX_NOTFOUND)
if (IsAvailableRes( aRes)) xMap->putOpCode(maStringList.GetString(nIndex), OpCode(nOp), pCharClass);
xMap->putOpCode( aRes.toString(), OpCode( nOp), pCharClass);
} }
// static // static
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment