Merge branch 'hotfix-1.4.1' into develop
This commit is contained in:
@@ -2050,24 +2050,29 @@ namespace nana{ namespace widgets
|
||||
|
||||
void text_editor::paste()
|
||||
{
|
||||
std::wstring text;
|
||||
nana::system::dataexch().get(text);
|
||||
auto text = system::dataexch{}.wget();
|
||||
|
||||
//If it is required check the acceptable
|
||||
if (accepts::no_restrict != impl_->capacities.acceptive)
|
||||
if ((accepts::no_restrict != impl_->capacities.acceptive) || impl_->capacities.pred_acceptive)
|
||||
{
|
||||
for (auto i = text.begin(); i != text.end(); ++i)
|
||||
{
|
||||
if (!_m_accepts(*i))
|
||||
if (_m_accepts(*i))
|
||||
{
|
||||
if (accepts::no_restrict == impl_->capacities.acceptive)
|
||||
put(*i);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (accepts::no_restrict != impl_->capacities.acceptive)
|
||||
{
|
||||
text.erase(i, text.end());
|
||||
break;
|
||||
put(std::move(text));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!text.empty())
|
||||
put(std::move(text));
|
||||
}
|
||||
|
||||
void text_editor::enter(bool record_undo)
|
||||
@@ -2794,8 +2799,12 @@ namespace nana{ namespace widgets
|
||||
|
||||
bool text_editor::_m_accepts(char_type ch) const
|
||||
{
|
||||
if(accepts::no_restrict == impl_->capacities.acceptive)
|
||||
if (accepts::no_restrict == impl_->capacities.acceptive)
|
||||
{
|
||||
if (impl_->capacities.pred_acceptive)
|
||||
return impl_->capacities.pred_acceptive(ch);
|
||||
return true;
|
||||
}
|
||||
|
||||
//Checks the input whether it meets the requirement for a numeric.
|
||||
auto str = text();
|
||||
|
||||
Reference in New Issue
Block a user