diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2018-08-01 16:32:55 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-02-20 13:53:20 +0100 |
commit | 29048c86be4b068e919fa57928c8f79f62785d92 (patch) | |
tree | 14a31af82d4cd98a54e5227731249d634839678c | |
parent | b99d49b015c937533ec1496a6dec309aa7dcd9e1 (diff) |
Work around MSVC2017 optimizer bug when printing a page usind Pdfium
On Windows MSVC2017 32bit release builds of WebEngine, printing to
a QPrinter instance only printed partial page content.
This ended up being a compiler / optimizer bug triggered in the
FX_atof function in
src/3rdparty/chromium/third_party/pdfium/core/fxcrt/fx_string.cpp
which resulted in returning float numbers without any digits past
the decimal point. Because of that, many size / offset calcuations
were wrong.
The fix is to remove a redundant 'strc[cc] == "."' check, which is
implcitly present in a previous if condition. This in turn stops
the compiler from generating incorrect code, and thus parsing
the digits past the decimal point.
Task-number: QTBUG-69639
Change-Id: I7908318b6e7ca58e81d951af784ed8dcd901e12c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r-- | chromium/third_party/pdfium/core/fxcrt/fx_string.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/chromium/third_party/pdfium/core/fxcrt/fx_string.cpp b/chromium/third_party/pdfium/core/fxcrt/fx_string.cpp index b55931c9bdd..8a150fdb622 100644 --- a/chromium/third_party/pdfium/core/fxcrt/fx_string.cpp +++ b/chromium/third_party/pdfium/core/fxcrt/fx_string.cpp @@ -74,7 +74,7 @@ float StringToFloat(ByteStringView strc) { cc++; } int scale = 0; - if (cc < len && strc[cc] == '.') { + if (cc < len) { cc++; while (cc < len) { value += FractionalScale(scale, FXSYS_DecimalCharToInt(strc.CharAt(cc))); |