修复选择横向纸张时的界面显示问题
This commit is contained in:
parent
80ffb60c34
commit
4b01b1adc9
|
@ -214,6 +214,15 @@ namespace sane_opt_trans
|
|||
{
|
||||
VALUE_TO_TWAIN(g_paper_map, val);
|
||||
|
||||
std::string lat("\xe6\xa8\xaa\xe5\x90\x91"), // 横向
|
||||
v(to_default_language(val, nullptr));
|
||||
size_t pos = v.find(lat);
|
||||
if (pos != std::string::npos)
|
||||
{
|
||||
v.erase(pos, lat.length());
|
||||
VALUE_TO_TWAIN(g_paper_map, v.c_str());
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
const char* switch_paper_lateral(const char* val)
|
||||
|
|
|
@ -1950,6 +1950,7 @@ EX_OPTION_HANDLER_IMPL(paper)
|
|||
int now = sane_opt_trans::paper_to_twain(buf),
|
||||
init = sane_opt_trans::paper_to_twain(def),
|
||||
val = 0;
|
||||
std::vector<int> exists;
|
||||
|
||||
local_utility::free_memory(def);
|
||||
do
|
||||
|
@ -1960,8 +1961,10 @@ EX_OPTION_HANDLER_IMPL(paper)
|
|||
{
|
||||
value_role role = VAL_ROLE_NONE;
|
||||
val = sane_opt_trans::paper_to_twain(desc->constraint.string_list[i]);
|
||||
if (val == -1)
|
||||
if (val == -1 || std::find(exists.begin(), exists.end(), val) != exists.end())
|
||||
continue;
|
||||
|
||||
exists.push_back(val);
|
||||
if (val == now)
|
||||
role = VAL_ROLE_CURRENT;
|
||||
if (val == init)
|
||||
|
|
Loading…
Reference in New Issue