diff options
Diffstat (limited to 'scaddins/source')
-rw-r--r-- | scaddins/source/analysis/analysis.cxx | 34 | ||||
-rw-r--r-- | scaddins/source/analysis/analysis.hrc | 234 | ||||
-rw-r--r-- | scaddins/source/analysis/analysis.hxx | 11 | ||||
-rw-r--r-- | scaddins/source/analysis/analysis.src | 1404 | ||||
-rw-r--r-- | scaddins/source/analysis/analysis_funcnames.src | 527 | ||||
-rw-r--r-- | scaddins/source/analysis/analysishelper.cxx | 10 | ||||
-rw-r--r-- | scaddins/source/analysis/analysishelper.hxx | 30 | ||||
-rw-r--r-- | scaddins/source/datefunc/datefunc.cxx | 37 | ||||
-rw-r--r-- | scaddins/source/datefunc/datefunc.hrc | 49 | ||||
-rw-r--r-- | scaddins/source/datefunc/datefunc.hxx | 28 | ||||
-rw-r--r-- | scaddins/source/datefunc/datefunc.src | 154 | ||||
-rw-r--r-- | scaddins/source/pricing/pricing.cxx | 51 | ||||
-rw-r--r-- | scaddins/source/pricing/pricing.hrc | 41 | ||||
-rw-r--r-- | scaddins/source/pricing/pricing.hxx | 36 | ||||
-rw-r--r-- | scaddins/source/pricing/pricing.src | 153 |
15 files changed, 78 insertions, 2721 deletions
diff --git a/scaddins/source/analysis/analysis.cxx b/scaddins/source/analysis/analysis.cxx index 14a9b6b89481..4d98db9a1ea3 100644 --- a/scaddins/source/analysis/analysis.cxx +++ b/scaddins/source/analysis/analysis.cxx @@ -18,7 +18,7 @@ */ #include "analysis.hxx" -#include "analysis.hrc" +#include "strings.hrc" #include "bessel.hxx" #include <cppuhelper/factory.hxx> #include <comphelper/processfactory.hxx> @@ -29,9 +29,7 @@ #include <rtl/math.hxx> #include <sal/macros.h> #include <string.h> -#include <tools/resary.hxx> #include <tools/resmgr.hxx> -#include <tools/rcid.h> #include <algorithm> #include <cmath> @@ -66,29 +64,14 @@ extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL analysis_component_getFactory( return pRet; } -ResMgr& AnalysisAddIn::GetResMgr() +OUString AnalysisAddIn::GetFuncDescrStr(const char** pResId, sal_uInt16 nStrIndex) { - if( !pResMgr ) - { - InitData(); // try to get resource manager - - if( !pResMgr ) - throw uno::RuntimeException(); - } - - return *pResMgr; -} - -OUString AnalysisAddIn::GetFuncDescrStr( sal_uInt16 nResId, sal_uInt16 nStrIndex ) -{ - ResStringArray aArr(AnalysisResId(nResId, GetResMgr())); - return aArr.GetString(nStrIndex - 1); + return AnalysisResId(pResId[nStrIndex - 1]); } void AnalysisAddIn::InitData() { - delete pResMgr; - pResMgr = ResMgr::CreateResMgr("analysis", LanguageTag(aFuncLoc)); + aResLocale = Translate::Create("analysis", LanguageTag(aFuncLoc)); delete pFD; pFD = new FuncDataList; @@ -103,14 +86,12 @@ AnalysisAddIn::AnalysisAddIn( const uno::Reference< uno::XComponentContext >& xC pFD( nullptr ), pFactDoubles( nullptr ), pCDL( nullptr ), - pResMgr( nullptr ), aAnyConv( xContext ) { } AnalysisAddIn::~AnalysisAddIn() { - delete pResMgr; delete pCDL; delete pFD; delete[] pDefLocales; @@ -240,7 +221,7 @@ OUString SAL_CALL AnalysisAddIn::getDisplayFunctionName( const OUString& aProgra auto it = std::find_if(pFD->begin(), pFD->end(), FindFuncData( aProgrammaticName ) ); if( it != pFD->end() ) { - aRet = AnalysisResId(it->GetUINameID(), GetResMgr()); + aRet = AnalysisResId(it->GetUINameID()); if( it->IsDouble() ) { const OUString& rSuffix = it->GetSuffix(); @@ -1124,4 +1105,9 @@ double SAL_CALL AnalysisAddIn::getConvert( double f, const OUString& aFU, const RETURN_FINITE( fRet ); } +OUString AnalysisAddIn::AnalysisResId(const char* pResId) +{ + return Translate::get(pResId, aResLocale); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scaddins/source/analysis/analysis.hrc b/scaddins/source/analysis/analysis.hrc deleted file mode 100644 index 75d4bfe28363..000000000000 --- a/scaddins/source/analysis/analysis.hrc +++ /dev/null @@ -1,234 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef SCADDINS_ANALYSIS_HRC -#define SCADDINS_ANALYSIS_HRC - -#define ANALYSIS_RESOURCE_START 1000 - -#define ANALYSIS_FUNCDESC_START (ANALYSIS_RESOURCE_START) - -#define ANALYSIS_Workday (ANALYSIS_FUNCDESC_START) -#define ANALYSIS_Yearfrac (ANALYSIS_FUNCDESC_START+1) -#define ANALYSIS_Edate (ANALYSIS_FUNCDESC_START+2) -#define ANALYSIS_Weeknum (ANALYSIS_FUNCDESC_START+3) -#define ANALYSIS_Eomonth (ANALYSIS_FUNCDESC_START+4) -#define ANALYSIS_Networkdays (ANALYSIS_FUNCDESC_START+5) -#define ANALYSIS_Iseven (ANALYSIS_FUNCDESC_START+6) -#define ANALYSIS_Isodd (ANALYSIS_FUNCDESC_START+7) -#define ANALYSIS_Multinomial (ANALYSIS_FUNCDESC_START+8) -#define ANALYSIS_Seriessum (ANALYSIS_FUNCDESC_START+9) -#define ANALYSIS_Quotient (ANALYSIS_FUNCDESC_START+10) -#define ANALYSIS_Mround (ANALYSIS_FUNCDESC_START+11) -#define ANALYSIS_Sqrtpi (ANALYSIS_FUNCDESC_START+12) -#define ANALYSIS_Randbetween (ANALYSIS_FUNCDESC_START+13) -#define ANALYSIS_Gcd (ANALYSIS_FUNCDESC_START+14) -#define ANALYSIS_Lcm (ANALYSIS_FUNCDESC_START+15) -#define ANALYSIS_Besseli (ANALYSIS_FUNCDESC_START+16) -#define ANALYSIS_Besselj (ANALYSIS_FUNCDESC_START+17) -#define ANALYSIS_Besselk (ANALYSIS_FUNCDESC_START+18) -#define ANALYSIS_Bessely (ANALYSIS_FUNCDESC_START+19) -#define ANALYSIS_Bin2Oct (ANALYSIS_FUNCDESC_START+20) -#define ANALYSIS_Bin2Dec (ANALYSIS_FUNCDESC_START+21) -#define ANALYSIS_Bin2Hex (ANALYSIS_FUNCDESC_START+22) -#define ANALYSIS_Oct2Bin (ANALYSIS_FUNCDESC_START+23) -#define ANALYSIS_Oct2Dec (ANALYSIS_FUNCDESC_START+24) -#define ANALYSIS_Oct2Hex (ANALYSIS_FUNCDESC_START+25) -#define ANALYSIS_Dec2Bin (ANALYSIS_FUNCDESC_START+26) -#define ANALYSIS_Dec2Hex (ANALYSIS_FUNCDESC_START+27) -#define ANALYSIS_Dec2Oct (ANALYSIS_FUNCDESC_START+28) -#define ANALYSIS_Hex2Bin (ANALYSIS_FUNCDESC_START+29) -#define ANALYSIS_Hex2Dec (ANALYSIS_FUNCDESC_START+30) -#define ANALYSIS_Hex2Oct (ANALYSIS_FUNCDESC_START+31) -#define ANALYSIS_Delta (ANALYSIS_FUNCDESC_START+32) -#define ANALYSIS_Erf (ANALYSIS_FUNCDESC_START+33) -#define ANALYSIS_Erfc (ANALYSIS_FUNCDESC_START+34) -#define ANALYSIS_Gestep (ANALYSIS_FUNCDESC_START+35) -#define ANALYSIS_Factdouble (ANALYSIS_FUNCDESC_START+36) -#define ANALYSIS_Imabs (ANALYSIS_FUNCDESC_START+37) -#define ANALYSIS_Imaginary (ANALYSIS_FUNCDESC_START+38) -#define ANALYSIS_Impower (ANALYSIS_FUNCDESC_START+39) -#define ANALYSIS_Imargument (ANALYSIS_FUNCDESC_START+40) -#define ANALYSIS_Imcos (ANALYSIS_FUNCDESC_START+41) -#define ANALYSIS_Imdiv (ANALYSIS_FUNCDESC_START+42) -#define ANALYSIS_Imexp (ANALYSIS_FUNCDESC_START+43) -#define ANALYSIS_Imconjugate (ANALYSIS_FUNCDESC_START+44) -#define ANALYSIS_Imln (ANALYSIS_FUNCDESC_START+45) -#define ANALYSIS_Imlog10 (ANALYSIS_FUNCDESC_START+46) -#define ANALYSIS_Imlog2 (ANALYSIS_FUNCDESC_START+47) -#define ANALYSIS_Improduct (ANALYSIS_FUNCDESC_START+48) -#define ANALYSIS_Imreal (ANALYSIS_FUNCDESC_START+49) -#define ANALYSIS_Imsin (ANALYSIS_FUNCDESC_START+50) -#define ANALYSIS_Imsub (ANALYSIS_FUNCDESC_START+51) -#define ANALYSIS_Imsqrt (ANALYSIS_FUNCDESC_START+52) -#define ANALYSIS_Imsum (ANALYSIS_FUNCDESC_START+53) -#define ANALYSIS_Complex (ANALYSIS_FUNCDESC_START+54) -#define ANALYSIS_Convert (ANALYSIS_FUNCDESC_START+55) -#define ANALYSIS_Amordegrc (ANALYSIS_FUNCDESC_START+56) -#define ANALYSIS_Amorlinc (ANALYSIS_FUNCDESC_START+57) -#define ANALYSIS_Accrint (ANALYSIS_FUNCDESC_START+58) -#define ANALYSIS_Accrintm (ANALYSIS_FUNCDESC_START+59) -#define ANALYSIS_Received (ANALYSIS_FUNCDESC_START+60) -#define ANALYSIS_Disc (ANALYSIS_FUNCDESC_START+61) -#define ANALYSIS_Duration (ANALYSIS_FUNCDESC_START+62) -#define ANALYSIS_Effect (ANALYSIS_FUNCDESC_START+63) -#define ANALYSIS_Cumprinc (ANALYSIS_FUNCDESC_START+64) -#define ANALYSIS_Cumipmt (ANALYSIS_FUNCDESC_START+65) -#define ANALYSIS_Price (ANALYSIS_FUNCDESC_START+66) -#define ANALYSIS_Pricedisc (ANALYSIS_FUNCDESC_START+67) -#define ANALYSIS_Pricemat (ANALYSIS_FUNCDESC_START+68) -#define ANALYSIS_Mduration (ANALYSIS_FUNCDESC_START+69) -#define ANALYSIS_Nominal (ANALYSIS_FUNCDESC_START+70) -#define ANALYSIS_Dollarfr (ANALYSIS_FUNCDESC_START+71) -#define ANALYSIS_Dollarde (ANALYSIS_FUNCDESC_START+72) -#define ANALYSIS_Yield (ANALYSIS_FUNCDESC_START+73) -#define ANALYSIS_Yielddisc (ANALYSIS_FUNCDESC_START+74) -#define ANALYSIS_Yieldmat (ANALYSIS_FUNCDESC_START+75) -#define ANALYSIS_Tbilleq (ANALYSIS_FUNCDESC_START+76) -#define ANALYSIS_Tbillprice (ANALYSIS_FUNCDESC_START+77) -#define ANALYSIS_Tbillyield (ANALYSIS_FUNCDESC_START+78) -#define ANALYSIS_Oddfprice (ANALYSIS_FUNCDESC_START+79) -#define ANALYSIS_Oddfyield (ANALYSIS_FUNCDESC_START+80) -#define ANALYSIS_Oddlprice (ANALYSIS_FUNCDESC_START+81) -#define ANALYSIS_Oddlyield (ANALYSIS_FUNCDESC_START+82) -#define ANALYSIS_Xirr (ANALYSIS_FUNCDESC_START+83) -#define ANALYSIS_Xnpv (ANALYSIS_FUNCDESC_START+84) -#define ANALYSIS_Intrate (ANALYSIS_FUNCDESC_START+85) -#define ANALYSIS_Coupncd (ANALYSIS_FUNCDESC_START+86) -#define ANALYSIS_Coupdays (ANALYSIS_FUNCDESC_START+87) -#define ANALYSIS_Coupdaysnc (ANALYSIS_FUNCDESC_START+88) -#define ANALYSIS_Coupdaybs (ANALYSIS_FUNCDESC_START+89) -#define ANALYSIS_Couppcd (ANALYSIS_FUNCDESC_START+90) -#define ANALYSIS_Coupnum (ANALYSIS_FUNCDESC_START+91) -#define ANALYSIS_Fvschedule (ANALYSIS_FUNCDESC_START+92) -#define ANALYSIS_Imtan (ANALYSIS_FUNCDESC_START+93) -#define ANALYSIS_Imsec (ANALYSIS_FUNCDESC_START+94) -#define ANALYSIS_Imcsc (ANALYSIS_FUNCDESC_START+95) -#define ANALYSIS_Imcot (ANALYSIS_FUNCDESC_START+96) -#define ANALYSIS_Imsinh (ANALYSIS_FUNCDESC_START+97) -#define ANALYSIS_Imcosh (ANALYSIS_FUNCDESC_START+98) -#define ANALYSIS_Imsech (ANALYSIS_FUNCDESC_START+99) -#define ANALYSIS_Imcsch (ANALYSIS_FUNCDESC_START+100) - -#define ANALYSIS_FUNCNAME_START (ANALYSIS_RESOURCE_START+2000) - -#define ANALYSIS_FUNCNAME_Workday (ANALYSIS_FUNCNAME_START) -#define ANALYSIS_FUNCNAME_Yearfrac (ANALYSIS_FUNCNAME_START+1) -#define ANALYSIS_FUNCNAME_Edate (ANALYSIS_FUNCNAME_START+2) -#define ANALYSIS_FUNCNAME_Weeknum (ANALYSIS_FUNCNAME_START+3) -#define ANALYSIS_FUNCNAME_Eomonth (ANALYSIS_FUNCNAME_START+4) -#define ANALYSIS_FUNCNAME_Networkdays (ANALYSIS_FUNCNAME_START+5) -#define ANALYSIS_FUNCNAME_Iseven (ANALYSIS_FUNCNAME_START+6) -#define ANALYSIS_FUNCNAME_Isodd (ANALYSIS_FUNCNAME_START+7) -#define ANALYSIS_FUNCNAME_Multinomial (ANALYSIS_FUNCNAME_START+8) -#define ANALYSIS_FUNCNAME_Seriessum (ANALYSIS_FUNCNAME_START+9) -#define ANALYSIS_FUNCNAME_Quotient (ANALYSIS_FUNCNAME_START+10) -#define ANALYSIS_FUNCNAME_Mround (ANALYSIS_FUNCNAME_START+11) -#define ANALYSIS_FUNCNAME_Sqrtpi (ANALYSIS_FUNCNAME_START+12) -#define ANALYSIS_FUNCNAME_Randbetween (ANALYSIS_FUNCNAME_START+13) -#define ANALYSIS_FUNCNAME_Gcd (ANALYSIS_FUNCNAME_START+14) -#define ANALYSIS_FUNCNAME_Lcm (ANALYSIS_FUNCNAME_START+15) -#define ANALYSIS_FUNCNAME_Besseli (ANALYSIS_FUNCNAME_START+16) -#define ANALYSIS_FUNCNAME_Besselj (ANALYSIS_FUNCNAME_START+17) -#define ANALYSIS_FUNCNAME_Besselk (ANALYSIS_FUNCNAME_START+18) -#define ANALYSIS_FUNCNAME_Bessely (ANALYSIS_FUNCNAME_START+19) -#define ANALYSIS_FUNCNAME_Bin2Oct (ANALYSIS_FUNCNAME_START+20) -#define ANALYSIS_FUNCNAME_Bin2Dec (ANALYSIS_FUNCNAME_START+21) -#define ANALYSIS_FUNCNAME_Bin2Hex (ANALYSIS_FUNCNAME_START+22) -#define ANALYSIS_FUNCNAME_Oct2Bin (ANALYSIS_FUNCNAME_START+23) -#define ANALYSIS_FUNCNAME_Oct2Dec (ANALYSIS_FUNCNAME_START+24) -#define ANALYSIS_FUNCNAME_Oct2Hex (ANALYSIS_FUNCNAME_START+25) -#define ANALYSIS_FUNCNAME_Dec2Bin (ANALYSIS_FUNCNAME_START+26) -#define ANALYSIS_FUNCNAME_Dec2Hex (ANALYSIS_FUNCNAME_START+27) -#define ANALYSIS_FUNCNAME_Dec2Oct (ANALYSIS_FUNCNAME_START+28) -#define ANALYSIS_FUNCNAME_Hex2Bin (ANALYSIS_FUNCNAME_START+29) -#define ANALYSIS_FUNCNAME_Hex2Dec (ANALYSIS_FUNCNAME_START+30) -#define ANALYSIS_FUNCNAME_Hex2Oct (ANALYSIS_FUNCNAME_START+31) -#define ANALYSIS_FUNCNAME_Delta (ANALYSIS_FUNCNAME_START+32) -#define ANALYSIS_FUNCNAME_Erf (ANALYSIS_FUNCNAME_START+33) -#define ANALYSIS_FUNCNAME_Erfc (ANALYSIS_FUNCNAME_START+34) -#define ANALYSIS_FUNCNAME_Gestep (ANALYSIS_FUNCNAME_START+35) -#define ANALYSIS_FUNCNAME_Factdouble (ANALYSIS_FUNCNAME_START+36) -#define ANALYSIS_FUNCNAME_Imabs (ANALYSIS_FUNCNAME_START+37) -#define ANALYSIS_FUNCNAME_Imaginary (ANALYSIS_FUNCNAME_START+38) -#define ANALYSIS_FUNCNAME_Impower (ANALYSIS_FUNCNAME_START+39) -#define ANALYSIS_FUNCNAME_Imargument (ANALYSIS_FUNCNAME_START+40) -#define ANALYSIS_FUNCNAME_Imcos (ANALYSIS_FUNCNAME_START+41) -#define ANALYSIS_FUNCNAME_Imdiv (ANALYSIS_FUNCNAME_START+42) -#define ANALYSIS_FUNCNAME_Imexp (ANALYSIS_FUNCNAME_START+43) -#define ANALYSIS_FUNCNAME_Imconjugate (ANALYSIS_FUNCNAME_START+44) -#define ANALYSIS_FUNCNAME_Imln (ANALYSIS_FUNCNAME_START+45) -#define ANALYSIS_FUNCNAME_Imlog10 (ANALYSIS_FUNCNAME_START+46) -#define ANALYSIS_FUNCNAME_Imlog2 (ANALYSIS_FUNCNAME_START+47) -#define ANALYSIS_FUNCNAME_Improduct (ANALYSIS_FUNCNAME_START+48) -#define ANALYSIS_FUNCNAME_Imreal (ANALYSIS_FUNCNAME_START+49) -#define ANALYSIS_FUNCNAME_Imsin (ANALYSIS_FUNCNAME_START+50) -#define ANALYSIS_FUNCNAME_Imsub (ANALYSIS_FUNCNAME_START+51) -#define ANALYSIS_FUNCNAME_Imsqrt (ANALYSIS_FUNCNAME_START+52) -#define ANALYSIS_FUNCNAME_Imsum (ANALYSIS_FUNCNAME_START+53) -#define ANALYSIS_FUNCNAME_Complex (ANALYSIS_FUNCNAME_START+54) -#define ANALYSIS_FUNCNAME_Convert (ANALYSIS_FUNCNAME_START+55) -#define ANALYSIS_FUNCNAME_Amordegrc (ANALYSIS_FUNCNAME_START+56) -#define ANALYSIS_FUNCNAME_Amorlinc (ANALYSIS_FUNCNAME_START+57) -#define ANALYSIS_FUNCNAME_Accrint (ANALYSIS_FUNCNAME_START+58) -#define ANALYSIS_FUNCNAME_Accrintm (ANALYSIS_FUNCNAME_START+59) -#define ANALYSIS_FUNCNAME_Received (ANALYSIS_FUNCNAME_START+60) -#define ANALYSIS_FUNCNAME_Disc (ANALYSIS_FUNCNAME_START+61) -#define ANALYSIS_FUNCNAME_Duration (ANALYSIS_FUNCNAME_START+62) -#define ANALYSIS_FUNCNAME_Effect (ANALYSIS_FUNCNAME_START+63) -#define ANALYSIS_FUNCNAME_Cumprinc (ANALYSIS_FUNCNAME_START+64) -#define ANALYSIS_FUNCNAME_Cumipmt (ANALYSIS_FUNCNAME_START+65) -#define ANALYSIS_FUNCNAME_Price (ANALYSIS_FUNCNAME_START+66) -#define ANALYSIS_FUNCNAME_Pricedisc (ANALYSIS_FUNCNAME_START+67) -#define ANALYSIS_FUNCNAME_Pricemat (ANALYSIS_FUNCNAME_START+68) -#define ANALYSIS_FUNCNAME_Mduration (ANALYSIS_FUNCNAME_START+69) -#define ANALYSIS_FUNCNAME_Nominal (ANALYSIS_FUNCNAME_START+70) -#define ANALYSIS_FUNCNAME_Dollarfr (ANALYSIS_FUNCNAME_START+71) -#define ANALYSIS_FUNCNAME_Dollarde (ANALYSIS_FUNCNAME_START+72) -#define ANALYSIS_FUNCNAME_Yield (ANALYSIS_FUNCNAME_START+73) -#define ANALYSIS_FUNCNAME_Yielddisc (ANALYSIS_FUNCNAME_START+74) -#define ANALYSIS_FUNCNAME_Yieldmat (ANALYSIS_FUNCNAME_START+75) -#define ANALYSIS_FUNCNAME_Tbilleq (ANALYSIS_FUNCNAME_START+76) -#define ANALYSIS_FUNCNAME_Tbillprice (ANALYSIS_FUNCNAME_START+77) -#define ANALYSIS_FUNCNAME_Tbillyield (ANALYSIS_FUNCNAME_START+78) -#define ANALYSIS_FUNCNAME_Oddfprice (ANALYSIS_FUNCNAME_START+79) -#define ANALYSIS_FUNCNAME_Oddfyield (ANALYSIS_FUNCNAME_START+80) -#define ANALYSIS_FUNCNAME_Oddlprice (ANALYSIS_FUNCNAME_START+81) -#define ANALYSIS_FUNCNAME_Oddlyield (ANALYSIS_FUNCNAME_START+82) -#define ANALYSIS_FUNCNAME_Xirr (ANALYSIS_FUNCNAME_START+83) -#define ANALYSIS_FUNCNAME_Xnpv (ANALYSIS_FUNCNAME_START+84) -#define ANALYSIS_FUNCNAME_Intrate (ANALYSIS_FUNCNAME_START+85) -#define ANALYSIS_FUNCNAME_Coupncd (ANALYSIS_FUNCNAME_START+86) -#define ANALYSIS_FUNCNAME_Coupdays (ANALYSIS_FUNCNAME_START+87) -#define ANALYSIS_FUNCNAME_Coupdaysnc (ANALYSIS_FUNCNAME_START+88) -#define ANALYSIS_FUNCNAME_Coupdaybs (ANALYSIS_FUNCNAME_START+89) -#define ANALYSIS_FUNCNAME_Couppcd (ANALYSIS_FUNCNAME_START+90) -#define ANALYSIS_FUNCNAME_Coupnum (ANALYSIS_FUNCNAME_START+91) -#define ANALYSIS_FUNCNAME_Fvschedule (ANALYSIS_FUNCNAME_START+92) -#define ANALYSIS_FUNCNAME_Imtan (ANALYSIS_FUNCNAME_START+93) -#define ANALYSIS_FUNCNAME_Imsec (ANALYSIS_FUNCNAME_START+94) -#define ANALYSIS_FUNCNAME_Imcsc (ANALYSIS_FUNCNAME_START+95) -#define ANALYSIS_FUNCNAME_Imcot (ANALYSIS_FUNCNAME_START+96) -#define ANALYSIS_FUNCNAME_Imsinh (ANALYSIS_FUNCNAME_START+97) -#define ANALYSIS_FUNCNAME_Imcosh (ANALYSIS_FUNCNAME_START+98) -#define ANALYSIS_FUNCNAME_Imsech (ANALYSIS_FUNCNAME_START+99) -#define ANALYSIS_FUNCNAME_Imcsch (ANALYSIS_FUNCNAME_START+100) - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scaddins/source/analysis/analysis.hxx b/scaddins/source/analysis/analysis.hxx index c38c65759148..22e82cddfe15 100644 --- a/scaddins/source/analysis/analysis.hxx +++ b/scaddins/source/analysis/analysis.hxx @@ -40,8 +40,6 @@ namespace sca { namespace analysis { class ConvertDataList; } } -class ResMgr; - css::uno::Reference< css::uno::XInterface > SAL_CALL AnalysisAddIn_CreateInstance( const css::uno::Reference< css::lang::XMultiServiceFactory >& ); @@ -59,14 +57,12 @@ private: sca::analysis::FuncDataList* pFD; std::unique_ptr<double[]> pFactDoubles; sca::analysis::ConvertDataList* pCDL; - ResMgr* pResMgr; + std::locale aResLocale; sca::analysis::ScaAnyConverter aAnyConv; /// @throws css::uno::RuntimeException - ResMgr& GetResMgr(); - /// @throws css::uno::RuntimeException - OUString GetFuncDescrStr( sal_uInt16 nResId, sal_uInt16 nStrIndex ); + OUString GetFuncDescrStr(const char** pResId, sal_uInt16 nStrIndex); void InitDefLocales(); inline const css::lang::Locale& GetLocale( sal_uInt32 nInd ); void InitData(); @@ -82,6 +78,9 @@ private: public: explicit AnalysisAddIn( const css::uno::Reference< css::uno::XComponentContext >& xContext ); + + OUString AnalysisResId(const char* pId); + virtual ~AnalysisAddIn() override; /// @throws css::uno::RuntimeException diff --git a/scaddins/source/analysis/analysis.src b/scaddins/source/analysis/analysis.src deleted file mode 100644 index 14d15b9e3f5b..000000000000 --- a/scaddins/source/analysis/analysis.src +++ /dev/null @@ -1,1404 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include "analysis.hrc" - -StringArray ANALYSIS_Workday -{ - ItemList [ en-US ] = - { - < "Returns the serial number of the date before or after a specified number of workdays"; > ; - < "Start date"; > ; - < "The start date"; > ; - < "Days"; > ; - < "The number of workdays before or after the start date"; > ; - < "Holidays"; > ; - < "List of date values of days off (vacation, holidays, etc.)"; > ; - }; -}; - -StringArray ANALYSIS_Yearfrac -{ - ItemList [ en-US ] = - { - < "Returns the number of years (including fractional part) between two dates"; > ; - < "Start date"; > ; - < "The start date"; > ; - < "End date"; > ; - < "The end date"; > ; - < "Basis"; > ; - < "Basis indicates the day-count convention to use in the calculation"; > ; - }; -}; - -StringArray ANALYSIS_Edate -{ - ItemList [ en-US ] = - { - < "Returns the serial number of the date that is a specified number of months before or after the start date"; > ; - < "Start date"; > ; - < "The start date"; > ; - < "Months"; > ; - < "Number of months before or after the start date"; > ; - }; -}; - -StringArray ANALYSIS_Weeknum -{ - ItemList [ en-US ] = - { - < "Returns the number of the calendar week in which the specified date occurs.\nThis function exists for interoperability with older Microsoft Excel documents, for new documents use WEEKNUM instead."; > ; - < "Date"; > ; - < "The date or date serial number"; > ; - < "Return type"; > ; - < "Indicates the first day of the week (1 = Sunday, 2 = Monday)"; > ; - }; -}; - -StringArray ANALYSIS_Eomonth -{ - ItemList [ en-US ] = - { - < "Returns the serial number of the last day of the month that comes a certain number of months before or after the start date"; > ; - < "Start date"; > ; - < "The start date"; > ; - < "Months"; > ; - < "Number of months before or after the start date"; > ; - }; -}; - -StringArray ANALYSIS_Networkdays -{ - ItemList [ en-US ] = - { - < "Returns the number of workdays between two dates.\nThis function exists for interoperability with older Microsoft Excel documents, for new documents use NETWORKDAYS instead."; > ; - < "Start date"; > ; - < "The start date"; > ; - < "End date"; > ; - < "The end date"; > ; - < "Holidays"; > ; - < "List of date values representing days off (vacation, holidays, etc.)"; > ; - }; -}; - -StringArray ANALYSIS_Iseven -{ - ItemList [ en-US ] = - { - < "Returns the value 'true' if the number is even"; > ; - < "Number"; > ; - < "The number"; > ; - }; -}; - -StringArray ANALYSIS_Isodd -{ - ItemList [ en-US ] = - { - < "Returns the value 'true' if the number is odd"; > ; - < "Number"; > ; - < "The number"; > ; - }; -}; - -StringArray ANALYSIS_Multinomial -{ - ItemList [ en-US ] = - { - < "Returns the multinomial coefficient of a set of numbers"; > ; - < "Number"; > ; - < "Number or list of numbers for which you want the multinomial coefficient"; > ; - }; -}; - -StringArray ANALYSIS_Seriessum -{ - ItemList [ en-US ] = - { - < "Returns the sum of a power series"; > ; - < "X"; > ; - < "The independent variable of the power series"; > ; - < "N"; > ; - < "The initial power to which x is to be raised"; > ; - < "M"; > ; - < "The increment by which to increase n for each term in the series"; > ; - < "Coefficients"; > ; - < "Set of coefficients by which each successive power of the variable x is multiplied"; > ; - }; -}; - -StringArray ANALYSIS_Quotient -{ - ItemList [ en-US ] = - { - < "Returns the integer portion of a division"; > ; - < "Numerator"; > ; - < "The dividend"; > ; - < "Denominator"; > ; - < "The divisor"; > ; - }; -}; - -StringArray ANALYSIS_Mround -{ - ItemList [ en-US ] = - { - < "Returns a number rounded to a specified multiple"; > ; - < "Number"; > ; - < "The number to round off"; > ; - < "Multiple"; > ; - < "The multiple to which you want to round number"; > ; - }; -}; - -StringArray ANALYSIS_Sqrtpi -{ - ItemList [ en-US ] = - { - < "Returns the square root of a number which has been multiplied by pi"; > ; - < "Number"; > ; - < "The number by which pi is multiplied"; > ; - }; -}; - -StringArray ANALYSIS_Randbetween -{ - ItemList [ en-US ] = - { - < "Returns a random integer between the numbers you specify"; > ; - < "Bottom"; > ; - < "The smallest integer returned"; > ; - < "Top"; > ; - < "The largest integer returned"; > ; - }; -}; - -StringArray ANALYSIS_Gcd -{ - ItemList [ en-US ] = - { - < "Returns the greatest common divisor.\nThis function exists for interoperability with older Microsoft Excel documents, for new documents use GCD instead."; > ; - < "Number"; > ; - < "Number or list of numbers"; > ; - }; -}; - -StringArray ANALYSIS_Lcm -{ - ItemList [ en-US ] = - { - < "Returns the least common multiple.\nThis function exists for interoperability with older Microsoft Excel documents, for new documents use LCM instead."; > ; - < "Number"; > ; - < "Number or list of numbers"; > ; - }; -}; - -StringArray ANALYSIS_Besseli -{ - ItemList [ en-US ] = - { - < "Returns the modified Bessel function In(x)"; > ; - < "X"; > ; - < "The value at which the function is to be evaluated"; > ; - < "N"; > ; - < "The order of the Bessel function"; > ; - }; -}; - -StringArray ANALYSIS_Besselj -{ - ItemList [ en-US ] = - { - < "Returns the Bessel function Jn(x)"; > ; - < "X"; > ; - < "The value at which the function is to be evaluated"; > ; - < "N"; > ; - < "The order of the Bessel function"; > ; - }; -}; - -StringArray ANALYSIS_Besselk -{ - ItemList [ en-US ] = - { - < "Returns the Bessel function Kn(x)"; > ; - < "X"; > ; - < "The value at which the function is to be evaluated"; > ; - < "N"; > ; - < "The order of the Bessel function"; > ; - }; -}; - -StringArray ANALYSIS_Bessely -{ - ItemList [ en-US ] = - { - < "Returns the Bessel function Yn(x)"; > ; - < "X"; > ; - < "The value at which the function is to be evaluated"; > ; - < "N"; > ; - < "The order of the Bessel function"; > ; - }; -}; - -StringArray ANALYSIS_Bin2Oct -{ - ItemList [ en-US ] = - { - < "Converts a binary number to an octal number"; > ; - < "Number"; > ; - < "The binary number to be converted (as text)"; > ; - < "Places"; > ; - < "Number of places used"; > ; - }; -}; - -StringArray ANALYSIS_Bin2Dec -{ - ItemList [ en-US ] = - { - < "Converts a binary number to a decimal number"; > ; - < "Number"; > ; - < "The binary number to be converted (as text)"; > ; - }; -}; - -StringArray ANALYSIS_Bin2Hex -{ - ItemList [ en-US ] = - { - < "Converts a binary number to a hexadecimal number"; > ; - < "Number"; > ; - < "The binary number to be converted (as text)"; > ; - < "Places"; > ; - < "Number of places used."; > ; - }; -}; - -StringArray ANALYSIS_Oct2Bin -{ - ItemList [ en-US ] = - { - < "Converts an octal number to a binary number"; > ; - < "Number"; > ; - < "The octal number to be converted (as text)"; > ; - < "Places"; > ; - < "Number of places used"; > ; - }; -}; - -StringArray ANALYSIS_Oct2Dec -{ - ItemList [ en-US ] = - { - < "Converts an octal number to a decimal number"; > ; - < "Number"; > ; - < "The octal number to be converted (as text)"; > ; - }; -}; - -StringArray ANALYSIS_Oct2Hex -{ - ItemList [ en-US ] = - { - < "Converts an octal number to a hexadecimal number"; > ; - < "Number"; > ; - < "The octal number to be converted (as text)"; > ; - < "Places"; > ; - < "Number of places used"; > ; - }; -}; - -StringArray ANALYSIS_Dec2Bin -{ - ItemList [ en-US ] = - { - < "Converts a decimal number to a binary number"; > ; - < "Number"; > ; - < "The decimal integer to be converted"; > ; - < "Places"; > ; - < "Number of places used"; > ; - }; -}; - -StringArray ANALYSIS_Dec2Hex -{ - ItemList [ en-US ] = - { - < "Converts a decimal number to a hexadecimal number"; > ; - < "Number"; > ; - < "The decimal integer to be converted"; > ; - < "Places"; > ; - < "Number of places used"; > ; - }; -}; - -StringArray ANALYSIS_Dec2Oct -{ - ItemList [ en-US ] = - { - < "Converts a decimal number into an octal number"; > ; - < "Number"; > ; - < "The decimal number"; > ; - < "Places"; > ; - < "Number of places used"; > ; - }; -}; - -StringArray ANALYSIS_Hex2Bin -{ - ItemList [ en-US ] = - { - < "Converts a hexadecimal number to a binary number"; > ; - < "Number"; > ; - < "The hexadecimal number to be converted (as text)"; > ; - < "Places"; > ; - < "Number of places used"; > ; - }; -}; - -StringArray ANALYSIS_Hex2Dec -{ - ItemList [ en-US ] = - { - < "Converts a hexadecimal number to a decimal number"; > ; - < "Number"; > ; - < "The hexadecimal number to be converted (as text)"; > ; - }; -}; - -StringArray ANALYSIS_Hex2Oct -{ - ItemList [ en-US ] = - { - < "Converts a hexadecimal number to an octal number"; > ; - < "Number"; > ; - < "The hexadecimal number to be converted (as text)"; > ; - < "Places"; > ; - < "Number of places used"; > ; - }; -}; - -StringArray ANALYSIS_Delta -{ - ItemList [ en-US ] = - { - < "Tests whether two values are equal"; > ; - < "Number 1"; > ; - < "The first number"; > ; - < "Number 2"; > ; - < "The second number"; > ; - }; -}; - -StringArray ANALYSIS_Erf -{ - ItemList [ en-US ] = - { - < "Returns the error function"; > ; - < "Lower limit"; > ; - < "The lower limit for integration"; > ; - < "Upper limit"; > ; - < "The upper limit for integration"; > ; - }; -}; - -StringArray ANALYSIS_Erfc -{ - ItemList [ en-US ] = - { - < "Returns the complementary error function"; > ; - < "Lower limit"; > ; - < "The lower limit for integration"; > ; - }; -}; - -StringArray ANALYSIS_Gestep -{ - ItemList [ en-US ] = - { - < "Tests whether a number is greater than a threshold value"; > ; - < "Number"; > ; - < "The value to test against step"; > ; - < "Step"; > ; - < "The threshold value"; > ; - }; -}; - -StringArray ANALYSIS_Factdouble -{ - ItemList [ en-US ] = - { - < "Returns the double factorial of Number"; > ; - < "Number"; > ; - < "The number"; > ; - }; -}; - -StringArray ANALYSIS_Imabs -{ - ItemList [ en-US ] = - { - < "Returns the absolute value (modulus) of a complex number"; > ; - < "Complex number"; > ; - < "The complex number"; > ; - }; -}; - -StringArray ANALYSIS_Imaginary -{ - ItemList [ en-US ] = - { - < "Returns the imaginary coefficient of a complex number"; > ; - < "Complex number"; > ; - < "The complex number"; > ; - }; -}; - -StringArray ANALYSIS_Impower -{ - ItemList [ en-US ] = - { - < "Returns a complex number raised to a real power"; > ; - < "Complex number"; > ; - < "The complex number"; > ; - < "Number"; > ; - < "Power to which the complex number is raised"; > ; - }; -}; - -StringArray ANALYSIS_Imargument -{ - ItemList [ en-US ] = - { - < "Returns the argument theta, an angle expressed in radians"; > ; - < "Complex number"; > ; - < "A complex number"; > ; - }; -}; - -StringArray ANALYSIS_Imcos -{ - ItemList [ en-US ] = - { - < "Returns the cosine of a complex number"; > ; - < "Complex number"; > ; - < "A complex number"; > ; - }; -}; - -StringArray ANALYSIS_Imdiv -{ - ItemList [ en-US ] = - { - < "Returns the quotient of two complex numbers"; > ; - < "Numerator"; > ; - < "The dividend"; > ; - < "Denominator"; > ; - < "The divisor"; > ; - }; -}; - -StringArray ANALYSIS_Imexp -{ - ItemList [ en-US ] = - { - < "Returns the algebraic form of the exponential of a complex number"; > ; - < "Complex number"; > ; - < "The complex number"; > ; - }; -}; - -StringArray ANALYSIS_Imconjugate -{ - ItemList [ en-US ] = - { - < "Returns the complex conjugate of a complex number"; > ; - < "Complex number"; > ; - < "The complex number"; > ; - }; -}; - -StringArray ANALYSIS_Imln -{ - ItemList [ en-US ] = - { - < "Returns the natural logarithm of a complex number"; > ; - < "Complex number"; > ; - < "The complex number"; > ; - }; -}; - -StringArray ANALYSIS_Imlog10 -{ - ItemList [ en-US ] = - { - < "Returns the base-10 logarithm of a complex number"; > ; - < "Complex number"; > ; - < "The complex number"; > ; - }; -}; - -StringArray ANALYSIS_Imlog2 -{ - ItemList [ en-US ] = - { - < "Returns the base-2 logarithm of a complex number"; > ; - < "Complex number"; > ; - < "The complex number"; > ; - }; -}; - -StringArray ANALYSIS_Improduct -{ - ItemList [ en-US ] = - { - < "Returns the product of several complex numbers"; > ; - < "Complex number"; > ; - < "The first complex number"; > ; - < "Complex number"; > ; - < "Another complex number"; > ; - }; -}; - -StringArray ANALYSIS_Imreal -{ - ItemList [ en-US ] = - { - < "Returns the real coefficient of a complex number"; > ; - < "Complex number"; > ; - < "The complex number"; > ; - }; -}; - -StringArray ANALYSIS_Imsin -{ - ItemList [ en-US ] = - { - < "Returns the sine of a complex number"; > ; - < "Complex number"; > ; - < "The complex number"; > ; - }; -}; - -StringArray ANALYSIS_Imsub -{ - ItemList [ en-US ] = - { - < "Returns the difference of two complex numbers"; > ; - < "Complex number 1"; > ; - < "Complex number 1"; > ; - < "Complex number 2"; > ; - < "Complex number 2"; > ; - }; -}; - -StringArray ANALYSIS_Imsqrt -{ - ItemList [ en-US ] = - { - < "Returns the square root of a complex number"; > ; - < "Complex number"; > ; - < "The complex number"; > ; - }; -}; - -StringArray ANALYSIS_Imsum -{ - ItemList [ en-US ] = - { - < "Returns the sum of complex numbers"; > ; - < "Complex number"; > ; - < "The complex number"; > ; - }; -}; - -StringArray ANALYSIS_Imtan -{ - ItemList [ en-US ] = - { - < "Returns the tangent of a complex number"; > ; - < "Complex number"; > ; - < "A complex number"; > ; - }; -}; - -StringArray ANALYSIS_Imsec -{ - ItemList [ en-US ] = - { - < "Returns the secant of a complex number"; > ; - < "Complex number"; > ; - < "A complex number"; > ; - }; -}; - -StringArray ANALYSIS_Imcsc -{ - ItemList [ en-US ] = - { - < "Returns the cosecant of a complex number"; > ; - < "Complex number"; > ; - < "A complex number"; > ; - }; -}; - -StringArray ANALYSIS_Imcot -{ - ItemList [ en-US ] = - { - < "Returns the cotangent of a complex number"; > ; - < "Complex number"; > ; - < "A complex number"; > ; - }; -}; - -StringArray ANALYSIS_Imsinh -{ - ItemList [ en-US ] = - { - < "Returns the hyperbolic sine of a complex number"; > ; - < "Complex number"; > ; - < "A complex number"; > ; - }; -}; - -StringArray ANALYSIS_Imcosh -{ - ItemList [ en-US ] = - { - < "Returns the hyperbolic cosine of a complex number"; > ; - < "Complex number"; > ; - < "A complex number"; > ; - }; -}; - -StringArray ANALYSIS_Imsech -{ - ItemList [ en-US ] = - { - < "Returns the hyperbolic secant of a complex number"; > ; - < "Complex number"; > ; - < "A complex number"; > ; - }; -}; - -StringArray ANALYSIS_Imcsch -{ - ItemList [ en-US ] = - { - < "Returns the hyperbolic cosecant of a complex number"; > ; - < "Complex number"; > ; - < "A complex number"; > ; - }; -}; - -StringArray ANALYSIS_Complex -{ - ItemList [ en-US ] = - { - < "Converts real and imaginary coefficients into a complex number"; > ; - < "Real num"; > ; - < "The real coefficient"; > ; - < "I num"; > ; - < "The imaginary coefficient"; > ; - < "Suffix"; > ; - < "The suffix"; > ; - }; -}; - -StringArray ANALYSIS_Convert -{ - ItemList [ en-US ] = - { - < "Converts a number from one measurement system to another"; > ; - < "Number"; > ; - < "The number"; > ; - < "From unit"; > ; - < "Unit of measure for number"; > ; - < "To unit"; > ; - < "Unit of measure for the result"; > ; - }; -}; - -StringArray ANALYSIS_Amordegrc -{ - ItemList [ en-US ] = - { - < "Returns the prorated linear depreciation of an asset for each accounting period"; > ; - < "Cost"; > ; - < "Cost of the asset"; > ; - < "Date purchased"; > ; - < "Purchase date of the asset"; > ; - < "First period"; > ; - < "Date the first period ends"; > ; - < "Salvage"; > ; - < "Salvage value of an asset at the end of its life"; > ; - < "Period"; > ; - < "The period"; > ; - < "Rate"; > ; - < "The rate of depreciation"; > ; - < "Basis"; > ; - < "The year basis to be used"; > ; - }; -}; - -StringArray ANALYSIS_Amorlinc -{ - ItemList [ en-US ] = - { - < "Returns the prorated linear depreciation of an asset for each accounting period"; > ; - < "Cost"; > ; - < "Cost of the asset"; > ; - < "Date purchased"; > ; - < "Purchase date of the asset"; > ; - < "First period"; > ; - < "The date the first period ends"; > ; - < "Salvage"; > ; - < "The salvage value of an asset at the end of its life"; > ; - < "Period"; > ; - < "The period"; > ; - < "Rate"; > ; - < "The rate of depreciation"; > ; - < "Basis"; > ; - < "The year basis to be used"; > ; - }; -}; - -StringArray ANALYSIS_Accrint -{ - ItemList [ en-US ] = - { - < "Returns the accrued interest for a security that pays periodic interest"; > ; - < "Issue"; > ; - < "Issue date of the security"; > ; - < "First interest"; > ; - < "First interest date of the security"; > ; - < "Settlement"; > ; - < "The settlement"; > ; - < "Rate"; > ; - < "The rate"; > ; - < "Par"; > ; - < "The par value"; > ; - < "Frequency"; > ; - < "The frequency"; > ; - < "Basis"; > ; - < "The basis"; > ; - }; -}; - -StringArray ANALYSIS_Accrintm -{ - ItemList [ en-US ] = - { - < "Returns the accrued interest for a security that pays interest at maturity"; > ; - < "Issue"; > ; - < "The issue date"; > ; - < "Settlement"; > ; - < "The settlement"; > ; - < "Rate"; > ; - < "The rate"; > ; - < "Par"; > ; - < "The par value"; > ; - < "Basis"; > ; - < "The basis"; > ; - }; -}; - -StringArray ANALYSIS_Received -{ - ItemList [ en-US ] = - { - < "Returns the amount paid out at maturity for a fully invested security"; > ; - < "Settlement"; > ; - < "The settlement"; > ; - < "Maturity"; > ; - < "The maturity"; > ; - < "Investment"; > ; - < "The investment"; > ; - < "Discount"; > ; - < "The discount"; > ; - < "Basis"; > ; - < "The basis"; > ; - }; -}; - -StringArray ANALYSIS_Disc -{ - ItemList [ en-US ] = - { - < "Returns the discount rate for a security"; > ; - < "Settlement"; > ; - < "The settlement"; > ; - < "Maturity"; > ; - < "The maturity"; > ; - < "Price"; > ; - < "The price"; > ; - < "Redemption"; > ; - < "The redemption value"; > ; - < "Basis"; > ; - < "The basis"; > ; - }; -}; - -StringArray ANALYSIS_Duration -{ - ItemList [ en-US ] = - { - < "Returns the annual Macaulay duration of a security with periodic interest payments"; > ; - < "Settlement"; > ; - < "The settlement"; > ; - < "Maturity"; > ; - < "The maturity"; > ; - < "Coupon"; > ; - < "The coupon rate"; > ; - < "Yield"; > ; - < "The yield"; > ; - < "Frequency"; > ; - < "The frequency"; > ; - < "Basis"; > ; - < "The basis"; > ; - }; -}; - -StringArray ANALYSIS_Effect -{ - ItemList [ en-US ] = - { - < "Returns the effective annual interest rate"; > ; - < "Nominal rate"; > ; - < "The nominal rate"; > ; - < "Npery"; > ; - < "The periods"; > ; - }; -}; - -StringArray ANALYSIS_Cumprinc -{ - ItemList [ en-US ] = - { - < "Returns the cumulative principal on a loan to be paid between two periods"; > ; - < "Rate"; > ; - < "The rate"; > ; - < "Nper"; > ; - < "Number of payment periods"; > ; - < "Pv"; > ; - < "The present value"; > ; - < "Start period"; > ; - < "The start period"; > ; - < "End period"; > ; - < "The end period"; > ; - < "Type"; > ; - < "The type of maturity"; > ; - }; -}; - -StringArray ANALYSIS_Cumipmt -{ - ItemList [ en-US ] = - { - < "Returns the cumulative interest to be paid between two periods"; > ; - < "Rate"; > ; - < "The rate"; > ; - < "Nper"; > ; - < "Number of payment periods"; > ; - < "Pv"; > ; - < "The present value"; > ; - < "Start period"; > ; - < "The start period"; > ; - < "End period"; > ; - < "The end period"; > ; - < "Type"; > ; - < "The type of maturity"; > ; - }; -}; - -StringArray ANALYSIS_Price -{ - ItemList [ en-US ] = - { - < "Returns the price per 100 currency units face value of a security that pays periodic interest"; > ; - < "Settlement"; > ; - < "The settlement"; > ; - < "Maturity"; > ; - < "The maturity"; > ; - < "Rate"; > ; - < "The rate"; > ; - < "Yield"; > ; - < "The yield"; > ; - < "Redemption"; > ; - < "The redemption value"; > ; - < "Frequency"; > ; - < "The frequency"; > ; - < "Basis"; > ; - < "The basis"; > ; - }; -}; - -StringArray ANALYSIS_Pricedisc -{ - ItemList [ en-US ] = - { - < "Returns the price per 100 currency units face value of a discounted security"; > ; - < "Settlement"; > ; - < "The settlement"; > ; - < "Maturity"; > ; - < "The maturity"; > ; - < "Discount"; > ; - < "The discount"; > ; - < "Redemption"; > ; - < "The redemption value"; > ; - < "Basis"; > ; - < "The basis"; > ; - }; -}; - -StringArray ANALYSIS_Pricemat -{ - ItemList [ en-US ] = - { - < "Returns the price per 100 currency units face value of a security that pays interest at maturity"; > ; - < "Settlement"; > ; - < "The settlement"; > ; - < "Maturity"; > ; - < "The maturity"; > ; - < "Issue"; > ; - < "The issue date"; > ; - < "Rate"; > ; - < "The rate"; > ; - < "Yield"; > ; - < "The yield"; > ; - < "Basis"; > ; - < "The basis"; > ; - }; -}; - -StringArray ANALYSIS_Mduration -{ - ItemList [ en-US ] = - { - < "Returns the Macaulay modified duration for a security with an assumed par value of 100 currency units"; > ; - < "Settlement"; > ; - < "The settlement"; > ; - < "Maturity"; > ; - < "The maturity"; > ; - < "Coupon"; > ; - < "The coupon rate"; > ; - < "Yield"; > ; - < "The yield"; > ; - < "Frequency"; > ; - < "The frequency"; > ; - < "Basis"; > ; - < "The basis"; > ; - }; -}; - -StringArray ANALYSIS_Nominal -{ - ItemList [ en-US ] = - { - < "Returns the annual nominal interest rate"; > ; - < "Effective rate"; > ; - < "The effective interest rate"; > ; - < "Npery"; > ; - < "The periods"; > ; - }; -}; - -StringArray ANALYSIS_Dollarfr -{ - ItemList [ en-US ] = - { - < "Converts a price expressed as a decimal into a price expressed as a fraction"; > ; - < "Decimal dollar"; > ; - < "The decimal number"; > ; - < "Fraction"; > ; - < "The divisor"; > ; - }; -}; - -StringArray ANALYSIS_Dollarde -{ - ItemList [ en-US ] = - { - < "Converts a price expressed as a fraction into a price expressed as a decimal"; > ; - < "Fractional dollar"; > ; - < "The number as a fraction"; > ; - < "Fraction"; > ; - < "The divisor"; > ; - }; -}; - -StringArray ANALYSIS_Yield -{ - ItemList [ en-US ] = - { - < "Returns the yield on a security that pays periodic interest"; > ; - < "Settlement"; > ; - < "The settlement"; > ; - < "Maturity"; > ; - < "The maturity"; > ; - < "Rate"; > ; - < "The rate"; > ; - < "Price"; > ; - < "The price"; > ; - < "Redemption"; > ; - < "The redemption value"; > ; - < "Frequency"; > ; - < "The frequency"; > ; - < "Basis"; > ; - < "The basis"; > ; - }; -}; - -StringArray ANALYSIS_Yielddisc -{ - ItemList [ en-US ] = - { - < "Returns the annual yield for a discounted security"; > ; - < "Settlement"; > ; - < "The settlement"; > ; - < "Maturity"; > ; - < "The maturity"; > ; - < "Price"; > ; - < "The price"; > ; - < "Redemption"; > ; - < "The redemption value"; > ; - < "Basis"; > ; - < "The basis"; > ; - }; -}; - -StringArray ANALYSIS_Yieldmat -{ - ItemList [ en-US ] = - { - < "Returns the annual yield of a security that pays interest at maturity"; > ; - < "Settlement"; > ; - < "The settlement"; > ; - < "Maturity"; > ; - < "The maturity"; > ; - < "Issue"; > ; - < "The issue date"; > ; - < "Rate"; > ; - < "The rate"; > ; - < "Price"; > ; - < "The price"; > ; - < "Basis"; > ; - < "The basis"; > ; - }; -}; - -StringArray ANALYSIS_Tbilleq -{ - ItemList [ en-US ] = - { - < "Returns the bond-equivalent yield for a treasury bill"; > ; - < "Settlement"; > ; - < "The settlement"; > ; - < "Maturity"; > ; - < "The maturity"; > ; - < "Discount"; > ; - < "The discount rate"; > ; - }; -}; - -StringArray ANALYSIS_Tbillprice -{ - ItemList [ en-US ] = - { - < "Returns the price of 100 currency units face value for a treasury bill"; > ; - < "Settlement"; > ; - < "The settlement"; > ; - < "Maturity"; > ; - < "The maturity"; > ; - < "Discount"; > ; - < "The discount rate"; > ; - }; -}; - -StringArray ANALYSIS_Tbillyield -{ - ItemList [ en-US ] = - { - < "Returns the yield for a treasury bill"; > ; - < "Settlement"; > ; - < "The settlement"; > ; - < "Maturity"; > ; - < "The maturity"; > ; - < "Price"; > ; - < "The price"; > ; - }; -}; - -StringArray ANALYSIS_Oddfprice -{ - ItemList [ en-US ] = - { - < "Returns the price per $100 face value of a security with an odd first period"; > ; - < "Settlement"; > ; - < "The settlement"; > ; - < "Maturity"; > ; - < "The maturity"; > ; - < "Issue"; > ; - < "The issue date"; > ; - < "First coupon"; > ; - < "The first coupon date"; > ; - < "Rate"; > ; - < "The rate"; > ; - < "Yield"; > ; - < "The yield"; > ; - < "Redemption"; > ; - < "The redemption value"; > ; - < "Frequency"; > ; - < "The frequency"; > ; - < "Basis"; > ; - < "The basis"; > ; - }; -}; - -StringArray ANALYSIS_Oddfyield -{ - ItemList [ en-US ] = - { - < "Returns the yield of a security with an odd first period"; > ; - < "Settlement"; > ; - < "The settlement"; > ; - < "Maturity"; > ; - < "The maturity"; > ; - < "Issue"; > ; - < "The issue date"; > ; - < "First coupon"; > ; - < "The first coupon date"; > ; - < "Rate"; > ; - < "The rate"; > ; - < "Price"; > ; - < "The price"; > ; - < "Redemption"; > ; - < "The redemption value"; > ; - < "Frequency"; > ; - < "The frequency"; > ; - < "Basis"; > ; - < "The basis"; > ; - }; -}; - -StringArray ANALYSIS_Oddlprice -{ - ItemList [ en-US ] = - { - < "Returns the price per $100 face value of a security with an odd last period"; > ; - < "Settlement"; > ; - < "The settlement"; > ; - < "Maturity"; > ; - < "The maturity"; > ; - < "Last interest"; > ; - < "The last interest date"; > ; - < "Rate"; > ; - < "The rate"; > ; - < "Yield"; > ; - < "The yield"; > ; - < "Redemption"; > ; - < "The redemption value"; > ; - < "Frequency"; > ; - < "The frequency"; > ; - < "Basis"; > ; - < "The basis"; > ; - }; -}; - -StringArray ANALYSIS_Oddlyield -{ - ItemList [ en-US ] = - { - < "Returns the yield of a security with an odd last period"; > ; - < "Settlement"; > ; - < "The settlement"; > ; - < "Maturity"; > ; - < "The maturity"; > ; - < "Last interest"; > ; - < "The last interest date"; > ; - < "Rate"; > ; - < "The rate"; > ; - < "Price"; > ; - < "The price"; > ; - < "Redemption"; > ; - < "The redemption value"; > ; - < "Frequency"; > ; - < "The frequency"; > ; - < "Basis"; > ; - < "The basis"; > ; - }; -}; - -StringArray ANALYSIS_Xirr -{ - ItemList [ en-US ] = - { - < "Returns the internal rate of return for a non-periodic schedule of payments"; > ; - < "Values"; > ; - < "The values"; > ; - < "Dates"; > ; - < "The dates"; > ; - < "Guess"; > ; - < "The guess"; > ; - }; -}; - -StringArray ANALYSIS_Xnpv -{ - ItemList [ en-US ] = - { - < "Returns the net present value for a non-periodic schedule of payments"; > ; - < "Rate"; > ; - < "The rate"; > ; - < "Values"; > ; - < "The values"; > ; - < "Dates"; > ; - < "The dates"; > ; - }; -}; - -StringArray ANALYSIS_Intrate -{ - ItemList [ en-US ] = - { - < "Returns the interest rate for a fully invested security"; > ; - < "Settlement"; > ; - < "The settlement"; > ; - < "Maturity"; > ; - < "The maturity"; > ; - < "Investment"; > ; - < "The investment"; > ; - < "Redemption"; > ; - < "The redemption value"; > ; - < "Basis"; > ; - < "The basis"; > ; - }; -}; - -StringArray ANALYSIS_Coupncd -{ - ItemList [ en-US ] = - { - < "Returns the first coupon date after the settlement date"; > ; - < "Settlement"; > ; - < "The settlement"; > ; - < "Maturity"; > ; - < "The maturity"; > ; - < "Frequency"; > ; - < "The frequency"; > ; - < "Basis"; > ; - < "The basis"; > ; - }; -}; - -StringArray ANALYSIS_Coupdays -{ - ItemList [ en-US ] = - { - < "Returns the number of days in the coupon period containing the settlement date"; > ; - < "Settlement"; > ; - < "The settlement"; > ; - < "Maturity"; > ; - < "The maturity"; > ; - < "Frequency"; > ; - < "The frequency"; > ; - < "Basis"; > ; - < "The basis"; > ; - }; -}; - -StringArray ANALYSIS_Coupdaysnc -{ - ItemList [ en-US ] = - { - < "Returns the number of days from the settlement date to the next coupon date"; > ; - < "Settlement"; > ; - < "The settlement"; > ; - < "Maturity"; > ; - < "The maturity"; > ; - < "Frequency"; > ; - < "The frequency"; > ; - < "Basis"; > ; - < "The basis"; > ; - }; -}; - -StringArray ANALYSIS_Coupdaybs -{ - ItemList [ en-US ] = - { - < "Returns the number of days from the beginning of the coupon period to the settlement date"; > ; - < "Settlement"; > ; - < "The settlement"; > ; - < "Maturity"; > ; - < "The maturity"; > ; - < "Frequency"; > ; - < "The frequency"; > ; - < "Basis"; > ; - < "The basis"; > ; - }; -}; - -StringArray ANALYSIS_Couppcd -{ - ItemList [ en-US ] = - { - < "Returns the last coupon date preceding the settlement date"; > ; - < "Settlement"; > ; - < "The settlement"; > ; - < "Maturity"; > ; - < "The maturity"; > ; - < "Frequency"; > ; - < "The frequency"; > ; - < "Basis"; > ; - < "The basis"; > ; - }; -}; - -StringArray ANALYSIS_Coupnum -{ - ItemList [ en-US ] = - { - < "Returns the number of coupons payable between the settlement and maturity dates"; > ; - < "Settlement"; > ; - < "The settlement"; > ; - < "Maturity"; > ; - < "The maturity"; > ; - < "Frequency"; > ; - < "The frequency"; > ; - < "Basis"; > ; - < "The basis"; > ; - }; -}; - -StringArray ANALYSIS_Fvschedule -{ - ItemList [ en-US ] = - { - < "Returns the future value of the initial principal after a series of compound interest rates are applied"; > ; - < "Principal"; > ; - < "The principal"; > ; - < "Schedule"; > ; - < "The schedule"; > ; - }; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scaddins/source/analysis/analysis_funcnames.src b/scaddins/source/analysis/analysis_funcnames.src deleted file mode 100644 index 540bf2c30207..000000000000 --- a/scaddins/source/analysis/analysis_funcnames.src +++ /dev/null @@ -1,527 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include "analysis.hrc" - -String ANALYSIS_FUNCNAME_Workday -{ - Text [ en-US ] = "WORKDAY"; -}; - -String ANALYSIS_FUNCNAME_Yearfrac -{ - Text [ en-US ] = "YEARFRAC"; -}; - -String ANALYSIS_FUNCNAME_Edate -{ - Text [ en-US ] = "EDATE"; -}; - -String ANALYSIS_FUNCNAME_Weeknum -{ - Text [ en-US ] = "WEEKNUM"; -}; - -String ANALYSIS_FUNCNAME_Eomonth -{ - Text [ en-US ] = "EOMONTH"; -}; - -String ANALYSIS_FUNCNAME_Networkdays -{ - Text [ en-US ] = "NETWORKDAYS"; -}; - -String ANALYSIS_FUNCNAME_Amordegrc -{ - Text [ en-US ] = "AMORDEGRC"; -}; - -String ANALYSIS_FUNCNAME_Amorlinc -{ - Text [ en-US ] = "AMORLINC"; -}; - -String ANALYSIS_FUNCNAME_Accrint -{ - Text [ en-US ] = "ACCRINT"; -}; - -String ANALYSIS_FUNCNAME_Accrintm -{ - Text [ en-US ] = "ACCRINTM"; -}; - -String ANALYSIS_FUNCNAME_Received -{ - Text [ en-US ] = "RECEIVED"; -}; - -String ANALYSIS_FUNCNAME_Disc -{ - Text [ en-US ] = "DISC"; -}; - -String ANALYSIS_FUNCNAME_Duration -{ - Text [ en-US ] = "DURATION"; -}; - -String ANALYSIS_FUNCNAME_Effect -{ - Text [ en-US ] = "EFFECT"; -}; - -String ANALYSIS_FUNCNAME_Cumprinc -{ - Text [ en-US ] = "CUMPRINC"; -}; - -String ANALYSIS_FUNCNAME_Cumipmt -{ - Text [ en-US ] = "CUMIPMT"; -}; - -String ANALYSIS_FUNCNAME_Price -{ - Text [ en-US ] = "PRICE"; -}; - -String ANALYSIS_FUNCNAME_Pricedisc -{ - Text [ en-US ] = "PRICEDISC"; -}; - -String ANALYSIS_FUNCNAME_Pricemat -{ - Text [ en-US ] = "PRICEMAT"; -}; - -String ANALYSIS_FUNCNAME_Mduration -{ - Text [ en-US ] = "MDURATION"; -}; - -String ANALYSIS_FUNCNAME_Nominal -{ - Text [ en-US ] = "NOMINAL"; -}; - -String ANALYSIS_FUNCNAME_Dollarfr -{ - Text [ en-US ] = "DOLLARFR"; -}; - -String ANALYSIS_FUNCNAME_Dollarde -{ - Text [ en-US ] = "DOLLARDE"; -}; - -String ANALYSIS_FUNCNAME_Yield -{ - Text [ en-US ] = "YIELD"; -}; - -String ANALYSIS_FUNCNAME_Yielddisc -{ - Text [ en-US ] = "YIELDDISC"; -}; - -String ANALYSIS_FUNCNAME_Yieldmat -{ - Text [ en-US ] = "YIELDMAT"; -}; - -String ANALYSIS_FUNCNAME_Tbilleq -{ - Text [ en-US ] = "TBILLEQ"; -}; - -String ANALYSIS_FUNCNAME_Tbillprice -{ - Text [ en-US ] = "TBILLPRICE"; -}; - -String ANALYSIS_FUNCNAME_Tbillyield -{ - Text [ en-US ] = "TBILLYIELD"; -}; - -String ANALYSIS_FUNCNAME_Oddfprice -{ - Text [ en-US ] = "ODDFPRICE"; -}; - -String ANALYSIS_FUNCNAME_Oddfyield -{ - Text [ en-US ] = "ODDFYIELD"; -}; - -String ANALYSIS_FUNCNAME_Oddlprice -{ - Text [ en-US ] = "ODDLPRICE"; -}; - -String ANALYSIS_FUNCNAME_Oddlyield -{ - Text [ en-US ] = "ODDLYIELD"; -}; - -String ANALYSIS_FUNCNAME_Xirr -{ - Text [ en-US ] = "XIRR"; -}; - -String ANALYSIS_FUNCNAME_Xnpv -{ - Text [ en-US ] = "XNPV"; -}; - -String ANALYSIS_FUNCNAME_Intrate -{ - Text [ en-US ] = "INTRATE"; -}; - -String ANALYSIS_FUNCNAME_Coupncd -{ - Text [ en-US ] = "COUPNCD"; -}; - -String ANALYSIS_FUNCNAME_Coupdays -{ - Text [ en-US ] = "COUPDAYS"; -}; - -String ANALYSIS_FUNCNAME_Coupdaysnc -{ - Text [ en-US ] = "COUPDAYSNC"; -}; - -String ANALYSIS_FUNCNAME_Coupdaybs -{ - Text [ en-US ] = "COUPDAYBS"; -}; - -String ANALYSIS_FUNCNAME_Couppcd -{ - Text [ en-US ] = "COUPPCD"; -}; - -String ANALYSIS_FUNCNAME_Coupnum -{ - Text [ en-US ] = "COUPNUM"; -}; - -String ANALYSIS_FUNCNAME_Fvschedule -{ - Text [ en-US ] = "FVSCHEDULE"; -}; - -String ANALYSIS_FUNCNAME_Iseven -{ - Text [ en-US ] = "ISEVEN"; -}; - -String ANALYSIS_FUNCNAME_Isodd -{ - Text [ en-US ] = "ISODD"; -}; - -String ANALYSIS_FUNCNAME_Gcd -{ - Text [ en-US ] = "GCD"; -}; - -String ANALYSIS_FUNCNAME_Lcm -{ - Text [ en-US ] = "LCM"; -}; - -String ANALYSIS_FUNCNAME_Multinomial -{ - Text [ en-US ] = "MULTINOMIAL"; -}; - -String ANALYSIS_FUNCNAME_Seriessum -{ - Text [ en-US ] = "SERIESSUM"; -}; - -String ANALYSIS_FUNCNAME_Quotient -{ - Text [ en-US ] = "QUOTIENT"; -}; - -String ANALYSIS_FUNCNAME_Mround -{ - Text [ en-US ] = "MROUND"; -}; - -String ANALYSIS_FUNCNAME_Sqrtpi -{ - Text [ en-US ] = "SQRTPI"; -}; - -String ANALYSIS_FUNCNAME_Randbetween -{ - Text [ en-US ] = "RANDBETWEEN"; -}; - -String ANALYSIS_FUNCNAME_Besseli -{ - Text [ en-US ] = "BESSELI"; -}; - -String ANALYSIS_FUNCNAME_Besselj -{ - Text [ en-US ] = "BESSELJ"; -}; - -String ANALYSIS_FUNCNAME_Besselk -{ - Text [ en-US ] = "BESSELK"; -}; - -String ANALYSIS_FUNCNAME_Bessely -{ - Text [ en-US ] = "BESSELY"; -}; - -String ANALYSIS_FUNCNAME_Bin2Dec -{ - Text [ en-US ] = "BIN2DEC"; -}; - -String ANALYSIS_FUNCNAME_Bin2Hex -{ - Text [ en-US ] = "BIN2HEX"; -}; - -String ANALYSIS_FUNCNAME_Bin2Oct -{ - Text [ en-US ] = "BIN2OCT"; -}; - -String ANALYSIS_FUNCNAME_Delta -{ - Text [ en-US ] = "DELTA"; -}; - -String ANALYSIS_FUNCNAME_Dec2Bin -{ - Text [ en-US ] = "DEC2BIN"; -}; - -String ANALYSIS_FUNCNAME_Dec2Hex -{ - Text [ en-US ] = "DEC2HEX"; -}; - -String ANALYSIS_FUNCNAME_Dec2Oct -{ - Text [ en-US ] = "DEC2OCT"; -}; - -String ANALYSIS_FUNCNAME_Erf -{ - Text [ en-US ] = "ERF"; -}; - -String ANALYSIS_FUNCNAME_Erfc -{ - Text [ en-US ] = "ERFC"; -}; - -String ANALYSIS_FUNCNAME_Gestep -{ - Text [ en-US ] = "GESTEP"; -}; - -String ANALYSIS_FUNCNAME_Hex2Bin -{ - Text [ en-US ] = "HEX2BIN"; -}; - -String ANALYSIS_FUNCNAME_Hex2Dec -{ - Text [ en-US ] = "HEX2DEC"; -}; - -String ANALYSIS_FUNCNAME_Hex2Oct -{ - Text [ en-US ] = "HEX2OCT"; -}; - -String ANALYSIS_FUNCNAME_Imabs -{ - Text [ en-US ] = "IMABS"; -}; - -String ANALYSIS_FUNCNAME_Imaginary -{ - Text [ en-US ] = "IMAGINARY"; -}; - -String ANALYSIS_FUNCNAME_Impower -{ - Text [ en-US ] = "IMPOWER"; -}; - -String ANALYSIS_FUNCNAME_Imargument -{ - Text [ en-US ] = "IMARGUMENT"; -}; - -String ANALYSIS_FUNCNAME_Imcos -{ - Text [ en-US ] = "IMCOS"; -}; - -String ANALYSIS_FUNCNAME_Imdiv -{ - Text [ en-US ] = "IMDIV"; -}; - -String ANALYSIS_FUNCNAME_Imexp -{ - Text [ en-US ] = "IMEXP"; -}; - -String ANALYSIS_FUNCNAME_Imconjugate -{ - Text [ en-US ] = "IMCONJUGATE"; -}; - -String ANALYSIS_FUNCNAME_Imln -{ - Text [ en-US ] = "IMLN"; -}; - -String ANALYSIS_FUNCNAME_Imlog10 -{ - Text [ en-US ] = "IMLOG10"; -}; - -String ANALYSIS_FUNCNAME_Imlog2 -{ - Text [ en-US ] = "IMLOG2"; -}; - -String ANALYSIS_FUNCNAME_Improduct -{ - Text [ en-US ] = "IMPRODUCT"; -}; - -String ANALYSIS_FUNCNAME_Imreal -{ - Text [ en-US ] = "IMREAL"; -}; - -String ANALYSIS_FUNCNAME_Imsin -{ - Text [ en-US ] = "IMSIN"; -}; - -String ANALYSIS_FUNCNAME_Imsub -{ - Text [ en-US ] = "IMSUB"; -}; - -String ANALYSIS_FUNCNAME_Imsum -{ - Text [ en-US ] = "IMSUM"; -}; - -String ANALYSIS_FUNCNAME_Imsqrt -{ - Text [ en-US ] = "IMSQRT"; -}; - -String ANALYSIS_FUNCNAME_Imtan -{ - Text [ en-US ] = "IMTAN"; -}; - -String ANALYSIS_FUNCNAME_Imsec -{ - Text [ en-US ] = "IMSEC"; -}; - -String ANALYSIS_FUNCNAME_Imcsc -{ - Text [ en-US ] = "IMCSC"; -}; - -String ANALYSIS_FUNCNAME_Imcot -{ - Text [ en-US ] = "IMCOT"; -}; - -String ANALYSIS_FUNCNAME_Imsinh -{ - Text [ en-US ] = "IMSINH"; -}; - -String ANALYSIS_FUNCNAME_Imcosh -{ - Text [ en-US ] = "IMCOSH"; -}; - -String ANALYSIS_FUNCNAME_Imsech -{ - Text [ en-US ] = "IMSECH"; -}; - -String ANALYSIS_FUNCNAME_Imcsch -{ - Text [ en-US ] = "IMCSCH"; -}; - -String ANALYSIS_FUNCNAME_Complex -{ - Text [ en-US ] = "COMPLEX"; -}; - -String ANALYSIS_FUNCNAME_Oct2Bin -{ - Text [ en-US ] = "OCT2BIN"; -}; - -String ANALYSIS_FUNCNAME_Oct2Dec -{ - Text [ en-US ] = "OCT2DEC"; -}; - -String ANALYSIS_FUNCNAME_Oct2Hex -{ - Text [ en-US ] = "OCT2HEX"; -}; - -String ANALYSIS_FUNCNAME_Convert -{ - Text [ en-US ] = "CONVERT"; -}; - -String ANALYSIS_FUNCNAME_Factdouble -{ - Text [ en-US ] = "FACTDOUBLE"; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scaddins/source/analysis/analysishelper.cxx b/scaddins/source/analysis/analysishelper.cxx index 6b7e3dbe8501..1225f20027ee 100644 --- a/scaddins/source/analysis/analysishelper.cxx +++ b/scaddins/source/analysis/analysishelper.cxx @@ -23,13 +23,13 @@ #include <string.h> #include <stdio.h> #include <o3tl/any.hxx> -#include <tools/resary.hxx> #include <rtl/math.hxx> #include <sal/macros.h> #include <algorithm> #include <memory> #include "analysishelper.hxx" #include "analysis.hrc" +#include "strings.hrc" #include "deffuncname.hxx" using namespace ::com::sun::star; @@ -1375,8 +1375,8 @@ double GetCoupnum( sal_Int32 nNullDate, sal_Int32 nSettle, sal_Int32 nMat, sal_I FuncData::FuncData(const FuncDataBase& r) : aIntName( OUString::createFromAscii( r.pIntName ) ), - nUINameID( r.nUINameID ), - nDescrID( r.nDescrID ), + pUINameID( r.pUINameID ), + pDescrID( r.pDescrID ), bDouble( r.bDouble ), bWithOpt( r.bWithOpt ), nParam( r.nNumOfParams ), @@ -1411,10 +1411,6 @@ void InitFuncDataList(FuncDataList& rList) rList.push_back(FuncData(rFuncData)); } -AnalysisResId::AnalysisResId( sal_uInt16 nId, ResMgr& rResMgr ) : ResId( nId, rResMgr ) -{ -} - SortedIndividualInt32List::SortedIndividualInt32List() { } diff --git a/scaddins/source/analysis/analysishelper.hxx b/scaddins/source/analysis/analysishelper.hxx index 8e4528339c39..591150aaaafa 100644 --- a/scaddins/source/analysis/analysishelper.hxx +++ b/scaddins/source/analysis/analysishelper.hxx @@ -32,15 +32,11 @@ #include <math.h> -#include <tools/resid.hxx> - #include "analysisdefs.hxx" #include <vector> -class ResMgr; - namespace sca { namespace analysis { class SortedIndividualInt32List; @@ -202,8 +198,8 @@ enum class FDCategory struct FuncDataBase { const sal_Char* pIntName; - sal_uInt16 nUINameID; // resource ID to UI name - sal_uInt16 nDescrID; // resource ID to description, parameter names and ~ description + const char* pUINameID; // resource ID to UI name + const char** pDescrID; // resource ID to description, parameter names and ~ description bool bDouble; // name already exist in Calc bool bWithOpt; // first parameter is internal const char** pCompListID; // list of valid names @@ -217,8 +213,8 @@ class FuncData final { private: OUString aIntName; - sal_uInt16 nUINameID; - sal_uInt16 nDescrID; // leads also to parameter descriptions! + const char* pUINameID; + const char** pDescrID; // leads also to parameter descriptions! bool bDouble; // flag for names that already exist in Calc bool bWithOpt; // has internal parameter on first position @@ -231,8 +227,8 @@ public: FuncData(const FuncDataBase& rBaseData); ~FuncData(); - inline sal_uInt16 GetUINameID() const; - inline sal_uInt16 GetDescrID() const; + inline const char* GetUINameID() const; + inline const char** GetDescrID() const; inline bool IsDouble() const; inline const OUString& GetSuffix() const; @@ -257,12 +253,6 @@ struct FindFuncData bool operator() ( FuncData const & rCandidate ) const { return rCandidate.Is(m_rId); } }; -class AnalysisResId : public ResId -{ - public: - AnalysisResId( sal_uInt16 nId, ResMgr& rResMgr ); -}; - /// sorted list with unique sal_Int32 values class SortedIndividualInt32List final { @@ -626,15 +616,15 @@ inline double GetYearFrac( const css::uno::Reference< css::beans::XPropertySet > } -inline sal_uInt16 FuncData::GetUINameID() const +inline const char* FuncData::GetUINameID() const { - return nUINameID; + return pUINameID; } -inline sal_uInt16 FuncData::GetDescrID() const +inline const char** FuncData::GetDescrID() const { - return nDescrID; + return pDescrID; } diff --git a/scaddins/source/datefunc/datefunc.cxx b/scaddins/source/datefunc/datefunc.cxx index d2a33ccf5398..ef73390c854b 100644 --- a/scaddins/source/datefunc/datefunc.cxx +++ b/scaddins/source/datefunc/datefunc.cxx @@ -19,11 +19,11 @@ #include "datefunc.hxx" #include "datefunc.hrc" +#include "strings.hrc" #include <com/sun/star/util/Date.hpp> #include <cppuhelper/factory.hxx> #include <cppuhelper/supportsservice.hxx> #include <rtl/ustrbuf.hxx> -#include <tools/rcid.h> #include <tools/resmgr.hxx> #include <algorithm> #include "deffuncname.hxx" @@ -34,11 +34,6 @@ using namespace ::com::sun::star; #define MY_SERVICE "com.sun.star.sheet.addin.DateFunctions" #define MY_IMPLNAME "com.sun.star.sheet.addin.DateFunctionsImpl" -ScaResId::ScaResId( sal_uInt16 nId, ResMgr& rResMgr ) : - ResId( nId, rResMgr ) -{ -} - #define UNIQUE false // function name does not exist in Calc #define STDPAR false // all parameters are described @@ -63,8 +58,8 @@ const ScaFuncDataBase pFuncDataArr[] = ScaFuncData::ScaFuncData(const ScaFuncDataBase& rBaseData) : aIntName( OUString::createFromAscii( rBaseData.pIntName ) ), - nUINameID( rBaseData.nUINameID ), - nDescrID( rBaseData.nDescrID ), + pUINameID( rBaseData.pUINameID ), + pDescrID( rBaseData.pDescrID ), nParamCount( rBaseData.nParamCount ), eCat( rBaseData.eCat ), bDouble( rBaseData.bDouble ), @@ -129,7 +124,6 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL date_component_getFactory( // "normal" service implementation ScaDateAddIn::ScaDateAddIn() : pDefLocales( nullptr ), - pResMgr( nullptr ), pFuncDataList( nullptr ) { } @@ -157,20 +151,9 @@ const lang::Locale& ScaDateAddIn::GetLocale( sal_uInt32 nIndex ) return (nIndex < sizeof( pLang )) ? pDefLocales[ nIndex ] : aFuncLoc; } -ResMgr& ScaDateAddIn::GetResMgr() -{ - if( !pResMgr ) - { - InitData(); // try to get resource manager - if( !pResMgr ) - throw uno::RuntimeException(); - } - return *pResMgr; -} - void ScaDateAddIn::InitData() { - pResMgr.reset(ResMgr::CreateResMgr("date", LanguageTag(aFuncLoc))); + aResLocale = Translate::Create("sca", LanguageTag(aFuncLoc)); pFuncDataList.reset(); pFuncDataList.reset(new ScaFuncDataList); @@ -182,10 +165,9 @@ void ScaDateAddIn::InitData() } } -OUString ScaDateAddIn::GetFuncDescrStr( sal_uInt16 nResId, sal_uInt16 nStrIndex ) +OUString ScaDateAddIn::GetFuncDescrStr(const char** pResId, sal_uInt16 nStrIndex) { - ResStringArray aArr(ScaResId(nResId, GetResMgr())); - return aArr.GetString(nStrIndex - 1); + return ScaResId(pResId[nStrIndex - 1]); } OUString ScaDateAddIn::getImplementationName_Static() @@ -252,7 +234,7 @@ OUString SAL_CALL ScaDateAddIn::getDisplayFunctionName( const OUString& aProgram FindScaFuncData( aProgrammaticName ) ); if( fDataIt != pFuncDataList->end() ) { - aRet = ScaResId(fDataIt->GetUINameID(), GetResMgr()); + aRet = ScaResId(fDataIt->GetUINameID()); if( fDataIt->IsDouble() ) aRet += "_ADD"; } @@ -770,4 +752,9 @@ OUString SAL_CALL ScaDateAddIn::getRot13( const OUString& aSrcString ) return aBuffer.makeStringAndClear(); } +OUString ScaDateAddIn::ScaResId(const char* pId) +{ + return Translate::get(pId, aResLocale); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scaddins/source/datefunc/datefunc.hrc b/scaddins/source/datefunc/datefunc.hrc deleted file mode 100644 index 44653ef848a2..000000000000 --- a/scaddins/source/datefunc/datefunc.hrc +++ /dev/null @@ -1,49 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SCADDINS_SOURCE_DATEFUNC_DATEFUNC_HRC -#define INCLUDED_SCADDINS_SOURCE_DATEFUNC_DATEFUNC_HRC - -#define DATE_RESOURCE_START 1000 - -#define DATE_FUNCDESC_START DATE_RESOURCE_START - -#define DATE_FUNCDESC_DiffWeeks (DATE_FUNCDESC_START) -#define DATE_FUNCDESC_DiffMonths (DATE_FUNCDESC_START+1) -#define DATE_FUNCDESC_DiffYears (DATE_FUNCDESC_START+2) -#define DATE_FUNCDESC_IsLeapYear (DATE_FUNCDESC_START+3) -#define DATE_FUNCDESC_DaysInMonth (DATE_FUNCDESC_START+4) -#define DATE_FUNCDESC_DaysInYear (DATE_FUNCDESC_START+5) -#define DATE_FUNCDESC_WeeksInYear (DATE_FUNCDESC_START+6) -#define DATE_FUNCDESC_Rot13 (DATE_FUNCDESC_START+7) - -#define DATE_FUNCNAME_START (DATE_RESOURCE_START+1000) - -#define DATE_FUNCNAME_DiffWeeks (DATE_FUNCNAME_START) -#define DATE_FUNCNAME_DiffMonths (DATE_FUNCNAME_START+1) -#define DATE_FUNCNAME_DiffYears (DATE_FUNCNAME_START+2) -#define DATE_FUNCNAME_IsLeapYear (DATE_FUNCNAME_START+3) -#define DATE_FUNCNAME_DaysInMonth (DATE_FUNCNAME_START+4) -#define DATE_FUNCNAME_DaysInYear (DATE_FUNCNAME_START+5) -#define DATE_FUNCNAME_WeeksInYear (DATE_FUNCNAME_START+6) -#define DATE_FUNCNAME_Rot13 (DATE_FUNCNAME_START+7) - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scaddins/source/datefunc/datefunc.hxx b/scaddins/source/datefunc/datefunc.hxx index 816aaffd6c19..51b2899daeef 100644 --- a/scaddins/source/datefunc/datefunc.hxx +++ b/scaddins/source/datefunc/datefunc.hxx @@ -33,14 +33,6 @@ #include <com/sun/star/sheet/addin/XDateFunctions.hpp> #include <com/sun/star/sheet/addin/XMiscFunctions.hpp> #include <cppuhelper/implbase.hxx> -#include <tools/resid.hxx> -#include <tools/resary.hxx> - -class ScaResId : public ResId -{ -public: - ScaResId(sal_uInt16 nResId, ResMgr& rResMgr); -}; enum class ScaCategory { @@ -55,8 +47,8 @@ enum class ScaCategory struct ScaFuncDataBase { const sal_Char* pIntName; // internal name (get***) - sal_uInt16 nUINameID; // resource ID to UI name - sal_uInt16 nDescrID; // resource ID to description, parameter names and ~ description + const char* pUINameID; // resource ID to UI name + const char** pDescrID; // resource ID to description, parameter names and ~ description const char** pCompListID; // list of valid names sal_uInt16 nParamCount; // number of named / described parameters ScaCategory eCat; // function category @@ -68,8 +60,8 @@ class ScaFuncData final { private: OUString aIntName; // internal name (get***) - sal_uInt16 nUINameID; // resource ID to UI name - sal_uInt16 nDescrID; // leads also to parameter descriptions! + const char* pUINameID; // resource ID to UI name + const char** pDescrID; // leads also to parameter descriptions! sal_uInt16 nParamCount; // num of parameters std::vector<OUString> aCompList; // list of all valid names ScaCategory eCat; // function category @@ -80,8 +72,8 @@ public: ScaFuncData(const ScaFuncDataBase& rBaseData); ~ScaFuncData(); - sal_uInt16 GetUINameID() const { return nUINameID; } - sal_uInt16 GetDescrID() const { return nDescrID; } + const char* GetUINameID() const { return pUINameID; } + const char** GetDescrID() const { return pDescrID; } ScaCategory GetCategory() const { return eCat; } bool IsDouble() const { return bDouble; } @@ -120,22 +112,22 @@ class ScaDateAddIn : public ::cppu::WeakImplHelper< private: css::lang::Locale aFuncLoc; std::unique_ptr< css::lang::Locale[] > pDefLocales; - std::unique_ptr< ResMgr > pResMgr; + std::locale aResLocale; std::unique_ptr< ScaFuncDataList > pFuncDataList; void InitDefLocales(); const css::lang::Locale& GetLocale( sal_uInt32 nIndex ); - /// @throws css::uno::RuntimeException - ResMgr& GetResMgr(); void InitData(); /// @throws css::uno::RuntimeException - OUString GetFuncDescrStr( sal_uInt16 nResId, sal_uInt16 nStrIndex ); + OUString GetFuncDescrStr(const char** pResId, sal_uInt16 nStrIndex); public: ScaDateAddIn(); + OUString ScaResId(const char* pId); + static OUString getImplementationName_Static(); static css::uno::Sequence< OUString > getSupportedServiceNames_Static(); diff --git a/scaddins/source/datefunc/datefunc.src b/scaddins/source/datefunc/datefunc.src deleted file mode 100644 index 9e8632995a37..000000000000 --- a/scaddins/source/datefunc/datefunc.src +++ /dev/null @@ -1,154 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include "datefunc.hrc" - -StringArray DATE_FUNCDESC_DiffWeeks -{ - ItemList [ en-US ] = - { - < "Calculates the number of weeks in a specific period"; > ; - < "Start date"; > ; - < "First day of the period"; > ; - < "End date"; > ; - < "Last day of the period"; > ; - < "Type"; > ; - < "Type of calculation: Type=0 means the time interval, Type=1 means calendar weeks."; > ; - }; -}; - -StringArray DATE_FUNCDESC_DiffMonths -{ - ItemList [ en-US ] = - { - < "Determines the number of months in a specific period."; > ; - < "Start date"; > ; - < "First day of the period."; > ; - < "End date"; > ; - < "Last day of the period."; > ; - < "Type"; > ; - < "Type of calculation: Type=0 means the time interval, Type=1 means calendar months."; > ; - }; -}; - -StringArray DATE_FUNCDESC_DiffYears -{ - ItemList [ en-US ] = - { - < "Calculates the number of years in a specific period."; > ; - < "Start date"; > ; - < "First day of the period"; > ; - < "End date"; > ; - < "Last day of the period"; > ; - < "Type"; > ; - < "Type of calculation: Type=0 means the time interval, Type=1 means calendar years."; > ; - }; -}; - -StringArray DATE_FUNCDESC_IsLeapYear -{ - ItemList [ en-US ] = - { - < "Returns 1 (TRUE) if the date is a day of a leap year, otherwise 0 (FALSE)."; > ; - < "Date"; > ; - < "Any day in the desired year"; > ; - }; -}; - -StringArray DATE_FUNCDESC_DaysInMonth -{ - ItemList [ en-US ] = - { - < "Returns the number of days of the month in which the date entered occurs"; > ; - < "Date"; > ; - < "Any day in the desired month"; > ; - }; -}; - -StringArray DATE_FUNCDESC_DaysInYear -{ - ItemList [ en-US ] = - { - < "Returns the number of days of the year in which the date entered occurs."; > ; - < "Date"; > ; - < "Any day in the desired year"; > ; - }; -}; - -StringArray DATE_FUNCDESC_WeeksInYear -{ - ItemList [ en-US ] = - { - < "Returns the number of weeks of the year in which the date entered occurs"; > ; - < "Date"; > ; - < "Any day in the desired year"; > ; - }; -}; - -StringArray DATE_FUNCDESC_Rot13 -{ - ItemList [ en-US ] = - { - < "Encrypts or decrypts a text using the ROT13 algorithm"; > ; - < "Text"; > ; - < "Text to be encrypted or text already encrypted"; > ; - }; -}; - -String DATE_FUNCNAME_DiffWeeks -{ - 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"; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scaddins/source/pricing/pricing.cxx b/scaddins/source/pricing/pricing.cxx index 466c0e78fd44..3df3fe78a061 100644 --- a/scaddins/source/pricing/pricing.cxx +++ b/scaddins/source/pricing/pricing.cxx @@ -25,6 +25,7 @@ #include "pricing.hxx" #include "black_scholes.hxx" #include "pricing.hrc" +#include "strings.hrc" #include <cppuhelper/factory.hxx> #include <cppuhelper/supportsservice.hxx> @@ -32,7 +33,6 @@ #include <algorithm> #include <rtl/math.hxx> #include <rtl/ustrbuf.hxx> -#include <tools/rcid.h> #include <tools/resmgr.hxx> using namespace ::com::sun::star; @@ -43,11 +43,6 @@ using namespace sca::pricing; #define MY_SERVICE "com.sun.star.sheet.addin.PricingFunctions" #define MY_IMPLNAME "com.sun.star.sheet.addin.PricingFunctionsImpl" -ScaResId::ScaResId( sal_uInt16 nId, ResMgr& rResMgr ) : - ResId( nId, rResMgr ) -{ -} - #define UNIQUE false // function name does not exist in Calc #define STDPAR false // all parameters are described @@ -67,8 +62,8 @@ const ScaFuncDataBase pFuncDataArr[] = ScaFuncData::ScaFuncData( const ScaFuncDataBase& rBaseData ) : aIntName( OUString::createFromAscii( rBaseData.pIntName ) ), - nUINameID( rBaseData.nUINameID ), - nDescrID( rBaseData.nDescrID ), + pUINameID( rBaseData.pUINameID ), + pDescrID( rBaseData.pDescrID ), nParamCount( rBaseData.nParamCount ), eCat( rBaseData.eCat ), bDouble( rBaseData.bDouble ), @@ -132,7 +127,6 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL pricing_component_getFactory( // "normal" service implementation ScaPricingAddIn::ScaPricingAddIn() : pDefLocales( nullptr ), - pResMgr( nullptr ), pFuncDataList( nullptr ) { } @@ -140,7 +134,6 @@ ScaPricingAddIn::ScaPricingAddIn() : ScaPricingAddIn::~ScaPricingAddIn() { delete pFuncDataList; - delete pResMgr; delete[] pDefLocales; } @@ -167,32 +160,13 @@ const lang::Locale& ScaPricingAddIn::GetLocale( sal_uInt32 nIndex ) return (nIndex < sizeof( pLang )) ? pDefLocales[ nIndex ] : aFuncLoc; } -ResMgr& ScaPricingAddIn::GetResMgr() -{ - if( !pResMgr ) - { - InitData(); // try to get resource manager - if( !pResMgr ) - throw uno::RuntimeException(); - } - return *pResMgr; -} - void ScaPricingAddIn::InitData() { - delete pResMgr; - pResMgr = ResMgr::CreateResMgr("pricing", LanguageTag( aFuncLoc) ); + aResLocale = Translate::Create("sca", LanguageTag(aFuncLoc)); delete pFuncDataList; - if(pResMgr) - { - pFuncDataList = new ScaFuncDataList; - InitScaFuncDataList(*pFuncDataList); - } - else - { - pFuncDataList = nullptr; - } + pFuncDataList = new ScaFuncDataList; + InitScaFuncDataList(*pFuncDataList); if( pDefLocales ) { @@ -201,10 +175,9 @@ void ScaPricingAddIn::InitData() } } -OUString ScaPricingAddIn::GetFuncDescrStr( sal_uInt16 nResId, sal_uInt16 nStrIndex ) +OUString ScaPricingAddIn::GetFuncDescrStr(const char** pResId, sal_uInt16 nStrIndex) { - ResStringArray aArr(ScaResId(nResId, GetResMgr())); - return aArr.GetString(nStrIndex - 1); + return ScaResId(pResId[nStrIndex - 1]); } OUString ScaPricingAddIn::getImplementationName_Static() @@ -271,9 +244,9 @@ OUString SAL_CALL ScaPricingAddIn::getDisplayFunctionName( const OUString& aProg auto fDataIt = std::find_if(pFuncDataList->begin(), pFuncDataList->end(), FindScaFuncData( aProgrammaticName ) ); - if(fDataIt != pFuncDataList->end() ) + if (fDataIt != pFuncDataList->end() ) { - aRet = ScaResId(fDataIt->GetUINameID(), GetResMgr()); + aRet = ScaResId(fDataIt->GetUINameID()); if( fDataIt->IsDouble() ) aRet += "_ADD"; } @@ -583,5 +556,9 @@ double SAL_CALL ScaPricingAddIn::getOptProbInMoney( double spot, double vol, RETURN_FINITE( fRet ); } +OUString ScaPricingAddIn::ScaResId(const char* pResId) +{ + return Translate::get(pResId, aResLocale); +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scaddins/source/pricing/pricing.hrc b/scaddins/source/pricing/pricing.hrc deleted file mode 100644 index af516650eb75..000000000000 --- a/scaddins/source/pricing/pricing.hrc +++ /dev/null @@ -1,41 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SCADDINS_SOURCE_PRICING_PRICING_HRC -#define INCLUDED_SCADDINS_SOURCE_PRICING_PRICING_HRC - -#define PRICING_RESOURCE_START 1000 - -#define PRICING_FUNCDESC_START PRICING_RESOURCE_START - -#define PRICING_FUNCDESC_OptBarrier (PRICING_FUNCDESC_START) -#define PRICING_FUNCDESC_OptTouch (PRICING_FUNCDESC_START+1) -#define PRICING_FUNCDESC_OptProbHit (PRICING_FUNCDESC_START+2) -#define PRICING_FUNCDESC_OptProbInMoney (PRICING_FUNCDESC_START+3) - -#define PRICING_FUNCNAME_START (PRICING_RESOURCE_START+1000) - -#define PRICING_FUNCNAME_OptBarrier (PRICING_FUNCNAME_START) -#define PRICING_FUNCNAME_OptTouch (PRICING_FUNCNAME_START+1) -#define PRICING_FUNCNAME_OptProbHit (PRICING_FUNCNAME_START+2) -#define PRICING_FUNCNAME_OptProbInMoney (PRICING_FUNCNAME_START+3) - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scaddins/source/pricing/pricing.hxx b/scaddins/source/pricing/pricing.hxx index 18acc54c811f..82fbbb6cacc5 100644 --- a/scaddins/source/pricing/pricing.hxx +++ b/scaddins/source/pricing/pricing.hxx @@ -37,8 +37,6 @@ #include <com/sun/star/sheet/XCompatibilityNames.hpp> #include <com/sun/star/sheet/addin/XPricingFunctions.hpp> #include <cppuhelper/implbase.hxx> -#include <tools/resid.hxx> -#include <tools/resary.hxx> #define RETURN_FINITE(d) if( ::rtl::math::isFinite( d ) ) return d; else throw css::lang::IllegalArgumentException() @@ -46,12 +44,6 @@ namespace sca { namespace pricing { -class ScaResId : public ResId -{ -public: - ScaResId( sal_uInt16 nResId, ResMgr& rResMgr ); -}; - enum class ScaCategory { DateTime, @@ -65,8 +57,8 @@ enum class ScaCategory struct ScaFuncDataBase { const sal_Char* pIntName; // internal name (get***) - sal_uInt16 nUINameID; // resource ID to UI name - sal_uInt16 nDescrID; // resource ID to description, parameter names and ~ description + const char* pUINameID; // resource ID to UI name + const char** pDescrID; // resource ID to description, parameter names and ~ description // pCompName was originally meant to be able to load Excel documents that for // some time were stored with localized function names. // This is not relevant to this add-in, so we only supply the same @@ -82,12 +74,12 @@ struct ScaFuncDataBase class ScaFuncData final { private: - OUString aIntName; // internal name (get***) - sal_uInt16 nUINameID; // resource ID to UI name - sal_uInt16 nDescrID; // leads also to parameter descriptions! - sal_uInt16 nParamCount; // num of parameters - std::vector<OUString> aCompList; // list of all valid names - ScaCategory eCat; // function category + OUString aIntName; // internal name (get***) + const char* pUINameID; // resource ID to UI name + const char** pDescrID; // leads also to parameter descriptions! + sal_uInt16 nParamCount; // num of parameters + std::vector<OUString> aCompList; // list of all valid names + ScaCategory eCat; // function category bool bDouble; // name already exist in Calc bool bWithOpt; // first parameter is internal @@ -95,8 +87,8 @@ public: ScaFuncData(const ScaFuncDataBase& rBaseData); ~ScaFuncData(); - sal_uInt16 GetUINameID() const { return nUINameID; } - sal_uInt16 GetDescrID() const { return nDescrID; } + const char* GetUINameID() const { return pUINameID; } + const char** GetDescrID() const { return pDescrID; } ScaCategory GetCategory() const { return eCat; } bool IsDouble() const { return bDouble; } @@ -140,23 +132,23 @@ class ScaPricingAddIn : public ::cppu::WeakImplHelper< private: css::lang::Locale aFuncLoc; css::lang::Locale* pDefLocales; - ResMgr* pResMgr; + std::locale aResLocale; sca::pricing::ScaFuncDataList* pFuncDataList; void InitDefLocales(); const css::lang::Locale& GetLocale( sal_uInt32 nIndex ); - /// @throws css::uno::RuntimeException - ResMgr& GetResMgr(); void InitData(); /// @throws css::uno::RuntimeException - OUString GetFuncDescrStr( sal_uInt16 nResId, sal_uInt16 nStrIndex ); + OUString GetFuncDescrStr(const char** pResId, sal_uInt16 nStrIndex); public: ScaPricingAddIn(); virtual ~ScaPricingAddIn() override; + OUString ScaResId(const char* pResId); + static OUString getImplementationName_Static(); static css::uno::Sequence< OUString > getSupportedServiceNames_Static(); diff --git a/scaddins/source/pricing/pricing.src b/scaddins/source/pricing/pricing.src deleted file mode 100644 index d1ed46a08898..000000000000 --- a/scaddins/source/pricing/pricing.src +++ /dev/null @@ -1,153 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include "pricing.hrc" - -// function and parameter description -StringArray PRICING_FUNCDESC_OptBarrier -{ - ItemList [ en-US ] = - { - < "Pricing of a barrier option"; > ; - < "spot"; > ; - < "Price/value of the underlying asset"; > ; - < "vol"; > ; - < "Annual volatility of the underlying asset"; > ; - < "r"; > ; - < "Interest rate (continuously compounded)"; > ; - < "rf"; > ; - < "Foreign interest rate (continuously compounded)"; > ; - < "T"; > ; - < "Time to maturity of the option in years"; > ; - < "strike"; > ; - < "Strike level of the option"; > ; - < "barrier_low"; > ; - < "Lower barrier (set to 0 for no lower barrier)"; > ; - < "barrier_up"; > ; - < "Upper barrier (set to 0 for no upper barrier)"; > ; - < "rebate"; > ; - < "Amount of money paid at maturity if barrier was hit"; > ; - < "put/call"; > ; - < "String to define if the option is a (p)ut or a (c)all"; > ; - < "knock in/out"; > ; - < "String to define if the option is of type knock-(i)n or knock-(o)ut"; > ; - < "barrier_type"; > ; - < "String to define whether the barrier is observed (c)ontinuously or only at the (e)nd/maturity"; > ; - < "greek"; > ; - < "Optional parameter, if left out then the function simply returns the option price; if set, the function returns price sensitivities (Greeks) to one of the input parameters; possible values are (d)elta, (g)amma, (t)heta, v(e)ga, v(o)lga, v(a)nna, (r)ho, rho(f)"; > ; - }; -}; - -StringArray PRICING_FUNCDESC_OptTouch -{ - ItemList [ en-US ] = - { - < "Pricing of a touch/no-touch option"; > ; - < "spot"; > ; - < "Price/value of the underlying asset"; > ; - < "vol"; > ; - < "Annual volatility of the underlying asset"; > ; - < "r"; > ; - < "Interest rate (continuously compounded)"; > ; - < "rf"; > ; - < "Foreign interest rate (continuously compounded)"; > ; - < "T"; > ; - < "Time to maturity of the option in years"; > ; - < "barrier_low"; > ; - < "Lower barrier (set to 0 for no lower barrier)"; > ; - < "barrier_up"; > ; - < "Upper barrier (set to 0 for no upper barrier)"; > ; - < "foreign/domestic"; > ; - < "String to define if the option pays one unit of (d)omestic currency (cash or nothing) or (f)oreign currency (asset or nothing)"; > ; - < "knock in/out"; > ; - < "String to define if the option is of type knock-(i)n (touch) or knock-(o)ut (no-touch)"; > ; - < "barrier_type"; > ; - < "String to define whether the barrier is observed (c)ontinuously or only at the (e)nd/maturity"; > ; - < "greek"; > ; - < "Optional parameter, if left out then the function simply returns the option price; if set, the function returns price sensitivities (Greeks) to one of the input parameters; possible values are (d)elta, (g)amma, (t)heta, v(e)ga, v(o)lga, v(a)nna, (r)ho, rho(f)"; > ; - }; -}; - -StringArray PRICING_FUNCDESC_OptProbHit -{ - ItemList [ en-US ] = - { - < "Probability that an asset hits a barrier assuming it follows dS/S = mu dt + vol dW"; > ; - < "spot"; > ; - < "Price/value S of the underlying asset"; > ; - < "vol"; > ; - < "Annual volatility of the underlying asset"; > ; - < "drift"; > ; - < "Parameter mu in dS/S = mu dt + vol dW"; > ; - < "T"; > ; - < "Time to maturity"; > ; - < "barrier_low"; > ; - < "Lower barrier (set to 0 for no lower barrier)"; > ; - < "barrier_up"; > ; - < "Upper barrier (set to 0 for no upper barrier)"; > ; - }; -}; - -StringArray PRICING_FUNCDESC_OptProbInMoney -{ - ItemList [ en-US ] = - { - < "Probability that an asset will at maturity end up between two barrier levels, assuming it follows dS/S = mu dt + vol dW (if the last two optional parameters (strike, put/call) are specified, the probability of S_T in [strike, upper barrier] for a call and S_T in [lower barrier, strike] for a put will be returned)"; > ; - < "spot"; > ; - < "Price/value of the asset"; > ; - < "vol"; > ; - < "Annual volatility of the asset"; > ; - < "drift"; > ; - < "Parameter mu from dS/S = mu dt + vol dW"; > ; - < "T"; > ; - < "Time to maturity in years"; > ; - < "barrier_low"; > ; - < "Lower barrier (set to 0 for no lower barrier)"; > ; - < "barrier_up"; > ; - < "Upper barrier (set to 0 for no upper barrier)"; > ; - < "put/call"; > ; - < "Optional (p)ut/(c)all indicator"; > ; - < "strike"; > ; - < "Optional strike level"; > ; - }; -}; - -// function names as accessible from cells - -String PRICING_FUNCNAME_OptBarrier -{ - Text [ en-US ] = "OPT_BARRIER"; -}; - -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"; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |