[Libreoffice-commits] core.git: fpicker/source sfx2/source

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Thu Jun 6 11:06:48 UTC 2019


 fpicker/source/aqua/SalAquaFilePicker.mm |    3 ++-
 sfx2/source/appl/sfxhelp.cxx             |    4 ++--
 sfx2/source/appl/shutdowniconaqua.mm     |    6 ++++--
 3 files changed, 8 insertions(+), 5 deletions(-)

New commits:
commit d2d6b2d785ccdfb67473c5b97bcac9bd25d3407b
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Thu Jun 6 10:00:30 2019 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Thu Jun 6 13:05:34 2019 +0200

    loplugin:cstylecast (macOS)
    
    Change-Id: I4468aff1817fdb47256dff94e7f2d8aa7575137e
    Reviewed-on: https://gerrit.libreoffice.org/73586
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/fpicker/source/aqua/SalAquaFilePicker.mm b/fpicker/source/aqua/SalAquaFilePicker.mm
index 71a2940dec9e..e0137e0d665d 100644
--- a/fpicker/source/aqua/SalAquaFilePicker.mm
+++ b/fpicker/source/aqua/SalAquaFilePicker.mm
@@ -162,7 +162,8 @@ sal_Int16 SAL_CALL SalAquaFilePicker::execute()
     // So instead of:
     // [m_pDialog setDelegate:m_pDelegate];
     // do:
-    ((id (*)(id, SEL, ...))objc_msgSend)(m_pDialog, @selector(setDelegate:), m_pDelegate);
+    reinterpret_cast<id (*)(id, SEL, ...)>(objc_msgSend)(
+        m_pDialog, @selector(setDelegate:), m_pDelegate);
 
     int nStatus = runandwaitforresult();
 
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index 275b55172630..f746843e99ff 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -1076,10 +1076,10 @@ bool SfxHelp::Start_Impl(const OUString& rURL, const vcl::Window* pWindow, const
         CFURLRef pBrowser = LSCopyDefaultApplicationURLForURL(
                                 CFURLCreateWithString(
                                     kCFAllocatorDefault,
-                                    (CFStringRef)@"https://www.libreoffice.org",
+                                    static_cast<CFStringRef>(@"https://www.libreoffice.org"),
                                     NULL),
                                 kLSRolesAll, NULL);
-        if([(NSString*)CFURLGetString(pBrowser) isEqualToString:@"file:///Applications/Safari.app/"]) {
+        if([static_cast<NSString*>(CFURLGetString(pBrowser)) isEqualToString:@"file:///Applications/Safari.app/"]) {
             impl_showOnlineHelp( aHelpURL );
             return true;
         }
diff --git a/sfx2/source/appl/shutdowniconaqua.mm b/sfx2/source/appl/shutdowniconaqua.mm
index 741e89c639c7..10b6a743f740 100644
--- a/sfx2/source/appl/shutdowniconaqua.mm
+++ b/sfx2/source/appl/shutdowniconaqua.mm
@@ -351,7 +351,8 @@ static void appendRecentMenu( NSMenu* i_pMenu, NSMenu* i_pDockMenu, const OUStri
     // confused. Anyway, to avoid warnings, instead of this:
     // [pRecentMenu setDelegate: pRecentDelegate];
     // do this:
-    ((id (*)(id, SEL, ...))objc_msgSend)(pRecentMenu, @selector(setDelegate:), pRecentDelegate);
+    reinterpret_cast<id (*)(id, SEL, ...)>(objc_msgSend)(
+        pRecentMenu, @selector(setDelegate:), pRecentDelegate);
 
     [pRecentMenu setAutoenablesItems: NO];
     [pItem setSubmenu: pRecentMenu];
@@ -368,7 +369,8 @@ static void appendRecentMenu( NSMenu* i_pMenu, NSMenu* i_pDockMenu, const OUStri
 
         // See above
         // [pRecentMenu setDelegate: pRecentDelegate];
-        ((id (*)(id, SEL, ...))objc_msgSend)(pRecentMenu, @selector(setDelegate:), pRecentDelegate);
+        reinterpret_cast<id (*)(id, SEL, ...)>(objc_msgSend)(
+            pRecentMenu, @selector(setDelegate:), pRecentDelegate);
 
         [pRecentMenu setAutoenablesItems: NO];
         [pItem setSubmenu: pRecentMenu];


More information about the Libreoffice-commits mailing list