Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 370756
Collapse All | Expand All

(-)src/org/eclipse/rwt/internal/textsize/TextSizeRecalculation.java (-4 / +9 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2011 Frank Appel and others.
2
 * Copyright (c) 2011, 2012 Frank Appel and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 31-36 Link Here
31
  }
31
  }
32
32
33
  private void forceShellRecalculations( Shell shell ) {
33
  private void forceShellRecalculations( Shell shell ) {
34
    boolean isPacked = ControlUtil.getControlAdapter( shell ).isPacked();
34
    Rectangle boundsBuffer = shell.getBounds();
35
    Rectangle boundsBuffer = shell.getBounds();
35
    bufferScrolledCompositeOrigins( shell );
36
    bufferScrolledCompositeOrigins( shell );
36
    clearLayoutBuffers( shell );
37
    clearLayoutBuffers( shell );
Lines 39-45 Link Here
39
    rePack( shell );
40
    rePack( shell );
40
    enlargeScrolledCompositeContent( shell );
41
    enlargeScrolledCompositeContent( shell );
41
    clearLayoutBuffers( shell );
42
    clearLayoutBuffers( shell );
42
    restoreShellSize( shell, boundsBuffer );
43
    restoreShellSize( shell, boundsBuffer, isPacked );
43
    restoreScrolledCompositeOrigins( shell );
44
    restoreScrolledCompositeOrigins( shell );
44
  }
45
  }
45
46
Lines 67-74 Link Here
67
    WidgetTreeVisitor.accept( shell, new RestoreScrolledCompositeOriginsVisitor() );
68
    WidgetTreeVisitor.accept( shell, new RestoreScrolledCompositeOriginsVisitor() );
68
  }
69
  }
69
70
70
  private void restoreShellSize( Shell shell, Rectangle bufferedBounds ) {
71
  private void restoreShellSize( Shell shell, Rectangle bufferedBounds, boolean isPacked ) {
71
    setShellSize( shell, bufferedBounds );
72
    if( isPacked ) {
73
      shell.pack();
74
    } else {
75
      setShellSize( shell, bufferedBounds );
76
    }
72
  }
77
  }
73
78
74
  private void enlargeShell( Shell shell ) {
79
  private void enlargeShell( Shell shell ) {
(-)src/org/eclipse/rwt/internal/textsize/TextSizeRecalculation_Test.java (-1 / +12 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2011 Frank Appel and others.
2
 * Copyright (c) 2011, 2012 Frank Appel and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 74-79 Link Here
74
    assertFalse( ControlUtil.getControlAdapter( control ).isPacked() );
74
    assertFalse( ControlUtil.getControlAdapter( control ).isPacked() );
75
  }
75
  }
76
76
77
  public void testShellRePackTookPlace() {
78
    shell.pack();
79
    turnOnImmediateResizeEventHandling();
80
    fakeMeasurementResults();
81
    TextSizeRecalculation recalculation = new TextSizeRecalculation();
82
83
    recalculation.execute();
84
85
    assertTrue( ControlUtil.getControlAdapter( shell ).isPacked() );
86
  }
87
77
  public void testLayoutOfCompositeWithFixedSize() {
88
  public void testLayoutOfCompositeWithFixedSize() {
78
    turnOnImmediateResizeEventHandling();
89
    turnOnImmediateResizeEventHandling();
79
    createShellWithLayout();
90
    createShellWithLayout();

Return to bug 370756