Hi Felix,
while discussing a workaround with Cor I have recognized that my
assumption regarding the necessary fix looks to be wrong.
The suggested solution is necessary and would definitely solve a
problem, but another one: ( open a template for editing in
File/Templates/Organizer, edit the template, store using
File/Templates/Save to the same location ). You could investigate the
scenario as the following task, after the fix for the issue i97969 is
ready ( it has OOo3.2, and thus more important ) .
So as the first step you should probably debug the method
"SfxDocTplService_Impl::storeTemplate()" to investigate what exactly
causes the error.
Best regards,
Mikhail.
On 06/25/09 11:41, Cor Nouws wrote:
Hi,
I just added another hint to the issue.
Regards,
Cor
Mikhail Voytenko wrote (25-6-2009 10:05)
Ups, just a small correction. It is not really necessary to let the
template document switch to a temporary medium, it is enough to call
XStorable::store() in case the URLs are equal. The mentioned call
will do all the necessary work to store the template.
Best regards,
Mikhail.
On 06/25/09 10:01, Mikhail Voytenko wrote:
Hi Felix,
please take a look to the following issue
http://qa.openoffice.org/issues/show_bug.cgi?id=97969
The most interesting comment there is the last one ( from mru ). The
problem is that the functionality tries to overwrite file that is
currently locked by office, since the template is being edited. The
solution would be to let the template temporarily switch to a
temporary medium.
As first step please take a look to the file
sfx2/source/doc/doctemplates.cxx in method
"SfxDocTplService_Impl::storeTemplate()". The problem there is that
storeToURL() is not allowed to overwrite the currently used file,
since storeToURL() let the document stay based on the current medium
and changing of this medium using the mentioned method is not
allowed. So the solution is to check whether the target URL is the
same as the URL from the document ( can be retrieved using
XStorable::getLocation() ). The URLs should be compared using the
method SfxMedium::EqualURLs().
--
Sun Microsystems GmbH Mikhail Voytenko
Nagelsweg 55 Software Engineer
20097 Hamburg Phone: (+49 40)23646 500
Germany Fax: (+49 40)23646 550
http://www.sun.de mailto:mikhail.voyte...@sun.com
Sitz der Gesellschaft:
Sun Microsystems GmbH, Sonnenallee 1, D-85551 Kirchheim-Heimstetten
Amtsgericht München: HRB 161028
Geschäftsführer: Thomas Schröder, Wolfgang Engels, Wolf Frenkel
Vorsitzender des Aufsichtsrates: Martin Häring
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@framework.openoffice.org
For additional commands, e-mail: dev-h...@framework.openoffice.org