Revert "loplugin:constfields in scaddins,sccomp"

This reverts commit 1ab27f9ae6.

Change-Id: Iaf9b011201ee763aaf4d08ceedd6074bafad1c3c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90409
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2020-03-12 09:39:16 +02:00
parent f6cd2dd6c6
commit 8070e2f7c6
6 changed files with 38 additions and 36 deletions

View File

@@ -191,11 +191,11 @@ struct FuncDataBase
const char* pIntName; const char* pIntName;
const char* pUINameID; // resource ID to UI name const char* pUINameID; // resource ID to UI name
const char** pDescrID; // resource ID to description, parameter names and ~ description const char** pDescrID; // resource ID to description, parameter names and ~ description
bool const bDouble; // name already exist in Calc bool bDouble; // name already exist in Calc
bool const bWithOpt; // first parameter is internal bool bWithOpt; // first parameter is internal
const char** pCompListID; // list of valid names const char** pCompListID; // list of valid names
sal_uInt16 const nNumOfParams; // number of named / described parameters sal_uInt16 nNumOfParams; // number of named / described parameters
FDCategory const eCat; // function category FDCategory eCat; // function category
const char* pSuffix; // if bDouble, append a suffix other than "_ADD" for UI const char* pSuffix; // if bDouble, append a suffix other than "_ADD" for UI
}; };
@@ -203,15 +203,15 @@ struct FuncDataBase
class FuncData final class FuncData final
{ {
private: private:
OUString const aIntName; OUString aIntName;
const char* pUINameID; const char* pUINameID;
const char** pDescrID; // leads also to parameter descriptions! const char** pDescrID; // leads also to parameter descriptions!
bool const bDouble; // flag for names that already exist in Calc bool bDouble; // flag for names that already exist in Calc
bool const bWithOpt; // has internal parameter on first position bool bWithOpt; // has internal parameter on first position
sal_uInt16 const nParam; // num of parameters sal_uInt16 nParam; // num of parameters
std::vector<OUString> aCompList; // list of all valid names std::vector<OUString> aCompList; // list of all valid names
FDCategory const eCat; // function category FDCategory eCat; // function category
OUString aSuffix; // if bDouble and not empty, append a suffix other than "_ADD" for UI OUString aSuffix; // if bDouble and not empty, append a suffix other than "_ADD" for UI
public: public:
@@ -503,10 +503,10 @@ class ConvertData
{ {
protected: protected:
friend class ConvertDataList; friend class ConvertDataList;
double const fConst; double fConst;
OUString const aName; OUString aName;
ConvertDataClass const eClass; ConvertDataClass eClass;
bool const bPrefixSupport; bool bPrefixSupport;
public: public:
ConvertData( ConvertData(
const char pUnitName[], const char pUnitName[],
@@ -533,7 +533,7 @@ public:
class ConvertDataLinear final : public ConvertData class ConvertDataLinear final : public ConvertData
{ {
double const fOffs; double fOffs;
public: public:
inline ConvertDataLinear( inline ConvertDataLinear(
const char pUnitName[], const char pUnitName[],

View File

@@ -50,23 +50,23 @@ struct ScaFuncDataBase
const char* pUINameID; // resource ID to UI name const char* pUINameID; // resource ID to UI name
const char** pDescrID; // resource ID to description, parameter names and ~ description const char** pDescrID; // resource ID to description, parameter names and ~ description
const char** pCompListID; // list of valid names const char** pCompListID; // list of valid names
sal_uInt16 const nParamCount; // number of named / described parameters sal_uInt16 nParamCount; // number of named / described parameters
ScaCategory const eCat; // function category ScaCategory eCat; // function category
bool const bDouble; // name already exist in Calc bool bDouble; // name already exist in Calc
bool const bWithOpt; // first parameter is internal bool bWithOpt; // first parameter is internal
}; };
class ScaFuncData final class ScaFuncData final
{ {
private: private:
OUString const aIntName; // internal name (get***) OUString aIntName; // internal name (get***)
const char* pUINameID; // resource ID to UI name const char* pUINameID; // resource ID to UI name
const char** pDescrID; // leads also to parameter descriptions! const char** pDescrID; // leads also to parameter descriptions!
sal_uInt16 const nParamCount; // num of parameters sal_uInt16 nParamCount; // num of parameters
std::vector<OUString> aCompList; // list of all valid names std::vector<OUString> aCompList; // list of all valid names
ScaCategory const eCat; // function category ScaCategory eCat; // function category
bool const bDouble; // name already exist in Calc bool bDouble; // name already exist in Calc
bool const bWithOpt; // first parameter is internal bool bWithOpt; // first parameter is internal
public: public:
ScaFuncData(const ScaFuncDataBase& rBaseData); ScaFuncData(const ScaFuncDataBase& rBaseData);

View File

@@ -66,23 +66,23 @@ struct ScaFuncDataBase
// (English) function names again. // (English) function names again.
// see also: GetExcelName() or GetCompNames() or getCompatibilityNames() // see also: GetExcelName() or GetCompNames() or getCompatibilityNames()
const char* pCompName; const char* pCompName;
sal_uInt16 const nParamCount; // number of named / described parameters sal_uInt16 nParamCount; // number of named / described parameters
ScaCategory const eCat; // function category ScaCategory eCat; // function category
bool const bDouble; // name already exist in Calc bool bDouble; // name already exist in Calc
bool const bWithOpt; // first parameter is internal bool bWithOpt; // first parameter is internal
}; };
class ScaFuncData final class ScaFuncData final
{ {
private: private:
OUString const aIntName; // internal name (get***) OUString aIntName; // internal name (get***)
const char* pUINameID; // resource ID to UI name const char* pUINameID; // resource ID to UI name
const char** pDescrID; // leads also to parameter descriptions! const char** pDescrID; // leads also to parameter descriptions!
sal_uInt16 const nParamCount; // num of parameters sal_uInt16 nParamCount; // num of parameters
std::vector<OUString> aCompList; // list of all valid names std::vector<OUString> aCompList; // list of all valid names
ScaCategory const eCat; // function category ScaCategory eCat; // function category
bool const bDouble; // name already exist in Calc bool bDouble; // name already exist in Calc
bool const bWithOpt; // first parameter is internal bool bWithOpt; // first parameter is internal
public: public:
ScaFuncData(const ScaFuncDataBase& rBaseData); ScaFuncData(const ScaFuncDataBase& rBaseData);

View File

@@ -29,12 +29,12 @@ template <typename DataProvider> class DifferentialEvolutionAlgorithm
DataProvider& mrDataProvider; DataProvider& mrDataProvider;
size_t const mnPopulationSize; size_t mnPopulationSize;
std::vector<Individual> maPopulation; std::vector<Individual> maPopulation;
std::random_device maRandomDevice; std::random_device maRandomDevice;
std::mt19937 maGenerator; std::mt19937 maGenerator;
size_t const mnDimensionality; size_t mnDimensionality;
std::uniform_int_distribution<> maRandomPopulation; std::uniform_int_distribution<> maRandomPopulation;
std::uniform_int_distribution<> maRandomDimensionality; std::uniform_int_distribution<> maRandomDimensionality;

View File

@@ -49,7 +49,7 @@ private:
DataProvider& mrDataProvider; DataProvider& mrDataProvider;
size_t const mnNumOfParticles; size_t mnNumOfParticles;
std::vector<Particle> maSwarm; std::vector<Particle> maSwarm;

View File

@@ -121,6 +121,7 @@ private:
// results // results
bool mbSuccess; bool mbSuccess;
double mfResultValue;
uno::Sequence<double> maSolution; uno::Sequence<double> maSolution;
OUString maStatus; OUString maStatus;
@@ -144,6 +145,7 @@ public:
, mnTimeout(60000) , mnTimeout(60000)
, mnAlgorithm(0) , mnAlgorithm(0)
, mbSuccess(false) , mbSuccess(false)
, mfResultValue(0.0)
{ {
registerProperty("NonNegative", PROP_NONNEGATIVE, 0, &mbNonNegative, registerProperty("NonNegative", PROP_NONNEGATIVE, 0, &mbNonNegative,
cppu::UnoType<decltype(mbNonNegative)>::get()); cppu::UnoType<decltype(mbNonNegative)>::get());
@@ -215,7 +217,7 @@ public:
virtual void SAL_CALL setMaximize(sal_Bool bMaximize) override { mbMaximize = bMaximize; } virtual void SAL_CALL setMaximize(sal_Bool bMaximize) override { mbMaximize = bMaximize; }
virtual sal_Bool SAL_CALL getSuccess() override { return mbSuccess; } virtual sal_Bool SAL_CALL getSuccess() override { return mbSuccess; }
virtual double SAL_CALL getResultValue() override { return 0; } virtual double SAL_CALL getResultValue() override { return mfResultValue; }
virtual uno::Sequence<double> SAL_CALL getSolution() override { return maSolution; } virtual uno::Sequence<double> SAL_CALL getSolution() override { return maSolution; }