From 6d7ed03dd3c7472a481728b132e4fb8b86957f84 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 23 Mar 2017 15:28:11 +0100 Subject: Use rtl::toAsciiLowerCase Change-Id: I44e9f9382de2a7235b02ad94ff51b7f21295f2ae --- shell/source/win32/shlxthandler/util/fileextensions.cxx | 13 +++++-------- 1 file 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 #include @@ -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(c)); }); if (std::string::npos != WRITER_FILE_EXTENSIONS.find(fext)) return WRITER; -- cgit