Bug 147819 - Setting page style area to None is not kept in a specific DOC
Summary: Setting page style area to None is not kept in a specific DOC
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium minor
Assignee: Justin L
URL:
Whiteboard: target:25.2.0
Keywords:
Depends on:
Blocks: Writer-Styles-Page DOC-Styles
  Show dependency treegraph
 
Reported: 2022-03-07 07:17 UTC by Mike Kaganski
Modified: 2024-11-26 20:34 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2022-03-07 07:17:43 UTC
Open attachment 178684 [details] from bug 147811. Open current page style, and change the Area from Color to None. Save (as DOC) and reload.

The result is that the page style's area is set to White color again.

Not reproducible with a new Writer document.

Version: 7.3.1.3 (x64) / LibreOffice Community
Build ID: a69ca51ded25f3eefd52d7bf9a5fad8c90b87951
CPU threads: 12; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: CL
Comment 1 Dieter 2022-03-22 06:01:37 UTC
I confirm it with

Version: 7.3.1.3 (x64) / LibreOffice Community
Build ID: a69ca51ded25f3eefd52d7bf9a5fad8c90b87951
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL
Comment 2 Aron Budea 2022-07-08 03:14:47 UTC
Already in 4.0.0.3. I assume the problem isn't with the dialog, but with DOC export/import.
Comment 3 QA Administrators 2024-08-29 03:16:24 UTC Comment hidden (obsolete)
Comment 4 Dieter 2024-10-24 06:39:58 UTC Comment hidden (no-value)
Comment 5 Mike Kaganski 2024-10-24 06:55:19 UTC
(In reply to Dieter from comment #4)
> Works fine with
> 
> Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community

No it doesn't.
Comment 6 Justin L 2024-10-24 14:19:37 UTC
IMHO, no bug should be closed as WORKSFORME without a bibisect.

Confirmed comment 5: The problem still exists in 25.2's Linux bibisect.
Comment 7 Justin L 2024-11-25 21:37:21 UTC
(In reply to Aron Budea from comment #2)
> Already in 4.0.0.3. 
Already in OOo 3.3.  (The only two choices are Color or Image. It is set on Color, but the white color block is selected, and not the "No Fill" choice at the top. Changing to "No Fill" is not round-tripped.)
Comment 8 Justin L 2024-11-26 02:53:40 UTC
Export is writing RES_BACKGROUND color during SwEscherEx::SwEscherEx, so it must be somewhere within CreateEscher().

This is reproducible with any document as long as there is SOME graphic that needs to be created. (So to create a clean room reproducer, just insert an image into a new document - and on the round-trip you will have a white page style background.)

Importing this is handled by ww8par.cxx's wwSectionManager::SetSegmentToPageDesc and that gives the clue about ShapeFlag::Background.

In the SwEscherEx CTOR, if (nSecondShapeId) AddShape with ShapeFlag::Background. I THINK what is happening is that this is defining a dummy shape that is used to hold the document background.
Comment 9 Justin L 2024-11-26 13:59:09 UTC
Potentially useful history:
commit 7cd378518b38def9cda5a0055a1d7525aad1c427
Author: Yong Lin Ma on Tue Jul 10 01:07:14 2012 +0000
    Resolves: #i56806# Page (IMAGE) background lost when export to doc format

commit 8a8f2a873e2a315aa712ddc09e980971a2b485e9
Author: Rüdiger Timm on Thu Sep 25 06:42:09 2003 +0000
    INTEGRATION: CWS killarneyfilterteam13 (1.63.78); FILE MERGED
    2003/08/28 12:13:51 cmc 1.63.78.2: #i18247# Implment import and export of background page colours (for free we get some support for background images)

and the commit that introduced all this was (yikes)
commit 65dc2c7c4c5586f3907a6b047c2ee00f4c4f5aa0
Author: Caolán McNamara on Wed Aug 28 11:15:07 2002 +0000
    #i2853# Split escher export into two parts, one of which is capable of writing inline graphics as escher for large space savings in .docs

Hmm- the web link of that last commit is incomplete - missing the interesting stuff for this bug. Need to use 
"git log -p 65dc2c7c4c5586f3907a6b047c2ee00f4c4f5aa0".
Comment 10 Commit Notification 2024-11-26 20:34:06 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/1f60ba36f4e2fa2785d31200b2a95226920ec298

tdf#147819 doc export: only ShapeFlag::Background if XATTR_FILL

It will be available in 25.2.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.