Kaydet (Commit) 52723210 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

We only support NT-based Windows

üst 33f178c1
...@@ -128,29 +128,6 @@ typedef struct tagMYITEM ...@@ -128,29 +128,6 @@ typedef struct tagMYITEM
UINT iconId; UINT iconId;
} MYITEM; } MYITEM;
// -------------------------------
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 ) static void addMenuItem( HMENU hMenu, UINT id, UINT iconId, const OUString& text, int& pos, int bOwnerdraw, const OUString& module )
...@@ -889,22 +866,7 @@ static bool FileExistsW( LPCWSTR lpPath ) ...@@ -889,22 +866,7 @@ static bool FileExistsW( LPCWSTR lpPath )
bool ShutdownIcon::IsQuickstarterInstalled() bool ShutdownIcon::IsQuickstarterInstalled()
{ {
wchar_t aPath[_MAX_PATH]; wchar_t aPath[_MAX_PATH];
if( isNT() ) GetModuleFileNameW( NULL, aPath, _MAX_PATH-1);
{
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 );
}
OUString aOfficepath( reinterpret_cast<const sal_Unicode*>(aPath) ); OUString aOfficepath( reinterpret_cast<const sal_Unicode*>(aPath) );
int i = aOfficepath.lastIndexOf((sal_Char) '\\'); int i = aOfficepath.lastIndexOf((sal_Char) '\\');
...@@ -920,20 +882,7 @@ bool ShutdownIcon::IsQuickstarterInstalled() ...@@ -920,20 +882,7 @@ bool ShutdownIcon::IsQuickstarterInstalled()
void ShutdownIcon::EnableAutostartW32( const rtl::OUString &aShortcut ) void ShutdownIcon::EnableAutostartW32( const rtl::OUString &aShortcut )
{ {
wchar_t aPath[_MAX_PATH]; wchar_t aPath[_MAX_PATH];
if( isNT() ) GetModuleFileNameW( NULL, aPath, _MAX_PATH-1);
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 );
}
OUString aOfficepath( reinterpret_cast<const sal_Unicode*>(aPath) ); OUString aOfficepath( reinterpret_cast<const sal_Unicode*>(aPath) );
int i = aOfficepath.lastIndexOf((sal_Char) '\\'); int i = aOfficepath.lastIndexOf((sal_Char) '\\');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment