[Libreoffice-commits] .: 3 commits - sfx2/inc sfx2/source

Tor Lillqvist tml at kemper.freedesktop.org
Wed Sep 28 13:51:28 PDT 2011


 sfx2/inc/sfx2/objuno.hxx             |    2 
 sfx2/source/appl/shutdowniconaqua.mm |   74 +++++++++++++++++++++--------------
 2 files changed, 47 insertions(+), 29 deletions(-)

New commits:
commit 41ebcaefd132d15616b88a5fa3a3d3aec5b4c50a
Author: Tor Lillqvist <tml at iki.fi>
Date:   Wed Sep 28 23:47:40 2011 +0300

    Add mode lines and detabify

diff --git a/sfx2/source/appl/shutdowniconaqua.mm b/sfx2/source/appl/shutdowniconaqua.mm
index 8cb96b1..d20d998 100755
--- a/sfx2/source/appl/shutdowniconaqua.mm
+++ b/sfx2/source/appl/shutdowniconaqua.mm
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -149,16 +150,16 @@ struct RecentMenuEntry
 
 class RecentFilesStringLength : public ::cppu::WeakImplHelper1< ::com::sun::star::util::XStringWidth >
 {
-	public:
-		RecentFilesStringLength() {}
-		virtual ~RecentFilesStringLength() {}
-
-		// XStringWidth
-		sal_Int32 SAL_CALL queryStringWidth( const ::rtl::OUString& aString )
-			throw (::com::sun::star::uno::RuntimeException)
-		{
-			return aString.getLength();
-		}
+    public:
+        RecentFilesStringLength() {}
+        virtual ~RecentFilesStringLength() {}
+
+        // XStringWidth
+        sal_Int32 SAL_CALL queryStringWidth( const ::rtl::OUString& aString )
+            throw (::com::sun::star::uno::RuntimeException)
+        {
+            return aString.getLength();
+        }
 };
 
 @interface RecentMenuDelegate : NSObject
