diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-11-13 12:19:49 +0200 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-11-13 12:12:45 +0100 |
commit | a339ebca55f53db5f0b72b26fcfbb3aaa2b2a825 (patch) | |
tree | ca13e5002b070e7cc3eae5d26c45d9576e995ec4 /extensions | |
parent | 9af1dc8a03958c32d4bd56804166293cc1031828 (diff) |
Drop unused variables
nWidth/nHeight (1) are irrelevant here (we get the correct pixel size
right in the hDIB), and (2) should not be -1, because we don't use
ICAP_UNDEFINEDIMAGESIZE capability [1].
[1] https://twain.org/wp-content/uploads/2017/03/TWAIN-2.4-Specification.pdf#page=268
Change-Id: I8cb20087944536552326b3e1582e8ef12dcc0d32
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124986
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/scanner/twain32shim.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/extensions/source/scanner/twain32shim.cxx b/extensions/source/scanner/twain32shim.cxx index 0a34fa13ce7e..8821a3b0cabc 100644 --- a/extensions/source/scanner/twain32shim.cxx +++ b/extensions/source/scanner/twain32shim.cxx @@ -387,17 +387,15 @@ void ImpTwain::ImplXfer() { TW_IMAGEINFO aInfo; HANDLE hDIB = nullptr; - TW_INT32 nWidth, nHeight, nXRes, nYRes; + TW_INT32 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 = FixToInt32(aInfo.XResolution); nYRes = FixToInt32(aInfo.YResolution); } else - nWidth = nHeight = nXRes = nYRes = -1; + nXRes = nYRes = -1; switch (m_pDSM(&m_aAppId, &m_aSrcId, DG_IMAGE, DAT_IMAGENATIVEXFER, MSG_GET, &hDIB)) { @@ -417,7 +415,7 @@ void ImpTwain::ImplXfer() { if (LPVOID pBmpMem = GlobalLock(hGlob)) { - if ((nXRes != -1) && (nYRes != -1) && (nWidth != -1) && (nHeight != -1)) + if ((nXRes != -1) && (nYRes != -1)) { // set resolution of bitmap BITMAPINFOHEADER* pBIH = static_cast<BITMAPINFOHEADER*>(pBmpMem); |