summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFredrik Orderud <fredrik.orderud@ge.com>2020-03-14 13:27:55 +0100
committerFredrik Orderud <fredrik.orderud@ge.com>2020-03-16 09:25:58 +0100
commit927a76c9246109f14b51bd9a3cf224d6f987e10d (patch)
tree3cf35e1c1c1626a2792ffb90fbcfd29becca7618
parent34d89d9b72198f0e0f085d7445db5709a8a130b3 (diff)
Fix broken IDL version handling in DumpIDL
IDL versions are limited to "major.minor" format, where each number can range from 0 to 65k. Patch and build numbers are not supported. The current implementation just removes extra dots, converting a "10.20.30.40" version string into "10.203040", which seem odd to me. It also causes the following failure when the concatenated "<minor><patch><build>" string exceed 65k: MIDL2152: [version] format is incorrect Change-Id: I915e70a5480f69caa3822ec9b41fc6edc7fe4cfa Fixes: QTBUG-82883 Reference: https://docs.microsoft.com/en-us/windows/win32/midl/compiler-errors Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
-rw-r--r--src/activeqt/control/qaxserver.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/activeqt/control/qaxserver.cpp b/src/activeqt/control/qaxserver.cpp
index af6fbb2..92f03f9 100644
--- a/src/activeqt/control/qaxserver.cpp
+++ b/src/activeqt/control/qaxserver.cpp
@@ -1157,9 +1157,10 @@ extern "C" HRESULT __stdcall DumpIDL(const QString &outfile, const QString &ver)
out.setDevice(&file);
QString version(ver.unicode(), ver.length());
+ // truncate "major.minor.patch.build" version string to "major.minor"
while (version.count(QLatin1Char('.')) > 1) {
int lastdot = version.lastIndexOf(QLatin1Char('.'));
- version.remove(lastdot, 1);
+ version.truncate(lastdot);
}
if (version.isEmpty())
version = QLatin1String("1.0");