Last modified 15 years ago
Last modified on 10/09/09 20:41:05
Analysis
The purpose of this task is to fix known text bugs from the previous revisions of the text redesign task.
Overview
- The following bugs should be fixed:
- Open of a book containing a frame with styled text in TrueReader.
- Typing of text after opening of a book from the server.
- If style values are applied to the current text the font hud does not always show the correct font properties of the caret position.
- Navigation with End on the last line of text does not go to the last position of the text.
- Multiple UP/DOWN navigations go too much to the left.
Task requirements
- Fix the bugs specified in the Overview.
- UP/DOWN navigation bug is Optional.
Task result
- The result of this task is source code.
Implementation idea
- For the Reader and Server problems fix persistence.
- For the styling bug fix ImmHotText.getStyleValue method.
- For the End navigation bug correct getHitPos and getPosPlace functionalities in the layouts.
- For the UP/DOWN navigation bug consider and implement TextViewFlow.wantedX functionality.
Related
Design
- Bugs
- Open of a book containing a frame with styled text in TrueReader crashes.
- Problem: HotAttr class is not loaded by the class loader, because all creations of HotAttr objects are in CommonAttr.
- Solution: Move the attribute map to CommonAttr.
- Typing of text after opening of a book from the server does not work correctly. On each update of the server the caret position is set to the beginning of the text. The previous bug with the TrueReader is also present on the Server.
- Problem: The history and the last changed interval (on which the mark and caret positions depend) of ImmHotText are not persisted. When the text goes to the server the information needed for the mark and caret is lost.
- Solution:
- The whole history is not needed.
- Add persistence for ImmHotText's last changed interval.
- A new HotIntervalPersister should be created.
- Modify ImmHotTextPersister to save/load the last changed interval.
- If style values are applied to the current text the font hud does not always show the correct font properties of the caret position.
- Problem: The style values inside ImmHotText keep HotPosKind.AFTER and HotPosKind.BEFORE positions, whereas the input in ImmHotText.getStyleValue method is a HotPosKind.MIDDLE position. This leads to incorrect calculations inside getStyleValue.
- Solution:
- Use HotInterval as input to getStyleValue so that ImmHotText itself gives a complete information for a whole range of positions.
- Convert the positions of the input HotInterval to AFTER/BEFORE kinds, as in applyStyle.
- Navigation with End on the last line of text does not go to the last position of the text.
- Problem: HotAreaLayout.getLineEnds does not work correctly for the last line.
- Solution: Add a check in HotAreaLayout.getLineEnds to get the right position for line end when this is the last line in the area.
- Multiple UP/DOWN navigations go too much to the left.
- Problem: TextViewFlow.wantedX() is not considered.
- Solution:
- Set the wantedX property after all operations in TextFlowLogic except UP/DOWN.
- On UP/DOWN navigation read the wantedX property to get the X coordinate instead of calling the layout.
- http://www.sophie2.org/trac/ticket/2096 - Keyboard shortcuts for text styling don't work.
- Problem: Not implemented due to focus problem, which are now solved.
- Solution: Add interactions for Ctrl+B, Ctrl+I and Ctrl+U in TextView class.
- http://www.sophie2.org/trac/ticket/2092 - The first delete operation after typing text doesn't work.
- Problem: Incorrect comparison of HotPoses in HotInterval.isEmpty(). This leads to setting the same text when handling DELETE in TextFlowLogic.
- Solution: Fix HotInterval.isEmpty() to receive the HotPos Comparator of the text for which the positions should be compared.
- Open of a book containing a frame with styled text in TrueReader crashes.
- Testing - use TextNavigationTest, TextSelectionTest, HotLayoutTest and ImmHotTextTest
Implementation
- Implementation committed to a separate branch: branches/private/vlado/hottext-r3
- Changesets:
- Note: Text tests are fixed and extended where needed to check for the fixed bugs.
- Merged into trunk in [7460]
Testing
(Place the testing results here.)
Comments
(Write comments for this or later revisions here.)