Bug Hunting Session
Bug 102627 - Paste Special of RTF formatted text from Writer table can change the font in Calc
Summary: Paste Special of RTF formatted text from Writer table can change the font in ...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
3.5.0 release
Hardware: x86 (IA32) Windows (All)
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: RTF-Paste
  Show dependency treegraph
 
Reported: 2016-09-27 14:28 UTC by David F Smith
Modified: 2019-04-15 09:53 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Writer document containing a table with various font effects, all in Times New Roman. (10.98 KB, application/vnd.oasis.opendocument.text)
2016-09-27 14:28 UTC, David F Smith
Details
Calc spreadsheet showing the result of the bug: cells containing more than one font effect are partly in Liberation Sans font. (13.16 KB, application/vnd.oasis.opendocument.spreadsheet)
2016-09-27 14:29 UTC, David F Smith
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David F Smith 2016-09-27 14:28:02 UTC
Created attachment 127675 [details]
Writer document containing a table with various font effects, all in Times New Roman.

1. In a blank LibreOffice Writer document, create a table.
2. Select all rows and columns of the table, then set the Paragraph Style to Default Style and the Font Name to Times New Roman.
3. Enter text in the table cells.  Some text must contain both normal and italics, bold, subscript, or other special effects.  (The attached file is an example.)
4. Select all rows and columns of the table, then copy (Ctrl+C or Edit > Copy).
5. Create a new LibreOffice spreadsheet.  Select cell A1, then choose Edit > Paste Special (or Ctrl+Shift+V). From the Paste Special box, choose Formatted Text [RTF] and click OK.
6. Examine the imported cells.  Any cell with a single text type (for example, normal text, or italics, or bold) will appear in Times New Roman.  In any cell with two text types (for example, normal and italics), the normal text will be in the default spreadsheet font (Liberation Sans, in my copy), and the "special" characters will be in Times New Roman.  (It's easy to distinguish the two by the absence or presence of serifs on the letters.)

I think that this is a problem in the way Calc pastes formatted (RTF) material rather than the way Writer stores it, because I see the same issue when I use Microsoft Word in steps 1-4.

Variations:
In step 2, if the Paragraph Style for the table is set to (or left at) Table Contents, then the import in step 6 is correct, with all cells in Times New Roman.  There's something significant about Default Style.
In step 2, the Font Name can be set to any font, and the result is the same: on import, the cells with only one font effect, or the "special" effect in cells with two effects, are in the selected font, and the remainder of the text is in Liberation Sans.
If a cell in the Writer table has three different text types (normal and italics and bold), the normal text appears in Calc in Liberation Sans font and the others are in Times New Roman.
I haven't figured out how to change the default font of a spreadsheet to something other than Liberation Sans.  That might be an interesting experiment.
Comment 1 David F Smith 2016-09-27 14:29:38 UTC
Created attachment 127676 [details]
Calc spreadsheet showing the result of the bug: cells containing more than one font effect are partly in Liberation Sans font.
Comment 2 Buovjaga 2016-10-12 11:46:25 UTC
Repro.

This is kind of expected as it is risky to mix styles with direct formatting.

(In reply to David F Smith from comment #0)
> I haven't figured out how to change the default font of a spreadsheet to
> something other than Liberation Sans.  That might be an interesting
> experiment.

Go to Styles and formatting in the sidebar, right-click Default (in Cell styles view), Modify, go to Font tab and change away.

Win 7 Pro 64-bit Version: 5.3.0.0.alpha0+
Build ID: e2f6c7f0d0cc14f851d7028ff846c5dc658a81c6
CPU Threads: 4; OS Version: Windows 6.1; UI Render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2016-10-10_23:08:02
Locale: fi-FI (fi_FI); Calc: group

LibreOffice 3.5.0rc3 
Build ID: 7e68ba2-a744ebf-1f241b7-c506db1-7d53735
Comment 3 QA Administrators 2017-10-23 14:02:36 UTC Comment hidden (obsolete)
Comment 4 David F Smith 2017-10-23 18:18:03 UTC Comment hidden (obsolete)
Comment 5 QA Administrators 2018-10-24 02:57:46 UTC Comment hidden (obsolete)
Comment 6 David F Smith 2018-11-23 16:19:53 UTC
This bug is still present, with exactly the same symptoms as in the original report.

Version: 6.0.5.2 (x64)
Build ID: 54c8cbb85f300ac59db32fe8a675ff7683cd5a16
CPU threads: 4; OS: Windows 10.0; UI render: default; 
Locale: en-US (en_US); Calc: group