Bug 146953 - RTF document being opened in Calc
Summary: RTF document being opened in Calc
Status: RESOLVED DUPLICATE of bug 59016
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected) release
Hardware: All All
: medium normal
Assignee: Not Assigned
Depends on:
Reported: 2022-01-24 07:02 UTC by Vasily Melenchuk (CIB)
Modified: 2022-01-27 13:24 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:

Sample document (4.51 KB, application/msword)
2022-01-27 06:06 UTC, Rainer Bielefeld Retired
Which is the defaupt app for RTF (71.94 KB, application/vnd.oasis.opendocument.graphics)
2022-01-27 06:21 UTC, Rainer Bielefeld Retired

Note You need to log in before you can comment on or make changes to this bug.
Description Vasily Melenchuk (CIB) 2022-01-24 07:02:39 UTC
In some scenarios for opening RTF documents Calc is used.

Steps to Reproduce:
1. Create empty calc document (or open any existing)
2. Open any existing RTF document

Actual Results:
RTF document is being opened in Calc

Expected Results:
Writer should be used to open RTF document.

Reproducible: Always

User Profile Reset: No

Additional Info:
Version marked ( is not earliest, but oldest checked by me. This behavior can be older.

This behavior is not a case for DOC or DOCX documents: if instead of RTF I use any of them Writer is opened, so this is something specific to RTF.
Comment 1 Mike Kaganski 2022-01-24 07:20:20 UTC
It is intended AFAIR; it uses Calc-RTF filter if opened from Calc (and also there's something similar for text files IIRC). But no reference from the top of my head.
Comment 2 Mike Kaganski 2022-01-24 08:00:58 UTC
FTR: this is since 3.6, and does not happen in 3.5.
Comment 3 Mike Kaganski 2022-01-24 08:28:31 UTC
(In reply to Mike Kaganski from comment #1)
> there's something similar for text files IIRC

Or was that HTML?
Comment 5 Vasily Melenchuk (CIB) 2022-01-26 16:41:49 UTC
Thanks for extra info for this problem.

Anyway situation looks strange for me:
1. RTF is a text format and it is expected to be opened in Writer.
2. Different behavior described in this bug is not the good UX experience imho: it is quite a surprise to realize that RTF can be opened by Writer or by Calc depending on absolutely unrelated document type I'm editing right now.
3. The behavior is not consistent: we are trying to expand RTF tables from file to calc spreadsheet, but why we are not doing so for DOC, DOCX or even ODT? They are also text formats with tables.
4. Opened by Calc RTF we can't save back to RTF.
5. If there is real need to have RTF table in Calc, it can be opened in Writer and copy-pasted to Calc.

I'm not sure, if this is intended behavior or side-effect from introducing RTF filter for Calc (for example, to use copy-paste). implementation is done in bunch of commits starting from:
>commit ed55b27bae9f7517863216e9bcc0312d7e48b35b
>Author: Kurt Zenker <kz@openoffice.org>
>Date:   Wed Jan 28 15:22:14 2004 +0000
>    INTEGRATION: CWS filtercfg (1.1.2); FILE ADDED
>    2003/10/02 11:25:02 as #102620# first revision
Comment 6 Rainer Bielefeld Retired 2022-01-27 06:06:39 UTC
Created attachment 177820 [details]
Sample document

REPRODUCIBLE with attached sample document and Installation of Version: (x64) Build ID 499f9727c189e6ef3471021d6132d4c694f357e5
CPU threads: 12; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-US
Calc: threaded

0. Open a CALC document
1. From CALCdocument Menu ˋFile → Open → Browse for sample.rtf → Openˊ
   » Expected: opens in WRITER
     Actual: Opens in CALC

Additional info:
It doesn't matter whether OS or LibO Dialogs are active
Comment 7 Rainer Bielefeld Retired 2022-01-27 06:18:48 UTC
This Query <https://bugs.documentfoundation.org/buglist.cgi?cmdtype=dorem&remaction=run&namedcmd=DUPs146953&sharer_id=19321> shows some possible DUPs or at least related bugs

"Bug 118882 - Default application to open RTF files was set to Calc
  Very unclear description - unusable"
"Bug 65017 - FILEOPEN : Menu "File > Recent Documents" opens rtf file as a Calc document instead of in Writer"
  This one might be DUP? see  Comment 11 Cor Nouws 2013-06-03 23:56:17 UTC 
"Bug 59016 - FILEOPEN: RTF file open in Calc"
  Intended behavior due to  Kohei Yoshida 2013-01-16 20:37:04 UTC ?
Comment 8 Rainer Bielefeld Retired 2022-01-27 06:21:08 UTC
Created attachment 177821 [details]
Which is the defaupt app for RTF

WIN file dialog shows WRITER as default app, LibO file dialog shows some different app as default app for .rtf
Comment 9 Rainer Bielefeld Retired 2022-01-27 06:27:06 UTC
Strange observation, addition for Attachment 177821 [details]:
In OS settings WRITER is sown as defaupt app for .rtf. Why does LibO files dialogshow something different (I don'tknow what "W" in the icon is standing for)?
Comment 10 Eike Rathke 2022-01-27 11:18:44 UTC
This is a duplicate of bug 59016, isn't it?
If both modules/apps offer a filter for a file format then the currently active one is used. Maybe unless the file type is selected in the file picker.
Comment 11 Timur 2022-01-27 13:24:54 UTC
Even OO could open RTF in Calc:

mikekaganski in Ask:
Calc filter can be turned off so that RTF files no longer open in Calc, but always in Writer. Go to Tools▸Options▸LibreOffice▸Advanced; click Open Expert Configuration button; in the Expert Configuration dialog, search for Rich Text Format (StarCalc); in the result list, double-click the string where Property column reads DocumentService; and then edit the string e.g. adding “1” to the end, so that it would be unknown document service like “com.sun.star.sheet.SpreadsheetDocument1”.

So this looks like a duplicate or NotABug. 
Only thing I'd like to see is some GUI option in Options to change this. 
If someones disagree, please explain.

*** This bug has been marked as a duplicate of bug 59016 ***