From 8da59821bdb522aace7546bdb36ae9f71cee117c Mon Sep 17 00:00:00 2001 From: gb <741021719@qq.com> Date: Wed, 15 Jun 2022 17:22:10 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=89=A9=E5=B1=95=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E9=87=8D=E7=94=A8=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sane/scanner.cpp | 1 - twain/twain/huagaods.cpp | 12 +++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/sane/scanner.cpp b/sane/scanner.cpp index 1becdc6..6d29bf9 100644 --- a/sane/scanner.cpp +++ b/sane/scanner.cpp @@ -18,7 +18,6 @@ static IMPLEMENT_OPTION_STRING_COMPARE(compare_sane_opt); } - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // class scanner scanner::scanner(SCANNERID id) : handle_(NULL), id_(id), ex_id_(EXTENSION_ID_BASE), prev_start_result_(SCANNER_ERR_NOT_START) diff --git a/twain/twain/huagaods.cpp b/twain/twain/huagaods.cpp index 1b50f62..16c5c7f 100644 --- a/twain/twain/huagaods.cpp +++ b/twain/twain/huagaods.cpp @@ -2140,14 +2140,12 @@ void huagao_ds::init_support_caps(void) return success(); // CapSupGetAll(msg, data, str, str); }; -#define SET_EXISTING_EXTENSION(scan_ind, cap) \ - op_ind = scanner_->sane_opt_id_##scan_ind();\ - if(op_ind != -1) \ - { \ - m_query[(CapType)cap] = msgSupportGetAllSetReset; \ - m_caps[(CapType)cap] = m_caps[CapType((int)CAP_EX_SANE_##scan_ind)]; \ +#define SET_EXISTING_EXTENSION(name, cap) \ + if(m_query.count((CapType)CAP_EX_SANE_##name)) \ + { \ + m_query[(CapType)cap] = m_query[(CapType)CAP_EX_SANE_##name]; \ + m_caps[(CapType)cap] = m_caps[CapType((int)CAP_EX_SANE_##name)]; \ } - int op_ind = -1; SET_EXISTING_EXTENSION(is_swap, CapTypeEx::CAP_TYPE_EX_FLIP); SET_EXISTING_EXTENSION(is_rotate_bkg180, CapTypeEx::CAP_TYPE_EX_ROTATE_BKG_180);