Buggy code:
} selectionForeground = - 1 ; ignoreDrawForeground = ignoreDrawSelection = ignoreFullSelection = ignoreDrawBackground = false ; if ( hooks ( EraseItem ) ) { RECT rect = new RECT ( ) ; OS . SetRect ( rect , nmcd . left , nmcd . top , nmcd . right , nmcd . bottom ) ; if ( ( OS . IsWindowEnabled ( handle ) ) || ( ( findImageControl ( ) ) != null ) ) { drawBackground ( hDC , rect ) ; } else { fillBackground ( hDC , OS . GetBkColor ( hDC ) , rect ) ; } RECT cellRect = item . getBounds ( index , true , true , true , true , true , hDC ) ; if ( clrSortBk != ( - 1 ) ) { RECT fullRect = item . getBounds ( index , true , true , true , true , true , hDC ) ; drawBackground ( hDC , fullRect , clrSortBk ) ; } int nSavedDC = OS . SaveDC ( hDC ) ; GCData data = new GCData ( ) ; data . device = display ; data . foreground = OS . GetTextColor ( hDC ) ; data . background = OS . GetBkColor ( hDC ) ; if ( ! selected ) { if ( clrText != ( - 1 ) ) data . foreground = clrText ; if ( clrTextBk != ( - 1 ) ) data . background = clrTextBk ; } data . hPen = OS . CreatePen ( PS_SOLID , 0 , data . foreground ) ; data . hBrush = OS . CreateSolidBrush ( data . background ) ; if ( hFont != ( - 1 ) ) data . hFont = hFont ; OS . SelectObject ( hDC , data . hPen ) ; OS . SelectObject ( hDC , data . hBrush ) ; GC gc = GC . win32_new ( hDC , data ) ; Event event = new Event ( ) ; event . index = index ; event . item = item ; event . gc = gc ; event . detail |= SWT . FOREGROUND ; if ( clrTextBk != ( - 1 ) ) event . detail |= SWT . BACKGROUND ; if ( selected ) event . detail |= SWT . SELECTED ; if ( ( ( nmcd . uItemState ) & ( OS . CDIS_FOCUS ) ) != 0 ) { if ( ( ( style ) & ( SWT . FULL_SELECTION ) ) != 0 ) { if ( ( handle ) == ( OS . GetFocus ( ) ) ) { int uiState = OS . SendMessage ( handle , WM_QUERYUISTATE , 0 , 0 ) ; if ( ( uiState & ( OS . UISF_HIDEFOCUS ) ) == 0 ) event . detail |= SWT . FOCUSED ; } } } event . x = cellRect . left ; event . y = cellRect . top ; event . width = ( cellRect . right ) - ( cellRect . left ) ; event . height = ( cellRect . bottom ) - ( cellRect . top ) ; gc . setClipping ( event . x , event . y , event . width , event . height ) ; sendEvent ( EraseItem , event ) ; event . gc = null ; int newTextClr = OS . GetTextColor ( hDC ) ; gc . dispose ( ) ; OS . RestoreDC ( hDC , nSavedDC ) ; if ( ( isDisposed ( ) ) || ( item . isDisposed ( ) ) ) return null ; if ( event . doit ) { ignoreDrawForeground = ( ( event . detail ) & ( SWT . FOREGROUND ) ) == 0 ; ignoreDrawSelection = ( ( event . detail ) & ( SWT . SELECTED ) ) == 0 ; ignoreDrawBackground = ( ( event . detail ) & ( SWT . BACKGROUND ) ) == 0 ; } else { ignoreDrawForeground = ignoreDrawSelection = ignoreDrawBackground = true ; } <START_BUG> if ( ( ! ( ignoreDrawBackground ) ) && ( clrTextBk != ( - 1 ) ) ) { <END_BUG> if ( count == 0 ) { if ( ( ( style ) & ( SWT . FULL_SELECTION ) ) != 0 ) { fillBackground ( hDC , clrTextBk , rect ) ; } else { RECT textRect = item . getBounds ( index , true , false , true , false , true , hDC ) ; fillBackground ( hDC , clrTextBk , textRect ) ; } } else { fillBackground ( hDC , clrTextBk , cellRect ) ; } } if ( ignoreDrawSelection ) ignoreFullSelection = true ; if ( ! ( ignoreDrawSelection ) ) { if ( ! selected ) { selectionForeground = clrText = OS . GetSysColor ( COLOR_HIGHLIGHTTEXT ) ; } if ( ( ( style ) & ( SWT . FULL_SELECTION ) ) != 0 ) { if ( ( ( ( style ) & ( SWT . FULL_SELECTION ) ) != 0 ) && ( count == 0 ) ) { fillBackground ( hDC , OS . GetBkColor ( hDC ) , rect ) ; } else { fillBackground ( hDC , OS . GetBkColor ( hDC ) , cellRect ) ; } } else { RECT textRect = item . getBounds ( index , true , false , false , false , true , hDC ) ; fillBackground ( hDC , OS . GetBkColor ( hDC ) , textRect ) ; } } else { if ( selected ) { selectionForeground = clrText = newTextClr ; ignoreDrawSelection = true ; } } RECT itemRect = item . getBounds ( index , true , true , false , false , false , hDC ) ; OS . SaveDC ( hDC ) ; OS . SelectClipRgn ( hDC , 0 ) ;

Fix:
if ( ( ( ! ( ignoreDrawBackground ) ) && ( ! ( ignoreDrawSelection ) ) ) && ( clrTextBk != ( - 1 ) ) ) {