diff options
author | Tor Lillqvist <tlillqvist@novell.com> | 2011-04-26 16:45:32 +0300 |
---|---|---|
committer | Tor Lillqvist <tlillqvist@novell.com> | 2011-04-26 16:47:44 +0300 |
commit | 1565e72e3c3e3d6d1ed2595a0cba9ce47014a6f5 (patch) | |
tree | 602f0782176b2d39832f4ea16c73cc38c7c407d7 /sfx2 | |
parent | 0c7bf5708c04d713f9fc9ad7c9797475cb095f06 (diff) |
We only support NT-based Windows
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/shutdowniconw32.cxx | 55 |
1 files changed, 2 insertions, 53 deletions
diff --git a/sfx2/source/appl/shutdowniconw32.cxx b/sfx2/source/appl/shutdowniconw32.cxx index 9bf85e0b36..5a3094a9d1 100644 --- a/sfx2/source/appl/shutdowniconw32.cxx +++ b/sfx2/source/appl/shutdowniconw32.cxx @@ -130,29 +130,6 @@ typedef struct tagMYITEM // ------------------------------- -static bool isNT() -{ - static bool bInitialized = false; - static bool bWnt = false; - - if( !bInitialized ) - { - bInitialized = true; - - OSVERSIONINFO aVerInfo; - aVerInfo.dwOSVersionInfoSize = sizeof( aVerInfo ); - if ( GetVersionEx( &aVerInfo ) ) - { - if ( aVerInfo.dwPlatformId == VER_PLATFORM_WIN32_NT ) - bWnt = true; - } - } - return bWnt; -} - - -// ------------------------------- - static void addMenuItem( HMENU hMenu, UINT id, UINT iconId, const OUString& text, int& pos, int bOwnerdraw, const OUString& module ) { MENUITEMINFOW mi; @@ -889,22 +866,7 @@ static bool FileExistsW( LPCWSTR lpPath ) bool ShutdownIcon::IsQuickstarterInstalled() { wchar_t aPath[_MAX_PATH]; - if( isNT() ) - { - GetModuleFileNameW( NULL, aPath, _MAX_PATH-1); - } - else - { - char szPathA[_MAX_PATH]; - GetModuleFileNameA( NULL, szPathA, _MAX_PATH-1); - - // calc the string wcstr len - int nNeededWStrBuffSize = MultiByteToWideChar( CP_ACP, 0, szPathA, -1, NULL, 0 ); - - // copy the string if necessary - if ( nNeededWStrBuffSize > 0 ) - MultiByteToWideChar( CP_ACP, 0, szPathA, -1, aPath, nNeededWStrBuffSize ); - } + GetModuleFileNameW( NULL, aPath, _MAX_PATH-1); OUString aOfficepath( reinterpret_cast<const sal_Unicode*>(aPath) ); int i = aOfficepath.lastIndexOf((sal_Char) '\\'); @@ -920,20 +882,7 @@ bool ShutdownIcon::IsQuickstarterInstalled() void ShutdownIcon::EnableAutostartW32( const rtl::OUString &aShortcut ) { wchar_t aPath[_MAX_PATH]; - if( isNT() ) - GetModuleFileNameW( NULL, aPath, _MAX_PATH-1); - else - { - char szPathA[_MAX_PATH]; - GetModuleFileNameA( NULL, szPathA, _MAX_PATH-1); - - // calc the string wcstr len - int nNeededWStrBuffSize = MultiByteToWideChar( CP_ACP, 0, szPathA, -1, NULL, 0 ); - - // copy the string if necessary - if ( nNeededWStrBuffSize > 0 ) - MultiByteToWideChar( CP_ACP, 0, szPathA, -1, aPath, nNeededWStrBuffSize ); - } + GetModuleFileNameW( NULL, aPath, _MAX_PATH-1); OUString aOfficepath( reinterpret_cast<const sal_Unicode*>(aPath) ); int i = aOfficepath.lastIndexOf((sal_Char) '\\'); |