calculator icon indicating copy to clipboard operation
calculator copied to clipboard

Function won't Show after Pressing Enter if IME is Open in Graphing Mode

Open xuhongxu96 opened this issue 4 years ago • 3 comments

Describe the bug

Function won't show after pressing Enter if IME is open in Graphing Mode. Also, some strange expressions may be filled in next editbox.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Go to Graphing Mode
  2. Enable the IME (I'm using Chinese IME)
  3. Input an expression and press Enter
  4. Nothing will show on graph
  5. Input more expressions, and sometimes strange expressions are auto filled in next editbox after pressing Enter
  6. Still not works if go back to previous editbox and hit Enter again even with IME disabled.

Expected behavior

  • Function should be shown after pressing Enter with IME open.
  • No strange expressions should appear.

Screenshots

I never input the 4th function x+3 and 5th function x but they're filled in next editbox automatically.

1

Device and Application Information

  • OS Build: 10.0.19042.0
  • Architecture: x64
  • Application Version: 10.2009.4.0
  • Region: zh-CN
  • Dev Version Installed: True

Requested Assignment

I'm just reporting this problem. I don't want to fix it for now.

xuhongxu96 avatar Nov 13 '20 03:11 xuhongxu96

This is your friendly Microsoft Issue Bot. I've seen this issue come in and have gone to tell a human about it.

MicrosoftIssueBot avatar Nov 13 '20 04:11 MicrosoftIssueBot

It looks like ITextDocument4::GetMath() method fetched a null result when user types letters with IME.

String ^ MathRichEditBox::GetMathTextProperty()
{
	// TODO when Windows 10 version 2004 SDK is adopted, replace with:
	// String ^ text;
	// this->TextDocument->GetMath(&text);
	// return text;

	ComPtr<Windows_2004_Prerelease::ITextDocument4> textDocument4;
	reinterpret_cast<IInspectable*>(this->TextDocument)->QueryInterface(IID_PPV_ARGS(&textDocument4));
	HSTRING math;
	auto hr = textDocument4->GetMath(&math);  <------------- Line 89 in file MathRichEditBox.cpp
	if (FAILED(hr))
	{
		throw Exception::CreateException(hr);
	}
	return reinterpret_cast<String ^>(math);
}

An interesting thing is if you try to type numbers before letters while enabling IME, the RichEditBox control can handle it properly. calculator_issue1433_comment1

tian-lt avatar Dec 08 '20 08:12 tian-lt