Revert "[ui_data] reactivate bytes column in browsevar" 63/20663/1
Antoine ELIAS [Mon, 17 Dec 2018 15:25:03 +0000 (16:25 +0100)]
This reverts commit 68d44f64d5995bfe54000f2138c4628198728108.

Change-Id: I8891230f479c642a52e8f2c071d9d30f5c41cde1

scilab/CHANGES.md
scilab/modules/ui_data/src/cpp/BrowseVarManager.cpp
scilab/modules/ui_data/src/java/org/scilab/modules/ui_data/variablebrowser/SwingScilabVariableBrowser.java

index 1993b1f..0f99485 100644 (file)
@@ -453,9 +453,7 @@ Known issues
 * [#12198](http://bugzilla.scilab.org/show_bug.cgi?id=12198): Scilab control and block keywords `break case ... try while` and `clear()` could be overloaded as regular assignable variables.
 * [#12275](http://bugzilla.scilab.org/show_bug.cgi?id=12275): `msprintf("%s",ascii(97*ones(1,4097)))` produced "An error occurred: Buffer too small."
 * [#12402](http://bugzilla.scilab.org/show_bug.cgi?id=12402): The menu `Applications => Scinotes` could launch the external editor instead of Scinotes.
-* [#12520](http://bugzilla.scilab.org/show_bug.cgi?id=12520): Variable browser did not display the size of the variables.
 * [#12529](http://bugzilla.scilab.org/show_bug.cgi?id=12529): The `listvarinfile` help page needed to be updated.
-* [#12534](http://bugzilla.scilab.org/show_bug.cgi?id=12534): Variable browser did not display the size of the variables.
 * [#12566](http://bugzilla.scilab.org/show_bug.cgi?id=12566): `disp()` of a T-list with a single field set to an encoded integer value generated an error.
 * [#12618](http://bugzilla.scilab.org/show_bug.cgi?id=12618): `mfile2sci()` failed converting `a=1i // ab` into `a=1*%i // ab`.
 * [#12659](http://bugzilla.scilab.org/show_bug.cgi?id=12659): Crash on big modulo.
index ab76fef..26b22d1 100644 (file)
@@ -147,6 +147,7 @@ void SetBrowseVarData()
         err = getVarType(NULL, (int*)pIT, &piAllVariableTypes[i]);
         if (!err.iErr)
         {
+            piAllVariableBytes[i] = 0;
             err = getVarDimension(NULL, (int*)pIT, &nbRows, &nbCols);
         }
 
@@ -217,10 +218,7 @@ void SetBrowseVarData()
         {
             piAllVariableFromUser[i] = FALSE;
         }
-        
-        int bytesWithoutOverHead;
-        pIT->getMemory(&bytesWithoutOverHead, &piAllVariableBytes[i]);
-        
+
         ++i;
     }
 
@@ -243,16 +241,14 @@ void SetBrowseVarData()
         }
         //type
         piAllVariableTypes[i] = sci_lib;
+
+        piAllVariableBytes[i] = 0;
         pstAllVariableSizes[i] = os_strdup(N_A);
         piAllVariableIntegerTypes[i] = -1;
         pstAllVariableListTypes[i] = os_strdup("");
         piAllVariableFromUser[i] = FALSE;
         piAllVariableNbRows[i] = 1;
         piAllVariableNbCols[i] = 1;
-        //get value and bytes
-        types::GenericType* pIT = sl->m_pLib;
-        int bytesWithoutOverHead;
-        pIT->getMemory(&bytesWithoutOverHead, &piAllVariableBytes[i]);
 
         ++i;
     }
index b5765bc..1ab5d65 100644 (file)
@@ -175,7 +175,15 @@ public final class SwingScilabVariableBrowser extends SwingScilabDockablePanel i
                         } catch (IllegalArgumentException exception) {
                             /* If the type is not known/managed, don't crash */
                         }
-                    } 
+                    } else {
+
+                        if (colIndex == BrowseVar.SIZE_COLUMN_INDEX) {
+                            /* Use the getModel() method because the
+                             * column 5 has been removed from display
+                             * but still exist in the model */
+                            tip = Messages.gettext("Bytes:") + " " + model.getValueAt(rowIndex, BrowseVar.BYTES_COLUMN_INDEX).toString();
+                        }
+                    }
                 }
                 return tip;
             }
@@ -204,7 +212,7 @@ public final class SwingScilabVariableBrowser extends SwingScilabDockablePanel i
         table.removeColumn(column);
 
         column = table.getColumnModel().getColumn(BrowseVar.BYTES_COLUMN_INDEX);
-        //table.removeColumn(column);
+        table.removeColumn(column);
 
         table.addMouseListener(new BrowseVarMouseListener());
         // Mouse selection mode