Bug 155465 - FILESAVE DOC: Saving as doc file would make the paragraph justified effects not worked
Summary: FILESAVE DOC: Saving as doc file would make the paragraph justified effects n...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:7.6.0 target:7.5.5
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-24 02:10 UTC by Franklin Weng
Modified: 2023-05-25 04:44 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample odt file (9.70 KB, application/vnd.oasis.opendocument.text)
2023-05-24 02:10 UTC, Franklin Weng
Details
155465_fullJustify.doc: justify last line already imports in OOo 3.3. (23.00 KB, application/msword)
2023-05-24 11:55 UTC, Justin L
Details
Screenshot of Style inspector odt vs doc (111.34 KB, image/png)
2023-05-24 12:03 UTC, m_a_riosv
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Franklin Weng 2023-05-24 02:10:03 UTC
Description:
Saving the sample file as doc file, then close and reopen it, the justified effects in the first paragraph would not work.  The setting is still there, but didn't show it.

Saving as docx file works.

Steps to Reproduce:
1. Open the sample file
2. Save as doc file
3. Close and reopen it

Actual Results:
The justified effect in the first paragraph didn't show (but paragraph format setting is there)

Expected Results:
The first paragraph should be justified.


Reproducible: Always


User Profile Reset: No

Additional Info:
Earliest version tested:
版本 3.6.7.2 (組建 ID:e183d5b)

Should be inherit from OOo?
Comment 1 Franklin Weng 2023-05-24 02:10:33 UTC
Created attachment 187469 [details]
Sample odt file

Save as doc file would make the first paragraph not justified.
Comment 2 Telesto 2023-05-24 05:45:54 UTC
Confirm
Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 8635c9aa8c6f1078a9e220076d5a08daf30077e8
CPU threads: 8; OS: Mac OS X 12.6.3; UI render: Skia/Raster; VCL: osx
Locale: nl-NL (nl_NL.UTF-8); UI: en-US
Calc: threaded
Comment 3 Telesto 2023-05-24 05:49:33 UTC
@Justin
You might be interested in this one
Comment 4 Justin L 2023-05-24 11:55:21 UTC
Created attachment 187475 [details]
155465_fullJustify.doc: justify last line already imports in OOo 3.3.

The first paragraph has the paragraph property "last line" "justified". That is lost on doc export.

Although the UI in MS Word doesn't allow this (at least in 2010), it is possible to accomplish by pressing Ctrl-Shift-J. Round-tripping that in MS Word shows that it IS possible to preserve this value.

This imports because sprmPJc  case 4, so:
            eAdjust = SvxAdjust::Block;
            bDistributed = true;
Comment 5 m_a_riosv 2023-05-24 12:03:18 UTC
Created attachment 187476 [details]
Screenshot of Style inspector odt vs doc

There is a parameter on direct format loosed with doc file.

Maybe it is no available with docs files.
Comment 6 Justin L 2023-05-24 13:08:33 UTC
DOCX export does
        case SvxAdjust::BlockLine:
        case SvxAdjust::Block:
            if (rAdjust.GetLastBlock() == SvxAdjust::Block)
                pAdjustString = "distribute";
            else
                pAdjustString = "both";
            break;

fix proposed at https://gerrit.libreoffice.org/c/core/+/152199
Comment 7 Commit Notification 2023-05-24 17:52:38 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/446f9d77af4fe0cedf50e9cbd792cf1aee105675

tdf#155465 doc export: handle para last line - justify

It will be available in 7.6.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Commit Notification 2023-05-24 21:25:03 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/dfe794ee03cab7906136c39ab2aa468c983af4cd

tdf#155465 doc export: handle para last line - justify

It will be available in 7.5.5.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 BogdanB 2023-05-25 04:44:54 UTC
Justin, thanks for fixing this bug.

Working with
Version: 7.6.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 9a4b768b0a22bd3ae627c7355bbd223b9cf65015
CPU threads: 16; OS: Linux 5.19; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded

Not working with (for reference of testing the fix)
Version: 7.5.3.2 (X86_64) / LibreOffice Community
Build ID: 9f56dff12ba03b9acd7730a5a481eea045e468f3
CPU threads: 16; OS: Linux 5.19; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded