[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.2' - 2 commits - svx/Library_svxcore.mk svx/source
Tor Lillqvist
tml at collabora.com
Wed Oct 8 23:00:45 PDT 2014
svx/Library_svxcore.mk | 12 ++++++++++++
svx/source/gallery2/gallery1.cxx | 20 +++++++++++++++++++-
2 files changed, 31 insertions(+), 1 deletion(-)
New commits:
commit 339f99665b73742afdcfc6595244921ccd2ee019
Author: Tor Lillqvist <tml at collabora.com>
Date: Wed Oct 8 19:08:22 2014 +0300
Fix thinko. Thanks to vmiklos for noticing
Change-Id: Id4e65908cc73978205bc0858a3a809b882864b62
(cherry picked from commit d61f8185e660a6820351b8cea3ac51d344f0ab3e)
diff --git a/svx/source/gallery2/gallery1.cxx b/svx/source/gallery2/gallery1.cxx
index 8f07ffc..c50050f 100644
--- a/svx/source/gallery2/gallery1.cxx
+++ b/svx/source/gallery2/gallery1.cxx
@@ -19,7 +19,7 @@
#include <config_features.h>
-#if defined(MACOSX) && defined(HAVE_FEATURE_READONLY_INSTALLSET)
+#if defined(MACOSX) && HAVE_FEATURE_READONLY_INSTALLSET
#define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
#include <premac.h>
#include <Foundation/Foundation.h>
@@ -244,7 +244,7 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, sal_Bool& rbDirIsR
uno::Reference< sdbc::XResultSet > xResultSet( aCnt.createCursor( aProps, ::ucbhelper::INCLUDE_DOCUMENTS_ONLY ) );
-#if defined(MACOSX) && defined(HAVE_FEATURE_READONLY_INSTALLSET)
+#if defined(MACOSX) && HAVE_FEATURE_READONLY_INSTALLSET
if( rBaseURL.GetProtocol() == INET_PROT_FILE )
{
const char *appBundle = [[[NSBundle mainBundle] bundlePath] UTF8String];
commit 8c127a28fb3e5ba322cae1696a45e20359215850
Author: Tor Lillqvist <tml at collabora.com>
Date: Wed Oct 8 11:28:00 2014 +0300
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
(cherry picked from commit 96d091d43428472c2c68054ed5dca22f79adc705)
diff --git a/svx/Library_svxcore.mk b/svx/Library_svxcore.mk
index 4b8914e..cc7bc06 100644
--- a/svx/Library_svxcore.mk
+++ b/svx/Library_svxcore.mk
@@ -82,6 +82,18 @@ $(eval $(call gb_Library_use_externals,svxcore,\
icuuc \
))
+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 004570b..8f07ffc 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>
@@ -235,6 +244,15 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, sal_Bool& rbDirIsR
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
@@ -266,7 +284,7 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, sal_Bool& rbDirIsR
catch( const uno::Exception& )
{
}
-
+#endif
if( xResultSet.is() )
{
uno::Reference< ucb::XContentAccess > xContentAccess( xResultSet, uno::UNO_QUERY );
More information about the Libreoffice-commits
mailing list