Merge branch 'master' into jgrpp
# Conflicts: # cmake/CompileFlags.cmake # src/crashlog.cpp # src/fileio.cpp # src/fileio_func.h # src/fios_gui.cpp # src/ini_load.cpp # src/ini_type.h # src/lang/english.txt # src/lang/german.txt # src/lang/korean.txt # src/network/network_client.cpp # src/order_base.h # src/order_cmd.cpp # src/os/windows/win32.cpp # src/road_cmd.cpp # src/saveload/saveload.cpp # src/saveload/saveload.h # src/settings.cpp # src/station_cmd.cpp # src/stdafx.h # src/table/settings.ini # src/tree_cmd.cpp # src/tree_gui.cpp # src/vehicle_base.h # src/video/cocoa/cocoa_v.mm # src/video/cocoa/event.mm # src/video/cocoa/wnd_quartz.mm # src/viewport.cpp # src/widgets/tree_widget.h
This commit is contained in:
@@ -464,6 +464,17 @@ bool strtolower(char *str)
|
||||
return changed;
|
||||
}
|
||||
|
||||
bool strtolower(std::string &str, std::string::size_type offs)
|
||||
{
|
||||
bool changed = false;
|
||||
for (auto ch = str.begin() + offs; ch != str.end(); ++ch) {
|
||||
auto new_ch = static_cast<char>(tolower(static_cast<unsigned char>(*ch)));
|
||||
changed |= new_ch != *ch;
|
||||
*ch = new_ch;
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Only allow certain keys. You can define the filter to be used. This makes
|
||||
* sure no invalid keys can get into an editbox, like BELL.
|
||||
@@ -760,7 +771,7 @@ int strnatcmp(const char *s1, const char *s2, bool ignore_garbage_at_front)
|
||||
}
|
||||
|
||||
#ifdef WITH_ICU_I18N
|
||||
if (_current_collator != nullptr) {
|
||||
if (_current_collator) {
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
int result = _current_collator->compareUTF8(s1, s2, status);
|
||||
if (U_SUCCESS(status)) return result;
|
||||
|
Reference in New Issue
Block a user