Bug 125440 - textimport: copy & paste one row is different from multiple rows
Summary: textimport: copy & paste one row is different from multiple rows
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.3.0.4 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisectRequest, regression
Depends on:
Blocks:
 
Reported: 2019-05-22 05:57 UTC by Oliver Brinzing
Modified: 2019-05-25 13:10 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
multiple_rows_textimport (61.28 KB, image/png)
2019-05-22 05:58 UTC, Oliver Brinzing
Details
one_row_paste (25.93 KB, image/png)
2019-05-22 05:58 UTC, Oliver Brinzing
Details
screenshot from viewfun5.cxx (165.30 KB, image/png)
2019-05-24 17:40 UTC, Oliver Brinzing
Details
screenshot from impex.cxx (96.64 KB, image/png)
2019-05-24 17:41 UTC, Oliver Brinzing
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Brinzing 2019-05-22 05:57:25 UTC
steps to reproduce:

- open new spreadsheet
- copy rows to clipboard:

  "Row1"	""	""	"50.000"
  "Row2"	""	""	"-50.000"

- paste data into spreadsheet
-> text Import dialog will open, make selection as shwon in attached screenshots
-> data is pasted as values.

do same with one row:
-> no text Import Dialog appear, datais pasted as text
Comment 1 Oliver Brinzing 2019-05-22 05:58:05 UTC
Created attachment 151584 [details]
multiple_rows_textimport
Comment 2 Oliver Brinzing 2019-05-22 05:58:42 UTC
Created attachment 151585 [details]
one_row_paste
Comment 3 m.a.riosv 2019-05-22 14:05:58 UTC
Repro
Version: 6.2.4.1 (x64)
Build ID: 170a9c04e0ad25cd937fc7a913bb06bf8c75c11d
CPU threads: 4; OS: Windows 10.0; UI render: GL; VCL: win; 
Locale: es-ES (es_ES); UI-Language: en-US Calc: threaded
Versión: 6.3.0.0.alpha1 (x64)
Id. de compilación: 547edd20e527fb02900f6174973770d26306e2e7
Subprocs. CPU: 4; SO: Windows 10.0; Repres. IU: GL; VCL: win; 
Configuración regional: es-ES (es_ES); Idioma de IU: es-ES Calc: threaded
Comment 4 Xisco Faulí 2019-05-23 10:00:24 UTC
Also reproduced in

Version: 5.2.0.0.alpha1+
Build ID: 5b168b3fa568e48e795234dc5fa454bf24c9805e
CPU Threads: 4; OS Version: Linux 4.15; UI Render: default; 
Locale: ca-ES (ca_ES.UTF-8)

in

Version 4.1.0.0.alpha0+ (Build ID: efca6f15609322f62a35619619a6d5fe5c9bd5a)

the 2 empty cells in the middle are respected
Comment 5 raal 2019-05-23 11:39:04 UTC
repro Version: 4.2.0.0.alpha1+
Build ID: fc8f44e82de4ebdd50ac5fbb9207cd1a59a927e3
Comment 6 Oliver Brinzing 2019-05-23 17:20:12 UTC
no repro with Version 3.6.7.2 (Build ID: e183d5b)
(using paste special)
Comment 7 Oliver Brinzing 2019-05-24 17:40:37 UTC
Created attachment 151662 [details]
screenshot from viewfun5.cxx
Comment 8 Oliver Brinzing 2019-05-24 17:41:14 UTC
Created attachment 151663 [details]
screenshot from impex.cxx
Comment 9 Oliver Brinzing 2019-05-24 17:51:00 UTC
started to debug:

viewfun5.cxx, line 341:
- csv text import dialog will only open if there is more than one line pasted
-> this is same code as in AOO 4.1.5

impex.cxx, line 1291
- pExtOptions is not set, maybe the root cause?

noticed: 
paste *special* one line with AOO 4.1.5/LO 3.6.7.2 results in pasting data
splitted into cells without opening text import dialog, while a simple paste
will copy the line in one cell
Comment 10 Oliver Brinzing 2019-05-25 13:10:32 UTC
noticed: 

- only tab separated values will be splitted and pasted into single cells 
- AOO 4.1.5/LO 3.6.7.2 will detect numbers and remove enclosing quotes

AOO 4.1.5/LO 3.6.7.2
- tab
  "Row1"	"1"	"2" -> Row1 | 1 | 2

- other delimeters:
  "Row1";"1";"2" -> "Row1";"1";"2" (AOO 4.1.5)
                 -> Row            (LO 3.6.7.2)

since LO 4
- tab
  "Row1"	"1"	"2" -> "Row1" | "1" | "2"

- other delimeters:
  "Row1";"1";"2" -> "Row1";"1";"2" 

AOO4.1.5 calls a method setString() with parameter bDetectNumberformat=true:
 sal_Bool ScDocument::SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const 
                                 String& rString, SvNumberFormatter* pFormatter,
                                 bool bDetectNumberFormat )

while LO setString() method misses this parameter:
sc\source\core\data\document.cxx:
 bool ScDocument::SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const 
                             OUString& rString, const ScSetStringParam* pParam )