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

Noel Grandin noel at peralex.com
Wed Oct 28 23:33:21 PDT 2015


 sfx2/source/appl/shutdownicon.hxx    |   18 +++++++----------
 sfx2/source/appl/shutdowniconaqua.mm |    1 
 sfx2/source/appl/shutdowniconunx.cxx |    3 --
 sfx2/source/appl/shutdowniconw32.cxx |   37 +++++++----------------------------
 4 files changed, 16 insertions(+), 43 deletions(-)

New commits:
commit b16cdb55caceb478e01da607fb41a475496f8eff
Author: Noel Grandin <noel at peralex.com>
Date:   Wed Oct 28 12:50:59 2015 +0200

    remove the USE_APP_SHORTCUTS #define and simplify the code in the process
    
    it was effectively always being set to true
    
    Change-Id: I9e29819d10985708e37e87daa37be72b3e160c7e
    Reviewed-on: https://gerrit.libreoffice.org/19639
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
    Tested-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/sfx2/source/appl/shutdownicon.hxx b/sfx2/source/appl/shutdownicon.hxx
index 7a8f462..94b6c31 100644
--- a/sfx2/source/appl/shutdownicon.hxx
+++ b/sfx2/source/appl/shutdownicon.hxx
@@ -46,16 +46,14 @@ typedef ::cppu::WeakComponentImplHelper<
     css::lang::XServiceInfo,
     css::beans::XFastPropertySet > ShutdownIconServiceBase;
 
-#if defined(USE_APP_SHORTCUTS)
-#define WRITER_URL      "private:factory/swriter"
-#define CALC_URL        "private:factory/scalc"
-#define IMPRESS_URL     "private:factory/simpress"
-#define IMPRESS_WIZARD_URL     "private:factory/simpress?slot=6686"
-#define DRAW_URL        "private:factory/sdraw"
-#define MATH_URL        "private:factory/smath"
-#define BASE_URL        "private:factory/sdatabase?Interactive"
-#define STARTMODULE_URL ".uno:ShowStartModule"
-#endif
+#define WRITER_URL          "private:factory/swriter"
+#define CALC_URL            "private:factory/scalc"
+#define IMPRESS_URL         "private:factory/simpress"
+#define IMPRESS_WIZARD_URL  "private:factory/simpress?slot=6686"
+#define DRAW_URL            "private:factory/sdraw"
+#define MATH_URL            "private:factory/smath"
+#define BASE_URL            "private:factory/sdatabase?Interactive"
+#define STARTMODULE_URL     ".uno:ShowStartModule"
 
 class SFX2_DLLPUBLIC ShutdownIcon : public ShutdownIconServiceBase
 {
diff --git a/sfx2/source/appl/shutdowniconaqua.mm b/sfx2/source/appl/shutdowniconaqua.mm
index 81b7db2..4fd1ee5 100644
--- a/sfx2/source/appl/shutdowniconaqua.mm
+++ b/sfx2/source/appl/shutdowniconaqua.mm
@@ -29,7 +29,6 @@
 #include <sfx2/app.hxx>
 #include <sal/macros.h>
 #include "app.hrc"
-#define USE_APP_SHORTCUTS
 #include "shutdownicon.hxx"
 
 #include <com/sun/star/util/XStringWidth.hpp>
diff --git a/sfx2/source/appl/shutdowniconunx.cxx b/sfx2/source/appl/shutdowniconunx.cxx
index fc2921c..73a7750 100644
--- a/sfx2/source/appl/shutdowniconunx.cxx
+++ b/sfx2/source/appl/shutdowniconunx.cxx
@@ -30,10 +30,7 @@
 #include "tools/rc.hxx"
 #include <sfx2/app.hxx>
 #include "app.hrc"
-#ifndef __SHUTDOWNICON_HXX__
-#define USE_APP_SHORTCUTS
 #include "shutdownicon.hxx"
-#endif
 
 #ifdef ENABLE_GIO
 #include <gio/gio.h>
diff --git a/sfx2/source/appl/shutdowniconw32.cxx b/sfx2/source/appl/shutdowniconw32.cxx
index 059f947..c0096912 100644
--- a/sfx2/source/appl/shutdowniconw32.cxx
+++ b/sfx2/source/appl/shutdowniconw32.cxx
@@ -18,16 +18,11 @@
 
 #include <sal/macros.h>
 
-#ifdef WNT
-
 // necessary to include system headers without warnings
 #ifdef _MSC_VER
 #pragma warning(disable:4668 4917)
 #endif
 
-#define USE_APP_SHORTCUTS
-// the systray icon is only available on windows
-
 #include <unotools/moduleoptions.hxx>
 #include <unotools/dynamicmenuoptions.hxx>
 
@@ -56,16 +51,14 @@ using ::com::sun::star::beans::PropertyValue;
 
 #define ID_QUICKSTART               1
 #define IDM_EXIT                    2
-#if defined(USE_APP_SHORTCUTS)
-#   define IDM_OPEN                    3
-#   define IDM_WRITER                  4
-#   define IDM_CALC                    5
-#   define IDM_IMPRESS                 6
-#   define IDM_DRAW                    7
-#   define IDM_BASE                    8
-#   define IDM_TEMPLATE                9
-#   define IDM_MATH                   12
-#endif
+#define IDM_OPEN                    3
+#define IDM_WRITER                  4
+#define IDM_CALC                    5
+#define IDM_IMPRESS                 6
+#define IDM_DRAW                    7
+#define IDM_BASE                    8
+#define IDM_TEMPLATE                9
+#define IDM_MATH                    12
 #define IDM_INSTALL                 10
 
 
@@ -133,10 +126,8 @@ static void addMenuItem( HMENU hMenu, UINT id, UINT iconId, const OUString& text
             mi.cch = text.getLength();
         }
 
-#if defined(USE_APP_SHORTCUTS)
         if ( IDM_TEMPLATE == id )
             mi.fState |= MFS_DEFAULT;
-#endif
     }
 
     InsertMenuItemW( hMenu, pos++, TRUE, &mi );
