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

Bug 313697

Summary: [Forms] Wrong code in org.eclipse.ui.forms.widgets.SizeCache
Product: [Eclipse Project] Platform Reporter: Julian <youhoo2000>
Component: User AssistanceAssignee: Chris Goldthorpe <cgold>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: cgold, youhoo2000
Version: 3.5.2   
Target Milestone: 3.7 M1   
Hardware: PC   
OS: Windows All   
Whiteboard:
Attachments:
Description Flags
Patch none

Description Julian CLA 2010-05-20 07:12:40 EDT
Build Identifier: 20100218-1602

package org.eclipse.ui.forms.widgets;

import java.util.List;  // should be org.eclipse.swt.widgets.List

............


    static boolean independentLengthAndWidth(Control control) {
        if (control == null || control.isDisposed()) {
            return true;
        }

        if (control instanceof Button || control instanceof ProgressBar
                || control instanceof Sash || control instanceof Scale
                || control instanceof Slider || control instanceof List  /*** here used List ***/
                || control instanceof Combo || control instanceof Tree) {
            return true;
        }

        if (control instanceof Label || control instanceof Text) {
            return (control.getStyle() & SWT.WRAP) == 0;
        }

        // Unless we're certain that the control has this property, we should
        // return false.

        return false;
    }


Reproducible: Always

Steps to Reproduce:
...
Comment 1 Chris Goldthorpe CLA 2010-05-20 16:39:48 EDT
I agree that the code is wrong - have you seen any visible problems as a result of this bug?
Comment 2 Julian CLA 2010-05-21 03:13:38 EDT
No, I just saw this bug and report it.
Comment 3 Chris Goldthorpe CLA 2010-06-21 20:01:26 EDT
Created attachment 172381 [details]
Patch
Comment 4 Chris Goldthorpe CLA 2010-06-21 20:03:46 EDT
Patch applied to HEAD, Fixed.
Comment 5 Chris Goldthorpe CLA 2010-06-21 20:04:15 EDT
Fixed in 3.7M1