Ticket #1902 (closed bug: fixed)

Opened 12 years ago

Last modified 11 years ago

Crash: Often "Position not in text" exceptions when working with text.

Reported by: boyan Owned by:
Priority: critical Milestone: M11_BETA3
Component: TEXT_EDITING Version: 2.0
Keywords: text,crash,position,delete Cc:
Category: unknown Effort:
Importance: Ticket_group:
Estimated Number of Hours: 0 Add Hours to Ticket: 0
Billable?: yes Total Hours: 0
Analysis_owners: boyan Design_owners: boyan
Imp._owners: boyan Test_owners:
Analysis_reviewers: boyan Changelog:
Design_reviewers: meddle, todor Imp._reviewers: meddle, todor
Test_reviewers: Analysis_score: 3.5
Design_score: 3.5 Imp._score: 3.5
Test_score: 3

Description

  1. Create a new book.
  2. Insert a text frame.
  3. Type some text.
  4. Delete all the text.
  5. Type some new text.
  6. Position the caret before the last character and hit delete. -> crash

Can also be invoked in various situations, hard to reproduce every time, makes text unusable.

Attachments

crash with postion not in text.txt (9.1 KB) - added by boyan 12 years ago.

Change History

Changed 12 years ago by boyan

comment:1 Changed 12 years ago by boyan

  • Status changed from new to s1b_analysis_finished

finishing the bug report

comment:2 Changed 12 years ago by boyan

  • Status changed from s1b_analysis_finished to s2a_design_started

starting design

comment:3 Changed 12 years ago by boyan

  • Design_owners set to boyan
  • Status changed from s2a_design_started to s3b_implementation_finished
  • Imp._owners set to boyan

The bug is caused by having an invalid position in an edge of the layout. It happens in different situations and can be hardly tracked (and reproduced). This is not a fix but a workaround that reduces throwing exceptions to a minimum.

Here are few things that cause the bug:

  1. isPresent() method of NaiveNavigator needs an additional check - when there is no text at all, the pre and post positions of the docUnit are still present and the method should return true.
  2. A check for valid positions is needed in the draw method of the EdgeKind.
  3. Logger messages in HotTextLayout that print invalid edges cause an exception to be thrown. Text manipulation is possible even with such edges so these loggers will be commented out.
  4. Cutting text does not set the caret and mark position which leads to errors when trying to type.

These have been fixed in the following changeset: [5199]. There are still rare occasions when the exception is thrown but text now is much more usable.

comment:4 Changed 12 years ago by meddle

  • Status changed from s3b_implementation_finished to s3c_implementation_ok
  • Analysis_reviewers set to boyan
  • Analysis_score changed from 0 to 3.5
  • Imp._reviewers set to meddle, todor
  • Design_score changed from 0 to 3.5
  • Design_reviewers set to meddle, todor
  • Imp._score changed from 0 to 3.5

Merged in [5217]. The error is not permanently fixed but in most cases the condition is better.

comment:5 Changed 11 years ago by deyan

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