@@ -157,7 +148,6 @@ static HMENU createSystrayMenu( )
     if( !pShutdownIcon )
         return NULL;
 
-#if defined(USE_APP_SHORTCUTS)
     // collect the URLs of the entries in the File/New menu
     ::std::set< OUString > aFileNewAppsAvailable;
     SvtDynamicMenuOptions aOpt;
@@ -217,7 +207,6 @@ static HMENU createSystrayMenu( )
     addMenuItem( hMenu, static_cast< UINT >( -1 ), 0, OUString(), pos, false, "" );
     addMenuItem( hMenu, IDM_OPEN,   ICON_OPEN, pShutdownIcon->GetResString( STR_QUICKSTART_FILEOPEN ), pos, true, OUString("SHELL32"));
     addMenuItem( hMenu, static_cast< UINT >( -1 ), 0, OUString(), pos, false, "" );
-#endif
     addMenuItem( hMenu, IDM_INSTALL,0, pShutdownIcon->GetResString( STR_QUICKSTART_PRELAUNCH ), pos, false, "" );
     addMenuItem( hMenu, static_cast< UINT >( -1 ), 0, OUString(), pos, false, "" );
     addMenuItem( hMenu, IDM_EXIT,   0, pShutdownIcon->GetResString( STR_QUICKSTART_EXIT ), pos, false, "" );
@@ -322,9 +311,7 @@ LRESULT CALLBACK listenerWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lP
             switch( lParam )
             {
                 case WM_LBUTTONDBLCLK:
-#if defined(USE_APP_SHORTCUTS)
                     PostMessage( aExecuterWindow, WM_COMMAND, IDM_TEMPLATE, (LPARAM)hWnd );
-#endif
                     break;
 
                 case WM_RBUTTONDOWN:
@@ -337,16 +324,13 @@ LRESULT CALLBACK listenerWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lP
                     CheckMenuItem( popupMenu, IDM_INSTALL, MF_BYCOMMAND| (ShutdownIcon::GetAutostart() ? MF_CHECKED : MF_UNCHECKED) );
 
                     EnableMenuItem( popupMenu, IDM_EXIT, MF_BYCOMMAND | (ShutdownIcon::bModalMode ? MF_GRAYED : MF_ENABLED) );
-#if defined(USE_APP_SHORTCUTS)
                     EnableMenuItem( popupMenu, IDM_OPEN, MF_BYCOMMAND | (ShutdownIcon::bModalMode ? MF_GRAYED : MF_ENABLED) );
                     EnableMenuItem( popupMenu, IDM_TEMPLATE, MF_BYCOMMAND | (ShutdownIcon::bModalMode ? MF_GRAYED : MF_ENABLED) );
-#endif
                     int m = TrackPopupMenuEx( popupMenu, TPM_RETURNCMD|TPM_LEFTALIGN|TPM_RIGHTBUTTON,
                                               pt.x, pt.y, hWnd, NULL );
                     PostMessage( hWnd, 0, 0, 0 );
                     switch( m )
                     {
-#if defined(USE_APP_SHORTCUTS)
                         case IDM_OPEN:
                         case IDM_WRITER:
                         case IDM_CALC:
@@ -356,7 +340,6 @@ LRESULT CALLBACK listenerWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lP
                         case IDM_BASE:
                         case IDM_MATH:
                             break;
-#endif
                         case IDM_INSTALL:
                             CheckMenuItem( popupMenu, IDM_INSTALL, MF_BYCOMMAND| (ShutdownIcon::GetAutostart() ? MF_CHECKED : MF_UNCHECKED) );
                             break;
@@ -417,7 +400,6 @@ LRESULT CALLBACK executerWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lP
         case WM_COMMAND:
             switch( LOWORD(wParam) )
             {
-#if defined(USE_APP_SHORTCUTS)
                 case IDM_OPEN:
                     if ( !ShutdownIcon::bModalMode )
                         ShutdownIcon::FileOpen();
@@ -444,7 +426,6 @@ LRESULT CALLBACK executerWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lP
                     if ( !ShutdownIcon::bModalMode )
                         ShutdownIcon::FromTemplate();
                 break;
-#endif
                 case IDM_INSTALL:
                     ShutdownIcon::SetAutostart( !ShutdownIcon::GetAutostart() );
                     break;
@@ -839,7 +820,5 @@ void ShutdownIcon::EnableAutostartW32( const OUString &aShortcut )
     CreateShortcut( quickstartExe, aOfficepath, aShortcut, OUString(), OUString() );
 }
 
-#endif // WNT
-
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list