Skip to content

Commit

Permalink
replace localresource of strings and keys with StringArray
Browse files Browse the repository at this point in the history
Change-Id: I369de4213c4cb38013b984d1c2784ad68e25793c
  • Loading branch information
Caolán McNamara committed Feb 9, 2017
1 parent 99d3574 commit 6093322
Show file tree
Hide file tree
Showing 2 changed files with 2,628 additions and 3,831 deletions.
19 changes: 9 additions & 10 deletions formula/source/core/api/FormulaCompiler.cxx
Expand Up @@ -29,6 +29,7 @@
#include <svl/zforlist.hxx>
#include <tools/rc.hxx>
#include <tools/rcid.h>
#include <tools/resary.hxx>
#include <com/sun/star/sheet/FormulaOpCodeMapEntry.hpp>
#include <com/sun/star/sheet/FormulaMapGroup.hpp>
#include <com/sun/star/sheet/FormulaMapGroupSpecialOffset.hpp>
Expand Down Expand Up @@ -141,7 +142,7 @@ void lclPushOpCodeMapEntries( ::std::vector< sheet::FormulaOpCodeMapEntry >& rVe
lclPushOpCodeMapEntry( rVec, pTable, *pnOpCodes );
}

class OpCodeList : public Resource // temp object for resource
class OpCodeList
{
public:

Expand All @@ -154,12 +155,13 @@ class OpCodeList : public Resource // temp object for resource

private:
FormulaCompiler::SeparatorType meSepType;
ResStringArray maStringList;
};

OpCodeList::OpCodeList( sal_uInt16 nRID, FormulaCompiler::NonConstOpCodeMapPtr xMap,
FormulaCompiler::SeparatorType eSepType ) :
Resource( ResId( nRID, *ResourceManager::getResManager()))
, meSepType( eSepType)
FormulaCompiler::SeparatorType eSepType )
: meSepType(eSepType)
, maStringList(ResId(nRID, *ResourceManager::getResManager()))
{
SvtSysLocale aSysLocale;
const CharClass* pCharClass = (xMap->isEnglish() ? nullptr : aSysLocale.GetCharClassPtr());
Expand All @@ -181,8 +183,6 @@ OpCodeList::OpCodeList( sal_uInt16 nRID, FormulaCompiler::NonConstOpCodeMapPtr x
putDefaultOpCode( xMap, i, pCharClass);
}
}

FreeResource();
}

bool OpCodeList::getOpCodeString( OUString& rStr, sal_uInt16 nOp )
Expand Down Expand Up @@ -239,10 +239,9 @@ bool OpCodeList::getOpCodeString( OUString& rStr, sal_uInt16 nOp )
void OpCodeList::putDefaultOpCode( const FormulaCompiler::NonConstOpCodeMapPtr& xMap, sal_uInt16 nOp,
const CharClass* pCharClass )
{
ResId aRes( nOp, *ResourceManager::getResManager());
aRes.SetRT( RSC_STRING);
if (IsAvailableRes( aRes))
xMap->putOpCode( aRes.toString(), OpCode( nOp), pCharClass);
sal_uInt32 nIndex = maStringList.FindIndex(nOp);
if (nIndex != RESARRAY_INDEX_NOTFOUND)
xMap->putOpCode(maStringList.GetString(nIndex), OpCode(nOp), pCharClass);
}

// static
Expand Down

0 comments on commit 6093322

Please sign in to comment.