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().
--
Cor Nouws - nl.OpenOffice.org marketing contact
Ontwikkelaar? Join! http://council.openoffice.org/developers.html
Gevoel niet vrij te zijn? Zie www.nieuwsteversie.nl
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@framework.openoffice.org
For additional commands, e-mail: dev-h...@framework.openoffice.org