summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--svx/Library_svxcore.mk12
-rw-r--r--svx/source/gallery2/gallery1.cxx20
2 files changed, 31 insertions, 1 deletions
diff --git a/svx/Library_svxcore.mk b/svx/Library_svxcore.mk
index 7efaf278d413..1536ee6ae551 100644
--- a/svx/Library_svxcore.mk
+++ b/svx/Library_svxcore.mk
@@ -90,6 +90,18 @@ $(eval $(call gb_Library_use_externals,svxcore,\
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,\
svx/source/core/coreservices \
svx/source/core/extedit \
diff --git a/svx/source/gallery2/gallery1.cxx b/svx/source/gallery2/gallery1.cxx
index 20fa438bad1f..e9ce8b614bcb 100644
--- a/svx/source/gallery2/gallery1.cxx
+++ b/svx/source/gallery2/gallery1.cxx
@@ -17,6 +17,15 @@
* 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 <comphelper/processfactory.hxx>
@@ -236,6 +245,15 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, bool& rbDirIsReadO
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
{
// check readonlyness the very hard way
@@ -267,7 +285,7 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, bool& rbDirIsReadO
catch( const uno::Exception& )
{
}
-
+#endif
if( xResultSet.is() )
{
uno::Reference< ucb::XContentAccess > xContentAccess( xResultSet, uno::UNO_QUERY );