Fix narrow/wide string concatenation errors for wxWidgets 3.3
In wx 3.3 with wxUSE_STD_CONTAINERS=ON, wxString is backed by
std::wstring, so direct concatenation of const char[] with
std::wstring or wxUniCharRef fails. Fix by splitting compound
concatenations into separate += operations on wxString, or by
wrapping the left operand in wxString() to use its operator+.
Files fixed:
- AuxiliaryDataViewModel.cpp: split "\\" + wxString/wstring chains
- AboutDialog.cpp: split std::string("\n") + wxUniCharRef
- Auxiliary.cpp: wrap dir.wstring() in wxString(), split "/" + wstring
This commit is contained in:
@@ -332,9 +332,12 @@ wxDataViewItemArray AuxiliaryModel::ImportFile(AuxiliaryModelNode* sel, wxArrayS
|
||||
// Copy imported file to project temp directory
|
||||
fs::path src_bfs_path(file_path.ToStdWstring());
|
||||
wxString dir_path = m_root_dir;
|
||||
if (sel != m_root)
|
||||
dir_path += "\\" + sel->name;
|
||||
dir_path += "\\" + src_bfs_path.filename().generic_wstring();
|
||||
if (sel != m_root) {
|
||||
dir_path += "\\";
|
||||
dir_path += sel->name;
|
||||
}
|
||||
dir_path += "\\";
|
||||
dir_path += src_bfs_path.filename().generic_wstring();
|
||||
|
||||
boost::system::error_code ec;
|
||||
if (!fs::copy_file(src_bfs_path, fs::path(dir_path.ToStdWstring()), fs::copy_options::overwrite_existing, ec))
|
||||
|
||||
Reference in New Issue
Block a user