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().

Best regards,
Mikhail.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@framework.openoffice.org
For additional commands, e-mail: dev-h...@framework.openoffice.org



--
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

Reply via email to