summaryrefslogtreecommitdiff
diff options
authorSimon Chenery <simon_chenery@yahoo.com>2025-03-29 16:37:16 +0100
committerDavid Gilbert <freedesktop@treblig.org>2025-04-28 03:04:52 +0200
commitd9435d2759e78b716b64bfccdecaac3f3f1a0e4d (patch)
treeca4e2939b5b1e67b9aff8cb5b79fdb2258761cf3
parentd87694cf9396ec557031a93cc8b92b01720b69e0 (diff)
tdf#153294 simplify for loop to std::find call in ImplHelper.cxx
Change-Id: I3bf6b955942c0ef5bf6ab4398b1a2f3103a0a133 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183488 Tested-by: Jenkins Reviewed-by: David Gilbert <freedesktop@treblig.org>
-rw-r--r--vcl/win/dtrans/ImplHelper.cxx8
1 files changed, 2 insertions, 6 deletions
diff --git a/vcl/win/dtrans/ImplHelper.cxx b/vcl/win/dtrans/ImplHelper.cxx
index 84c7383b2ce7..c1e541090445 100644
--- a/vcl/win/dtrans/ImplHelper.cxx
+++ b/vcl/win/dtrans/ImplHelper.cxx
@@ -134,16 +134,12 @@ bool IsOEMCP( sal_uInt32 codepage )
{
OSL_ASSERT( IsValidCodePage( codepage ) );
- sal_uInt32 arrOEMCP[] = { 437, 708, 709, 710, 720, 737,
+ static constexpr sal_uInt32 arrOEMCP[] = { 437, 708, 709, 710, 720, 737,
775, 850, 852, 855, 857, 860,
861, 862, 863, 864, 865, 866,
869, 874, 932, 936, 949, 950, 1361 };
- for ( size_t i = 0; i < SAL_N_ELEMENTS( arrOEMCP ); ++i )
- if ( arrOEMCP[i] == codepage )
- return true;
-
- return false;
+ return std::find(std::begin(arrOEMCP), std::end(arrOEMCP), codepage) != std::end(arrOEMCP);
}
// converts a codepage into its string representation
close