diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-04-30 17:01:32 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-05-02 13:18:57 +0200 |
commit | 34f7e618ddd3399d9e7f3998e25545256255d02d (patch) | |
tree | fd946f8f2ab8386db89f531d49fae1718a21e943 /scaddins | |
parent | c881756fcfdc1fa63ff534bf4538d551b2139515 (diff) |
untranslated strings are just strings
removes starmaths InsertCommand in favour of InsertCommandText
Change-Id: I5659adcaa28e5b5861d1a1cc5d2afa84009490f6
Reviewed-on: https://gerrit.libreoffice.org/37113
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'scaddins')
-rw-r--r-- | scaddins/source/datefunc/datefunc.cxx | 22 | ||||
-rw-r--r-- | scaddins/source/datefunc/datefunc.hrc | 11 | ||||
-rw-r--r-- | scaddins/source/datefunc/datefunc.hxx | 4 | ||||
-rw-r--r-- | scaddins/source/datefunc/datefunc.src | 65 | ||||
-rw-r--r-- | scaddins/source/datefunc/deffuncname.hxx | 73 |
5 files changed, 84 insertions, 91 deletions
diff --git a/scaddins/source/datefunc/datefunc.cxx b/scaddins/source/datefunc/datefunc.cxx index 5e862a971f48..718fbb675060 100644 --- a/scaddins/source/datefunc/datefunc.cxx +++ b/scaddins/source/datefunc/datefunc.cxx @@ -27,6 +27,7 @@ #include <tools/rcid.h> #include <tools/resmgr.hxx> #include <algorithm> +#include "deffuncname.hxx" using namespace ::com::sun::star; @@ -61,7 +62,7 @@ const ScaFuncDataBase pFuncDataArr[] = #undef FUNCDATA -ScaFuncData::ScaFuncData( const ScaFuncDataBase& rBaseData, ResMgr& rResMgr ) : +ScaFuncData::ScaFuncData(const ScaFuncDataBase& rBaseData) : aIntName( OUString::createFromAscii( rBaseData.pIntName ) ), nUINameID( rBaseData.nUINameID ), nDescrID( rBaseData.nDescrID ), @@ -70,9 +71,8 @@ ScaFuncData::ScaFuncData( const ScaFuncDataBase& rBaseData, ResMgr& rResMgr ) : bDouble( rBaseData.bDouble ), bWithOpt( rBaseData.bWithOpt ) { - ResStringArray aArr(ScaResId(rBaseData.nCompListID, rResMgr)); - for (sal_uInt32 nIndex = 0; nIndex < aArr.Count(); ++nIndex) - aCompList.push_back(aArr.GetString(nIndex)); + aCompList.push_back(OUString::createFromAscii(rBaseData.pCompListID[0])); + aCompList.push_back(OUString::createFromAscii(rBaseData.pCompListID[1])); } ScaFuncData::~ScaFuncData() @@ -86,11 +86,10 @@ sal_uInt16 ScaFuncData::GetStrIndex( sal_uInt16 nParam ) const return (nParam > nParamCount) ? (nParamCount * 2) : (nParam * 2); } - -void InitScaFuncDataList( ScaFuncDataList& rList, ResMgr& rResMgr ) +void InitScaFuncDataList(ScaFuncDataList& rList) { - for(const auto & nIndex : pFuncDataArr) - rList.push_back( ScaFuncData( nIndex, rResMgr ) ); + for (const auto & nIndex : pFuncDataArr) + rList.push_back(ScaFuncData(nIndex)); } // entry points for service registration / instantiation @@ -175,11 +174,8 @@ void ScaDateAddIn::InitData() pResMgr.reset(ResMgr::CreateResMgr("date", LanguageTag(aFuncLoc))); pFuncDataList.reset(); - if ( pResMgr ) - { - pFuncDataList.reset(new ScaFuncDataList); - InitScaFuncDataList( *pFuncDataList, *pResMgr ); - } + pFuncDataList.reset(new ScaFuncDataList); + InitScaFuncDataList(*pFuncDataList); if( pDefLocales ) { diff --git a/scaddins/source/datefunc/datefunc.hrc b/scaddins/source/datefunc/datefunc.hrc index 3830db4eaec9..44653ef848a2 100644 --- a/scaddins/source/datefunc/datefunc.hrc +++ b/scaddins/source/datefunc/datefunc.hrc @@ -44,17 +44,6 @@ #define DATE_FUNCNAME_WeeksInYear (DATE_FUNCNAME_START+6) #define DATE_FUNCNAME_Rot13 (DATE_FUNCNAME_START+7) -#define DATE_DEFFUNCNAME_START (DATE_RESOURCE_START+2000) - -#define DATE_DEFFUNCNAME_DiffWeeks (DATE_DEFFUNCNAME_START) -#define DATE_DEFFUNCNAME_DiffMonths (DATE_DEFFUNCNAME_START+1) -#define DATE_DEFFUNCNAME_DiffYears (DATE_DEFFUNCNAME_START+2) -#define DATE_DEFFUNCNAME_IsLeapYear (DATE_DEFFUNCNAME_START+3) -#define DATE_DEFFUNCNAME_DaysInMonth (DATE_DEFFUNCNAME_START+4) -#define DATE_DEFFUNCNAME_DaysInYear (DATE_DEFFUNCNAME_START+5) -#define DATE_DEFFUNCNAME_WeeksInYear (DATE_DEFFUNCNAME_START+6) -#define DATE_DEFFUNCNAME_Rot13 (DATE_DEFFUNCNAME_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 f93c1284fc8e..9204709bca1f 100644 --- a/scaddins/source/datefunc/datefunc.hxx +++ b/scaddins/source/datefunc/datefunc.hxx @@ -57,7 +57,7 @@ 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 - sal_uInt16 nCompListID; // resource ID to list of valid names + const char** pCompListID; // list of valid names sal_uInt16 nParamCount; // number of named / described parameters ScaCategory eCat; // function category bool bDouble; // name already exist in Calc @@ -77,7 +77,7 @@ private: bool bWithOpt; // first parameter is internal public: - ScaFuncData( const ScaFuncDataBase& rBaseData, ResMgr& rRscMgr ); + ScaFuncData(const ScaFuncDataBase& rBaseData); ~ScaFuncData(); sal_uInt16 GetUINameID() const { return nUINameID; } diff --git a/scaddins/source/datefunc/datefunc.src b/scaddins/source/datefunc/datefunc.src index 7741792436bf..9e8632995a37 100644 --- a/scaddins/source/datefunc/datefunc.src +++ b/scaddins/source/datefunc/datefunc.src @@ -151,69 +151,4 @@ String DATE_FUNCNAME_Rot13 Text [ en-US ] = "ROT13"; }; -StringArray DATE_DEFFUNCNAME_DiffWeeks -{ - ItemList = - { - < "WOCHEN"; >; - < "WEEKS"; >; - }; -}; -StringArray DATE_DEFFUNCNAME_DiffMonths -{ - ItemList = - { - < "MONATE"; >; - < "MONTHS"; >; - }; -}; -StringArray DATE_DEFFUNCNAME_DiffYears -{ - ItemList = - { - < "JAHRE"; >; - < "YEARS"; >; - }; -}; -StringArray DATE_DEFFUNCNAME_IsLeapYear -{ - ItemList = - { - < "ISTSCHALTJAHR"; >; - < "ISLEAPYEAR"; >; - }; -}; -StringArray DATE_DEFFUNCNAME_DaysInMonth -{ - ItemList = - { - < "TAGEIMMONAT"; >; - < "DAYSINMONTH"; >; - }; -}; -StringArray DATE_DEFFUNCNAME_DaysInYear -{ - ItemList = - { - < "TAGEIMJAHR"; >; - < "DAYSINYEAR"; >; - }; -}; -StringArray DATE_DEFFUNCNAME_WeeksInYear -{ - ItemList = - { - < "WOCHENIMJAHR"; >; - < "WEEKSINYEAR"; >; - }; -}; -StringArray DATE_DEFFUNCNAME_Rot13 -{ - ItemList = - { - < "ROT13"; >; - < "ROT13"; >; - }; -}; - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scaddins/source/datefunc/deffuncname.hxx b/scaddins/source/datefunc/deffuncname.hxx new file mode 100644 index 000000000000..15b77bdf4354 --- /dev/null +++ b/scaddins/source/datefunc/deffuncname.hxx @@ -0,0 +1,73 @@ +/* -*- 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_DEFFUNCTIONNAME_HXX +#define INCLUDED_SCADDINS_SOURCE_DATEFUNC_DEFFUNCTIONNAME_HXX + +static const char* DATE_DEFFUNCNAME_DiffWeeks[2] = +{ + "WOCHEN" + "WEEKS" +}; + +static const char* DATE_DEFFUNCNAME_DiffMonths[2] = +{ + "MONATE" + "MONTHS" +}; + +static const char* DATE_DEFFUNCNAME_DiffYears[2] = +{ + "JAHRE" + "YEARS" +}; + +static const char* DATE_DEFFUNCNAME_IsLeapYear[2] = +{ + "ISTSCHALTJAHR" + "ISLEAPYEAR" +}; + +static const char* DATE_DEFFUNCNAME_DaysInMonth[2] = +{ + "TAGEIMMONAT" + "DAYSINMONTH" +}; + +static const char* DATE_DEFFUNCNAME_DaysInYear[2] = +{ + "TAGEIMJAHR" + "DAYSINYEAR" +}; + +static const char* DATE_DEFFUNCNAME_WeeksInYear[2] = +{ + "WOCHENIMJAHR" + "WEEKSINYEAR" +}; + +static const char* DATE_DEFFUNCNAME_Rot13[2] = +{ + "ROT13" + "ROT13" +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |