Issue 121304

Summary: Allow detaching a document from the template that was used to create it
Product: General Reporter: Andrea Pescetti <pescetti>
Component: uiAssignee: AOO issues mailing list <issues>
Status: CONFIRMED --- QA Contact:
Severity: Normal    
Priority: P3 CC: argasoft, marcelly.bernard, oliver.brinzing
Version: 3.4.1   
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Latest Confirmation in: ---
Developer Difficulty: ---

Description Andrea Pescetti 2012-11-02 17:34:50 UTC
As discussed on ooo-utenti-it, it seems that when a document is created starting from a template (a "registered" one, i.e., one found under New - Templates) the file stores the template name, that can be seen in File - Properties.

If the template is then removed using the template management functions, this does not affect the document, so all information needed to render the document is in the document and not in the template.

The GUI, however, does not provide a "Detach" button allowing to forget the link between the document and the template used to create it. This can be useful to avoid issues with changed styles.

[ Reported by Arnaldo Gaudenzi on ooo-progetto-it ]
Comment 1 Oliver Brinzing 2012-11-04 15:20:57 UTC
this is not the only problem, changing the template is not possible too.
i added an issue last year:

updating a document from a template which is not in a template path is difficult
https://issues.apache.org/ooo/show_bug.cgi?id=96632
Comment 2 bmarcelly 2012-11-06 14:25:09 UTC
For the simple problem of detaching the current document from its template, add this routine in a library of My Macros.

Sub DetachFromTemplate
Dim d As New com.sun.star.util.DateTime
ThisComponent.DocumentProperties.TemplateName = ""
ThisComponent.DocumentProperties.TemplateURL  = ""
ThisComponent.DocumentProperties.TemplateDate = d
ThisComponent.store
End Sub

Run it from a button or a shortcut. It works for Writer, Calc, Draw, Impress documents.