diff dwtx/jface/action/ToolBarManager.d @ 71:4878bef4a38e

Some fixing
author Frank Benoit <benoit@tionex.de>
date Thu, 22 May 2008 04:03:58 +0200
parents 46a6e0e6ccd4
children 5df4896124c7
line wrap: on
line diff
--- a/dwtx/jface/action/ToolBarManager.d	Thu May 22 01:36:46 2008 +0200
+++ b/dwtx/jface/action/ToolBarManager.d	Thu May 22 04:03:58 2008 +0200
@@ -197,21 +197,21 @@
      *            the new number of items
      */
     protected void relayout(ToolBar layoutBar, int oldCount, int newCount) {
-        if ((oldCount !is newCount) && (newCount!is0)) {
+        if ((oldCount !is newCount) && (newCount!is 0)) {
             Point beforePack = layoutBar.getSize();
             layoutBar.pack(true);
             Point afterPack = layoutBar.getSize();
-            
+
             // If the TB didn't change size then we're done
             if (beforePack.equals(afterPack))
                 return;
-            
+
             // OK, we need to re-layout the TB
             layoutBar.getParent().layout();
-            
+
             // Now, if we're in a CoolBar then change the CoolItem size as well
-            if (layoutBar.getParent() instanceof CoolBar) {
-                CoolBar cb = (CoolBar) layoutBar.getParent();
+            if (null !is cast(CoolBar)layoutBar.getParent() ) {
+                CoolBar cb = cast(CoolBar) layoutBar.getParent();
                 CoolItem[] items = cb.getItems();
                 for (int i = 0; i < items.length; i++) {
                     if (items[i].getControl() is layoutBar) {
@@ -387,11 +387,11 @@
                 }
 
                 int newCount = toolBar.getItemCount();
-                
+
                 // If we're forcing a change then ensure that we re-layout everything
                 if (force)
                     oldCount = newCount+1;
-                
+
                 relayout(toolBar, oldCount, newCount);
             }