Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 313697 - [Forms] Wrong code in org.eclipse.ui.forms.widgets.SizeCache
Summary: [Forms] Wrong code in org.eclipse.ui.forms.widgets.SizeCache
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: User Assistance (show other bugs)
Version: 3.5.2   Edit
Hardware: PC Windows All
: P3 normal (vote)
Target Milestone: 3.7 M1   Edit
Assignee: Chris Goldthorpe CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-20 07:12 EDT by Julian CLA
Modified: 2010-06-22 17:32 EDT (History)
2 users (show)

See Also:


Attachments
Patch (1.48 KB, patch)
2010-06-21 20:01 EDT, Chris Goldthorpe CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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