@@ -533,25 +533,21 @@ void setSizeInPixels (int width, int height) {
533533 height = Math .max (0 , height );
534534 long hwnd = parent .handle ;
535535 int cx , cyChild , cxIdeal ;
536-
537- REBARBANDINFO rbBand = new REBARBANDINFO ();
538- rbBand .cbSize = REBARBANDINFO .sizeof ;
539-
540- /* Get the child size fields first so we don't overwrite them. */
541- rbBand .fMask = OS .RBBIM_CHILDSIZE | OS .RBBIM_IDEALSIZE ;
542- OS .SendMessage (hwnd , OS .RB_GETBANDINFO , index , rbBand );
543-
544536 if ((parent .style & SWT .VERTICAL ) != 0 ) {
545537 cx = height ;
546538 cyChild = width ;
547- rbBand .cyMaxChild = Math .max (rbBand .cyMaxChild , width );
548539 cxIdeal = Math .max (0 , height - parent .getMargin (index ));
549540 } else {
550541 cx = width ;
551542 cyChild = height ;
552- rbBand .cyMaxChild = Math .max (rbBand .cyMaxChild , height );
553543 cxIdeal = Math .max (0 , width - parent .getMargin (index ));
554544 }
545+ REBARBANDINFO rbBand = new REBARBANDINFO ();
546+ rbBand .cbSize = REBARBANDINFO .sizeof ;
547+
548+ /* Get the child size fields first so we don't overwrite them. */
549+ rbBand .fMask = OS .RBBIM_CHILDSIZE | OS .RBBIM_IDEALSIZE ;
550+ OS .SendMessage (hwnd , OS .RB_GETBANDINFO , index , rbBand );
555551
556552 /* Set the size fields we are currently modifying. */
557553 if (!ideal ) rbBand .cxIdeal = cxIdeal ;
0 commit comments