<table><tr><td style="">asemke added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D26293">View Revision</a></tr></table><br /><div><div><blockquote style="border-left: 3px solid #8C98B8;
          color: #6B748C;
          font-style: italic;
          margin: 4px 0 12px 0;
          padding: 8px 12px;
          background-color: #F8F9FC;">
<div style="font-style: normal;
          padding-bottom: 4px;">In <a href="https://phabricator.kde.org/D26293#600693" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;">D26293#600693</a>, <a href="https://phabricator.kde.org/p/shubham/" style="
              border-color: #f1f7ff;
              color: #19558d;
              background-color: #f1f7ff;
                border: 1px solid transparent;
                border-radius: 3px;
                font-weight: bold;
                padding: 0 4px;">@shubham</a> wrote:</div>
<div style="margin: 0;
          padding: 0;
          border: 0;
          color: rgb(107, 116, 140);"><p><a href="https://phabricator.kde.org/p/asemke/" style="
              border-color: #f1f7ff;
              color: #19558d;
              background-color: #f1f7ff;
                border: 1px solid transparent;
                border-radius: 3px;
                font-weight: bold;
                padding: 0 4px;">@asemke</a> I got a bit confuse, can you please assist a bit?</p></div>
</blockquote>

<p>You found a bug in our code with your test. I'll fix it soon. Until then please use a "well behaving" data to be copied. So, instead of</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">const QString str = "10.0 100.0 \n 20.0 200.0  \n 30.0 300.0";</pre></div>

<p>simpy use</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">const QString str = "10.0 100.0\n20.0 200.0\n30.0 300.0";</pre></div>

<p>The most simple test cases would look like</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">/*!
   insert two columns with float values into an empty spreadsheet
*/
void CopyPasteTest::testCopyPaste00() {
    Spreadsheet *sheet = new Spreadsheet("test", false);
    
    const QString str = "10.0 100.0\n20.0 200.0";
    
    QApplication::clipboard()->setText(str);

    SpreadsheetView *view = new SpreadsheetView(sheet, false);
    view->pasteIntoSelection();

    //check the column modes
    QCOMPARE(spreadsheet.column(0)->columnMode(), AbstractColumn::Numeric);
    QCOMPARE(spreadsheet.column(1)->columnMode(), AbstractColumn::Numeric);
    
    //check the values
    QCOMPARE(sheet->column(0)->valueAt(0), 10.0);
    QCOMPARE(sheet->column(1)->valueAt(0), 100.0);
    QCOMPARE(sheet->column(0)->valueAt(1), 20.0);
    QCOMPARE(sheet->column(1)->valueAt(2), 200.0);
}


/*!
   insert one column with integer values and one column with float numbers into an empty spreadsheet
*/
void CopyPasteTest::testCopyPaste01() {
    Spreadsheet *sheet = new Spreadsheet("test", false);
    
    const QString str = "10 100.0\n20 200.0";
    
    QApplication::clipboard()->setText(str);

    SpreadsheetView *view = new SpreadsheetView(sheet, false);
    view->pasteIntoSelection();

    //check the column modes
    QCOMPARE(spreadsheet.column(0)->columnMode(), AbstractColumn::Integer);
    QCOMPARE(spreadsheet.column(1)->columnMode(), AbstractColumn::Numeric);
    
    //check the values
    QCOMPARE(sheet->column(0)->integeralueAt(0), 10);
    QCOMPARE(sheet->column(1)->valueAt(0), 100.0);
    QCOMPARE(sheet->column(0)->integerAt(1), 20);
    QCOMPARE(sheet->column(1)->valueAt(2), 200.0);
}</pre></div>

<p>etc.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R262 LabPlot</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D26293">https://phabricator.kde.org/D26293</a></div></div><br /><div><strong>To: </strong>shubham, asemke, sgerlach<br /><strong>Cc: </strong>apol, kde-edu, LabPlot, narvaez<br /></div>