Bug 81944

Summary: FILEOPEN: RTF random words and links not retaining font name
Product: LibreOffice Reporter: Jay Philips <philipz85>
Component: WriterAssignee: Michael Stahl <mst.fdo>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: mst.fdo, vmiklos
Version: 4.0.2.2 releaseKeywords: regression
Hardware: Other   
OS: All   
See Also: https://bugs.freedesktop.org/show_bug.cgi?id=61507
Whiteboard: bisected filter:rtf rtf_filter target:4.4.0 target:4.3.1
i915 platform: i915 features:
Attachments: LibO 4.3.1 VS Word 2013
How the first page Word RTF looks in LibO 4.2.5 VS 4.3.1
sample file

Description Jay Philips 2014-07-31 05:58:47 UTC
Created attachment 103720 [details]
LibO 4.3.1 VS Word 2013

I downloaded < http://download.microsoft.com/documents/rus/microsoft4you/How_to_license_the_operating_system_Windows_8_new.docx > and opened it in Word 2013 and saved it as an rtf file. Then when opening the file in LibO 4.3.1, various text and links appear with Times New Roman font rather than Segoe UI on pretty much every page. This also effects 4.2.7 and master.

Steps:
1) open RTF attachment 103717 [details]
2) one page 1 look at "www.microsoft.com/rus"
3) one page 2 look at the word "Windows" on line 3 or "GML" on line 5.
4) one page 3 look at "Get Genuine Windows – Academic (GGWA-A)"

This is a regression as this doesnt happen in 3.6.7.
Comment 1 Michael Stahl 2014-08-01 13:23:09 UTC
bibisect range:
24bd259451fae36c993977f52d62365fa63ac87c..8a89a732522f90d68f1b1c84c9c34c666f2eb882

regression from:
commit 0805b222f87bf99ec0c53ca678d1c670eb5293a2
Author:     Miklos Vajna <vmiklos@suse.cz>
AuthorDate: Tue Feb 26 15:36:09 2013 +0100
Comment 2 Jay Philips 2014-08-01 21:00:10 UTC
I should have previously mentioned that i've seen more items in the RTF not retain their font name in 4.3.1 than 4.2.5 and below. An example of this is step 3, which only showed up in 4.3.1.
Comment 3 Commit Notification 2014-08-02 17:16:39 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=f8e8e476aa0a5576234dbb4daac9dc299e044e61

fdo#81944: writerfilter: RTF import: don't drop fonts in stylesheet



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 4 Michael Stahl 2014-08-02 17:19:28 UTC
funny thing is, it appears to work in current libreoffie-4-2 branch...

then this one broke it again:

commit 1be0a3fa9ebb22b607c54b47739d4467acfed259
Author:     Michael Stahl <mstahl@redhat.com>
AuthorDate: Tue Jun 17 18:40:04 2014 +0200

    n#825305: writerfilter RTF import: override style properties like Word
  

good thing we decided not to backport that earlier today...

so the problem appears to be that the default style's fonts
are not imported, or at least fixing that makes the right font
show up in the locations from the description:

on master:
para style Default Style
 Western: Times New Roman
 CJK: Courier New

Word:
para style Normal
 Western: Segoe UI
 CJK/Complex: Times New Roman

probably if this ever worked before it was by accident...
Comment 5 Jay Philips 2014-08-02 18:03:07 UTC
Created attachment 103872 [details]
How the first page Word RTF looks in LibO 4.2.5 VS 4.3.1

Everything after 3.6.7 has not worked flawlessly from the test documents i've been testing and things have shown to gotten worse between 4.2.5 and 4.3.1. I came across another file that was fine in 4.2.5 and then in 4.3.1, Times New Roman patches showed up here and there. You can see it by converting attachment  103815 [details] to RTF in Word 2013 and then opening it up in LibO.
Comment 6 Jay Philips 2014-08-02 18:07:51 UTC
Hi Michael,

When you do get a chance, can you check out bug 82033, as it is about RTF exporting attachment 103815 [details], which results in a 169mb file.
Comment 7 Commit Notification 2014-08-03 19:44:35 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-4-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=aed0f1e27be04ecd43b2edd3885c1f2eea0a3de9&h=libreoffice-4-3

fdo#81944: writerfilter: RTF import: don't drop fonts in stylesheet


It will be available in LibreOffice 4.3.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 8 Jay Philips 2014-08-05 10:03:53 UTC
Created attachment 104064 [details]
sample file

Hi Michael,

Thanks for the fix. It has worked perfectly on the file for this bug report.

Unfortunately, it has messed up another rtf that i've been testing these last few days. I have included the part that has gotten messed up in the last week. It is on page 2, all the text in the 2 frames used to be verdana and they are are now times new roman.

Also in the file on page 1, the numbering list numbers are supposed to be Verdana, but instead they are using Liberation Serif.
Comment 9 Miklos Vajna 2014-08-10 10:36:23 UTC
*** Bug 82074 has been marked as a duplicate of this bug. ***
Comment 10 Jay Philips 2014-08-23 14:39:18 UTC
Changing the status as the fix messed up another file.
Comment 11 Jay Philips 2014-08-23 14:39:51 UTC
Or should i create another bug report for the new file Michael?
Comment 12 Miklos Vajna 2014-09-03 17:36:47 UTC
Yes, please open a new bug. Thanks! :-)
Comment 13 Miklos Vajna 2014-09-08 13:01:44 UTC
*** Bug 82107 has been marked as a duplicate of this bug. ***
Comment 14 Jay Philips 2014-09-08 14:28:40 UTC
(In reply to comment #12)
> Yes, please open a new bug. Thanks! :-)

The new bug is bug 83464. :D

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.