summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2020-07-21 13:30:42 +0300
committerTor Lillqvist <tml@collabora.com>2020-07-21 13:54:02 +0200
commit6850d15eb8affeb9206da452fbd46e6a3682fdf6 (patch)
tree26e8a4f1e0286ce400fc81e06f13d12b85d8a554
parentc0ea5472de50589706ae5b46ea7bb78ef71cafc7 (diff)
Revert "tdf#125578 force webhelp as workaround for Safari sandboxing..."
That change also prevented local help from being displayed in the built-in viewer on macOS. But we do want local help in Collabora Office on macOS from this branch. at least for now. Also: Revert "loplugin:nullptr (macOS)", revert "loplugin:cstylecast (macOS)". This reverts commit ffed2de3e412ff35979ecea92c3d49eefe0fcc5d. This reverts commit d2d6b2d785ccdfb67473c5b97bcac9bd25d3407b. This reverts commit 44893662d510c4173e55ba27af02d0258a697a5d. Change-Id: I98805b4c39dc01c7d8e9d7f8f09abc61a103480c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99134 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tor Lillqvist <tml@collabora.com>
-rw-r--r--fpicker/source/aqua/SalAquaFilePicker.mm3
-rw-r--r--sfx2/Library_sfx.mk3
-rw-r--r--sfx2/source/appl/sfxhelp.cxx47
-rw-r--r--sfx2/source/appl/shutdowniconaqua.mm6
4 files changed, 6 insertions, 53 deletions
diff --git a/fpicker/source/aqua/SalAquaFilePicker.mm b/fpicker/source/aqua/SalAquaFilePicker.mm
index ac54fca0cc98..3ddad83529c4 100644
--- a/fpicker/source/aqua/SalAquaFilePicker.mm
+++ b/fpicker/source/aqua/SalAquaFilePicker.mm
@@ -160,8 +160,7 @@ sal_Int16 SAL_CALL SalAquaFilePicker::execute()
// So instead of:
// [m_pDialog setDelegate:m_pDelegate];
// do:
- reinterpret_cast<id (*)(id, SEL, ...)>(objc_msgSend)(
- m_pDialog, @selector(setDelegate:), m_pDelegate);
+ ((id (*)(id, SEL, ...))objc_msgSend)(m_pDialog, @selector(setDelegate:), m_pDelegate);
int nStatus = runandwaitforresult();
diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk
index cc2386fe5f82..4aa4d1727d11 100644
--- a/sfx2/Library_sfx.mk
+++ b/sfx2/Library_sfx.mk
@@ -325,9 +325,6 @@ $(eval $(call gb_Library_add_defs,sfx,\
endif
ifeq ($(OS),MACOSX)
-$(eval $(call gb_Library_add_cxxflags,sfx,\
- $(gb_OBJCXXFLAGS) \
-))
$(eval $(call gb_Library_add_objcxxobjects,sfx,\
sfx2/source/appl/shutdowniconaqua \
))
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index 6e8c4b20151b..3df45642a5df 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -24,13 +24,6 @@
#include <string_view>
#include <algorithm>
#include <cassert>
-#ifdef MACOSX
-#include <premac.h>
-#include <Foundation/NSString.h>
-#include <CoreFoundation/CFURL.h>
-#include <CoreServices/CoreServices.h>
-#include <postmac.h>
-#endif
#include <sal/log.hxx>
#include <com/sun/star/uno/Reference.h>
@@ -734,16 +727,7 @@ static bool impl_showOnlineHelp( const OUString& rURL )
try
{
-#ifdef MACOSX
- LSOpenCFURLRef(CFURLCreateWithString(kCFAllocatorDefault,
- CFStringCreateWithCString(kCFAllocatorDefault,
- aHelpLink.toUtf8().getStr(),
- kCFStringEncodingUTF8),
- nullptr),
- nullptr);
-#else
sfx2::openUriExternally(aHelpLink, false);
-#endif
return true;
}
catch (const Exception&)
@@ -922,11 +906,10 @@ bool rewriteFlatpakHelpRootUrl(OUString * helpRootUrl) {
}
#define SHTML1 "<!DOCTYPE HTML><html lang=\"en-US\"><head><meta charset=\"UTF-8\">"
-#define SHTML2 "<meta http-equiv=\"refresh\" content=\"1; url='"
-#define SHTML3 "'\"><script type=\"text/javascript\"> window.location.href = \""
+#define SHTML2 "<meta http-equiv=\"refresh\" content=\"1\" url=\""
+#define SHTML3 "\"><script type=\"text/javascript\"> window.location.href = \""
#define SHTML4 "\";</script><title>Help Page Redirection</title></head><body></body></html>"
-// use a tempfile since e.g. xdg-open doesn't support URL-parameters with file:// URLs
static bool impl_showOfflineHelp( const OUString& rURL )
{
OUString aBaseInstallPath = getHelpRootURL();
@@ -960,18 +943,10 @@ static bool impl_showOfflineHelp( const OUString& rURL )
pStream->WriteUnicodeOrByteText(aTempStr);
aTempFile.CloseStream();
+
try
{
-#ifdef MACOSX
- LSOpenCFURLRef(CFURLCreateWithString(kCFAllocatorDefault,
- CFStringCreateWithCString(kCFAllocatorDefault,
- aTempFile.GetURL().toUtf8().getStr(),
- kCFStringEncodingUTF8),
- nullptr),
- nullptr);
-#else
sfx2::openUriExternally(aTempFile.GetURL(), false);
-#endif
return true;
}
catch (const Exception&)
@@ -1090,22 +1065,6 @@ bool SfxHelp::Start_Impl(const OUString& rURL, const vcl::Window* pWindow, const
impl_showOnlineHelp( aHelpURL );
return true;
}
-#ifdef MACOSX
- if (@available(macOS 10.14, *)) {
- // Workaround: Safari sandboxing prevents it from accessing files in the LibreOffice.app folder
- // force online-help instead if Safari is default browser.
- CFURLRef pBrowser = LSCopyDefaultApplicationURLForURL(
- CFURLCreateWithString(
- kCFAllocatorDefault,
- static_cast<CFStringRef>(@"https://www.libreoffice.org"),
- nullptr),
- kLSRolesAll, nullptr);
- if([static_cast<NSString*>(CFURLGetString(pBrowser)) isEqualToString:@"file:///Applications/Safari.app/"]) {
- impl_showOnlineHelp( aHelpURL );
- return true;
- }
- }
-#endif
// If the HTML or no help is installed, but aHelpURL nevertheless references valid help content,
// that implies that this help content belongs to an extension (and thus would not be available
diff --git a/sfx2/source/appl/shutdowniconaqua.mm b/sfx2/source/appl/shutdowniconaqua.mm
index 14bb2d2efeb9..7b6b543dd19b 100644
--- a/sfx2/source/appl/shutdowniconaqua.mm
+++ b/sfx2/source/appl/shutdowniconaqua.mm
@@ -351,8 +351,7 @@ static void appendRecentMenu( NSMenu* i_pMenu, NSMenu* i_pDockMenu, const OUStri
// confused. Anyway, to avoid warnings, instead of this:
// [pRecentMenu setDelegate: pRecentDelegate];
// do this:
- reinterpret_cast<id (*)(id, SEL, ...)>(objc_msgSend)(
- pRecentMenu, @selector(setDelegate:), pRecentDelegate);
+ ((id (*)(id, SEL, ...))objc_msgSend)(pRecentMenu, @selector(setDelegate:), pRecentDelegate);
[pRecentMenu setAutoenablesItems: NO];
[pItem setSubmenu: pRecentMenu];
@@ -369,8 +368,7 @@ static void appendRecentMenu( NSMenu* i_pMenu, NSMenu* i_pDockMenu, const OUStri
// See above
// [pRecentMenu setDelegate: pRecentDelegate];
- reinterpret_cast<id (*)(id, SEL, ...)>(objc_msgSend)(
- pRecentMenu, @selector(setDelegate:), pRecentDelegate);
+ ((id (*)(id, SEL, ...))objc_msgSend)(pRecentMenu, @selector(setDelegate:), pRecentDelegate);
[pRecentMenu setAutoenablesItems: NO];
[pItem setSubmenu: pRecentMenu];