Disabled implicit conversion of wxString to std::string or const char*

and vice versa. Fixed one last implicit wxString conversion.
This commit is contained in:
bubnikv 2020-02-27 17:01:50 +01:00
parent 27f50778b2
commit 7c55674220
2 changed files with 4 additions and 1 deletions

View File

@ -227,6 +227,9 @@ endif(WIN32)
add_definitions(-DwxUSE_UNICODE -D_UNICODE -DUNICODE -DWXINTL_NO_GETTEXT_MACRO) add_definitions(-DwxUSE_UNICODE -D_UNICODE -DUNICODE -DWXINTL_NO_GETTEXT_MACRO)
# Disable unsafe implicit wxString to const char* / std::string and vice versa. This implicit conversion breaks the UTF-8 encoding quite often.
add_definitions(-DwxNO_UNSAFE_WXSTRING_CONV)
if (SLIC3R_PROFILE) if (SLIC3R_PROFILE)
message("PrusaSlicer will be built with a Shiny invasive profiler") message("PrusaSlicer will be built with a Shiny invasive profiler")
add_definitions(-DSLIC3R_PROFILE) add_definitions(-DSLIC3R_PROFILE)

View File

@ -734,7 +734,7 @@ static void msw_disable_cleartype(wxFont &font)
++ startpos_weight; ++ startpos_weight;
size_t endpos_weight = font_desc.find(sep, startpos_weight); size_t endpos_weight = font_desc.find(sep, startpos_weight);
// Parse the weight field. // Parse the weight field.
unsigned int weight = atoi(font_desc(startpos_weight, endpos_weight - startpos_weight)); unsigned int weight = wxAtoi(font_desc(startpos_weight, endpos_weight - startpos_weight));
size_t startpos = endpos_weight; size_t startpos = endpos_weight;
for (size_t i = 0; i < 6; ++ i) for (size_t i = 0; i < 6; ++ i)
startpos = font_desc.find(sep, startpos + 1); startpos = font_desc.find(sep, startpos + 1);