diff options
author | Noel Grandin <noel@peralex.com> | 2021-06-15 21:12:25 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-06-17 14:32:11 +0200 |
commit | 0771ac00acc8730f77db76b901724f1513a32723 (patch) | |
tree | 8af934c3f11e452bc8ef8941fd284cdc9cdbab5c /sccomp | |
parent | 0d97abc8ef890b2e2ead34c449f2a140e22dd5ee (diff) |
use string_view in the Translate API
Change-Id: I0bb0ea9d39ed623928060ffd3f2e2bc36ba33209
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117272
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sccomp')
-rw-r--r-- | sccomp/source/solver/SolverComponent.cxx | 4 | ||||
-rw-r--r-- | sccomp/source/solver/SolverComponent.hxx | 2 | ||||
-rw-r--r-- | sccomp/source/solver/SwarmSolver.cxx | 8 |
3 files changed, 7 insertions, 7 deletions
diff --git a/sccomp/source/solver/SolverComponent.cxx b/sccomp/source/solver/SolverComponent.cxx index 3df7bf5d5887..3f01c529a2cd 100644 --- a/sccomp/source/solver/SolverComponent.cxx +++ b/sccomp/source/solver/SolverComponent.cxx @@ -41,9 +41,9 @@ using namespace com::sun::star; // Resources from tools are used for translated strings -OUString SolverComponent::GetResourceString(const char* pId) +OUString SolverComponent::GetResourceString(std::string_view aId) { - return Translate::get(pId, Translate::Create("scc")); + return Translate::get(aId, Translate::Create("scc")); } size_t ScSolverCellHash::operator()( const css::table::CellAddress& rAddress ) const diff --git a/sccomp/source/solver/SolverComponent.hxx b/sccomp/source/solver/SolverComponent.hxx index 1abe8f494a16..0c3869bdd4b4 100644 --- a/sccomp/source/solver/SolverComponent.hxx +++ b/sccomp/source/solver/SolverComponent.hxx @@ -82,7 +82,7 @@ protected: css::uno::Sequence< double > maSolution; OUString maStatus; - static OUString GetResourceString(const char* pId); + static OUString GetResourceString(std::string_view aId); static css::uno::Reference<css::table::XCell> GetCell( const css::uno::Reference<css::sheet::XSpreadsheetDocument>& xDoc, const css::table::CellAddress& rPos ); diff --git a/sccomp/source/solver/SwarmSolver.cxx b/sccomp/source/solver/SwarmSolver.cxx index a55f410b4f10..515beaed0d51 100644 --- a/sccomp/source/solver/SwarmSolver.cxx +++ b/sccomp/source/solver/SwarmSolver.cxx @@ -130,7 +130,7 @@ private: std::vector<sheet::SolverConstraint> maNonBoundedConstraints; private: - static OUString getResourceString(const char* pId); + static OUString getResourceString(std::string_view aId); uno::Reference<table::XCell> getCell(const table::CellAddress& rPosition); void setValue(const table::CellAddress& rPosition, double fValue); @@ -283,12 +283,12 @@ public: }; } -OUString SwarmSolver::getResourceString(const char* pId) +OUString SwarmSolver::getResourceString(std::string_view aId) { - if (!pId) + if (aId.empty()) return OUString(); - return Translate::get(pId, Translate::Create("scc")); + return Translate::get(aId, Translate::Create("scc")); } uno::Reference<table::XCell> SwarmSolver::getCell(const table::CellAddress& rPosition) |