vcl/osx/salframeview.mm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
New commits: commit c333985c2948e77ef993f69f40a31dba203ee529 Author: Patrick Luby <[email protected]> AuthorDate: Fri Feb 23 17:45:19 2024 -0500 Commit: Ilmari Lauhakangas <[email protected]> CommitDate: Mon Sep 30 18:07:36 2024 +0200 tdf#158124 KEY_DELETE events do not need an ExtTextInput event When using various Japanese input methods, the last event will be a repeating key down event with a single delete character while the Backspace key, Delete key, or Fn-Delete keys are pressed. These key events are now ignored since setting mbTextInputWantsNonRepeatKeyDown to YES for these events will trigger an assert or crash when saving a .docx document. Change-Id: If3762fcf41aa82bf4aa5dc7d1f15c1d282c86f99 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163875 Tested-by: Jenkins Reviewed-by: Patrick Luby <[email protected]> (cherry picked from commit ef57aeb9ed190e18ebc034b9a45e190aea3f8f1d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174024 Reviewed-by: Ilmari Lauhakangas <[email protected]> diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm index 995eeb574999..dba377899838 100644 --- a/vcl/osx/salframeview.mm +++ b/vcl/osx/salframeview.mm @@ -2062,7 +2062,15 @@ static void updateWinDataInLiveResize(bool bInLiveResize) // and then dispatch a SalEvent::EndExtTextInput event. NSString *pNewMarkedText = nullptr; NSString *pChars = [mpLastEvent characters]; - bool bNeedsExtTextInput = ( pChars && mbInKeyInput && !mpLastMarkedText && mpLastEvent && [mpLastEvent type] == NSEventTypeKeyDown && [mpLastEvent isARepeat] ); + + // tdf#158124 KEY_DELETE events do not need an ExtTextInput event + // When using various Japanese input methods, the last event will be a + // repeating key down event with a single delete character while the + // Backspace key, Delete key, or Fn-Delete keys are pressed. These key + // events are now ignored since setting mbTextInputWantsNonRepeatKeyDown + // to YES for these events will trigger an assert or crash when saving a + // .docx document. + bool bNeedsExtTextInput = ( pChars && mbInKeyInput && !mpLastMarkedText && mpLastEvent && [mpLastEvent type] == NSEventTypeKeyDown && [mpLastEvent isARepeat] && ImplMapKeyCode( [mpLastEvent keyCode] ) != KEY_DELETE ); if ( bNeedsExtTextInput ) { // tdf#154708 Preserve selection for repeating Shift-arrow on Japanese keyboard
