Buggy code:
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 ; if ( selected && ( explorerTheme ) ) { data . foreground = OS . GetSysColor ( COLOR_WINDOWTEXT ) ; } else { 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 ) ; data . uiState = OS . SendMessage ( handle , WM_QUERYUISTATE , 0 , 0 ) ; 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 ( ( OS . SendMessage ( handle , TVM_GETNEXTITEM , TVGN_CARET , 0 ) ) == ( nmcd . dwItemSpec ) ) { 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 = data . foreground ; gc . dispose ( ) ; OS . RestoreDC ( hDC , nSavedDC ) ; if ( ( isDisposed ( ) ) || ( item . isDisposed ( ) ) ) return null ; if ( event . doit ) { ignoreDrawForeground = ( ( event . detail ) & ( SWT . FOREGROUND ) ) == 0 ; ignoreDrawBackground = ( ( event . detail ) & ( SWT . BACKGROUND ) ) == 0 ; ignoreDrawSelection = ( ( event . detail ) & ( SWT . SELECTED ) ) == 0 ; ignoreDrawFocus = ( ( event . detail ) & ( SWT . FOCUSED ) ) == 0 ; } else { ignoreDrawForeground = ignoreDrawBackground = ignoreDrawSelection = ignoreDrawFocus = true ; } <START_BUG> if ( ( ! ( ignoreDrawBackground ) ) && ( clrTextBk != ( - 1 ) ) ) { <END_BUG> if ( ( ! ( explorerTheme ) ) || ( ! selected ) ) { 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 ( ! ( explorerTheme ) ) { 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 ; } if ( explorerTheme ) { nmcd . uItemState |= OS . CDIS_DISABLED ; int newColor = ( clrText == ( - 1 ) ) ? getForegroundPixel ( ) : clrText ;

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