summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-10-28 12:50:59 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-10-29 06:33:00 +0000
commitb16cdb55caceb478e01da607fb41a475496f8eff (patch)
tree6dab9ad830fa619d393e762288853ec2c9932d62
parent913a2d3692f0dc36c41bfeca2cad7e936b189a30 (diff)
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@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r--sfx2/source/appl/shutdownicon.hxx18
-rw-r--r--sfx2/source/appl/shutdowniconaqua.mm1
-rw-r--r--sfx2/source/appl/shutdowniconunx.cxx3
-rw-r--r--sfx2/source/appl/shutdowniconw32.cxx37
4 files changed, 16 insertions, 43 deletions
diff --git a/sfx2/source/appl/shutdownicon.hxx b/sfx2/source/appl/shutdownicon.hxx
index 7a8f46281d3b..94b6c31cdcd4 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 81b7db29a315..4fd1ee54839f 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 fc2921cb788e..73a775048910 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 059f94732f22..c0096912ed1f 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: */