Bug 127474 - 'Break Links' to external files doesn't work
Summary: 'Break Links' to external files doesn't work
Status: RESOLVED DUPLICATE of bug 141297
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
6.1.0.0.alpha1+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
: 127630 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-09-10 12:44 UTC by Jörn Schwarz
Modified: 2021-04-06 13:42 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
Macro code to embed all images (5.95 KB, text/plain)
2019-09-29 00:23 UTC, Gerhard Weydt
Details
Macro code to embed all images, enhanced (6.71 KB, text/plain)
2020-04-18 18:49 UTC, Gerhard Weydt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jörn Schwarz 2019-09-10 12:44:29 UTC
'Break Links' to external files seems to work,
but after reopening a file all links still exist.
Comment 1 Regina Henschel 2019-09-10 20:28:47 UTC
Start with a new presentation. Insert an image as link. Save the document. Then break link (Edit menu -> Links to external files). Save it to a different name. You can already see by the file size, that the image was not embedded. Opening the zip-container shows, that the Picture sub-folder is missing.

There had been a similar problem in Writer, but that fix has not solved this problem in Impress.

It is OK in Version: 6.1.0.0.alpha0+ (x64)
Build ID: 715114595e0feec49c4d54cc5eb26f13dccb7968
CPU threads: 8; OS: Windows 10.0; UI render: default; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2018-02-06_02:09:50
Locale: de-DE (en_US); Calc: CL

It is broken in Version: 6.1.0.0.alpha0+ (x64)
Build ID: 55b9706bea5aa9b654ab39bc7d56339422e17087
CPU threads: 8; OS: Windows 10.0; UI render: default; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2018-04-18_06:02:46
Locale: en-US (en_US); Calc: CL

and still broken in Version: 6.4.0.0.alpha0+ (x64)
Build ID: fd67c89e52441387dffab1c788007271e717571b
CPU threads: 8; OS: Windows 10.0; UI render: default; VCL: win; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2019-09-03_06:15:20
Locale: de-DE (en_US); UI-Language: en-US
Calc: threaded
Comment 2 Regina Henschel 2019-09-19 00:32:24 UTC
*** Bug 127630 has been marked as a duplicate of this bug. ***
Comment 3 raal 2019-09-24 04:17:58 UTC
This seems to have begun at the below commit.
Adding Cc: to Tomaž Vajngerl; Could you possibly take a look at this one? Thanks
 0e5d984e1ebb2fdd824fdcbb7406e083923790cf is the first bad commit
commit 0e5d984e1ebb2fdd824fdcbb7406e083923790cf
Author: Norbert Thiebaud <nthiebaud@gmail.com>
Date:   Sun Apr 15 19:55:52 2018 -0700

    source 9fb7aaf570c03c8a26d763f1205fb8c890e8211a

author	Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>	2018-04-13 16:58:49 +0900
committer	Tomaž Vajngerl <quikee@gmail.com>	2018-04-16 02:52:02 +0200
commit 9fb7aaf570c03c8a26d763f1205fb8c890e8211a (patch)
tree 8f4466b24d9fcae2da5043479a57fabc662a2c43
parent ba69036c8e889237da4bb312d7c5c94066abbfd3 (diff)
Make linked graphic register into LinkedManager again
Comment 4 Gerhard Weydt 2019-09-29 00:23:22 UTC
Created attachment 154629 [details]
Macro code to embed all images

As a temporary substitute I can offer an adapted version of Bernard Marcelly's ImagesEmbedder, which he no longer provides on his homepage. Due to changes in LibreOffice his code did not work any longer, maybe that is the reason he withdrew it. I changed the statements in question and added the treatment of graphics contained within groups(recursive).
In contrast to the LibO tool not working for the moment there is no choice of graphics to be embedded; it wasn't there in Bernard's code, and I don't think it's a frequent case, so I left it out.

The code is in the attachment "Macro code to embed all images".
Comment 5 Andrew Wittenberg 2020-04-14 22:36:17 UTC
May I request that this bug be assigned higher priority?

The ability to break links is crucial -- especially since images used to be inserted as links by default.  Without the ability to remove external links, one can no longer move presentations or send them to others without the images disappearing.  This bug is a blocker for me.

The temporary workaround (the ImagesEmbedder macro) is also not working for me in LibreOffice version 6.3.4.2.  When attempting to run it, I get a popup that says "BASIC runtime error. Object variable not set", highlighting line 141 (shape.Graphic.linked = TRUE).
Comment 6 Gerhard Weydt 2020-04-14 22:59:36 UTC
I tested the macro again, exactly in 6.3.4.2, and got no error. Did you well use the macro as given in the attachment?
If you did: Maybe your presentation contains a shape of a type not contained in my test documents. Is it possible to send me a copy of your document by direct mail? You will see my mail address when pointing at my name in the header.
Comment 7 Gerhard Weydt 2020-04-18 18:49:43 UTC
Created attachment 159690 [details]
Macro code to embed all images, enhanced

In Andrew's case there was a graphic shape in the presentation which contained a null graphic object. I have no idea how this can happen, but that's not important now. As this shape was within a master page that came in via copying some slides, but was not in use now, he never looked at this page, otherwise he would have noticed that something was wrong, and would probably have deleted the page.
I have extended the program to cover the case of a null object, and to supply additional information in case of problems. It's in the attachment "Macro code to embed all images, enhanced".
Comment 8 Andrew Beck 2021-01-17 17:14:53 UTC
This bug also appears in Writer 

Version: 7.0.3.1 (x64)
Build ID: d7547858d014d4cf69878db179d326fc3483e082
CPU threads: 8; OS: Windows 10.0 Build 18362; UI render: Skia/Raster; VCL: win
Locale: en-GB (en_GB); UI: en-GB
Calc: threaded

But there is another work around.

I was able to successfully break links to image files in a document with links to multiple images IF I only broke one link at a time and then saved the document before breaking the next link. After breaking the last link it seemed to need to use "Save As" Menu to get it to embed the image in the document.
Comment 9 Xisco Faulí 2021-04-06 13:40:23 UTC
This is a duplicate of bug 141297

*** This bug has been marked as a duplicate of bug 141297 ***