diff options
Diffstat (limited to 'dbaccess/source/ui/app/templwin.cxx')
-rw-r--r-- | dbaccess/source/ui/app/templwin.cxx | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/dbaccess/source/ui/app/templwin.cxx b/dbaccess/source/ui/app/templwin.cxx index e9940782d630..224d8be0aed9 100644 --- a/dbaccess/source/ui/app/templwin.cxx +++ b/dbaccess/source/ui/app/templwin.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <algorithm> #include <core_resource.hxx> #include <templwin.hrc> #include "templwin.hxx" @@ -25,13 +26,9 @@ namespace SvtDocInfoTable_Impl { OUString GetString(int nId) { - for (size_t i = 0; i < SAL_N_ELEMENTS(STRARY_SVT_DOCINFO); ++i) - { - if (STRARY_SVT_DOCINFO[i].second == nId) - return DBA_RES(STRARY_SVT_DOCINFO[i].first); - } - - return OUString(); + auto const found = std::find_if(std::begin(STRARY_SVT_DOCINFO), std::end(STRARY_SVT_DOCINFO) + , [nId](auto const & docinfo){ return docinfo.second == nId; }); + return (found != std::end(STRARY_SVT_DOCINFO)) ? DBA_RES(found->first) : OUString(); } } |