Kaydet (Commit) 0dd2e602 authored tarafından Mike Kaganski's avatar Mike Kaganski

Drop check for Windows versions we don't support

Since we dropped support of Vista and below in master toward 6.0,
those checks are needless. Removing the code that only worked in
older versions, and streamlining the resulting code.

Also, use kernel32.dll version for Windows version, instead of
deprecated GetVersionEx, and inconvenient VersionHelpers. Since both
GetVersion(Ex) and VersionHelpers (based on VerifyVersionInfo) are
subject to manifest-based behavior since Windows 8.1, this move will
hopefully result in more reliable OS version detection.

Change-Id: I3edd8fc1843e64b6a65bd3a126be6a085511f13c
Reviewed-on: https://gerrit.libreoffice.org/42905Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
Tested-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst 8b12c98e
......@@ -26,9 +26,6 @@
#include <control.h>
#include <uuids.h>
#include <evcode.h>
#ifdef _WIN32_WINNT_WINBLUE
#include <VersionHelpers.h>
#endif
#if defined _MSC_VER
#pragma warning(pop)
#endif
......@@ -69,22 +66,6 @@ LRESULT CALLBACK MediaPlayerWndProc_2( HWND hWnd,UINT nMsg, WPARAM nPar1, LPARAM
}
bool isWindowsVistaOrHigher()
{
// the Win32 SDK 8.1 deprecates GetVersionEx()
#ifdef _WIN32_WINNT_WINBLUE
return IsWindowsVistaOrGreater();
#else
// POST: return true if we are at least on Windows Vista
OSVERSIONINFO osvi;
ZeroMemory(&osvi, sizeof(osvi));
osvi.dwOSVersionInfoSize = sizeof(osvi);
GetVersionEx(&osvi);
return osvi.dwMajorVersion >= 6;
#endif
}
Player::Player( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) :
Player_BASE(m_aMutex),
mxMgr( rxMgr ),
......@@ -166,13 +147,6 @@ bool Player::create( const OUString& rURL )
// Don't use the overlay mixer on Windows Vista
// It disables the desktop composition as soon as RenderFile is called
// also causes some other problems: video rendering is not reliable
if( !isWindowsVistaOrHigher() && SUCCEEDED( CoCreateInstance( CLSID_OverlayMixer, nullptr, CLSCTX_INPROC_SERVER, IID_IBaseFilter, reinterpret_cast<void**>(&mpOMF) ) ) )
{
mpGB->AddFilter( mpOMF, L"com_sun_star_media_OverlayMixerFilter" );
if( !SUCCEEDED( mpOMF->QueryInterface( IID_IDDrawExclModeVideo, reinterpret_cast<void**>(&mpEV) ) ) )
mpEV = nullptr;
}
if( SUCCEEDED( hR = mpGB->RenderFile( reinterpret_cast<LPCWSTR>(rURL.getStr()), nullptr ) ) &&
SUCCEEDED( hR = mpGB->QueryInterface( IID_IMediaControl, reinterpret_cast<void**>(&mpMC) ) ) &&
......
......@@ -44,9 +44,6 @@ static Reference< XInterface > SAL_CALL createInstance(
{
Reference< XInterface > xDlg;
if (!IsWindowsVistaOrNewer())
std::abort(); // not supported
xDlg.set(static_cast<XFilePicker2*>(
new ::fpicker::win32::vista::VistaFilePicker(rServiceManager)));
......
......@@ -24,10 +24,6 @@
#include <rtl/ustrbuf.hxx>
#include <com/sun/star/uno/Sequence.hxx>
#ifdef _WIN32_WINNT_WINBLUE
#include <VersionHelpers.h>
#endif
using ::com::sun::star::lang::IllegalArgumentException;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::XInterface;
......@@ -52,32 +48,6 @@ const sal_Unicode AMPERSAND_SIGN = L'&';
// Windows ME VER_PLATFORM_WIN32_WINDOWS 4 90
// determine if we are running under Vista or newer OS
bool SAL_CALL IsWindowsVistaOrNewer()
{
// the Win32 SDK 8.1 deprecates GetVersionEx()
#ifdef _WIN32_WINNT_WINBLUE
return IsWindowsVistaOrGreater();
#else
OSVERSIONINFO osvi;
osvi.dwOSVersionInfoSize = sizeof(osvi);
if(!GetVersionEx(&osvi))
return false;
bool bRet = (VER_PLATFORM_WIN32_NT == osvi.dwPlatformId) &&
(osvi.dwMajorVersion >= 6);
bRet = bRet &&
(osvi.dwMinorVersion >=
sal::static_int_cast< unsigned int >(0));
return bRet;
#endif
}
void Replace( const OUString& aLabel, sal_Unicode OldChar, sal_Unicode NewChar, OUStringBuffer& aBuffer )
{
OSL_ASSERT( aLabel.getLength( ) );
......
......@@ -37,8 +37,6 @@
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/lang/IllegalArgumentException.hpp>
bool SAL_CALL IsWindowsVistaOrNewer();
// converts a soffice label to a windows label
// the following rules for character replacements
// will be done:
......
......@@ -29,37 +29,9 @@ extern "C" UINT __stdcall InstallStartmenuFolderIcon( MSIHANDLE handle )
{
std::wstring sOfficeMenuFolder = GetMsiPropertyW( handle, L"OfficeMenuFolder" );
std::wstring sDesktopFile = sOfficeMenuFolder + L"Desktop.ini";
std::wstring sIconFile = GetMsiPropertyW( handle, L"INSTALLLOCATION" ) + L"program\\soffice.exe";
// the Win32 SDK 8.1 deprecates GetVersionEx()
#ifdef _WIN32_WINNT_WINBLUE
bool const bIsVistaOrLater = IsWindowsVistaOrGreater();
#else
OSVERSIONINFOW osverinfo;
osverinfo.dwOSVersionInfoSize = sizeof(osverinfo);
GetVersionExW( &osverinfo );
bool const bIsVistaOrLater = (osverinfo.dwMajorVersion >= 6);
#endif
if (!bIsVistaOrLater)
{
WritePrivateProfileStringW(
L".ShellClassInfo",
L"IconFile",
sIconFile.c_str(),
sDesktopFile.c_str() );
WritePrivateProfileStringW(
L".ShellClassInfo",
L"IconIndex",
L"0",
sDesktopFile.c_str() );
}
// else
// {
// // at the moment there exists no Vista Icon, so we use the default folder icon.
// // add the icon into desktop/util/verinfo.rc
// }
// at the moment there exists no Vista Icon, so we use the default folder icon.
// add the icon into desktop/util/verinfo.rc
// The value '0' is to avoid a message like "You Are Deleting a System Folder" warning when deleting or moving the folder.
WritePrivateProfileStringW(
......
......@@ -64,12 +64,6 @@ std::wstring UTF8ToWString(const std::string& String);
std::wstring GetResString(int ResId);
/** Returns whether we are running
on Windows XP or not
*/
bool is_windows_xp_or_above();
/** helper function to judge if the string is only has spaces.
@returns
<TRUE>if the provided string contains only but at least one space
......
......@@ -50,10 +50,7 @@
list_view_builder_ptr create_list_view_builder(
HWND hwnd_lv, const std::wstring& col1, const std::wstring& col2)
{
if (is_windows_xp_or_above())
return list_view_builder_ptr(new winxp_list_view_builder(hwnd_lv, col1, col2));
else
return list_view_builder_ptr(new list_view_builder(hwnd_lv, col1, col2));
return list_view_builder_ptr(new list_view_builder(hwnd_lv, col1, col2));
}
......@@ -64,7 +61,9 @@ list_view_builder::list_view_builder(
row_index_(-1),
hwnd_list_view_(hwnd_list_view),
column1_title_(column1_title),
column2_title_(column2_title)
column2_title_(column2_title),
group_count_(-1),
row_count_(0)
{
}
......@@ -121,73 +120,11 @@ void list_view_builder::setup_list_view()
header = GetResString(IDS_PROPERTY_VALUE);
lvc.pszText = const_cast<wchar_t*>(header.c_str());
ListView_InsertColumnW(hwnd_list_view_, 1, &lvc);
ListView_EnableGroupView(hwnd_list_view_, TRUE);
}
void list_view_builder::insert_group(const std::wstring& /*title*/)
{
insert_item(L"", L"", false);
}
void list_view_builder::insert_item(const std::wstring& title, const std::wstring& value, bool is_editable)
{
LVITEMW lvi;
lvi.iItem = ++row_index_;
lvi.iSubItem = 0;
lvi.mask = LVIF_TEXT;
lvi.state = 0;
lvi.cchTextMax = static_cast<int>(title.size() + 1);
lvi.stateMask = 0;
lvi.pszText = const_cast<wchar_t*>(title.c_str());
if (title.length() > 0)
{
lvi.mask |= LVIF_IMAGE;
if (is_editable)
lvi.iImage = 4;
else
lvi.iImage = 3;
}
ListView_InsertItemW(hwnd_list_view_, &lvi);
lvi.mask = LVIF_TEXT;
lvi.iSubItem = 1;
lvi.pszText = const_cast<wchar_t*>(value.c_str());
ListView_SetItemW(hwnd_list_view_, &lvi);
}
HWND list_view_builder::get_list_view() const
{
return hwnd_list_view_;
}
winxp_list_view_builder::winxp_list_view_builder(
HWND hwnd_list_view,
const std::wstring& column1_title,
const std::wstring& column2_title) :
list_view_builder(hwnd_list_view, column1_title, column2_title),
group_count_(-1),
row_count_(0)
{
}
void winxp_list_view_builder::setup_list_view()
{
list_view_builder::setup_list_view();
ListView_EnableGroupView(get_list_view(), TRUE);
}
void winxp_list_view_builder::insert_group(const std::wstring& name)
void list_view_builder::insert_group(const std::wstring& name)
{
LVGROUP lvg;
......@@ -205,8 +142,7 @@ void winxp_list_view_builder::insert_group(const std::wstring& name)
}
void winxp_list_view_builder::insert_item(
const std::wstring& title, const std::wstring& value, bool is_editable)
void list_view_builder::insert_item(const std::wstring& title, const std::wstring& value, bool is_editable)
{
LVITEMW lvi;
......@@ -239,4 +175,10 @@ void winxp_list_view_builder::insert_item(
row_count_++;
}
HWND list_view_builder::get_list_view() const
{
return hwnd_list_view_;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -62,32 +62,11 @@ protected:
virtual void insert_item(const std::wstring& title, const std::wstring& value, bool is_editable);
HWND get_list_view() const;
int get_current_row() const;
int row_index_;
private:
int row_index_;
HWND hwnd_list_view_;
std::wstring column1_title_;
std::wstring column2_title_;
friend list_view_builder_ptr create_list_view_builder(HWND hwnd_lv, const std::wstring& col1, const std::wstring& col2);
};
class winxp_list_view_builder : public list_view_builder
{
protected:
winxp_list_view_builder(
HWND hwnd_list_view,
const std::wstring& column1_title,
const std::wstring& column2_title);
virtual void setup_list_view() override;
virtual void insert_group(const std::wstring& name) override;
virtual void insert_item(const std::wstring& title, const std::wstring& value, bool is_editable) override;
private:
int group_count_;
int row_count_;
......
......@@ -29,9 +29,6 @@
#pragma warning(push, 1)
#endif
#include <shellapi.h>
#ifdef _WIN32_WINNT_WINBLUE
#include <VersionHelpers.h>
#endif
#if defined _MSC_VER
#pragma warning(pop)
#endif
......@@ -170,19 +167,6 @@ HRESULT STDMETHODCALLTYPE CPropertySheet::Initialize(
HRESULT STDMETHODCALLTYPE CPropertySheet::AddPages(LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam)
{
// the Win32 SDK 8.1 deprecates GetVersionEx()
#ifdef _WIN32_WINNT_WINBLUE
bool bIsVistaOrLater = IsWindowsVistaOrGreater();
#else
// Get OS version (we don't need the summary page on Windows Vista or later)
OSVERSIONINFOW sInfoOS;
ZeroMemory( &sInfoOS, sizeof(sInfoOS) );
sInfoOS.dwOSVersionInfoSize = sizeof( sInfoOS );
GetVersionExW( &sInfoOS );
bool bIsVistaOrLater = (sInfoOS.dwMajorVersion >= 6);
#endif
std::wstring proppage_header;
PROPSHEETPAGE psp;
......@@ -197,27 +181,6 @@ HRESULT STDMETHODCALLTYPE CPropertySheet::AddPages(LPFNADDPROPSHEETPAGE lpfnAddP
HPROPSHEETPAGE hPage = nullptr;
if ( !bIsVistaOrLater )
{
proppage_header = GetResString(IDS_PROPPAGE_SUMMARY_TITLE);
psp.pszTemplate = MAKEINTRESOURCE(IDD_PROPPAGE_SUMMARY);
psp.pszTitle = proppage_header.c_str();
psp.pfnDlgProc = reinterpret_cast<DLGPROC>(CPropertySheet::PropPageSummaryProc);
hPage = CreatePropertySheetPage(&psp);
// keep this instance alive, will be released when the
// page is about to be destroyed in the callback function
if (hPage)
{
if (lpfnAddPage(hPage, lParam))
AddRef();
else
DestroyPropertySheetPage(hPage);
}
}
// add the statistics property page
proppage_header = GetResString(IDS_PROPPAGE_STATISTICS_TITLE);
......
......@@ -40,9 +40,6 @@
#pragma warning(push, 1)
#endif
#include <shellapi.h>
#ifdef _WIN32_WINNT_WINBLUE
#include <VersionHelpers.h>
#endif
#if defined _MSC_VER
#pragma warning(pop)
#endif
......@@ -67,28 +64,6 @@ namespace internal
return zipfile->HasContent("META-INF/documentsignatures.xml");
}
bool IsWindowsXP()
{
// the Win32 SDK 8.1 deprecates GetVersionEx()
#ifdef _WIN32_WINNT_WINBLUE
return IsWindowsXPOrGreater();
#else
OSVERSIONINFOW osvi;
ZeroMemory(&osvi, sizeof(osvi));
osvi.dwOSVersionInfoSize = sizeof(osvi);
GetVersionExW(&osvi);
return ((osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) &&
((osvi.dwMajorVersion >= 5) && (osvi.dwMinorVersion >= 1)));
#endif
}
/* Calculate where to position the signet image.
On Windows ME we need to shift the signet a
little bit to the left because Windows ME
puts an overlay icon to the lower right
corner of a thumbnail image so that our signet
we be hidden. */
Gdiplus::Point CalcSignetPosition(
const Gdiplus::Rect& canvas, const Gdiplus::Rect& thumbnail_border, const Gdiplus::Rect& signet)
{
......@@ -108,9 +83,6 @@ namespace internal
y = thumbnail_border.GetBottom() - signet.GetBottom() + min(signet.GetBottom() / 2, voffset);
}
if (!IsWindowsXP())
x -= 15;
return Gdiplus::Point(x,y);
}
}
......
......@@ -24,10 +24,6 @@
#include "config.hxx"
#include "utilities.hxx"
#ifdef _WIN32_WINNT_WINBLUE
#include <VersionHelpers.h>
#endif
// constants
......@@ -94,28 +90,6 @@ std::wstring GetResString(int ResId)
}
bool is_windows_xp_or_above()
{
// the Win32 SDK 8.1 deprecates GetVersionEx()
#ifdef _WIN32_WINNT_WINBLUE
return IsWindowsXPOrGreater();
#else
OSVERSIONINFOW osvi;
ZeroMemory(&osvi, sizeof(osvi));
osvi.dwOSVersionInfoSize = sizeof(osvi);
GetVersionExW(&osvi);
// LLA: check for windows xp or above (Vista)
if (osvi.dwMajorVersion > 5 ||
(5 == osvi.dwMajorVersion && osvi.dwMinorVersion >= 1))
{
return true;
}
return false;
#endif
}
/** helper function to judge if the string is only has spaces.
@returns
<TRUE>if the provided string contains only but at least one space
......
......@@ -134,9 +134,6 @@ struct SalShlData
HINSTANCE mhInst; // Instance of SAL-DLL
UINT mnWheelScrollLines; // WheelScrollLines
UINT mnWheelScrollChars; // WheelScrollChars
BOOL mbWXP; // Windows XP
BOOL mbWVista; // Windows Vista
BOOL mbW7; // Windows 7
};
extern SalShlData aSalShlData;
......
......@@ -20,6 +20,7 @@
#include <setupapi.h>
#include <algorithm>
#include <cstdint>
#include <memory>
#include <osl/file.hxx>
#include <rtl/bootstrap.hxx>
......@@ -149,14 +150,14 @@ uint32_t ParseIDFromDeviceID(const OUString &key, const char *prefix, int length
// OS version in 16.16 major/minor form
// based on http://msdn.microsoft.com/en-us/library/ms724834(VS.85).aspx
enum {
kWindowsUnknown = 0,
kWindowsXP = 0x00050001,
kWindowsUnknown = 0,
kWindowsXP = 0x00050001,
kWindowsServer2003 = 0x00050002,
kWindowsVista = 0x00060000,
kWindows7 = 0x00060001,
kWindows8 = 0x00060002,
kWindows8_1 = 0x00060003,
kWindows10 = 0x000A0000 // Major 10 Minor 0
kWindowsVista = 0x00060000,
kWindows7 = 0x00060001,
kWindows8 = 0x00060002,
kWindows8_1 = 0x00060003,
kWindows10 = 0x000A0000 // Major 10 Minor 0
};
......@@ -189,23 +190,38 @@ int32_t WindowsOSVersion()
{
static int32_t winVersion = kWindowsUnknown;
OSVERSIONINFO vinfo;
if (winVersion == kWindowsUnknown)
{
vinfo.dwOSVersionInfoSize = sizeof (vinfo);
#pragma warning(push)
#pragma warning(disable:4996)
SAL_WNODEPRECATED_DECLARATIONS_PUSH
if (!GetVersionEx(&vinfo))
SAL_WNODEPRECATED_DECLARATIONS_POP
{
#pragma warning(pop)
winVersion = kWindowsUnknown;
}
else
// GetVersion(Ex) and VersionHelpers (based on VerifyVersionInfo) API are
// subject to manifest-based behavior since Windows 8.1, so give wrong results.
// Another approach would be to use NetWkstaGetInfo, but that has some small
// reported delays (some milliseconds), and might get slower in domains with
// poor network connections.
// So go with a solution described at https://msdn.microsoft.com/en-us/library/ms724429
HINSTANCE hLibrary = LoadLibraryW(L"kernel32.dll");
if (hLibrary != nullptr)
{
winVersion = int32_t(vinfo.dwMajorVersion << 16) + vinfo.dwMinorVersion;
wchar_t szPath[MAX_PATH];
DWORD dwCount = GetModuleFileNameW(hLibrary, szPath, SAL_N_ELEMENTS(szPath));
FreeLibrary(hLibrary);
if (dwCount != 0 && dwCount < SAL_N_ELEMENTS(szPath))
{
dwCount = GetFileVersionInfoSizeW(szPath, NULL);
if (dwCount != 0)
{
std::unique_ptr<char> ver(new char[dwCount]);
if (GetFileVersionInfoW(szPath, 0, dwCount, ver.get()) != FALSE)
{
void* pBlock = nullptr;
UINT dwBlockSz = 0;
if (VerQueryValueW(ver.get(), L"\\", &pBlock, &dwBlockSz) != FALSE && dwBlockSz >= sizeof(VS_FIXEDFILEINFO))
{
VS_FIXEDFILEINFO *vinfo = reinterpret_cast<VS_FIXEDFILEINFO *>(pBlock);
winVersion = int32_t(vinfo->dwProductVersionMS);
}
}
}
}
}
}
......
......@@ -197,6 +197,28 @@ namespace
return getHexString(pBuffer, RTL_DIGEST_LENGTH_MD5);
}
OString getDeviceInfoString()
{
#if defined( SAL_UNX ) && !defined( MACOSX ) && !defined( IOS )&& !defined( ANDROID )
const X11OpenGLDeviceInfo aInfo;
return aInfo.GetOS() +
aInfo.GetOSRelease() +
aInfo.GetRenderer() +
aInfo.GetVendor() +
aInfo.GetVersion();
#elif defined( _WIN32 )
const WinOpenGLDeviceInfo aInfo;
return OUStringToOString(aInfo.GetAdapterVendorID(), RTL_TEXTENCODING_UTF8) +
OUStringToOString(aInfo.GetAdapterDeviceID(), RTL_TEXTENCODING_UTF8) +
OUStringToOString(aInfo.GetDriverVersion(), RTL_TEXTENCODING_UTF8) +
OString::number(aInfo.GetWindowsVersion());
#else
return OString(reinterpret_cast<const char*>(glGetString(GL_VENDOR))) +
OString(reinterpret_cast<const char*>(glGetString(GL_RENDERER))) +
OString(reinterpret_cast<const char*>(glGetString(GL_VERSION)));
#endif
}
OString getStringDigest( const OUString& rVertexShaderName,
const OUString& rFragmentShaderName,
const OString& rPreamble )
......@@ -206,27 +228,7 @@ namespace
OString aFragmentShaderSource = getShaderSource( rFragmentShaderName );
// get info about the graphic device
#if defined( SAL_UNX ) && !defined( MACOSX ) && !defined( IOS )&& !defined( ANDROID )
static const X11OpenGLDeviceInfo aInfo;
static const OString aDeviceInfo (
aInfo.GetOS() +
aInfo.GetOSRelease() +
aInfo.GetRenderer() +
aInfo.GetVendor() +
aInfo.GetVersion() );
#elif defined( _WIN32 )
static const WinOpenGLDeviceInfo aInfo;
static const OString aDeviceInfo (
OUStringToOString( aInfo.GetAdapterVendorID(), RTL_TEXTENCODING_UTF8 ) +
OUStringToOString( aInfo.GetAdapterDeviceID(), RTL_TEXTENCODING_UTF8 ) +
OUStringToOString( aInfo.GetDriverVersion(), RTL_TEXTENCODING_UTF8 ) +
OString::number( aInfo.GetWindowsVersion() ) );
#else
static const OString aDeviceInfo (
OString( reinterpret_cast<const char*>(glGetString(GL_VENDOR)) ) +
OString( reinterpret_cast<const char*>(glGetString(GL_RENDERER)) ) +
OString( reinterpret_cast<const char*>(glGetString(GL_VERSION)) ) );
#endif
static const OString aDeviceInfo (getDeviceInfoString());
OString aMessage;
aMessage += rPreamble;
......
......@@ -67,9 +67,6 @@
#include <gdiplus.h>
#include <shlobj.h>
#ifdef _WIN32_WINNT_WINBLUE
#include <VersionHelpers.h>
#endif
#include "postwin.h"
#if defined _MSC_VER
......@@ -359,35 +356,6 @@ SalInstance* CreateSalInstance()
{
SalData* pSalData = GetSalData();
// determine the windows version
aSalShlData.mbWXP = 0;
aSalShlData.mbWVista = 0;
aSalShlData.mbW7 = 0;
// the Win32 SDK 8.1 deprecates GetVersionEx()
#ifdef _WIN32_WINNT_WINBLUE
aSalShlData.mbWXP = IsWindowsXPOrGreater() ? 1 : 0;
aSalShlData.mbWVista = IsWindowsVistaOrGreater() ? 1 : 0;
aSalShlData.mbW7 = IsWindows7OrGreater() ? 1 : 0;
#else
OSVERSIONINFO aVersionInfo;
memset( &aVersionInfo, 0, sizeof(aVersionInfo) );
aVersionInfo.dwOSVersionInfoSize = sizeof( aVersionInfo );
if (GetVersionEx( &aVersionInfo ))
{
// Windows XP ?
if (aVersionInfo.dwMajorVersion > 5 ||
(aVersionInfo.dwMajorVersion == 5 && aVersionInfo.dwMinorVersion >= 1))
aSalShlData.mbWXP = 1;
// Windows Vista ?
if (aVersionInfo.dwMajorVersion >= 6)
aSalShlData.mbWVista = 1;
// Windows 7 ?
if (aVersionInfo.dwMajorVersion > 6 ||
(aVersionInfo.dwMajorVersion == 6 && aVersionInfo.dwMinorVersion >= 1))
aSalShlData.mbW7 = 1;
}
#endif
pSalData->mnAppThreadId = GetCurrentThreadId();
// register frame class
......@@ -414,8 +382,7 @@ SalInstance* CreateSalInstance()
return nullptr;
// shadow effect for popups on XP
if( aSalShlData.mbWXP )
aWndClassEx.style |= CS_DROPSHADOW;
aWndClassEx.style |= CS_DROPSHADOW;
aWndClassEx.lpszClassName = SAL_TMPSUBFRAME_CLASSNAMEW;
if ( !RegisterClassExW( &aWndClassEx ) )
return nullptr;
......@@ -865,50 +832,47 @@ void WinSalInstance::AddToRecentDocumentList(const OUString& rFileUrl, const OUS
if (osl::FileBase::E_None == rc)
{
if ( aSalShlData.mbW7 )
{
IShellItem* pShellItem = nullptr;
IShellItem* pShellItem = nullptr;
HRESULT hr = SHCreateItemFromParsingName(SAL_W(system_path.getStr()), nullptr, IID_PPV_ARGS(&pShellItem));
HRESULT hr = SHCreateItemFromParsingName(SAL_W(system_path.getStr()), nullptr, IID_PPV_ARGS(&pShellItem));
if ( SUCCEEDED(hr) && pShellItem )
if ( SUCCEEDED(hr) && pShellItem )
{
OUString sApplicationName;
if ( rDocumentService == "com.sun.star.text.TextDocument" ||
rDocumentService == "com.sun.star.text.GlobalDocument" ||
rDocumentService == "com.sun.star.text.WebDocument" ||
rDocumentService == "com.sun.star.xforms.XMLFormDocument" )
sApplicationName = "Writer";
else if ( rDocumentService == "com.sun.star.sheet.SpreadsheetDocument" ||
rDocumentService == "com.sun.star.chart2.ChartDocument" )
sApplicationName = "Calc";
else if ( rDocumentService == "com.sun.star.presentation.PresentationDocument" )
sApplicationName = "Impress";
else if ( rDocumentService == "com.sun.star.drawing.DrawingDocument" )
sApplicationName = "Draw";
else if ( rDocumentService == "com.sun.star.formula.FormulaProperties" )
sApplicationName = "Math";
else if ( rDocumentService == "com.sun.star.sdb.DatabaseDocument" ||
rDocumentService == "com.sun.star.sdb.OfficeDatabaseDocument" ||
rDocumentService == "com.sun.star.sdb.RelationDesign" ||
rDocumentService == "com.sun.star.sdb.QueryDesign" ||
rDocumentService == "com.sun.star.sdb.TableDesign" ||