Kaydet (Commit) 96d091d4 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Don't try to create cdefghij.klm inside the app bundle on OS X when sandboxed

Actually, we check HAVE_FEATURE_READONLY_INSTALLSET and not
HAVE_FEATURE_MACOSX_SANDBOX, but in practice we set the former only
for the latter case.

We could do this test cross-platform but I didn't bother now. Nobody
uses --enable-readonly-installset when building for Linux or Windows
anyway, I think.

(There must be more places where we could and should check
HAVE_FEATURE_READONLY_INSTALLSET.)

Change-Id: Ie54f436616a1db3119b0bc0148149784127b156d
üst 1e721077
...@@ -90,6 +90,18 @@ $(eval $(call gb_Library_use_externals,svxcore,\ ...@@ -90,6 +90,18 @@ $(eval $(call gb_Library_use_externals,svxcore,\
glew \ glew \
)) ))
ifeq ($(OS),MACOSX)
$(eval $(call gb_Library_add_cxxflags,svxcore,\
$(gb_OBJCXXFLAGS) \
))
$(eval $(call gb_Library_use_system_darwin_frameworks,svxcore,\
Foundation \
))
endif
$(eval $(call gb_Library_add_exception_objects,svxcore,\ $(eval $(call gb_Library_add_exception_objects,svxcore,\
svx/source/core/coreservices \ svx/source/core/coreservices \
svx/source/core/extedit \ svx/source/core/extedit \
......
...@@ -17,6 +17,15 @@ ...@@ -17,6 +17,15 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include <config_features.h>
#if defined(MACOSX) && defined(HAVE_FEATURE_READONLY_INSTALLSET)
#define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
#include <premac.h>
#include <Foundation/Foundation.h>
#include <postmac.h>
#endif
#include "sal/config.h" #include "sal/config.h"
#include <comphelper/processfactory.hxx> #include <comphelper/processfactory.hxx>
...@@ -236,6 +245,15 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, bool& rbDirIsReadO ...@@ -236,6 +245,15 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, bool& rbDirIsReadO
uno::Reference< sdbc::XResultSet > xResultSet( aCnt.createCursor( aProps, ::ucbhelper::INCLUDE_DOCUMENTS_ONLY ) ); uno::Reference< sdbc::XResultSet > xResultSet( aCnt.createCursor( aProps, ::ucbhelper::INCLUDE_DOCUMENTS_ONLY ) );
#if defined(MACOSX) && defined(HAVE_FEATURE_READONLY_INSTALLSET)
if( rBaseURL.GetProtocol() == INET_PROT_FILE )
{
const char *appBundle = [[[NSBundle mainBundle] bundlePath] UTF8String];
OUString path = rBaseURL.GetURLPath();
if( path.startsWith( OUString( appBundle, strlen( appBundle ), RTL_TEXTENCODING_UTF8 ) + "/" ) )
rbDirIsReadOnly = true;
}
#else
try try
{ {
// check readonlyness the very hard way // check readonlyness the very hard way
...@@ -267,7 +285,7 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, bool& rbDirIsReadO ...@@ -267,7 +285,7 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, bool& rbDirIsReadO
catch( const uno::Exception& ) catch( const uno::Exception& )
{ {
} }
#endif
if( xResultSet.is() ) if( xResultSet.is() )
{ {
uno::Reference< ucb::XContentAccess > xContentAccess( xResultSet, uno::UNO_QUERY ); uno::Reference< ucb::XContentAccess > xContentAccess( xResultSet, uno::UNO_QUERY );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment