Lines 1-60
Link Here
|
1 |
--- src/ProjectSerializer.cpp.orig 2021-02-04 18:52:51 UTC |
|
|
2 |
+++ src/ProjectSerializer.cpp |
3 |
@@ -206,9 +206,9 @@ ProjectSerializer::ProjectSerializer(size_t allocSize) |
4 |
std::call_once(flag, []{ |
5 |
// Just once per run, store header information in the unique static |
6 |
// dictionary that will be written into each project that is saved. |
7 |
- // Store the size of "wxChar" so we can convert during recovery in |
8 |
- // case the file is used on a system with a different character size. |
9 |
- char size = sizeof(wxChar); |
10 |
+ // Store the size of "wxStringCharType" so we can convert during recovery |
11 |
+ // in case the file is used on a system with a different character size. |
12 |
+ char size = sizeof(wxStringCharType); |
13 |
mDict.AppendByte(FT_CharSize); |
14 |
mDict.AppendData(&size, 1); |
15 |
}); |
16 |
@@ -242,7 +242,7 @@ void ProjectSerializer::WriteAttr(const wxString & nam |
17 |
mBuffer.AppendByte(FT_String); |
18 |
WriteName(name); |
19 |
|
20 |
- const Length len = value.length() * sizeof(wxChar); |
21 |
+ const Length len = value.length() * sizeof(wxStringCharType); |
22 |
WriteLength( mBuffer, len ); |
23 |
mBuffer.AppendData(value.wx_str(), len); |
24 |
} |
25 |
@@ -309,7 +309,7 @@ void ProjectSerializer::WriteData(const wxString & val |
26 |
{ |
27 |
mBuffer.AppendByte(FT_Data); |
28 |
|
29 |
- Length len = value.length() * sizeof(wxChar); |
30 |
+ Length len = value.length() * sizeof(wxStringCharType); |
31 |
WriteLength( mBuffer, len ); |
32 |
mBuffer.AppendData(value.wx_str(), len); |
33 |
} |
34 |
@@ -317,7 +317,7 @@ void ProjectSerializer::WriteData(const wxString & val |
35 |
void ProjectSerializer::Write(const wxString & value) |
36 |
{ |
37 |
mBuffer.AppendByte(FT_Raw); |
38 |
- Length len = value.length() * sizeof(wxChar); |
39 |
+ Length len = value.length() * sizeof(wxStringCharType); |
40 |
WriteLength( mBuffer, len ); |
41 |
mBuffer.AppendData(value.wx_str(), len); |
42 |
} |
43 |
@@ -334,7 +334,7 @@ void ProjectSerializer::WriteSubTree(const ProjectSeri |
44 |
|
45 |
void ProjectSerializer::WriteName(const wxString & name) |
46 |
{ |
47 |
- wxASSERT(name.length() * sizeof(wxChar) <= SHRT_MAX); |
48 |
+ wxASSERT(name.length() * sizeof(wxStringCharType) <= SHRT_MAX); |
49 |
UShort id; |
50 |
|
51 |
auto nameiter = mNames.find(name); |
52 |
@@ -346,7 +346,7 @@ void ProjectSerializer::WriteName(const wxString & nam |
53 |
{ |
54 |
// mNames is static. This appends each name to static mDict only once |
55 |
// in each run. |
56 |
- UShort len = name.length() * sizeof(wxChar); |
57 |
+ UShort len = name.length() * sizeof(wxStringCharType); |
58 |
|
59 |
id = mNames.size(); |
60 |
mNames[name] = id; |