Fix egregiously bad comments that were frustrating
Bob Arnson committed
Jul 15, 2024 at 16:58 UTC
bb975d370a6a7398c4d28d23601b20ada7a7cdfe
2 files changed
+29
-29
src/libs/dutil/WixToolset.DUtil/locutil.cpp
+28
-28
@@ -116,15 +116,15 @@ extern "C" HRESULT DAPI LocProbeForFile(
116
LocExitOnFailure(hr, "Failed to parse langId.");
117
118
langid = MAKEWORD(HIBYTE(langid), LOBYTE(langid));
119
- hr = StrAllocFormatted(&sczLangIdFile, L"%u\\%ls", langid, wzLocFileName);
119
+ hr = StrAllocFormatted(&sczLangIdFile, L"%u\\%ls", langid, wzLocFileName);
120
LocExitOnFailure(hr, "Failed to format user preferred langid.");
121
122
- hr = PathConcat(wzBasePath, sczLangIdFile, &sczProbePath);
122
+ hr = PathConcat(wzBasePath, sczLangIdFile, &sczProbePath);
123
LocExitOnFailure(hr, "Failed to concat user preferred langid file name to base path.");
124
125
- if (FileExistsEx(sczProbePath, NULL))
126
- {
127
- ExitFunction();
125
+ if (FileExistsEx(sczProbePath, NULL))
126
+ {
127
+ ExitFunction();
128
}
129
}
130
}
@@ -142,20 +142,20 @@ extern "C" HRESULT DAPI LocProbeForFile(
142
ExitFunction();
143
}
144
145
- if (MAKELANGID(langid & 0x3FF, SUBLANG_DEFAULT) != langid)
146
- {
147
- langid = MAKELANGID(langid & 0x3FF, SUBLANG_DEFAULT);
148
-
149
- hr = StrAllocFormatted(&sczLangIdFile, L"%u\\%ls", langid, wzLocFileName);
145
+ if (MAKELANGID(langid & 0x3FF, SUBLANG_DEFAULT) != langid)
146
+ {
147
+ langid = MAKELANGID(langid & 0x3FF, SUBLANG_DEFAULT);
148
+
149
+ hr = StrAllocFormatted(&sczLangIdFile, L"%u\\%ls", langid, wzLocFileName);
150
LocExitOnFailure(hr, "Failed to format user langid (default sublang).");
151
152
- hr = PathConcat(wzBasePath, sczLangIdFile, &sczProbePath);
152
+ hr = PathConcat(wzBasePath, sczLangIdFile, &sczProbePath);
153
LocExitOnFailure(hr, "Failed to concat user langid file name to base path (default sublang).");
154
155
- if (FileExistsEx(sczProbePath, NULL))
156
- {
157
- ExitFunction();
158
- }
155
+ if (FileExistsEx(sczProbePath, NULL))
156
+ {
157
+ ExitFunction();
158
+ }
159
}
160
161
langid = ::GetSystemDefaultUILanguage();
@@ -171,20 +171,20 @@ extern "C" HRESULT DAPI LocProbeForFile(
171
ExitFunction();
172
}
173
174
- if (MAKELANGID(langid & 0x3FF, SUBLANG_DEFAULT) != langid)
175
- {
176
- langid = MAKELANGID(langid & 0x3FF, SUBLANG_DEFAULT);
177
-
178
- hr = StrAllocFormatted(&sczLangIdFile, L"%u\\%ls", langid, wzLocFileName);
174
+ if (MAKELANGID(langid & 0x3FF, SUBLANG_DEFAULT) != langid)
175
+ {
176
+ langid = MAKELANGID(langid & 0x3FF, SUBLANG_DEFAULT);
177
+
178
+ hr = StrAllocFormatted(&sczLangIdFile, L"%u\\%ls", langid, wzLocFileName);
179
LocExitOnFailure(hr, "Failed to format user langid (default sublang).");
180
181
- hr = PathConcat(wzBasePath, sczLangIdFile, &sczProbePath);
181
+ hr = PathConcat(wzBasePath, sczLangIdFile, &sczProbePath);
182
LocExitOnFailure(hr, "Failed to concat user langid file name to base path (default sublang).");
183
184
- if (FileExistsEx(sczProbePath, NULL))
185
- {
186
- ExitFunction();
187
- }
184
+ if (FileExistsEx(sczProbePath, NULL))
185
+ {
186
+ ExitFunction();
187
+ }
188
}
189
190
// Finally, look for the loc file in the base path.
@@ -242,13 +242,13 @@ extern "C" HRESULT DAPI LocLoadFromResource(
242
IXMLDOMDocument* pixd = NULL;
243
244
hr = ResReadData(hModule, szResource, &pvResource, &cbResource);
245
- LocExitOnFailure(hr, "Failed to read theme from resource.");
245
+ LocExitOnFailure(hr, "Failed to read localization from resource.");
246
247
hr = StrAllocStringAnsi(&sczXml, reinterpret_cast<LPCSTR>(pvResource), cbResource, CP_UTF8);
248
- LocExitOnFailure(hr, "Failed to convert XML document data from UTF-8 to unicode string.");
248
+ LocExitOnFailure(hr, "Failed to convert XML document data from UTF-8 to Unicode string.");
249
250
hr = XmlLoadDocument(sczXml, &pixd);
251
- LocExitOnFailure(hr, "Failed to load theme resource as XML document.");
251
+ LocExitOnFailure(hr, "Failed to load localization resource as XML document.");
252
253
hr = ParseWxl(pixd, ppWixLoc);
254
LocExitOnFailure(hr, "Failed to parse WXL.");
src/libs/dutil/WixToolset.DUtil/thmutil.cpp
+1
-1
@@ -711,7 +711,7 @@ DAPI_(HRESULT) ThemeLoadFromFile(
711
LPWSTR sczRelativePath = NULL;
712
713
hr = XmlLoadDocumentFromFile(wzThemeFile, &pixd);
714
- ThmExitOnFailure(hr, "Failed to load theme resource as XML document.");
714
+ ThmExitOnFailure(hr, "Failed to load theme file as XML document.");
715
716
hr = PathGetDirectory(wzThemeFile, &sczRelativePath);
717
ThmExitOnFailure(hr, "Failed to get relative path from theme file.");