Bug 131619 - The document doesn't try to update its styles
Summary: The document doesn't try to update its styles
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.2.7.1 release
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-27 08:36 UTC by larson
Modified: 2020-03-28 15:50 UTC (History)
1 user (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 larson 2020-03-27 08:36:17 UTC
Description:
Here is one of the LibreOffice options: Tools > Options > Load/Save > General > Save URLs relative to file system.

Most of the time we want this option to be enabled, because it provides us an opportunity to insert linked images with relative paths instead of absolute ones.

Typically, we would store the linked images close to the target document - in such a case, "Save URLs relative to file system" works fine. See below.

```
thesis/
  image_1.png
  image_2.png
  thesis.odt
```

```
thesis/
  images/
    image_1.png
    image_2.png
  thesis.odt
```

The problem with "Save URLs relative to file system" option is that it works the same way for linked **templates**.

The templates - in contrast with images - are typically stored in the special "Templates" directory. On Windows, it will be %AppData%\LibreOffice\4\user\template. They don't "travel" with the document.

Hence, when you have "Save URLs relative to file system" option is enabled, and then you create a document with a template linked to it, and then you save and close it, and then you move it to another disk drive (e.g., to the disk D), the document will stop to notice any changes in the template it is linked to.

Step by step guide:

0. Ensure "Save URLs relative to file system" option is enabled.
1. Create a custom template and save it to %AppData%\LibreOffice\4\user\template. (It is assuming that this directory is located on the disk C.)
2. Create a document based on this template. Save it do disk C. Ensure the template is linked to it.
3. Close it. Move it to disk D.
4. Open the template and make some changes in its styles. Of course, save it and close it.
5. Open the moved document and notice that there is no prompt to update the styles.

Steps to Reproduce:
-

Actual Results:
-

Expected Results:
-


Reproducible: Always


User Profile Reset: Yes



Additional Info:
-
Comment 1 larson 2020-03-27 08:55:58 UTC
How it should be fixed:

The linked templates should always use absolute paths; not relative ones. That is, "Save URLs relative to file system" should not affect how they are linked.
Comment 2 Oliver Brinzing 2020-03-28 10:35:09 UTC
> Open the moved document and notice that there is no prompt to update the styles.

reproducible with:

Version: 7.0.0.0.alpha0+ (x64)
Build ID: 54d3760f7dbd759cc8de6c777c6a2154d2382f16
CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL: win; 
Locale: de-DE (de_DE); UI-Language: en-US
Calc: threaded

LO user Profile:
D:\sources\libo-core\instdir\user

meta.xml, document saved to 
a) same drive:
<meta:template xlink:type="simple" xlink:actuate="onRequest" xlink:title="HelloTest" xlink:href="../user/template/HelloTest.ott" meta:date="2020-03-28T11:15:37.978000000"/>

b) different drive:
<meta:template xlink:type="simple" xlink:actuate="onRequest" xlink:title="HelloTest" xlink:href="file:///D:/sources/libo-core/instdir/user/template/HelloTest.ott" meta:date="2020-03-28T11:11:49.175000000"/>

After a template styles update there is no info about changed styles in case a) if the document has been moved to a different path. In case b) a message box pops up:
"The template 'HelloTest' on which this document is based, has been modified. Do you want to update style based formatting according to the modified template?"

btw: I remember there was a template changer extension available:
https://extensions.libreoffice.org/extensions/template-changer
Comment 3 Oliver Brinzing 2020-03-28 12:10:57 UTC
I think there should be a configuration option to let the user know that the document template is not available. In this case, you should be able to reassign the template.
Comment 4 larson 2020-03-28 12:52:26 UTC
> I think there should be a configuration option to let the user know
> that the document template is not available. 

Yes, I think it is good idea. It could be considered as a temporary solution until LO will be able to handle it in a more elegant way.

> https://extensions.libreoffice.org/extensions/template-changer

Deprecated. One should use DocumentTemplateChanger instead.

* https://extensions.libreoffice.org/extensions/documenttemplatechanger
* https://bugs.documentfoundation.org/show_bug.cgi?id=50699