summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-03-23 15:28:11 +0100
committerStephan Bergmann <sbergman@redhat.com>2017-03-23 15:28:11 +0100
commit6d7ed03dd3c7472a481728b132e4fb8b86957f84 (patch)
treef144929e073f914bf35bf57a3965e693c2b8f05f /shell
parent0f49fdd70e5bc612339c598185d9efe7646f364f (diff)
Use rtl::toAsciiLowerCase
Change-Id: I44e9f9382de2a7235b02ad94ff51b7f21295f2ae
Diffstat (limited to 'shell')
-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;