Ticket #1988 (closed bug: worksforme)

Opened 10 years ago

Last modified 10 years ago

Text: Shift + Enter throws exception

Reported by: deyan Owned by:
Priority: major Milestone: M12_RELEASE
Component: uncategorized Version: 2.0
Keywords: Cc:
Category: unknown Effort:
Importance: Ticket_group:
Estimated Number of Hours: 0 Add Hours to Ticket: 0
Billable?: yes Total Hours: 0
Analysis_owners: deyan, deyan Design_owners: nenko
Imp._owners: nenko Test_owners: vanya
Analysis_reviewers: nenko Changelog:
Design_reviewers: meddle, pap Imp._reviewers: meddle, pap
Test_reviewers: Analysis_score: 4
Design_score: 4 Imp._score: 4
Test_score: 3

Description (last modified by deyan) (diff)

Hitting Shift + Enter when a text frame is selected on the PWA throws an exception instead of going on a new row without creating a new paragraph. See attached report.

Attachments

1988.txt (6.6 KB) - added by deyan 10 years ago.

Change History

Changed 10 years ago by deyan

comment:1 Changed 10 years ago by deyan

  • Status changed from new to s1b_analysis_finished
  • Description modified (diff)
  • Summary changed from Text: Ctrl + Enter breaks the application to Text: Shift + Enter breaks the application

comment:2 Changed 10 years ago by nenko

  • Status changed from s1b_analysis_finished to new

"Hitting Shift + Enter throws an exception. See attached report." - The best description I've ever read...

When I start Sophie2 I press Shift+Enter and nothing happens...
Then I select a pallete and press Shift+Enter and nothing happens...again
So what should I do to reproduce this bug? I can press Shift+Enter in so many various ways that this description has no value...
Even more if Shift+Enter in some scenario breaks the application what should ne correct behavious when these buttons are pressed?

The only way I reproduced a Shif+Enter bug was to:

  1. Start Sophie2
  2. Create a book
  3. Insert a text frame
  4. Press Shift+Enter when the frame is selected and no text is written

But event these steps didn't break the application. An exception was thrown but the application was running and usable after it...

comment:3 Changed 10 years ago by deyan

  • Status changed from new to s1b_analysis_finished
  • Summary changed from Text: Shift + Enter breaks the application to Text: Shift + Enter throws exception
  • Analysis_reviewers set to nenko
  • Description modified (diff)

comment:4 Changed 10 years ago by deyan

  • Analysis_owners changed from deyan to deyan, deyan

comment:5 Changed 10 years ago by nenko

  • Design_owners set to nenko
  • Status changed from s1b_analysis_finished to s2a_design_started

comment:6 Changed 10 years ago by nenko

  • Status changed from s2a_design_started to s3b_implementation_finished
  • Imp._owners set to nenko

The bug is because when press two buttons the event is KeyPressed for the modiefier button (in our case Shift). For KeyPressed event the event parameter for pressed button is an object of type Key but in TextFlowLogic is assumed that always when typing the event parameter for the pressed button is of type Character. The second one is true when we are listening for InputEventR3.KEY_TYPED. However when typing text in a text frame the events we are listening and receive are custom events that wrap InputEventR3.KEY_TYPED/KEY_PRESSED/KEY_RELEASED (may be they shouldn't wrap the last ones?) and after research I think the we don't need this custom event... So I deleted it and changed TextFlowLogic.ON_INSERT#defineFilter:177 from

filter.setEventId(TextView.EventIds.INSERT_CHAR); 

to

filter.setEventId(InputEventR3.KEY_TYPED); 

Changeset:
[6545]

comment:7 Changed 10 years ago by meddle

  • Status changed from s3b_implementation_finished to s3c_implementation_ok
  • Analysis_score changed from 0 to 4
  • Imp._reviewers set to meddle, pap
  • Design_score changed from 0 to 4
  • Design_reviewers set to meddle, pap
  • Imp._score changed from 0 to 4

Works for us.

Merged in [6559].

4p

comment:8 Changed 10 years ago by vanya

  • Status changed from s3c_implementation_ok to closed
  • Test_owners set to vanya
  • Resolution set to worksforme
  • Test_score changed from 0 to 3
Note: See TracTickets for help on using tickets.