Bug 152518

Summary: With an image set as a page background with specific size, changing page properties (e.g., margins) changes the image size unexpectedly
Product: LibreOffice Reporter: Mike Kaganski <mikekaganski>
Component: WriterAssignee: Not Assigned <libreoffice-bugs>
Status: NEW ---    
Severity: normal CC: michael.stahl, olivier.dev, stephane.guillou
Priority: medium    
Version: 7.2.7.2 release   
Hardware: All   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 108576    
Attachments: An image as the page background

Description Mike Kaganski 2022-12-15 11:15:06 UTC
Created attachment 184154 [details]
An image as the page background

The ODT attachment is created as a new text document, with Default Page Style changed to be 14 x 21 cm, and its area set to a PNG image (1400x2100, representing colored border), "Custom position/size", 14x21 cm, Center (the "Background covers margins" on Page tab is active by default).

Open it, and in the page style properties, try to change any margin (say, to 3 cm). Applying the change makes the border "disappear", and visiting the Area properties shows that the size has changed unexpectedly to 65.34x98.01 cm.
Comment 1 Stéphane Guillou (stragu) 2022-12-15 18:33:11 UTC
I found it difficult to reproduce, but I think I have found a consistent way:

1. Open attachment 184154 [details]
2. Format > Page Style
3. In Page tab, change a margin size (e.g. from 2 cm to 3 cm)
4. Also open the Area tab, but don't change anything in there
5. Click OK or Apply

Notes that I could not reproduce if I had not opened the Area tab as well (step 4). Also works if the Area tab was first focused, before changing margins in the Page tab. 

Is that correct, Mike?

Repro in:

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 28ff4647e9dac8eebe3a169e828bacc8dc78e363
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

and:

Version: 7.2.7.2 / LibreOffice Community
Build ID: 8d71d29d553c0f7dcbfa38fbfda25ee34cce99a2
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

(Full background fills were introduced in 7.2, could be an implementation error? Michael?)
Comment 2 Mike Kaganski 2022-12-16 04:59:10 UTC
(In reply to Stéphane Guillou (stragu) from comment #1)
> Is that correct, Mike?

Yes you are correct - now testing it, I see that unless I activate the area tab, it works OK. I must accidentally have activated it always in my prior testing. Thanks!

> (Full background fills were introduced in 7.2, could be an implementation
> error? Michael?)

... but actually, the error is not specific to that mode - also if you disable the full page background (and decrease the size accordingly to 10x17 cm), it also behaves like this. Not saying it necessarily is unrelated to that implementation, everything is possible, just mentioning.