On 08/12/11 11:39, Markus Mohrhard wrote:
Hello Michael,
of course there is:
PropertyValue[] loadProps = new PropertyValue[1];
loadProps[0] = new PropertyValue();
loadProps[0].Name = "ReadOnly";
loadProps[0].Value = new Boolean(true);
now pass that as the last argument to loadComponentFromURL
This is not an option. If you set the document read-only you can at
least in calc no longer do a lot of actions. We have a function that
tests the SfxMedium if it is read only and prevent modification in
this case.
ah of course, i was wondering why most of my complex tests don't
actually use it :)
I'll work on the copy idea.
there is the following in sfx2/source/doc/docfile.cxx, function
IsSystemFileLockingUsed():
xCommonConfig =
ConfigurationHelper::openConfig("/org.openoffice.Office.Common")
ConfigurationHelper::readRelativeKey(
xCommonConfig,
"Misc/",
"UseDocumentSystemFileLocking") >>= bUseSystemLock;
which looks like it disables the creation of the lock file and uses
system file locking instead, which should go away automatically when the
office process exits or crashes.
perhaps you could try to set this configuration item, if that works...
(there may also be some way to force opening as a copy automatically,
but i don't know how)
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.