[Libreoffice-bugs] [Bug 121074] Missing images in an XLSX on Linux and macOS (OK on Windows)

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Mon Jan 13 17:09:36 UTC 2020


https://bugs.documentfoundation.org/show_bug.cgi?id=121074

--- Comment #18 from Mike Kaganski <mikekaganski at hotmail.com> ---
So yes, the problem is different size of long in used in generic Size (*not*
awt::Size): long is 4-byte on all architectures on Windows (or rather MSVC),
while it's 8 byte on 64-bit gcc/clang. Note that "long" in IDL is always
4-byte, so awt::Size is consistently uses sal_Int32 on all platforms.

On Windows, ScDocument::GetMMRect overflows aRect's 32-bit height when
multiplying 1824306210 by HMM_PER_TWIPS (~1.7), resulting in -2147483648
(SAL_MIN_INT32). Later, calculating resulting height, and subtracting 1 from
that, positive 2147483647 (SAL_MAX_INT32) appears, which successfully goes into
awt:Size.

On other platforms, ScDocument::GetMMRect produces correct 64-bit height, which
overflows only when copying to awt::Size, resulting in negative value there.

Converting the result of ScDocument::GetMMRect (already in MM100) from twips to
MM100 is incorrect; it could only succeed here because that would become more
than 0xFFFFFFFF, and owerflowing when writing to awt::Size would again give
positive fake result...

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20200113/2242b1e0/attachment-0001.htm>


More information about the Libreoffice-bugs mailing list