[hg] main-silver: #223236 - AssertionError: Invalid wrapLine[0]:...

  • From: Miloslav Metelka < >
  • To: ,
  • Subject: [hg] main-silver: #223236 - AssertionError: Invalid wrapLine[0]:...
  • Date: Tue, 04 Dec 2012 09:08:46 -0800

changeset 63a4bfb0e2eb in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/63a4bfb0e2eb
description:
        #223236 - AssertionError: Invalid wrapLine[0]: WL[0]: SV:NULL; x=0.0 
[0,0] EV:<3112,3134> WL[1]: SV:<3134,3171>; x=296.0 [1,1] EV:<3171,3181> 
WL[2]: SV:<3181,3209>; x=224.0 [2,4] <3209,3220> EV:NUL.

diffstat:

 
editor.lib2/src/org/netbeans/modules/editor/lib2/view/ParagraphViewChildren.java
 |  11 ++++++++-
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (34 lines):

diff --git 
a/editor.lib2/src/org/netbeans/modules/editor/lib2/view/ParagraphViewChildren.java
 
b/editor.lib2/src/org/netbeans/modules/editor/lib2/view/ParagraphViewChildren.java
--- 
a/editor.lib2/src/org/netbeans/modules/editor/lib2/view/ParagraphViewChildren.java
+++ 
b/editor.lib2/src/org/netbeans/modules/editor/lib2/view/ParagraphViewChildren.java
@@ -481,14 +481,15 @@
                     
logBuilder.append("START-part:").append(ViewUtils.toString(startPartAlloc)); 
// NOI18N
                 }
                 ret = wrapLine.startPart.view.modelToViewChecked(offset, 
startPartAlloc, bias);
-            } else if (wrapLine.endPart != null && offset >= 
wrapLine.endPart.view.getStartOffset()) {
+            } else if (wrapLine.endPart != null && (offset >= 
wrapLine.endPart.view.getStartOffset() ||
+                    !wrapLine.hasFullViews())) // Fallback for invalid offset
+            {
                 Shape endPartAlloc = endPartAlloc(wrapLineBounds, wrapLine, 
pView);
                 if (logBuilder != null) {
                     
logBuilder.append("END-part:").append(ViewUtils.toString(endPartAlloc)); // 
NOI18N
                 }
                 ret = wrapLine.endPart.view.modelToViewChecked(offset, 
endPartAlloc, bias);
             } else {
-                assert (wrapLine.hasFullViews()) : 
wrapInfo.dumpWrapLine(pView, wrapLineIndex);
                 for (int i = wrapLine.firstViewIndex; i < 
wrapLine.endViewIndex; i++) {
                     EditorView view = pView.getEditorView(i);
                     if (offset < view.getEndOffset()) {
@@ -498,6 +499,12 @@
                         break;
                     }
                 }
+                // Fallback for invalid offset - use last offset of last view
+                if (ret == null && wrapLine.hasFullViews()) {
+                    EditorView view = 
pView.getEditorView(wrapLine.endViewIndex - 1);
+                    Shape viewAlloc = wrapAlloc(wrapLineBounds, wrapLine, 
wrapLine.endViewIndex - 1, pView);
+                    ret = view.modelToViewChecked(view.getEndOffset() - 1, 
viewAlloc, bias);
+                }
             }
             if (logBuilder != null) {
                 logBuilder.append("\n    
RET=").append(ViewUtils.toString(ret)).append('\n'); // NOI18N

[hg] main-silver: #223236 - AssertionError: Invalid wrapLine[0]:...

Miloslav Metelka 12/04/2012

Project Features

About this Project

Editor was started in November 2009, is owned by Martin Ryzl, and has 147 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close