diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-11-25 17:54:52 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-11-25 21:41:29 +0100 |
commit | 8de92fa9bc7b284cb151ec57205bbccda379e379 (patch) | |
tree | b8a22ea6f870119552f8f0f34137df156416b31f | |
parent | ff75b172cc86374969a986ee94cac0931d95a5cd (diff) |
TW_IMAGEINFO::ImageWidth,ImageHeight are of type TW_INT32
...and for TW_IMAGEINFO::XResolution,YResolution of type TW_FIX32 it appears
more natural to also convert them to TW_INT32 here, rather than to long
Change-Id: If531f3f3c4778439ae1ba19a5d829eb2ae9c803d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106606
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r-- | extensions/source/scanner/twain32shim.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/extensions/source/scanner/twain32shim.cxx b/extensions/source/scanner/twain32shim.cxx index 30cbba8558e4..0a34fa13ce7e 100644 --- a/extensions/source/scanner/twain32shim.cxx +++ b/extensions/source/scanner/twain32shim.cxx @@ -35,9 +35,9 @@ namespace { -long FixToLong(const TW_FIX32& rFix) +TW_INT32 FixToInt32(const TW_FIX32& rFix) { - return static_cast<long>(floor(rFix.Whole + rFix.Frac / 65536. + 0.5)); + return static_cast<TW_INT32>(floor(rFix.Whole + rFix.Frac / 65536. + 0.5)); } const wchar_t sTwainWndClass[] = L"TwainClass"; @@ -387,14 +387,14 @@ void ImpTwain::ImplXfer() { TW_IMAGEINFO aInfo; HANDLE hDIB = nullptr; - long nWidth, nHeight, nXRes, nYRes; + TW_INT32 nWidth, nHeight, nXRes, nYRes; if (m_pDSM(&m_aAppId, &m_aSrcId, DG_IMAGE, DAT_IMAGEINFO, MSG_GET, &aInfo) == TWRC_SUCCESS) { nWidth = aInfo.ImageWidth; nHeight = aInfo.ImageLength; - nXRes = FixToLong(aInfo.XResolution); - nYRes = FixToLong(aInfo.YResolution); + nXRes = FixToInt32(aInfo.XResolution); + nYRes = FixToInt32(aInfo.YResolution); } else nWidth = nHeight = nXRes = nYRes = -1; |