@@ -228,8 +229,8 @@ class RecentFilesStringLength : public ::cppu::WeakImplHelper1< ::com::sun::star
     // insert new recent items
     for ( sal_uInt32 i = 0; i < m_pRecentFilesItems->size(); i++ )
     {
-        rtl::OUString	aMenuTitle;
-        INetURLObject	aURL( (*m_pRecentFilesItems)[i].aURL );
+        rtl::OUString   aMenuTitle;
+        INetURLObject   aURL( (*m_pRecentFilesItems)[i].aURL );
         
         if ( aURL.GetProtocol() == INET_PROT_FILE )
         {
@@ -237,8 +238,8 @@ class RecentFilesStringLength : public ::cppu::WeakImplHelper1< ::com::sun::star
             // path and abbreviate it with a special function:
             String aFileSystemPath( aURL.getFSysPath( INetURLObject::FSYS_DETECT ) );
             
-            ::rtl::OUString	aSystemPath( aFileSystemPath );
-            ::rtl::OUString	aCompactedSystemPath;
+            ::rtl::OUString aSystemPath( aFileSystemPath );
+            ::rtl::OUString aCompactedSystemPath;
             
             oslFileError nError = osl_abbreviateSystemPath( aSystemPath.pData, &aCompactedSystemPath.pData, 46, NULL );
             if ( !nError )
@@ -284,16 +285,16 @@ class RecentFilesStringLength : public ::cppu::WeakImplHelper1< ::com::sun::star
         sal_Int32 nPos = aFilter.indexOf( '|' );
         if ( nPos >= 0 )
         {
-	        rtl::OUString aFilterOptions;
+            rtl::OUString aFilterOptions;
 
-	        if ( nPos < ( aFilter.getLength() - 1 ) )
-		        aFilterOptions = aFilter.copy( nPos+1 );
+            if ( nPos < ( aFilter.getLength() - 1 ) )
+                aFilterOptions = aFilter.copy( nPos+1 );
 
-	        aArgsList[2].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterOptions" ));
-	        aArgsList[2].Value = makeAny( aFilterOptions );
+            aArgsList[2].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterOptions" ));
+            aArgsList[2].Value = makeAny( aFilterOptions );
 
-	        aFilter = aFilter.copy( 0, nPos-1 );
-	        aArgsList.realloc( ++NUM_OF_PICKLIST_ARGS );
+            aFilter = aFilter.copy( 0, nPos-1 );
+            aArgsList.realloc( ++NUM_OF_PICKLIST_ARGS );
         }
 
         aArgsList[NUM_OF_PICKLIST_ARGS-1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterName" ));
@@ -402,15 +403,15 @@ extern "C"
 
 void aqua_init_systray()
 {
-	SolarMutexGuard aGuard;
+    SolarMutexGuard aGuard;
 
     ShutdownIcon *pShutdownIcon = ShutdownIcon::getInstance();
     if( ! pShutdownIcon )
         return;
 
-	// disable shutdown
-	pShutdownIcon->SetVeto( true );
-	pShutdownIcon->addTerminateListener();
+    // disable shutdown
+    pShutdownIcon->SetVeto( true );
+    pShutdownIcon->addTerminateListener();
     
     if( ! pDefMenu )
     {
@@ -427,7 +428,7 @@ void aqua_init_systray()
             [pDockMenu setAutoenablesItems: NO];
             
             // collect the URLs of the entries in the File/New menu
-            SvtModuleOptions	aModuleOptions;
+            SvtModuleOptions    aModuleOptions;
             std::set< rtl::OUString > aFileNewAppsAvailable;
             SvtDynamicMenuOptions aOpt;
             Sequence < Sequence < PropertyValue > > aNewMenu = aOpt.GetMenu( E_NEWMENU );
@@ -525,3 +526,5 @@ void SAL_DLLPUBLIC_EXPORT aqua_shutdown_systray()
 }
 
 }
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 1db86ebf0dffe41c25d2d6e803e443daf6a32572
Author: Tor Lillqvist <tml at iki.fi>
Date:   Wed Sep 28 23:46:17 2011 +0300

    WaE: class 'RecentMenuDelegate' does not implement the 'NSMenuDelegate' protocol

diff --git a/sfx2/source/appl/shutdowniconaqua.mm b/sfx2/source/appl/shutdowniconaqua.mm
index 481447f..8cb96b1 100755
--- a/sfx2/source/appl/shutdowniconaqua.mm
+++ b/sfx2/source/appl/shutdowniconaqua.mm
@@ -49,6 +49,7 @@
 #include <vector>
 
 #include "premac.h"
+#include <objc/objc-runtime.h>
 #include <Cocoa/Cocoa.h>
 #include "postmac.h"
 
@@ -362,7 +363,17 @@ static void appendRecentMenu( NSMenu* i_pMenu, NSMenu* i_pDockMenu, const String
                         ];
     [pItem setEnabled: YES];
     NSMenu* pRecentMenu = [[NSMenu alloc] initWithTitle: getAutoreleasedString( i_rTitle ) ];
-    [pRecentMenu setDelegate: pRecentDelegate];
+
+    // When compiling against 10.6 SDK, we get the warning:
+    // class 'RecentMenuDelegate' does not implement the 'NSMenuDelegate' protocol
+
+    // No idea if that is a bogus warning, or if the way this is
+    // implemented just is so weird that the compiler gets
+    // confused. Anyway, to avoid warnings, instead of this:
+    // [pRecentMenu setDelegate: pRecentDelegate];
+    // do this:
+    objc_msgSend(pRecentMenu, @selector(setDelegate:), pRecentDelegate);
+
     [pRecentMenu setAutoenablesItems: NO];
     [pItem setSubmenu: pRecentMenu];
 
@@ -375,7 +386,11 @@ static void appendRecentMenu( NSMenu* i_pMenu, NSMenu* i_pDockMenu, const String
                         ];
         [pItem setEnabled: YES];
         pRecentMenu = [[NSMenu alloc] initWithTitle: getAutoreleasedString( i_rTitle ) ];
-        [pRecentMenu setDelegate: pRecentDelegate];
+
+        // See above
+        // [pRecentMenu setDelegate: pRecentDelegate];
+        objc_msgSend(pRecentDelegate, @selector(setDelegate:), pRecentDelegate);
+
         [pRecentMenu setAutoenablesItems: NO];
         [pItem setSubmenu: pRecentMenu];
     }
commit cf7c983126b469568792e40aabf44f161a04f266
Author: Tor Lillqvist <tml at iki.fi>
Date:   Wed Sep 28 23:25:33 2011 +0300

    Mark SfxStandaloneDocumentInfoObject as SAL_DLLPRIVATE
    
    Fixes warnings 'SfxStandaloneDocumentInfoObject' declared with greater
    visibility than the type of its field
    'SfxStandaloneDocumentInfoObject::<anonymous>' and
    'SfxStandaloneDocumentInfoObject' declared with greater visibility
    than its base 'SfxDocumentInfoO\ bject'.

diff --git a/sfx2/inc/sfx2/objuno.hxx b/sfx2/inc/sfx2/objuno.hxx
index 1c7a639..5161233 100644
--- a/sfx2/inc/sfx2/objuno.hxx
+++ b/sfx2/inc/sfx2/objuno.hxx
@@ -163,7 +163,7 @@ public:
     const SfxDocumentInfoObject& operator=( const SfxDocumentInfoObject & rOther);
 };
 
-class SfxStandaloneDocumentInfoObject: public SfxDocumentInfoObject,
+class SAL_DLLPRIVATE SfxStandaloneDocumentInfoObject: public SfxDocumentInfoObject,
                                        public ::com::sun::star::lang::XServiceInfo,
                                        public ::com::sun::star::document::XStandaloneDocumentInfo
 {


More information about the Libreoffice-commits mailing list