bugGNU Octave - Bugs: bug #53110, Variable Editor: Copy/paste...

 
 

bug #53110: Variable Editor: Copy/paste selections should limit to the matrix size

Submitted by:  Dan Sebald <sebald>
Submitted on:  Fri 09 Feb 2018 07:51:40 PM UTC  
 
Category:  GUI Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  dev Operating System:  Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 09 Feb 2018 07:51:40 PM UTC, original submission:

Since there have been some recently added Variable Editor bug reports, I'll add another one. I'm working on a revamp of the Variable Editor which should be ready for test in a day or two. I've noticed, though, that in general the copy/paste could use some extra work. I've fixed some bugs, but just looking at the code I can tell that some things can't be correct.

Just as an example, here is how the paste algorithm is currently coded:

The problem is that what's in the "text" could be a collection of CR-delimited entries, not just a single ASCII-encoded number. Here is what I think is a more useful algorithm:

The way the above works is say somewhere in the table I select two cells

1
2

and "copy" (cntrl-C). I then select five cells

0
0
0
0
0

and "paste" (cntrl-V). The above turns to

1
2
1
2
1

The main point is that I can then copy a single value (e.g., "1") and paste it into a much bigger block of cells and set the whole sub-matrix. That seems useful.

Anyway, I'll just pick one behavior I can tells isn't good.

If one selects a whole column or whole row using the column (row) button and does a "copy", the action will select the whole column which includes some empty cells at the bottom. The empty cells are put the QTableView so that the user can effectively expand the array by typing an entry in a empty cell. But as far as copy goes, we don't want to put the empty cells into the clipboard buffer. We aren't working with a spreadsheet that has an indefinite number of cells, we're working with a structured matrix. For example, if my matrix is (I will type at the command line to simulate what is done in the V.E. table)

its range is row 1:2 and column 1:2. If I enter a value in an empty cell (say I type "5" in cell 3,2):

Very structured; range is 1:3 by 1:2. If I delete a row or column; still very structured. In other words, we know that our column (or row) is always going to start at range 1 and end at one before the first empty cell. There's no reason to copy arbitrary empty cells into a buffer along with the valid data.

Dan Sebald <sebald>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by sebald (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No changes have been made to this item

    Back to the top


    Powered by Savane 3.3