Project

General

Profile

Bug #4624

Fill-in: StringIndexOutOfBoundsException and other bugs

Added by Vladimir Tsichevski about 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
-
Start date:
Due date:
% Done:

100%

billable:
No
vendor_id:
GCD
case_num:
version_reported:
version_resolved:
reviewer:
production:
No
env_name:
topics:

fill-in-scrolling-left-fwd.mp4 (32.4 KB) Vladimir Tsichevski, 04/22/2020 02:30 PM

fill-in-scrolling-left-openedge.mp4 (34.5 KB) Vladimir Tsichevski, 04/22/2020 02:30 PM

History

#1 Updated by Vladimir Tsichevski about 6 years ago

Problem 1. Wrong END key action result

The code:

ASSIGN
   CURRENT-WINDOW:Width = 20
   CURRENT-WINDOW:HEIGHT = 2
   .

DEFINE FRAME theFrame
   WITH SIZE 20 BY 2.

define variable fillin as handle no-undo.
create fill-in fillin
      assign 
      frame             = frame theFrame:HANDLE
      y                 = 0
      x                 = 0
      width             = 19
      height            = 1
      format            = "X(20000)" 
      sensitive         = yes 
      screen-value      = "one two three four five" 
      .

VIEW FRAME theFrame.
WAIT-FOR GO OF FRAME theFrame.

Run the code. Press the END button.

In 4gl the cursor moves into the position after the last character. To make sure, press the DELETE button, it will do nothing.

In FWD the cursor moves into the position before the last character. Pressing the DELETE button deletes this character.

Problem 2. Wrong insertion point

Run the code above. Press the END button.
With the LEFT ARROW key move the cursor to the left text boundary, then press the LEFT ARROW one time more to cause text scrolling.
Note the caret position after the scrolling.
Insert a character. Note the character is inserted not where the caret is.
See the fill-in-scrolling-left-fwd.mp4 video demonstrating the incorrect behavior, and the correct behavior in 4gl in fill-in-scrolling-left-openedge.mp4

Problem 3. StringIndexOutOfBoundsException

Modify the original code, add two leading spaces at the beginning of fill-in format spec:

ASSIGN
   CURRENT-WINDOW:Width = 20
   CURRENT-WINDOW:HEIGHT = 2
   .

DEFINE FRAME theFrame
   WITH SIZE 20 BY 2.

define variable fillin as handle no-undo.
create fill-in fillin
      assign 
      frame             = frame theFrame:HANDLE
      y                 = 0
      x                 = 0
      width             = 19
      height            = 1
      format            = "  X(20000)" 
      sensitive         = yes 
      screen-value      = "one two three four five" 
      .

VIEW FRAME theFrame.
WAIT-FOR GO OF FRAME theFrame.

Run the code. Press the END button, so the text scroll right.
Press the DELETE button. The StringIndexOutOfBoundsException is thrown.

#3 Updated by Greg Shah about 6 years ago

  • Assignee set to Adrian Lungu
  • Start date deleted (04/22/2020)

#4 Updated by Adrian Lungu about 6 years ago

  • % Done changed from 0 to 60
  • Status changed from New to WIP
Solved the following issues:
  1. Prevented text sliding when deleting while the cursor is at the end
  2. Fixed bad caret drawing when sliding to the left (this was due to bad delta when assisted by left anchor)
  3. Fixed issue in which space character is drawn twice - only in Swing.
  4. I couldn't reproduce the first problem neither on Swing nor in Web.

Committed fix for those in 4231b/rev. 11556. Continuing with Problem 3.

#5 Updated by Adrian Lungu about 6 years ago

  • Status changed from WIP to Review
  • % Done changed from 60 to 100

Problem 3 was solved in 4231b/rev. 11558. The bug was triggered by incorrect resizing of the text when explicit formats were used.

#6 Updated by Greg Shah about 6 years ago

Constantin: Please review.

#7 Updated by Constantin Asofiei about 6 years ago

The changes make sense. Only issue is WinKeyboardReader.java which is missing history entry.

#8 Updated by Greg Shah about 6 years ago

Did you review rev 11556 as well?

#9 Updated by Constantin Asofiei about 6 years ago

Greg Shah wrote:

Did you review rev 11556 as well?

Yes.

#10 Updated by Greg Shah about 6 years ago

  • Status changed from Review to Test

#11 Updated by Adrian Lungu about 6 years ago

Added missing history entry in 4231b/rev.11559.

#12 Updated by Greg Shah about 6 years ago

  • Status changed from Test to Closed

Task branch 4231b has been merged to trunk as revision 11347.

Also available in: Atom PDF