This commit is contained in:
13038267101 2023-01-30 09:35:45 +08:00
commit ab6cc31d55
2 changed files with 12 additions and 6 deletions

View File

@ -2441,6 +2441,8 @@ void hg_scanner::init_settings(const char* json_setting_text)
}
}
VLOG_MINI_1(LOG_LEVEL_ALL, "Initialize %d settings ... OK\n", jsn_children_.size() - 1);
if (lang_get_cur_code_page() != DEFAULT_CODE_PAGE)
on_language_changed();
notify_setting_result_ = true;
}
int hg_scanner::init_settings(int pid)
@ -3084,7 +3086,9 @@ void hg_scanner::on_language_changed(void)
if (now < val.length())
now = val.length();
}
now += 8;
now += 15;
now /= 8;
now *= 8;
if (now > old)
{
setting_jsn_.at(v.c_str()).at("size") = now;

View File

@ -2,6 +2,8 @@
#include <sane/sane_option_definitions.h>
#include "../sdk/hginclude/huagaoxxx_warraper_ex.h"
#include "../../sdk/include/lang/app_language.h"
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
static struct _paper_size
@ -44,9 +46,9 @@ static void match_paper(char* buf, int cx, int cy)
}
if (index == -1)
strcpy(buf, OPTION_VALUE_ZZCC_PPYSCC);
strcpy(buf, from_default_language(OPTION_VALUE_ZZCC_PPYSCC, NULL));
else
strcpy(buf, g_paper[index].title);
strcpy(buf, from_default_language(g_paper[index].title, NULL));
VLOG_MINI_3(LOG_LEVEL_DEBUG_INFO, "match paper(%u * %u) to '%s'\n", cx, cy, (char*)buf);
}
@ -108,7 +110,7 @@ void sane_std_opts::to_known_opt_value(OPTMAP* opmap, const void* data, void* kn
{
if (strcmp(opmap->known.desc->name, SANE_STD_OPT_NAME_DUPLEX) == 0)
{
*((SANE_Bool*)known_data) = strcmp((char*)data, OPTION_VALUE_SMYM_DM) == 0 ? SANE_FALSE : SANE_TRUE;
*((SANE_Bool*)known_data) = strcmp((char*)data, from_default_language(OPTION_VALUE_SMYM_DM, NULL)) == 0 ? SANE_FALSE : SANE_TRUE;
}
else if (strcmp(opmap->user.desc->name, SANE_STD_OPT_NAME_PAGE) == 0)
{
@ -146,9 +148,9 @@ void* sane_std_opts::from_known_opt_value(OPTMAP* opmap, const void* known_data,
if (len)
*len = size;
if (*((const SANE_Bool*)known_data) == SANE_TRUE)
strcpy((char*)buf, OPTION_VALUE_SMYM_SM);
strcpy((char*)buf, from_default_language(OPTION_VALUE_SMYM_SM, NULL));
else
strcpy((char*)buf, OPTION_VALUE_SMYM_DM);
strcpy((char*)buf, from_default_language(OPTION_VALUE_SMYM_DM, NULL));
}
else if (strcmp(opmap->user.desc->name, SANE_STD_OPT_NAME_PAPER) == 0)
{