@@ -46,7 +46,7 @@ public class Table extends Composite {
46
46
TableColumn [] columns ;
47
47
ImageList imageList ;
48
48
int lastIndexOf , lastWidth ;
49
- boolean customDraw , dragStarted , fixScrollWidth , mouseDown ;
49
+ boolean customDraw , dragStarted , fixScrollWidth , mouseDown , tipRequested ;
50
50
boolean ignoreActivate , ignoreSelect , ignoreShrink , ignoreRedraw , ignoreResize ;
51
51
static final int INSET = 4 ;
52
52
static final int GRID_WIDTH = 1 ;
@@ -629,7 +629,7 @@ void createItem (TableColumn column, int index) {
629
629
item .strings = new String [columnCount ];
630
630
item .strings [1 ] = item .text ;
631
631
}
632
- item .text = "" ;
632
+ item .text = "" ; //$NON-NLS-1$
633
633
if (images == null ) {
634
634
item .images = new Image [columnCount ];
635
635
item .images [1 ] = item .image ;
@@ -956,14 +956,14 @@ void destroyItem (TableColumn column) {
956
956
if (item .strings != null ) {
957
957
String [] strings = item .strings ;
958
958
if (index == 0 ) {
959
- item .text = strings [1 ] != null ? strings [1 ] : "" ;
959
+ item .text = strings [1 ] != null ? strings [1 ] : "" ; //$NON-NLS-1$
960
960
}
961
961
String [] temp = new String [columnCount ];
962
962
System .arraycopy (strings , 0 , temp , 0 , index );
963
963
System .arraycopy (strings , index + 1 , temp , index , columnCount - index );
964
964
item .strings = temp ;
965
965
} else {
966
- if (index == 0 ) item .text = "" ;
966
+ if (index == 0 ) item .text = "" ; //$NON-NLS-1$
967
967
}
968
968
if (item .images != null ) {
969
969
Image [] images = item .images ;
@@ -3218,7 +3218,18 @@ LRESULT WM_NOTIFY (int wParam, int lParam) {
3218
3218
}
3219
3219
}
3220
3220
}
3221
- return super .WM_NOTIFY (wParam , lParam );
3221
+ LRESULT result = super .WM_NOTIFY (wParam , lParam );
3222
+ if (result != null ) return result ;
3223
+ switch (hdr .code ) {
3224
+ case OS .TTN_GETDISPINFOA :
3225
+ case OS .TTN_GETDISPINFOW : {
3226
+ tipRequested = true ;
3227
+ int code = callWindowProc (handle , OS .WM_NOTIFY , wParam , lParam );
3228
+ tipRequested = false ;
3229
+ return new LRESULT (code );
3230
+ }
3231
+ }
3232
+ return result ;
3222
3233
}
3223
3234
3224
3235
LRESULT WM_RBUTTONDBLCLK (int wParam , int lParam ) {
@@ -3419,24 +3430,23 @@ LRESULT wmNotifyChild (int wParam, int lParam) {
3419
3430
* is not reset. This means that when the text for the
3420
3431
* item is set and then reset to an empty string, the
3421
3432
* selection draws using the bounds of the previous text.
3422
- * The fix is to assign a NULL pointer to pszText rather
3423
- * than a pointer to a zero length string.
3433
+ * The fix is to use a space rather than an empty string
3434
+ * when anything but a tool tip is requested (to avoid
3435
+ * a tool tip that is a single space).
3424
3436
*
3425
3437
* NOTE: This is only a problem for items in the first
3426
3438
* column. Assigning NULL to other columns stops Windows
3427
3439
* from drawing the selection when LVS_EX_FULLROWSELECT
3428
3440
* is set.
3429
3441
*/
3430
- if (string .length () == 0 && plvfi .iSubItem == 0 ) {
3431
- plvfi .pszText = 0 ;
3432
- plvfi .cchTextMax = 0 ;
3433
- } else {
3434
- TCHAR buffer = new TCHAR (getCodePage (), string , false );
3435
- int byteCount = Math .min (buffer .length (), plvfi .cchTextMax - 1 ) * TCHAR .sizeof ;
3436
- OS .MoveMemory (plvfi .pszText , buffer , byteCount );
3437
- OS .MoveMemory (plvfi .pszText + byteCount , new byte [TCHAR .sizeof ], TCHAR .sizeof );
3438
- plvfi .cchTextMax = Math .min (plvfi .cchTextMax , string .length () + 1 );
3442
+ if (!tipRequested && string .length () == 0 && plvfi .iSubItem == 0 ) {
3443
+ string = " " ; //$NON-NLS-1$
3439
3444
}
3445
+ TCHAR buffer = new TCHAR (getCodePage (), string , false );
3446
+ int byteCount = Math .min (buffer .length (), plvfi .cchTextMax - 1 ) * TCHAR .sizeof ;
3447
+ OS .MoveMemory (plvfi .pszText , buffer , byteCount );
3448
+ OS .MoveMemory (plvfi .pszText + byteCount , new byte [TCHAR .sizeof ], TCHAR .sizeof );
3449
+ plvfi .cchTextMax = Math .min (plvfi .cchTextMax , string .length () + 1 );
3440
3450
}
3441
3451
}
3442
3452
if ((plvfi .mask & OS .LVIF_IMAGE ) != 0 ) {
0 commit comments