mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 06:13:14 -07:00
Reject text from clipboard when it contains a dot and the local decimal separator is not one
This commit is contained in:
parent
1eb717f336
commit
8343a4632e
1 changed files with 7 additions and 0 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue