Bug 67274

Summary: Gallery: Do not link inserted images
Product: LibreOffice Reporter: Samuel Mehrbrodt <s.mehrbrodt>
Component: LibreofficeAssignee: Not Assigned <libreoffice-bugs>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: medium CC: barta, jmadero.dev, libreoffice, lohmaier, qubit, rb.henschel, s.mehrbrodt
Version: 4.2.0.0.alpha0+ Master   
Hardware: Other   
OS: All   
Whiteboard: target:4.2.0 Confirmed:4.2.0.0.beta1:Ubuntu Confirmed:4.2.0.0.alpha0+:Unknown
i915 platform: i915 features:
Bug Depends on: 69079    
Bug Blocks:    

Description Samuel Mehrbrodt 2013-07-24 20:49:47 UTC
Go to Gallery->Backgrounds
Right-click on a background and choose Insert->Background->Page or Paragraph

The page style has then a link like this:
<style:background-image xlink:href="../../../../opt/libreoffice4.0/program/../share/gallery/www-back/ice-blue.jpg" xlink:type="simple" xlink:actuate="onLoad"/>

and the paragraph style looks like this in the document structure:
<style:background-image xlink:href="../../../../opt/libreoffice4.0/program/../share/gallery/www-back/ice-light.jpg" xlink:type="simple" xlink:actuate="onLoad"/>

Instead of being linked, these images should be embedded in the document structure. Currently you only have to move the document to a different folder and the image won't load anymore.
Comment 1 Tomaz Vajngerl 2013-07-25 08:44:00 UTC
Confirmed.

Linking is always "dangerous" and I think any linking to gallery images should be removed. Additionally if a user tries to link to any external resource, he should be warned about the consequences of his action.
Comment 2 Samuel Mehrbrodt 2013-07-27 12:39:23 UTC
You are right, it should not be possible to link to gallery images. We discussed this also on the UX-Advise list: http://nabble.documentfoundation.org/Libreoffice-ux-advise-Remove-outdated-Gallery-images-tp4067129p4067444.html

I changed the title accordingly.
Comment 3 Commit Notification 2013-07-29 13:13:40 UTC
Samuel Mehrbrodt committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=4e3f7d32b80fcb44f20abe634a2035d2c90c9e08

fdo#67274 Always embed images from gallery



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 4 Samuel Mehrbrodt 2013-08-04 11:24:32 UTC
The mentioned commit fixes this problem only partly.
The Problem described in Comment 0 still exists.
Comment 5 Samuel Mehrbrodt 2013-09-22 09:23:53 UTC
Can someone else please have a look at it?
The Background URL is set here: http://opengrok.libreoffice.org/xref/core/svx/source/gallery2/galbrws2.cxx#372

Then the Image gets inserted here: http://opengrok.libreoffice.org/xref/core/sw/source/ui/shells/basesh.cxx#2662

Somewhere in between the SvxBrushItem (the background) is created as a linked graphic and that must be changed. But I don't know where that happens.

Can someone give a hint or take this over?

I mark this as MAB because it makes Documents depend on hard-coded image paths.
Comment 6 Samuel Mehrbrodt 2013-11-01 15:30:59 UTC
(Adding the Dev list to CC)
I'd need some help with the Fix for this bug. Can someone have a look at Comment 5 and help me with this?
Comment 7 Michael Meeks 2013-11-05 12:31:47 UTC
No idea but I assume code like this:

    706                 const Graphic aGrf( pGalleryItem->GetGraphic() );
    707 
    708                 if ( nSelType & nsSelectionType::SEL_GRF )
    709                     rSh.ReRead( aGrfName, aFltName, &aGrf );
    710                 else
    711                     rSh.Insert( aGrfName, aFltName, aGrf );

Creates that Graphic - and that (somehow) the GraphicObject that gets created from that gets tagged as linked somehow - perhaps chasing rSh.Insert() and re-read to see what parameters they take might be useful (?)
Comment 8 Robinson Tryon (qubit) 2013-11-24 05:43:59 UTC
CONFIRMED on LO 4.2.0.0.beta1 + Ubuntu 12.04.3

REPRO:
- Open LibreOffice
- Tools -> Gallery -> Backgrounds
- Right-click on aqua (first background in list) and choose: Insert as Background -> Page
- Right-click on the changed page background and select 'Page'
- Select 'Background' tab
- Under the 'File' section, the 'Link' checkbox is checked, and the filepath listed below the 'Browse' button is to a file in 'share/gallery' on disk.

EXPECTED:
- The background would be embedded in the file.
- The 'Link' checkbox would be unchecked

Adding repro information to whiteboard
Comment 9 Christian Lohmaier 2014-01-16 14:08:15 UTC
not a MAB in my opionion.. 
* has always been that way for decades, 
* graphic as page backgrounds are not a very common usecase
* easy workaround/manual fix (Goto Format|Page → Background and uncheck [ ] Link)

Not saying that this shouldn't be fixed, but that's not so important to have for 4.2.0 (4.2.x is enough IMHO)
Comment 10 Björn Michaelsen 2014-01-17 09:58:35 UTC
(This is an automated message.)

Setting priority to highest as this is a 4.0 MAB. This is part of an effort to make the importance of MAB reflected in priority too.
Comment 11 chtfn 2014-02-13 23:19:22 UTC
Moving to mab4.1 (Bug 60270) because:
- 4.0 reached EOL (End Of Life)
- bug confirmed in later version
Comment 12 tommy27 2014-05-04 08:41:56 UTC
if issue is still present in 4.2.x current releases please move it to the mab4.2 list (Bug 65675) since 4.1.x is END OF LIFE
Comment 13 Joel Madero 2014-05-23 02:35:10 UTC
Removing from MAB - this is an enhancement and does not belong on mab list. Marking as enhancement also. The product works as designed, the request is just to change the design which by definition is an enhancement.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.