summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shell/source/win32/shlxthandler/util/fileextensions.cxx13
1 files changed, 5 insertions, 8 deletions
diff --git a/shell/source/win32/shlxthandler/util/fileextensions.cxx b/shell/source/win32/shlxthandler/util/fileextensions.cxx
index 607421cc51f3..cb73b1af9796 100644
--- a/shell/source/win32/shlxthandler/util/fileextensions.cxx
+++ b/shell/source/win32/shlxthandler/util/fileextensions.cxx
@@ -19,6 +19,7 @@
#include "algorithm"
#include "fileextensions.hxx"
+#include <rtl/character.hxx>
#include <sal/macros.h>
@@ -76,17 +77,13 @@ std::string get_file_name_extension(const std::string& file_name)
/** Return the type of a file
*/
-char easytolower( char in )
-{
- if( in<='Z' && in>='A' )
- return in-('Z'-'z');
- return in;
-}
-
File_Type_t get_file_type(const std::string& file_name)
{
std::string fext = get_file_name_extension(file_name);
- std::transform(fext.begin(), fext.end(), fext.begin(), easytolower);
+ std::transform(
+ fext.begin(), fext.end(), fext.begin(),
+ [](char c) {
+ return rtl::toAsciiLowerCase(static_cast<unsigned char>(c)); });
if (std::string::npos != WRITER_FILE_EXTENSIONS.find(fext))
return WRITER;