Reject text from clipboard when it contains a dot and the local decimal separator is not one

This commit is contained in:
Rudy Huyn 2019-03-06 23:27:43 -08:00
commit 8343a4632e

View file

@ -136,6 +136,13 @@ String^ CopyPasteManager::ValidatePasteExpression(String^ pastedText, ViewMode m
wstring pasteExpression = pastedText->Data();
// Reject strings with '.' when the local decimal separator is different
wchar_t decimalSeparator = LocalizationSettings::GetInstance().GetDecimalSeparator();
if (decimalSeparator != '.' && pasteExpression.find('.') != std::string::npos)
{
return StringReference(PasteErrorString);
}
// Get english translated expression
String^ englishString = LocalizationSettings::GetInstance().GetEnglishValueFromLocalizedDigits(pasteExpression);