Keep spaces when users copy an error message (#430)
Verify if the StandardCalculatorViewModel::DisplayValue isn't an error message before removing group separators (including space character). How changes were validated: Tested in english and french Tested with "Cannot divide by zero" and "Result is undefined" Fixes #420
This commit is contained in:
		
				
					committed by
					
						
						Howard Wolosky
					
				
			
			
				
	
			
			
			
						parent
						
							dcc731f111
						
					
				
				
					commit
					d8cb5c82a8
				
			@@ -1223,13 +1223,18 @@ void StandardCalculatorViewModel::SetCalculatorType(ViewMode targetState)
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Platform::String ^ StandardCalculatorViewModel::GetRawDisplayValue()
 | 
					String^ StandardCalculatorViewModel::GetRawDisplayValue()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    wstring rawValue;
 | 
					    if (IsInError)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
    LocalizationSettings::GetInstance().RemoveGroupSeparators(DisplayValue->Data(), DisplayValue->Length(), &rawValue);
 | 
					        return DisplayValue;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    return ref new Platform::String(rawValue.c_str());
 | 
					    else
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        wstring rawValue;
 | 
				
			||||||
 | 
					        LocalizationSettings::GetInstance().RemoveGroupSeparators(DisplayValue->Data(), DisplayValue->Length(), &rawValue);
 | 
				
			||||||
 | 
					        return ref new String(rawValue.c_str());
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Given a format string, returns a string with the input display value inserted.
 | 
					// Given a format string, returns a string with the input display value inserted.
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user