Bug 157601 - FILEOPEN: CSV and TXT files determine which filter based on the current application
Summary: FILEOPEN: CSV and TXT files determine which filter based on the current appli...
Status: RESOLVED DUPLICATE of bug 89683
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.6.2.1 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-04 17:56 UTC by Turtle
Modified: 2023-10-04 19:43 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
proposed test fix by rearranging the if/else and adding case for .txt (1.56 KB, patch)
2023-10-04 18:57 UTC, Turtle
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Turtle 2023-10-04 17:56:27 UTC
Description:
RFC 4180 describes a CSV file. https://www.rfc-editor.org/rfc/rfc4180
The appropriate appliactoin to open this type of file in libreoffice is calc.
The appropriate application to open a text file is libreoffice writer.
  
When in the writer application opening a .csv file opens the file in writer.
When in the calc app opening a .txt file begins a csv import to calc.

A file with a mimetype text/csv or ending with a .csv extension is a spreadsheet
and should be opened with calc, even if the user is in writer.
A file with a mimetype of text/plain or .txt extension is a text file and should be opened with witer even if the user is in calc.

Or at the very least the filter should give the user the choice of which app  or 'document service' to import with.

Steps to Reproduce:
1.Create a directory in /tmp and with writer create the following
two non native text files with libreoffice in that directory.
Save As 'test.txt'
then save as 'test.docx'
2.Next create two non native spreadsheets in that directory
first fill in some cells and save as 'test.csv' choose csv extension.
Then save as test.xlsx 
3.Next open the csv file with libreoffice calc for editing.
4.use file --> open and open test.docx, ibreoffice will open the file with writer as expected.
5.Go back to the csv file and use File -> open again to open test.txt



Actual Results:
libreoffice will launch a import box thinking this is a spreadsheet.

Expected Results:
Libreoffice should either open the .txt file with writer.


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Same thing happens if you open a .csv file with writer, it opens it as a text document .
I would expect it to launch the import box or just open the file and launch calc
as it does when you open a .xlsx from writer.

I suspect the issue is in filter/source/textfilterdetect/filterdetect.cxx
around line 219
Comment 1 Mike Kaganski 2023-10-04 18:16:45 UTC

*** This bug has been marked as a duplicate of bug 89683 ***
Comment 2 Turtle 2023-10-04 18:37:04 UTC
(In reply to Mike Kaganski from comment #1)
> 
> *** This bug has been marked as a duplicate of bug 89683 ***

bug 89683 is years old and was closed (in error) as a wont fix. 
I am requesting the issue be reconsidered as CSV is a spreadsheet file format defined in rfc 4180.
Opening a .csv with calc will bring liberoffice in line with rfc 4180
See the definition of a CSV format:
https://www.rfc-editor.org/rfc/rfc4180#page-2
Comment 3 Turtle 2023-10-04 18:57:15 UTC
Created attachment 190018 [details]
proposed test fix by rearranging the if/else and adding case for .txt

Well when I open libreoffice asks me to contribute so here goes.
Comment 4 Mike Kaganski 2023-10-04 19:41:12 UTC

*** This bug has been marked as a duplicate of bug 89683 ***
Comment 5 Mike Kaganski 2023-10-04 19:43:01 UTC
If you want it reconsidered, then post there. That issue has all the context.