reset saved table viewer column size to default if it is incorrect
authorVictor Kirhenshtein <victor@netxms.org>
Tue, 23 Aug 2016 15:17:18 +0000 (18:17 +0300)
committerVictor Kirhenshtein <victor@netxms.org>
Tue, 23 Aug 2016 15:17:18 +0000 (18:17 +0300)
src/java/netxms-eclipse/Core/src/org/netxms/ui/eclipse/tools/WidgetHelper.java
webui/webapp/Core/src/org/netxms/ui/eclipse/tools/WidgetHelper.java

index 3d542f7..a7d7989 100644 (file)
@@ -409,7 +409,7 @@ public class WidgetHelper
                        try
                        {
                                int w = settings.getInt(prefix + "." + i + ".width"); //$NON-NLS-1$ //$NON-NLS-2$
-                               columns[i].setWidth(w);
+                               columns[i].setWidth((w > 0) ? w : 50);
                        }
                        catch(NumberFormatException e)
                        {
index 68a490f..1769c58 100644 (file)
@@ -146,7 +146,7 @@ public class WidgetHelper
                layout.marginWidth = 0;
                layout.marginHeight = 0;
                group.setLayout(layout);
-
+               
                if (layoutData != DEFAULT_LAYOUT_DATA)
                {
                        group.setLayoutData(layoutData);
@@ -173,7 +173,7 @@ public class WidgetHelper
                GridData gridData = new GridData();
                gridData.horizontalAlignment = GridData.FILL;
                gridData.grabExcessHorizontalSpace = true;
-               combo.setLayoutData(gridData);          
+               combo.setLayoutData(gridData);
                
                if (toolkit != null)
                        toolkit.adapt(combo);
@@ -351,7 +351,7 @@ public class WidgetHelper
                        try
                        {
                                int w = settings.getInt(prefix + "." + i + ".width"); //$NON-NLS-1$ //$NON-NLS-2$
-                               columns[i].setWidth(w);
+                               columns[i].setWidth((w > 0) ? w : 50);
                        }
                        catch(NumberFormatException e)
                        {