Bug 128216 - UI: Relative paths should be displayed as relative
Summary: UI: Relative paths should be displayed as relative
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 135506 139317 146064 (view as bug list)
Depends on:
Blocks: Files-Linked
  Show dependency treegraph
 
Reported: 2019-10-17 15:31 UTC by John
Modified: 2021-12-06 19:24 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John 2019-10-17 15:31:59 UTC
Description:
1. Open Writer. Ensure your LibreOffice options are correct:
     Menu > Tools > Options > Load/Save > General >
     Save URLs relative to file system = True
2. Insert some linked image. The image should be in the same directory with the document.
3. Close Writer. Move the document with the image to some another directory.
4. Open Writer again. Ensure the image is visible.
5. Close Writer again. Move the image outside the directory. The image should not be visible in the document anymore.

In case all these steps works correctly for you, you know that the image is really the linked one, and linked via _relative_ path.

But then, if you look at this relative path, you will notice that it looks like the absolute one:

  Open image properties window > Open Image tab >
  See that the path in the File Name field looks 
  as the absolute one.

This issue leads to the following drawbacks:

1. First of all, this is just confusing. The user expect that relative paths should be displayed as relative. Therefore, when they see the relative path which looks like the absolute one, they think that this one is absolute. 

2. In case the user need to change the relative paths into the absolute ones (or vice versa), and they already changed them, there will be no visual "signal" about this change. I.e. the paths "before" and "after" will look the same.

3. In case the relative paths will be displayed as relative (and absolute as absolute), it will be much more intuitive to change them. Something like:

  Click on the linked image > Find its path >
  change it from `./foo/bar.png` 
  to `file:///C:/Users/John/Desktop/images/bar.png`


Steps to Reproduce:
-

Actual Results:
-

Expected Results:
-


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 Dieter 2020-01-21 16:39:59 UTC
(In reply to John from comment #0)

> 2. Insert some linked image. The image should be in the same directory with
> the document.

Please excuse me, but I don't know how to insert a linked image (I always insert an image with Insert => Image)
Comment 2 Oliver Brinzing 2020-01-21 17:40:53 UTC
(In reply to Dieter Praas from comment #1)
> (In reply to John from comment #0)
> 
> > 2. Insert some linked image. The image should be in the same directory with
> > the document.
> 
> Please excuse me, but I don't know how to insert a linked image (I always
> insert an image with Insert => Image)

The File Open dialog should have a "[ ] Link" checkbox
Comment 3 Buovjaga 2020-05-01 18:00:42 UTC
Confirmed and seems like a useful request.
Comment 4 S.Zosgornik 2020-12-18 20:12:38 UTC
*** Bug 135506 has been marked as a duplicate of this bug. ***
Comment 5 Heiko Tietze 2021-11-29 10:29:20 UTC
*** Bug 139317 has been marked as a duplicate of this bug. ***
Comment 6 m.a.riosv 2021-12-06 18:48:44 UTC
*** Bug 146064 has been marked as a duplicate of this bug. ***
Comment 7 pb 2021-12-06 19:21:14 UTC
There are alternate solutions which might be easier to implement.

For example, on the properties dialog for the image, and/or on the file selection dialog, there should be a check box[es] for "relative"/"absolute" in addition to the current "link".

Right now this behavior is controlled, apparently, by
Menu/Tools/Options/LIbre Office/Load & Save/General - Save URLs relative to file system.

What I suggested above would allow choice of relative/absolute by image.  If that is too much trouble to implement, it would be sufficient to include a note on the properties dialog and the file selection dialog to the effect of "file link will be saved as [relative|absolute] according to global settings."  (as the case may be).  That only requires sending an extra 1 bit message to the dialogs, without the need to handle more user input.

(It would be really nice if "global settings" were a hyperlink that opened the place to set it.)

Many users on Windows or Mac might not even know what a relative path is, or the notation for it.  If so, then a path such as "../../foo/myimage.jpg" might confuse them.  Instead the properties dialog could say "file path resolves to:"

There is also another problem with displaying the relative path.  Until the document is saved, the target path for the document is not known.  Presumably, the relative path that is written into the document is relative to the saved location.
Comment 8 pb 2021-12-06 19:24:25 UTC
By "target path for the document is not known" above, I mean the relative path that needs to be stored with the document, in case that was not clear.