Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 320647

Summary: [Table] Font of TableItem not preserved
Product: [RT] RAP Reporter: Benjamin Muskalla <b.muskalla>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: 1.4 M1   
Hardware: All   
OS: All   
Whiteboard:

Description Benjamin Muskalla CLA 2010-07-22 11:44:24 EDT
Specifying a font for a TableItem leads to continuous rendering of this font. In TableItemLCA#preserveValues, we preserve the Font object of this TableItem but in TableItemLCA#writeFont we compare it with the CSS syntax and not the real font object.
Comment 1 Benjamin Muskalla CLA 2010-07-22 11:44:54 EDT
Snippet to reproduce:

Display display = new Display();
    Shell shell = new Shell( display );
    shell.setLayout( new GridLayout( 1, false ) );
    
    Table table = new Table( shell, SWT.SINGLE | SWT.FULL_SELECTION );
    table.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, true ) );
    table.setLinesVisible( true );
    table.setHeaderVisible( true );
    
    for( int i = 0; i < 10; i++ ) {
      TableItem tableItem = new TableItem( table, SWT.NONE );
      tableItem.setText( 0, "foo" );
      tableItem.setFont( new Font( display, "Arial", 10, SWT.BOLD ) );
    }
    
    shell.pack();
    shell.open();
    while( !shell.isDisposed() ) {
      if( !display.readAndDispatch() )
        display.sleep();
    }
    display.dispose();
    return 0;
Comment 2 Ivan Furnadjiev CLA 2010-08-10 08:57:56 EDT
Fixed in CVS HEAD.