Bug 127322 - Gallery: Insert items as background does no longer work
Summary: Gallery: Insert items as background does no longer work
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.1.0.3 release
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:7.6.0 target:7.5.4
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Regressions-imageHandling
  Show dependency treegraph
 
Reported: 2019-09-03 22:10 UTC by Gerhard Weydt
Modified: 2023-10-01 22:58 UTC (History)
6 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 Gerhard Weydt 2019-09-03 22:10:10 UTC
You could insert a gallery item as background for a page or a paragraph (I once even saw "image" as a choice, but I could not make it work) by selecting an image in the gallery, then right-clicking and choosing "Insert as background" and then "page" or "Paragraph". This still works in 6.0.7.3.
In 6.1.3.2, 6.2.4.2 and 6.3.0.1 this does no longer work. Instead of the image there is only a blue rectangle inserted if "Page" is selected, and nothing visible if "Paragraph" is selected. The only difference in these cases is that the blue rectangle covers the entire page and not only the printable region in 6.3.0.1, which is not surprising, as this was changed for release 6.3.
Comment 1 Xisco Faulí 2019-09-04 10:43:09 UTC
Regression introduced by:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=c7ff07b2dab639b901c80f1f62efee4dd3ad549b

author	Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>	2018-03-09 11:30:23 +0900
committer	Tomaž Vajngerl <quikee@gmail.com>	2018-03-09 09:41:44 +0100
commit c7ff07b2dab639b901c80f1f62efee4dd3ad549b (patch)
tree 580551b479fa8694799facbdccd967b1d0fef7ee
parent b288fdf89386446854debea35f8b8d013fec671d (diff)
remove MID_GRAPHIC_URL and related mappings, implementation

Bisected with: bibisect-linux64-6.1

Adding Cc: to Tomaž Vajngerl
Comment 2 Xisco Faulí 2019-09-04 11:58:29 UTC
@Miklos, I thought you might be interested in this issue...
Comment 3 Justin L 2020-07-30 19:05:06 UTC
Some code pointers:
gallerymenu2|background">Insert as Bac_kground</property>
sw/source/uibase/shells/basesh.cxx-void SwBaseShell::ExecuteGallery
.uno:BackgroundImage SID_GALLERY_BG_BRUSH

I thought it might just be a simple problem of XATTR_FILL_ not being used. But it looks like RES_BACKGROUND is handled via unobrushitemhelper.cxx. But the end result gives a aGraphic.Type == GraphicType::NONE.

GalleryThemePopup::BackgroundMenuSelectHdl passes the URL
libreoffice2/instdir/program/../share/gallery/computers/Computer-Desktop.png
somewhere, but so far I haven't been able to find out which black box turns that into a Graphic.
Comment 4 Stéphane Guillou (stragu) 2021-06-14 07:28:49 UTC
Reproduced in:

Version: 7.2.0.0.alpha1+ / LibreOffice Community
Build ID: bb54d6d8241a06a6772052b77b67d6a4f686426c
CPU threads: 8; OS: Linux 4.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2021-06-11_20:14:38
Calc: threaded

Steps to reproduce:

1. Open Writer
2. Open Galler sidebar
3. Click on Bullets (as some other categories don's seem to be filetypes that can be used as backgrounds)
4. Right click on an image
5. Use "Insert as Background" > Page or Paragraph
Comment 5 Justin L 2023-05-02 17:20:13 UTC
repro 7.6+
Comment 6 Justin L 2023-05-03 19:50:16 UTC
sfx2/source/appl/appuno.cxx'a TransformParameters, for "Background.*" has
{nAID = 3, pName = 0x7fffbe5393a5 "Transparent"}
{nAID = 0, pName = 0x7fffbe5393b1 "BackColor"}
{nAID = 5, pName = 0x7fffbe5393bb "Filtername"}
{nAID = 1, pName = 0x7fffbe5393c6 "Position"}

and in galbrws2.cxx, we set
        comphelper::makePropertyValue("Background.Transparent", sal_Int32( 0 )),
        comphelper::makePropertyValue("Background.BackColor", sal_Int32( - 1 )),
        comphelper::makePropertyValue("Background.URL", aURL),
        comphelper::makePropertyValue("Background.Filtername", aFilterName), 
        comphelper::makePropertyValue("Background.Position", ...Location_TILED),

Inserting the Background.Position into subId 128+1 initializes the GetGraphic too.

Well, that makes perfect sense then. Tomaz removed MID_GRAPHIC_URL which is the missing subId to handle Background.URL.
Comment 7 Commit Notification 2023-05-03 21:46:00 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/2f474d5690d0c9850ef82efa26f2f82580c09a8d

tdf#127322 svx: add back MID_GRAPHIC_URL to SvxBrush

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-04 10:58:40 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

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

tdf#127322 svx: add back MID_GRAPHIC_URL to SvxBrush

It will be available in 7.5.4.

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-05 05:08:54 UTC
Working well now. Thanks.

Fixed in
Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 5e7327e9313e2d9fe2f0defb30d3e7dc28c0b2ce
CPU threads: 16; OS: Linux 5.19; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded

Bad in
Version: 7.5.2.1 (X86_64) / LibreOffice Community
Build ID: e8bf3b441b8370f8440b0339fd9490765a8d57ca
CPU threads: 16; OS: Linux 5.19; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded