summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2022-06-30 22:23:30 +0200
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2022-07-01 21:06:46 +0200
commit5460aadf5b8539f6dc5f0215e89d0feb6730ce6f (patch)
treedfb9e77a02340c961e152ec6c19fcb7e3e6c3e8f
parentUpdate git submodules (diff)
downloadcore-5460aadf5b8539f6dc5f0215e89d0feb6730ce6f.tar.gz
core-5460aadf5b8539f6dc5f0215e89d0feb6730ce6f.zip
tdf#149603 macOS: fix workaround to use web help if Safari is the default browser
Safari won't access the local helpfiles from LO's app folder unless you enable Safari's webdeveloper menu. The workaround broke since f31f0038f5fd9254584a06665066faf9715d1cd8 switched from window to widget references and hence using a different codepath, skipping the workaround added in 44893662d510c4173e55ba27af02d0258a697a5d Change-Id: I0c59066fe1cef1514c6595e0439d31d3e60e02f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136685 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> (cherry picked from commit 82acd35e3cc5dc458930daaf6de9f41c7deb73dc) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136704
-rw-r--r--sfx2/source/appl/sfxhelp.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index 73d86cba8266..889c669241d0 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -1281,6 +1281,22 @@ bool SfxHelp::Start_Impl(const OUString& rURL, weld::Widget* pWidget, const OUSt
impl_showOnlineHelp(aHelpURL, pWidget);
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, pWidget);
+ return true;
+ }
+ }
+#endif
// If the HTML or no help is installed, but aHelpURL nevertheless references valid help content,
// that implies that help content belongs to an extension (and thus would not be available