[Libreoffice-commits] core.git: scaddins/source

Caolán McNamara caolanm at redhat.com
Tue Feb 14 12:21:36 UTC 2017


 scaddins/source/pricing/pricing.hxx |   27 +++++++++------------------
 scaddins/source/pricing/pricing.src |   22 ++++++----------------
 2 files changed, 15 insertions(+), 34 deletions(-)

New commits:
commit 6ba9de6a65cda4481f47664735791231c18e5ff1
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Feb 14 12:20:10 2017 +0000

    replace localresource of strings and keys with StringArray
    
    Change-Id: I09543bf862dce9e0ad2afb626d58f062f552fcba

diff --git a/scaddins/source/pricing/pricing.hxx b/scaddins/source/pricing/pricing.hxx
index 3fa96cd..05f580a 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 0515032..17299da 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


More information about the Libreoffice-commits mailing list