Bug 487467: [GTK3] org_eclipse_swt_widgets_Text.test_getTopIndex fails

This is an additional fix for a regression caused in the original patch
to this bug. The regression can be tested using Snippet243. Typing in
the text box will crash GTK.

We need to handle the case where getTopIndex() is called *without*
calling setTopIndex() first or scrolling in the UI. This can be covered
by checking to make sure indexMark is not 0. If indexMark is 0, don't
use it and use gtk_text_view_get_visible_rect() and
gtk_text_view_get_line_at_y() to fetch the topIndex instead.

Tested on GTK3.20, 3.18, 3.16, and 3.14. No additional AllNonBrowser
JUnit test failures on GTK3 or GTK2. Snippet243 no longer crashes.

Change-Id: I0477ef19d2303271b1ed62a8159727e6d492ca76
Signed-off-by: Eric Williams <ericwill@redhat.com>
1 file changed
tree: a84eaeac3d1d33e66840a718dcce5c5aaaf8af52
  1. bundles/
  2. examples/
  3. features/
  4. local-build/
  5. tests/
  6. .gitignore
  7. pom.xml
  8. README.md
README.md

Contributing to SWT

Thanks for your interest in this project.

Developer resources:

Information regarding source code management, builds, coding standards, and more.

Contributor License Agreement:

Before your contribution can be accepted by the project, you need to create and electronically sign the Eclipse Foundation Contributor License Agreement (CLA).

Contact:

Contact the project developers via the project's “dev” list.

Search for bugs:

This project uses Bugzilla to track ongoing development and issues.

Create a new bug:

Be sure to search for existing bugs before you create another one. Remember that contributions are always welcome!