summaryrefslogtreecommitdiff
path: root/scaddins
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-02-14 12:20:10 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-02-14 12:20:10 +0000
commit6ba9de6a65cda4481f47664735791231c18e5ff1 (patch)
tree80184298fb57de9b83c26615eddb6537f8e3ba46 /scaddins
parentdd355079b82f3b2b7e49533c89aee7819ffae3d3 (diff)
replace localresource of strings and keys with StringArray
Change-Id: I09543bf862dce9e0ad2afb626d58f062f552fcba
Diffstat (limited to 'scaddins')
-rw-r--r--scaddins/source/pricing/pricing.hxx27
-rw-r--r--scaddins/source/pricing/pricing.src22
2 files changed, 15 insertions, 34 deletions
diff --git a/scaddins/source/pricing/pricing.hxx b/scaddins/source/pricing/pricing.hxx
index 3fa96cde37bb..05f580a3eda7 100644
--- a/scaddins/source/pricing/pricing.hxx
+++ b/scaddins/source/pricing/pricing.hxx
@@ -50,31 +50,25 @@ namespace pricing {
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 );
+ ScaResStringLoader(sal_uInt16 nResId, sal_uInt16 nStrId, ResMgr& rResMgr)
+ {
+ ResStringArray aStrArray(ScaResId(nResId, rResMgr));
+ aStr = aStrArray.GetString(aStrArray.FindIndex(nStrId));
+ }
- inline const OUString& GetString() const { return aStr; }
+ 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:
@@ -93,7 +87,6 @@ inline ScaResStringArrLoader::ScaResStringArrLoader( sal_uInt16 nResId, sal_uInt
FreeResource();
}
-
class ScaResPublisher : public Resource
{
public:
@@ -103,14 +96,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,
diff --git a/scaddins/source/pricing/pricing.src b/scaddins/source/pricing/pricing.src
index 0515032bcd9b..17299da27b0d 100644
--- a/scaddins/source/pricing/pricing.src
+++ b/scaddins/source/pricing/pricing.src
@@ -399,25 +399,15 @@ Resource RID_PRICING_FUNCTION_DESCRIPTIONS
};
// function names as accessible from cells
-Resource RID_PRICING_FUNCTION_NAMES
+StringArray RID_PRICING_FUNCTION_NAMES
{
- String PRICING_FUNCNAME_OptBarrier
+ ItemList [ en-US ] =
{
- Text [ en-US ] = "OPT_BARRIER";
+ < "OPT_BARRIER"; PRICING_FUNCNAME_OptBarrier ; >;
+ < "OPT_TOUCH"; PRICING_FUNCNAME_OptTouch ; >;
+ < "OPT_PROB_HIT"; PRICING_FUNCNAME_OptProbHit ; >;
+ < "OPT_PROB_INMONEY"; PRICING_FUNCNAME_OptProbInMoney ; >;
};
- String PRICING_FUNCNAME_OptTouch
- {
- Text [ en-US ] = "OPT_TOUCH";
- };
- String PRICING_FUNCNAME_OptProbHit
- {
- Text [ en-US ] = "OPT_PROB_HIT";
- };
- String PRICING_FUNCNAME_OptProbInMoney
- {
- Text [ en-US ] = "OPT_PROB_INMONEY";
- };
-
};
// These were originally meant to be able to load Excel documents that for