Page 1 of 2
[Solved] Changed template, and document keep old styles
Posted: Thu Sep 30, 2021 4:35 pm
by Ponny
I changed one of my templates *.ott.
But when I open document based on this template, I get dialog box with question: Do you want to update styles in document, or you want to keep uncahged?
I select "keep old styley" and save document.
But at next opening this document I get this question again: Do you want to update styles?
NO!!!!!
How can I do this to get rid of this question again and again at every opening this document?
OpenOffice is 4.1.10
Re: Changed template, but document should keep old styles
Posted: Thu Sep 30, 2021 5:49 pm
by Hagar Delest
It is the point of a template!
Either you accept the update, or you break the link with the template. I think that the extension template changer can do that. Else, it should be possible by removing the template value in the meta.xml file of the .odt file.
Please add
[Solved] at the beginning of the title in your
first post (top of the topic) with the
*EDIT button if your issue has been fixed.
Re: Changed template, but document should keep old styles
Posted: Thu Sep 30, 2021 6:28 pm
by Ponny
Hm, maybe I not explained very good.
If I select option "Keep old styles" and then save changes,
at next opening still get this question
and in the file preferences stil exist this template.
Or another explanation:
1. Answer "No" to the question about updating styles.
2. Your document is now disociated from the template... Realy? No, I am afraid, it is not.
But this worked in some older version of OpenOffice, if I remember right. Why not in 4.1.10?
By the way, what is: the extension template changer?
Re: Changed template, but document should keep old styles
Posted: Thu Sep 30, 2021 8:04 pm
by Hagar Delest
Ponny wrote:2. Your document is now disociated from the template... Realy? No, I am afraid, it is not.
Indeed, it does not. Why should it dissociate the template? It just keeps the styles are they are, that's all.
I don't see why it would worked in previous versions.
The template changer extension aims at changing the template on a document-base or a folder-base:
https://extensions.openoffice.org/en/pr ... te-changer
I think there is an option to break the link but not 100% sure, just try.
Re: Changed template, but document should keep old styles
Posted: Thu Sep 30, 2021 11:20 pm
by Ponny
Oh, that means I have to answer NO every time I open the same file?
Re: Changed template, but document should keep old styles
Posted: Fri Oct 01, 2021 7:12 am
by Hagar Delest
Yes. Unless you break the link with the template (not that difficult once you know what to do).
Re: Changed template, but document should keep old styles
Posted: Sat Oct 02, 2021 2:23 am
by Bill
It works for me using AOO 4.1.10 on Ubuntu MATE if I keep the old styles and save the changes. Breaking the link to the template is not required. The update question reappears only if I discard the changes when closing the document.
Re: Changed template, but document should keep old styles
Posted: Sat Oct 02, 2021 6:49 pm
by Hagar Delest
Well, it works indeed with LO on Xubuntu. Not sure how it works (have not investigated, maybe it sets the template date in the meta.xml to the date the document is saved).
Re: Changed template, but document should keep old styles
Posted: Sun Oct 03, 2021 12:26 pm
by Ponny
How can I break the link between file and template with tool Template Changer template?
I installed Tempplate Changer, use it, select the same tempalte as already connected, and do it.
Then I get empty file. All file content is gone.
Test 2: I select different template and do it. I get empty file with connected template, just like test 1.
Well, then I removed this enxtensino.
The moral of this fairy tale is: Template Changer is useless for me.
Or maybe..... If this work in LibreOffice. I mean, breaking the link between file and template, just with built in functions.
Re: Changed template, but document should keep old styles
Posted: Sun Oct 03, 2021 1:38 pm
by Villeroy
With LibreOffice and AOO on my Linux laptop:
1) File > New> From Template: "Contract"
2) Save As: Test.odt
3) Open "Contract" template for editing.
4) Change font attribute of some para style.
5) Save and close tempate.
6) Open Test.odt and answer the question with "No". The document becomes "dirty". Some data changed without editing.
7) Save and close modified Test.odt
8) Reload Test.odt. No questions asked.
Re: Changed template, but document should keep old styles
Posted: Sun Oct 03, 2021 6:21 pm
by Hagar Delest
Ponny wrote:How can I break the link between file and template with tool Template Changer template?
I just tested and you need to go go the menu File > Templates > Change template (current document) and then the last entry: cut link to template. The result is that there is no more template listed in the file properties.
I also tested with the portable version of AOO 4.1.10 on my Windows machine and it works as expected: once the file is saved after having denied the styles update, the question does not come back indeed. I think I remember being in the same situation than OP in a previous version of AOO. Maybe I wasn't saving the file after all. Not sure anymore.
But that doesn't explain the issue with AOO 4.1.10 for OP...
Are you sure you do save the file? Note that to be actually saved, you have to make a change (type a space and delete it, not using undo).
Re: Changed template, but document should keep old styles
Posted: Sun Oct 03, 2021 7:36 pm
by Ponny
I made test now.
File with this problem saved as new name - for test purpose only.
Close OpenOffice and star it again.
Open this test file. Then:
1. Get this question and select "keep old styles"
2. Get status "file changed"
3. Save file
4. Make some changes
5. Save again
6. Look at File / Properties and see, Template name is stil here; Template: Matic - Bsitream Vera
I remember, few years back, in this case, the template name was dissapeared from here. And then I should get like this:
Template:
Empty.
Should I transfer my work to LibreOffice?
Re: Changed template, but document should keep old styles
Posted: Sun Oct 03, 2021 7:41 pm
by Villeroy
Ponny wrote:Should I transfer my work to LibreOffice?
There is not so much to transfer. LO is the successor to OpenOffice. It is almost the same software producing almost the same document files.
Copy any Basic macros and import your templates, auto-text, dictionaries from one user profile to the other.
Re: Changed template, but document should keep old styles
Posted: Sun Oct 03, 2021 7:54 pm
by Ponny
I forget this. Another test, I made.
But I can't find command File / Templates / Change Template.
There is only
Organise
Source Adress Book
Save
Edit
Re: Changed template, but document should keep old styles
Posted: Sun Oct 03, 2021 8:13 pm
by Hagar Delest
See (LibreOffice):
I made some tests and I think I found how it works. There is a setting for the template comparison operation in the settings.xml file: <config:config-item config:name="UpdateFromTemplate" config:type="boolean">true</config:config-item>
When you click the keep old styles button, this parameter is switched to false. Thus, it will no longer check the template, ever. Meaning that whatever change you do on your template afterward, you won't have the possibility to update again that file accordingly. Unless you link it again of course.
The takeaway is that you can't decline the update thinking that you'll be able to update the styles later at a future template update.
Edit: 13-NOV-2021: well, unless you use the extension to reactivate the link to the template. |
Ponny wrote:[...]
6. Look at File / Properties and see, Template name is stil here; Template: Matic - Bsitream Vera
Yes, you have just asked AOO/LO not to check again, you've not cut the link with the template.
Re: Changed template, but document should keep old styles
Posted: Sun Oct 03, 2021 11:29 pm
by Ponny
This your screen picture is perhaps with installed Template Changer Extension.
This ext at me produce empty file connected to selected template.
But I installed Libre Office portable for testing purpose.
And trick, when answering NO, keep old styles; then save file, works there. At next open file is no question more.
I not undestand, why this is not happend with Open Office.
By the way, in Libre Office info about connected template is not deleted, if you saj NO about updating styles.
Re: Changed template, but document should keep old styles
Posted: Sun Oct 03, 2021 11:36 pm
by Hagar Delest
I've already used the template changer extension and there is no way it can wipe out a file on its own.
As I said, there is no "cut" link out of the template changer extension (it will delete the meta info about the template, thus giving a blank field).
AOO/LO keep the name of the template (it may be useful) BUT it will deactivate the template update (when answering no to the question at opening). There is no actual need of deleting the template name if the update feature is disabled.
Note that it worked with the test I made with the portable version of AOO 4.1.10 on my Windows 10 machine, there may be something specific to your machine (maybe linked to the issue when using the template changer extension).
Please add
[Solved] at the beginning of the title in your
first post (top of the topic) with the
*EDIT button if your issue has been fixed.
Re: [UNSOLVABLE] Changed template, and document keep old sty
Posted: Tue Oct 05, 2021 12:22 am
by Ponny
I think, it is time to leave Open Office and start using Libre Office.
Re: [UNSOLVABLE] Changed template, and document keep old sty
Posted: Tue Oct 05, 2021 9:31 am
by Hagar Delest
Then it's solvable, isn't it?
Update styles or keep old styles
Posted: Thu Nov 11, 2021 5:49 pm
by Ponny
I made few tests
In OpenOffice 4.1.11 at opening I answer "keep old styles and save.
But then ask me again, and again, and again.....
I tried LibreOffice 7.1.6 portable.
There this info is saved and program ask me just once.
Then I installed LibreOffice 7.1.7.2 full version.
And then again not save, but ask about styles again and again and again.....
What for god sake I am doing wrong?
Because, I am sure, I doing something wrong.
If this happend only in one program, then maybe the error is in this program.
But if happend in two programs, I am sure, the error is not in both.
And I am sure, the portable version should work the same way as full version.
There is in fact no the exactly same number versino for portable and full.
If anybody know, what I am doing wrong, please tell me.
Ponny
Re: Update styles or keep old styles
Posted: Thu Nov 11, 2021 6:45 pm
by Ponny
Just now I made another test. And shock!
Libreoffice portable absolutely not ask question: do you want to update styles, or keep old styles?
Not at all.
What happend doc?
Ponny
Re: Update styles or keep old styles
Posted: Thu Nov 11, 2021 7:31 pm
by Hagar Delest
For the record, this is a continuation of:
Changed template, and document keep old styles.
I guess that it needs a detailed investigation with comparison of the meta.xml files of both documents.
Re: Update styles or keep old styles
Posted: Thu Nov 11, 2021 8:19 pm
by Ponny
I sent this other question. You should say now I am stupid.
I tried to continue post in this first topic. But simply I can't fint it today. I don't know why.
Re: [UNSOLVABLE] Changed template, and document keep old sty
Posted: Thu Nov 11, 2021 10:01 pm
by Hagar Delest
I've merged the topics. You can access your posts with the link
View your posts top of page, below the forum logo.
Your problem is not that easy.
Does it occur for rather new or old files? It may be a settings in former files that stick and cause problems.
Re: [UNSOLVABLE] Changed template, and document keep old sty
Posted: Fri Nov 12, 2021 4:46 am
by Ponny
In many cases in old files based on the same template. But in some cases also in new files.
Re: [UNSOLVABLE] Changed template, and document keep old sty
Posted: Fri Nov 12, 2021 10:58 am
by Hagar Delest
Can you share a file for which it does occur and another one for which it does not?
Re: Changed template, and document keep old styles
Posted: Fri Nov 12, 2021 12:00 pm
by Ponny
Feder.odt produce eternal questions,
but Afrika.odt not.
That's it I think.
Re: Changed template, and document keep old styles
Posted: Fri Nov 12, 2021 12:11 pm
by RoryOF
For what it's worth, Fedor.odt is based on Template Matic - Bistream Vera, whereas Afrika.odt is not based on any Template. Open /File /Properties, General Tab, and you will see the Template used named at the bottom.
Re: Changed template, and document keep old styles
Posted: Fri Nov 12, 2021 1:04 pm
by Ponny
Yes, I believe you.
The most important thing is, how to make connected template inactive.
You know, in Microsoft Word 6.0 - almost 30 years ago, you can select attached template, change attached template in any moment.
And.....
Make attached template active or inactive at every time, you want.
Aha, I almost forgot. I upgraded OpenOffice from 4.1.10 to 4.1.11 yesterday. Is this fact change any thing?
Re: Changed template, and document keep old styles
Posted: Fri Nov 12, 2021 2:29 pm
by Lupp
I took the opportunity to sketch a few lines of related user code.
If interested, you may visit
viewtopic.php?f=21&t=106530.