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)
(earliest affected) release
Hardware: All All
: medium normal
Assignee: Not Assigned
Keywords: bibisectRequest, regression
Depends on:
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:

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

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]
Comment 2 Oliver Brinzing 2019-05-22 05:58:42 UTC
Created attachment 151585 [details]
Comment 3 m.a.riosv 2019-05-22 14:05:58 UTC
Version: (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: (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

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


Version (Build ID: efca6f15609322f62a35619619a6d5fe5c9bd5a)

the 2 empty cells in the middle are respected
Comment 5 raal 2019-05-23 11:39:04 UTC
repro Version:
Build ID: fc8f44e82de4ebdd50ac5fbb9207cd1a59a927e3
Comment 6 Oliver Brinzing 2019-05-23 17:20:12 UTC
no repro with Version (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?

paste *special* one line with AOO 4.1.5/LO 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

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

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

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

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:
 bool ScDocument::SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const 
                             OUString& rString, const ScSetStringParam* pParam )