From 3c06db79d32583c6953d503f547a4ac5d78e608b Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 28 Feb 2013 23:57:58 +0200 Subject: Open files from /assets (i.e. read-only) even if asked for write access It seems to work better to silently "open" a such file read-only even if write access is requested, and let write attempts, if any, fail later. Otherwise loading a document from /assets fails with that idiotic "General Error" dialog... Change-Id: I95cbe18010ec5e75ee5993faef2656ae8a2f981b --- sal/osl/unx/file.cxx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx index d1840a3ca72f..d3f6251b629b 100644 --- a/sal/osl/unx/file.cxx +++ b/sal/osl/unx/file.cxx @@ -859,11 +859,10 @@ SAL_CALL osl_openFilePath( const char *cpFilePath, oslFileHandle* pHandle, sal_u { if (uFlags & osl_File_OpenFlag_Write) { - // Or should we just silently "open" it read-only and let write - // attempts, if any, fail then later? - OSL_TRACE("osl_openFile(%s, writeable), not possible!", cpFilePath); - errno = EPERM; - return osl_File_E_PERM; + // It seems to work better to silently "open" it read-only + // and let write attempts, if any, fail later. Otherwise + // loading a document from /assets fails with that idiotic + // "General Error" dialog... } void *address; size_t size; -- cgit