Buggy code:
} else { width = lineHeight // 3 ; } if ( gdip ) { Gdip . Graphics_FillRectangle ( gdipGraphics , gdipSelBackground , ( drawX + ( lineWidth [ line ] ) ) , drawY , width , lineHeight ) ; } else { OS . SelectObject ( hdc , selBackground ) ; OS . PatBlt ( hdc , ( drawX + ( lineWidth [ line ] ) ) , drawY , width , lineHeight , PATCOPY ) ; } } } if ( drawX > ( ( clip . x ) + ( clip . width ) ) ) continue ; if ( ( drawX + ( lineWidth [ line ] ) ) < ( clip . x ) ) continue ; int alignmentX = drawX ; for ( int i = 0 ; i < ( lineRuns . length ) ; i ++ ) { TextLayout . StyleItem run = lineRuns [ i ] ; if ( ( run . length ) == 0 ) continue ; if ( drawX > ( ( clip . x ) + ( clip . width ) ) ) break ; if ( ( drawX + ( run . width ) ) >= ( clip . x ) ) { if ( ( ! ( run . lineBreak ) ) || ( run . softBreak ) ) { OS . SetRect ( rect , drawX , drawY , ( drawX + ( run . width ) ) , ( drawY + lineHeight ) ) ; if ( gdip ) { drawRunBackgroundGDIP ( run , gdipGraphics , rect , selectionStart , selectionEnd , alpha , gdipSelBackground , hasSelection ) ; } else { drawRunBackground ( run , hdc , rect , selectionStart , selectionEnd , selBackground , hasSelection ) ; } } } drawX += run . width ; } int baseline = Math . max ( 0 , this . ascent ) ; int lineUnderlinePos = 0 ; for ( int i = 0 ; i < ( lineRuns . length ) ; i ++ ) { baseline = Math . max ( baseline , lineRuns [ i ] . ascent ) ; lineUnderlinePos = Math . min ( lineUnderlinePos , lineRuns [ i ] . underlinePos ) ; } RECT borderClip = null ; RECT underlineClip = null ; RECT strikeoutClip = null ; RECT pRect = null ; drawX = alignmentX ; for ( int i = 0 ; i < ( lineRuns . length ) ; i ++ ) { TextLayout . StyleItem run = lineRuns [ i ] ; if ( ( run . length ) == 0 ) continue ; if ( drawX > ( ( clip . x ) + ( clip . width ) ) ) break ; if ( ( drawX + ( run . width ) ) >= ( clip . x ) ) { boolean drawTab = run . tab ; TextStyle style = run . style ; <START_BUG> if ( ( style != null ) && ( ( style . underline ) || ( ( style . borderStyle ) != ( SWT . NONE ) ) ) ) <END_BUG> drawTab = false ; if ( ( ( ! drawTab ) && ( ( ! ( run . lineBreak ) ) || ( run . softBreak ) ) ) && ( ! ( ( style != null ) && ( ( style . metrics ) != null ) ) ) ) { OS . SetRect ( rect , drawX , drawY , ( drawX + ( run . width ) ) , ( drawY + lineHeight ) ) ; if ( gdip ) { int hFont = getItemFont ( run ) ; if ( hFont != lastHFont ) { lastHFont = hFont ; if ( gdipFont != 0 ) Gdip . Font_delete ( gdipFont ) ; gdipFont = Gdip . Font_new ( hdc , hFont ) ; if ( gdipFont == 0 ) SWT . error ( ERROR_NO_HANDLES ) ; if ( ! ( Gdip . Font_IsAvailable ( gdipFont ) ) ) { Gdip . Font_delete ( gdipFont ) ; gdipFont = 0 ; } } if ( gdipFont != 0 ) { pRect = drawRunTextGDIP ( gdipGraphics , run , rect , gdipFont , baseline , gdipForeground , gdipSelForeground , selectionStart , selectionEnd , alpha ) ; } else { pRect = drawRunTextGDIPRaster ( gdipGraphics , run , rect , baseline , foreground , selForeground , selectionStart , selectionEnd ) ; } underlineClip = drawUnderlineGDIP ( gdipGraphics , x , ( drawY + baseline ) , lineUnderlinePos , ( drawY + lineHeight ) , lineRuns , i , gdipForeground , gdipSelForeground , underlineClip , pRect , selectionStart , selectionEnd , alpha ) ; strikeoutClip = drawStrikeoutGDIP ( gdipGraphics , x , ( drawY + baseline ) , lineRuns , i , gdipForeground , gdipSelForeground , strikeoutClip , pRect , selectionStart , selectionEnd , alpha ) ; borderClip = drawBorderGDIP ( gdipGraphics , x , drawY , lineHeight , lineRuns , i , gdipForeground , gdipSelForeground , borderClip , pRect , selectionStart , selectionEnd , alpha ) ; } else { pRect = drawRunText ( hdc , run , rect , baseline , foreground , selForeground , selectionStart , selectionEnd ) ; underlineClip = drawUnderline ( hdc , x , ( drawY + baseline ) , lineUnderlinePos , ( drawY + lineHeight ) , lineRuns , i , foreground , selForeground , underlineClip , pRect , selectionStart , selectionEnd ) ; strikeoutClip = drawStrikeout ( hdc , x , ( drawY + baseline ) , lineRuns , i , foreground , selForeground , strikeoutClip , pRect , selectionStart , selectionEnd ) ; borderClip = drawBorder ( hdc , x , drawY , lineHeight , lineRuns , i , foreground , selForeground , borderClip , pRect , selectionStart , selectionEnd ) ;

Fix:
if ( ( style != null ) && ( ( ( style . underline ) || ( style . strikeout ) ) || ( ( style . borderStyle ) != ( SWT . NONE ) ) ) )