Skip to content

Commit

Permalink
Fix CharlesSkelton#25: fix copy as Excel
Browse files Browse the repository at this point in the history
  • Loading branch information
dzmipt committed Mar 16, 2021
1 parent 65d1eb6 commit 0005b0d
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/studio/ui/QGrid.java
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,13 @@ public void actionPerformed(ActionEvent e) {
if (row > 0)
sb.append(newline);
for (int col = 0; col < numcols; col++) {
boolean symColumn = table.getColumnClass(col) == K.KSymbolVector.class;
boolean symColumn = table.getColumnClass(colsselected[col]) == K.KSymbolVector.class;
if (symColumn)
sb.append("\"");

K.KBase b = (K.KBase) table.getValueAt(rowsselected[row], colsselected[col]);
if (!b.isNull())
sb.append(KFormatContext.NO_TYPE);
sb.append(b.toString(KFormatContext.NO_TYPE));
if (symColumn)
sb.append("\"");
if (col < numcols - 1)
Expand Down Expand Up @@ -293,11 +293,6 @@ public void mouseClicked(MouseEvent e) {
private boolean isTableSelectionValid() {
int numcols = table.getSelectedColumnCount();
int numrows = table.getSelectedRowCount();
int[] rowsselected = table.getSelectedRows();
int[] colsselected = table.getSelectedColumns();
return ((numrows - 1 == rowsselected[rowsselected.length - 1] - rowsselected[0] &&
numrows == rowsselected.length) &&
(numcols - 1 == colsselected[colsselected.length - 1] - colsselected[0] &&
numcols == colsselected.length));
return numrows>0 && numcols>0;
}
}

0 comments on commit 0005b0d

Please sign in to comment.