Bug 97567 - FILESAVE: Writer destroys format in odt file created by MS Office
Summary: FILESAVE: Writer destroys format in odt file created by MS Office
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:5.2.0
Keywords:
: 98523 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-02-04 12:32 UTC by Mark Hung
Modified: 2016-09-26 13:09 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
ODT created by MSO2010 ( tradtional Chinese ) (5.63 KB, application/vnd.oasis.opendocument.text)
2016-02-04 12:32 UTC, Mark Hung
Details
ODT created by MSO2010 ( tradtional Chinese ) (8.95 KB, application/vnd.oasis.opendocument.text)
2016-02-04 13:06 UTC, Mark Hung
Details
Screenshot ( side by side comparison ) (62.96 KB, image/png)
2016-02-04 13:09 UTC, Mark Hung
Details
Yet another sample (created by MSO 2013 traditional Chinese) (11.57 KB, application/vnd.oasis.opendocument.text)
2016-02-11 14:17 UTC, Mark Hung
Details
Sample file with Chinese style name and style display name (5.10 KB, application/vnd.oasis.opendocument.text)
2016-03-11 05:19 UTC, Mark Hung
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Hung 2016-02-04 12:32:02 UTC
Created attachment 122376 [details]
ODT created by MSO2010 ( tradtional Chinese )

Step to Reproduce
1. Open the attachment in Writer. 
2. Save as another odt file.
3. Reopen the new file, direct formats ( font size and font family ) are all gone.

The attachment is odt file created in MSO2010 traditional Chinese version.  

Version:5.0.4.2
Build ID:2b9802c1994aa0b7dc6079e128979269cf95bc78
Locale:zh-TW (zh_TW)
Comment 1 Mark Hung 2016-02-04 12:40:18 UTC
Oops. The attachment is wrong. I'll upload later.
Comment 2 Mark Hung 2016-02-04 13:06:10 UTC
Created attachment 122382 [details]
ODT created by MSO2010 ( tradtional Chinese )
Comment 3 Mark Hung 2016-02-04 13:09:21 UTC
Created attachment 122383 [details]
Screenshot ( side by side comparison )
Comment 4 Buovjaga 2016-02-11 08:22:02 UTC
Where can we get the font?
Comment 5 Mark Hung 2016-02-11 13:41:43 UTC
In attachment 122383 [details], it is using Microsoft JhengHei at the left side and Microsoft MingLiu at the other side  as CJK font. They are preinstalled in Windows7 ( traditional Chinese ).
Comment 6 Mark Hung 2016-02-11 14:17:43 UTC
Created attachment 122533 [details]
Yet another sample (created by MSO 2013 traditional Chinese)

After saving the file, direct formatting is missing. CJK font DFKai-SB fallback to MingLiu.
Comment 7 Buovjaga 2016-02-11 15:17:15 UTC
(In reply to Mark Hung from comment #5)
> In attachment 122383 [details], it is using Microsoft JhengHei at the left
> side and Microsoft MingLiu at the other side  as CJK font. They are
> preinstalled in Windows7 ( traditional Chinese ).

But how to get them, if we don't have Chinese Windows?
I tried installing this on Win 7, but it didn't work: https://www.microsoft.com/en-us/download/details.aspx?id=12072
LibO is still applying font replacement.
Comment 8 Mark Hung 2016-02-11 16:18:58 UTC
Hi Kevin,

Would you mind helping to confirm this issue?
Comment 9 Kevin Suo 2016-02-12 02:23:50 UTC
(In reply to Mark Hung from comment #8)
I use Simplified Chinese Win 10, with MSO 2010, I don't have the fonts you mentioned.

However, I tried to create a new odt document from MSO 2010, applied SimSun font and some other formating, save as another odt file with LibreOffice 5.0.4.2, the formating is still there, no reproduce.

I do noticed the "Grid Line" issue (as you may have noticed already), the grid line issue is not our bug. MSO set grid line mode to "line" in style.xml but do not display the grid line.
Comment 10 Mark Hung 2016-03-11 05:07:58 UTC
*** Bug 98523 has been marked as a duplicate of this bug. ***
Comment 11 Mark Hung 2016-03-11 05:19:51 UTC
Created attachment 123486 [details]
Sample file with Chinese style name and style display name

Steps to reproduce:
1. Set UI language to Chinese (traditional) - this is must
2. Open the attached file.
3. Save as another file.
4. Reopen it, direct formatting were missing. 
Font size are changed from 30pt to 12 pt in many paragraphs.


Version:5.1.0.3
Build ID:5e3e00a007d9b3b6efb6797a8b8e57b51ab1f737
CPU Threads: 8; OS Version: Windows 6.2; UI Render: GL; 
Lang:zh-TW (zh_TW)


Note:
In the attached document, both style name and style display name attributes of the paragraph style of text body are in Chinese (traditional). When Writer imports the file, it find existing style by its display name. If one is found, the style properties are imported, otherwise a new style is created. When UI language is set to Chinese ( traditional ), the display name of the built in one matches the one in the file. But style names of the two are different because LibreOffice do not localize its display name, hence leaving paragraphs or styles referring to the name refer to a style name that is not created. I'm not sure in what situation MS Word create both style name and display name with localized string, but in theory it could happen for other people if they are use MSWord to generate files in language other than English.
Comment 12 Commit Notification 2016-04-20 13:22:46 UTC
Mark Hung committed a patch related to this issue.
It has been pushed to "master":

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

tdf#97567 xmloff: use programmatic name for imported automatic style.

It will be available in 5.2.0.

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 13 Xisco Faulí 2016-09-26 10:21:27 UTC
Hello Mark,
Is this bug fixed?
If so, could you please close it as RESOLVED FIXED?
Changing status to NEW.