Free cookie consent management tool by TermsFeed Policy Generator

Opened 8 years ago

Closed 8 years ago

#2674 closed enhancement (done)

Copy&paste should also copy the row names for DoubleArrays

Reported by: gkronber Owned by: abeham
Priority: medium Milestone: HeuristicLab 3.3.15
Component: Data.Views Version: 3.3.14
Keywords: Cc:

Description


Change History (10)

comment:1 Changed 8 years ago by gkronber

  • Component changed from Core.Views to Data.Views

comment:2 Changed 8 years ago by gkronber

  • Owner set to gkronber
  • Status changed from new to accepted

comment:3 Changed 8 years ago by gkronber

r14299: also added row names to clipboard for StringConvertibleArrays (the code for copying to clipboard was irrelevant anyway because C&P was not disabled for the DataViewGrid)

comment:4 Changed 8 years ago by gkronber

  • Owner changed from gkronber to abeham
  • Status changed from accepted to reviewing

comment:5 Changed 8 years ago by gkronber

  • Owner changed from abeham to jkarder

comment:6 Changed 8 years ago by abeham

  • Owner changed from jkarder to gkronber
  • Status changed from reviewing to assigned

I get an exception when I try to copy and paste from a StringConvertibleArrayView. Maybe this change is responsible. It's a bit strange, because it's 4 months and no one noticed. But r14299 is the last change on the view. Please have a look.

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at HeuristicLab.Data.Views.StringConvertibleArrayView.CopyValuesFromDataGridView() in c:\Users\P40311\Work\HL3\trunk\sources\HeuristicLab.Data.Views\3.3\StringConvertibleArrayView.cs:line 206
   at HeuristicLab.Data.Views.StringConvertibleArrayView.dataGridView_KeyDown(Object sender, KeyEventArgs e) in c:\Users\P40311\Work\HL3\trunk\sources\HeuristicLab.Data.Views\3.3\StringConvertibleArrayView.cs:line 186
   at System.Windows.Forms.Control.OnKeyDown(KeyEventArgs e)
   at System.Windows.Forms.DataGridView.OnKeyDown(KeyEventArgs e)

comment:7 Changed 8 years ago by abeham

  • Status changed from assigned to reviewing

The problem was that Content.ElementNames need not be defined for all string convertible arrays. Also only the copy to clipboard code was manipulated and not the paste code which broke copy&paste from and to string convertible arrays.

The logic of correctly parsing a clipboard text with or without element names is unfortunately all but simple. Previously we had support for pasteing row vectors, because we included both tab and newline as separators, which is functionality that should be retained.

r14561:

  • Corrected copy & paste from StringConvertibleArrays
    • There are four possible cases that are handled by this change (rows are newline separated, columns tab separated)
      1. There is just one column of values
      2. There is one column of element names and one column of values
      3. There is one row of values
      4. There is one row of element names and one row of values
    • A message box is shown if the user selects a 2 by n or n by 2 range with n > 2

comment:8 Changed 8 years ago by gkronber

Reviewed r14561. Thanks for correcting this.

comment:9 Changed 8 years ago by gkronber

  • Owner changed from gkronber to abeham
  • Status changed from reviewing to readytorelease

comment:10 Changed 8 years ago by abeham

  • Resolution set to done
  • Status changed from readytorelease to closed

r14968: merged 14299,14561 to stable

Note: See TracTickets for help on using tickets.