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

Drop Win9x stuff

üst f1c4c90a
...@@ -37,31 +37,22 @@ ...@@ -37,31 +37,22 @@
// the service name is a description of a set of // the service name is a description of a set of
// interfaces (is the same as component categories in COM) // interfaces (is the same as component categories in COM)
#define TMPL95_FILEOPEN_READONLY_VERSION_BOX_ID 1000
#define TMPL2000_FILEOPEN_READONLY_VERSION_BOX_ID 1001 #define TMPL2000_FILEOPEN_READONLY_VERSION_BOX_ID 1001
#define TMPL95_FILEOPEN_LINK_PREVIEW_BOX_ID 2000
#define TMPL2000_FILEOPEN_LINK_PREVIEW_BOX_ID 2001 #define TMPL2000_FILEOPEN_LINK_PREVIEW_BOX_ID 2001
#define TMPL95_FILEOPEN_AUTOEXT_TEMPLATE_BOX_ID 3000
#define TMPL2000_FILEOPEN_AUTOEXT_TEMPLATE_BOX_ID 3001 #define TMPL2000_FILEOPEN_AUTOEXT_TEMPLATE_BOX_ID 3001
#define TMPL95_FILESAVE_AUTOEXT_PASSWORD_BOX_ID 4000
#define TMPL2000_FILESAVE_AUTOEXT_PASSWORD_BOX_ID 4001 #define TMPL2000_FILESAVE_AUTOEXT_PASSWORD_BOX_ID 4001
#define TMPL95_AUTOEXT_PASSWORD_FILTEROPTION_BOX 5000
#define TMPL2000_AUTOEXT_PASSWORD_FILTEROPTION_BOX 5001 #define TMPL2000_AUTOEXT_PASSWORD_FILTEROPTION_BOX 5001
#define TMPL95_PLAY_PUSHBUTTON 6000
#define TMPL2000_PLAY_PUSHBUTTON 6001 #define TMPL2000_PLAY_PUSHBUTTON 6001
#define TMPL95_AUTOEXT_SELECTION_BOX 7000
#define TMPL2000_AUTOEXT_SELECTION_BOX 7001 #define TMPL2000_AUTOEXT_SELECTION_BOX 7001
#define TMPL95_FILEOPEN_LINK_PREVIEW_BOX_SIMPLE_ID 8000
#define TMPL2000_FILEOPEN_LINK_PREVIEW_BOX_SIMPLE_ID 8001 #define TMPL2000_FILEOPEN_LINK_PREVIEW_BOX_SIMPLE_ID 8001
#define TMPL95_FILESAVE_AUTOEXT 9000
#define TMPL2000_FILESAVE_AUTOEXT 9001 #define TMPL2000_FILESAVE_AUTOEXT 9001
// the service names // the service names
......
...@@ -102,18 +102,8 @@ CFileOpenDialog::CFileOpenDialog( ...@@ -102,18 +102,8 @@ CFileOpenDialog::CFileOpenDialog(
m_pfnBaseDlgProc(0) m_pfnBaseDlgProc(0)
{ {
// initialize the OPENFILENAME struct // initialize the OPENFILENAME struct
if (IsWindows2000Platform() || IsWindowsME()) ZeroMemory(&m_ofn, sizeof(m_ofn));
{ m_ofn.lStructSize = sizeof(m_ofn);
ZeroMemory(&m_ofn, sizeof(m_ofn));
m_ofn.lStructSize = sizeof(m_ofn);
}
else // OSVER < Win2000
{
// the size of the OPENFILENAME structure is different
// under windows < win2000
ZeroMemory(&m_ofn, _OPENFILENAME_SIZE_VERSION_400);
m_ofn.lStructSize = _OPENFILENAME_SIZE_VERSION_400;
}
// 0x02000000 for #97681, sfx will make the entry into // 0x02000000 for #97681, sfx will make the entry into
// the recent document list // the recent document list
......
...@@ -646,7 +646,6 @@ void SAL_CALL CFilePicker::initialize(const uno::Sequence<uno::Any>& aArguments) ...@@ -646,7 +646,6 @@ void SAL_CALL CFilePicker::initialize(const uno::Sequence<uno::Any>& aArguments)
sal_Bool bFileOpenDialog = sal_True; sal_Bool bFileOpenDialog = sal_True;
sal_uInt32 winResTemplateId = 0; sal_uInt32 winResTemplateId = 0;
sal_Bool bIsWin2000 = IsWindows2000Platform();
switch ( templateId ) switch ( templateId )
{ {
...@@ -660,70 +659,43 @@ void SAL_CALL CFilePicker::initialize(const uno::Sequence<uno::Any>& aArguments) ...@@ -660,70 +659,43 @@ void SAL_CALL CFilePicker::initialize(const uno::Sequence<uno::Any>& aArguments)
case FILESAVE_AUTOEXTENSION_PASSWORD: case FILESAVE_AUTOEXTENSION_PASSWORD:
bFileOpenDialog = sal_False; bFileOpenDialog = sal_False;
if ( bIsWin2000 ) winResTemplateId = TMPL2000_FILESAVE_AUTOEXT_PASSWORD_BOX_ID;
winResTemplateId = TMPL2000_FILESAVE_AUTOEXT_PASSWORD_BOX_ID;
else
winResTemplateId = TMPL95_FILESAVE_AUTOEXT_PASSWORD_BOX_ID;
break; break;
case FILESAVE_AUTOEXTENSION_PASSWORD_FILTEROPTIONS: case FILESAVE_AUTOEXTENSION_PASSWORD_FILTEROPTIONS:
bFileOpenDialog = sal_False; bFileOpenDialog = sal_False;
if ( bIsWin2000 ) winResTemplateId = TMPL2000_AUTOEXT_PASSWORD_FILTEROPTION_BOX;
winResTemplateId = TMPL2000_AUTOEXT_PASSWORD_FILTEROPTION_BOX;
else
winResTemplateId = TMPL95_AUTOEXT_PASSWORD_FILTEROPTION_BOX;
break; break;
case FILESAVE_AUTOEXTENSION_SELECTION: case FILESAVE_AUTOEXTENSION_SELECTION:
bFileOpenDialog = sal_False; bFileOpenDialog = sal_False;
if ( bIsWin2000 ) winResTemplateId = TMPL2000_AUTOEXT_SELECTION_BOX;
winResTemplateId = TMPL2000_AUTOEXT_SELECTION_BOX;
else
winResTemplateId = TMPL95_AUTOEXT_SELECTION_BOX;
break; break;
case FILESAVE_AUTOEXTENSION_TEMPLATE: case FILESAVE_AUTOEXTENSION_TEMPLATE:
bFileOpenDialog = sal_False; bFileOpenDialog = sal_False;
if ( bIsWin2000 ) winResTemplateId = TMPL2000_FILEOPEN_AUTOEXT_TEMPLATE_BOX_ID;
winResTemplateId = TMPL2000_FILEOPEN_AUTOEXT_TEMPLATE_BOX_ID;
else
winResTemplateId = TMPL95_FILEOPEN_AUTOEXT_TEMPLATE_BOX_ID;
break; break;
case FILEOPEN_LINK_PREVIEW_IMAGE_TEMPLATE: case FILEOPEN_LINK_PREVIEW_IMAGE_TEMPLATE:
if ( bIsWin2000 ) winResTemplateId = TMPL2000_FILEOPEN_LINK_PREVIEW_BOX_ID;
winResTemplateId = TMPL2000_FILEOPEN_LINK_PREVIEW_BOX_ID;
else
winResTemplateId = TMPL95_FILEOPEN_LINK_PREVIEW_BOX_ID;
break; break;
case FILEOPEN_PLAY: case FILEOPEN_PLAY:
if ( bIsWin2000 ) winResTemplateId = TMPL2000_PLAY_PUSHBUTTON;
winResTemplateId = TMPL2000_PLAY_PUSHBUTTON;
else
winResTemplateId = TMPL95_PLAY_PUSHBUTTON;
break; break;
case FILEOPEN_READONLY_VERSION: case FILEOPEN_READONLY_VERSION:
if ( bIsWin2000 ) winResTemplateId = TMPL2000_FILEOPEN_READONLY_VERSION_BOX_ID;
winResTemplateId = TMPL2000_FILEOPEN_READONLY_VERSION_BOX_ID;
else
winResTemplateId = TMPL95_FILEOPEN_READONLY_VERSION_BOX_ID;
break; break;
case FILEOPEN_LINK_PREVIEW: case FILEOPEN_LINK_PREVIEW:
if ( bIsWin2000 ) winResTemplateId = TMPL2000_FILEOPEN_LINK_PREVIEW_BOX_SIMPLE_ID;
winResTemplateId = TMPL2000_FILEOPEN_LINK_PREVIEW_BOX_SIMPLE_ID;
else
winResTemplateId = TMPL95_FILEOPEN_LINK_PREVIEW_BOX_SIMPLE_ID;
break; break;
case FILESAVE_AUTOEXTENSION: case FILESAVE_AUTOEXTENSION:
bFileOpenDialog = sal_False; bFileOpenDialog = sal_False;
if ( bIsWin2000 ) winResTemplateId = TMPL2000_FILESAVE_AUTOEXT;
winResTemplateId = TMPL2000_FILESAVE_AUTOEXT;
else
winResTemplateId = TMPL95_FILESAVE_AUTOEXT;
break; break;
default: default:
......
...@@ -715,8 +715,8 @@ void CWinFileOpenImpl::EnlargeStdControlLabels() const ...@@ -715,8 +715,8 @@ void CWinFileOpenImpl::EnlargeStdControlLabels() const
RECT rcOkButton; RECT rcOkButton;
GetWindowRect(hOkButton, &rcOkButton); GetWindowRect(hOkButton, &rcOkButton);
const int MAX_GAP = IsWindows98() ? 5 : 10; const int MAX_GAP = 10;
const int OFFSET = IsWindows98() ? 10 : 0; const int OFFSET = 0;
RECT rcFileNameBox; RECT rcFileNameBox;
GetWindowRect(hFileNameBox, &rcFileNameBox); GetWindowRect(hFileNameBox, &rcFileNameBox);
...@@ -1007,8 +1007,7 @@ void SAL_CALL CWinFileOpenImpl::InitialSetDefaultName() ...@@ -1007,8 +1007,7 @@ void SAL_CALL CWinFileOpenImpl::InitialSetDefaultName()
// of an edit field for the file name edit field // of an edit field for the file name edit field
// the control id of this box is cmb13 and not // the control id of this box is cmb13 and not
// edt1 as before so we must use this id // edt1 as before so we must use this id
if (IsWindows2000Platform()) edt1Id = cmb13;
edt1Id = cmb13;
HWND hwndEdt1 = GetDlgItem(m_hwndFileOpenDlg, edt1Id); HWND hwndEdt1 = GetDlgItem(m_hwndFileOpenDlg, edt1Id);
SetWindowText(hwndEdt1, reinterpret_cast<LPCTSTR>(m_defaultName.getStr())); SetWindowText(hwndEdt1, reinterpret_cast<LPCTSTR>(m_defaultName.getStr()));
......
...@@ -403,146 +403,6 @@ HWND SAL_CALL CPreviewAdapterImpl::findFileListbox() const ...@@ -403,146 +403,6 @@ HWND SAL_CALL CPreviewAdapterImpl::findFileListbox() const
//############################################################## //##############################################################
//-----------------------------------------
// Special implementation for Win98
// because:
//
//-----------------------------------------
class CWin98PreviewAdapterImpl : public CPreviewAdapterImpl
{
public:
CWin98PreviewAdapterImpl(HINSTANCE instance);
virtual void SAL_CALL notifyParentWindowPosChanged();
protected:
virtual void SAL_CALL rearrangeLayout();
bool isValidToolbarDimension() const;
private:
sal_Bool m_PreviewActive;
int m_ToolbarPosX;
int m_ToolbarPosY;
int m_ToolbarWidth;
int m_ToolbarHeight;
};
//--------------------------------------------
//
//--------------------------------------------
CWin98PreviewAdapterImpl::CWin98PreviewAdapterImpl(HINSTANCE instance) :
CPreviewAdapterImpl(instance),
m_PreviewActive(sal_False),
m_ToolbarPosX(0),
m_ToolbarPosY(0),
m_ToolbarWidth(0),
m_ToolbarHeight(0)
{
}
//--------------------------------------------
//
//--------------------------------------------
void SAL_CALL CWin98PreviewAdapterImpl::notifyParentWindowPosChanged()
{
try
{
// the reason for this condition is
// Windows 98
// Under Windows 98 the message WM_SHOWWINDOW
// will be sent only the first time the
// GetOpenFileName function is called within
// the same process
// so we must use another message to initialize
// the preview window
if (IsWindow(m_FileDialog) && !m_PreviewActive)
{
initializeActivePreview();
m_PreviewActive = sal_True;
rearrangeLayout();
}
if (IsWindow(m_FileDialog) && !isValidToolbarDimension())
{
RECT rcStc1;
GetWindowRect(GetDlgItem(m_FileDialog,stc1),&rcStc1);
RECT rcCmb2;
GetWindowRect(GetDlgItem(m_FileDialog,cmb2),&rcCmb2);
// Assumption:
// the toolbar position is only valid
// if the left edge is greater or equal
// than the right edge of the drives listbox
// the stc1 static text is invisible at runtime
// but will be used as reference for the position
// and dimension of the toolbar
if (rcStc1.left >= rcCmb2.right)
{
// important: save the upper left corner in
// client coordinates
POINT pt = {rcStc1.left,rcStc1.top};
ScreenToClient(m_FileDialog,&pt);
m_ToolbarPosX = pt.x;
m_ToolbarPosY = pt.y;
m_ToolbarWidth = rcStc1.right - rcStc1.left;
m_ToolbarHeight = rcStc1.bottom - rcStc1.top;
}
}
}
catch(std::runtime_error&)
{
}
}
//--------------------------------------------
//
//--------------------------------------------
void SAL_CALL CWin98PreviewAdapterImpl::rearrangeLayout()
{
CPreviewAdapterImpl::rearrangeLayout();
// fix the position of the upper toolbar
// because the FileDialog moves all windows
// that are to the right of the FileListbox
// so if we have changed the size of the
// FileListbox we would run into trouble else
if (isValidToolbarDimension())
{
HWND hwndTlb = FindWindowEx(
m_FileDialog,NULL,TEXT("ToolbarWindow32"),NULL);
SetWindowPos(hwndTlb,
HWND_TOP,
m_ToolbarPosX,
m_ToolbarPosY,
m_ToolbarWidth,
m_ToolbarHeight,
SWP_NOACTIVATE);
}
}
//--------------------------------------------
//
//--------------------------------------------
bool CWin98PreviewAdapterImpl::isValidToolbarDimension() const
{
return (m_ToolbarPosX > 0 &&
m_ToolbarPosY > 0 &&
m_ToolbarWidth > 0 &&
m_ToolbarHeight > 0);
}
//##############################################################
//-------------------------------------------- //--------------------------------------------
// Implementation for Windows 95/NT/ME/2000/XP // Implementation for Windows 95/NT/ME/2000/XP
// because: // because:
...@@ -595,10 +455,7 @@ void SAL_CALL CWin95NTPreviewAdapterImpl::notifyParentShow(sal_Bool bShow) ...@@ -595,10 +455,7 @@ void SAL_CALL CWin95NTPreviewAdapterImpl::notifyParentShow(sal_Bool bShow)
CPreviewAdapter::CPreviewAdapter(HINSTANCE instance) CPreviewAdapter::CPreviewAdapter(HINSTANCE instance)
{ {
if (!IsWindows98()) m_pImpl.reset(new CWin95NTPreviewAdapterImpl(instance));
m_pImpl.reset(new CWin95NTPreviewAdapterImpl(instance));
else
m_pImpl.reset(new CWin98PreviewAdapterImpl(instance));
} }
//------------------------------- //-------------------------------
......
...@@ -73,25 +73,6 @@ const sal_Unicode AMPERSAND_SIGN = L'&'; ...@@ -73,25 +73,6 @@ const sal_Unicode AMPERSAND_SIGN = L'&';
// Windows ME VER_PLATFORM_WIN32_WINDOWS 4 90 // Windows ME VER_PLATFORM_WIN32_WINDOWS 4 90
//------------------------------------------------------------ //------------------------------------------------------------
bool SAL_CALL IsWindowsVersion(unsigned int PlatformId, unsigned int MajorVersion, int MinorVersion = -1)
{
OSVERSIONINFO osvi;
osvi.dwOSVersionInfoSize = sizeof(osvi);
if(!GetVersionEx(&osvi))
return false;
bool bRet = (PlatformId == osvi.dwPlatformId) &&
(MajorVersion == osvi.dwMajorVersion);
if (MinorVersion > -1)
bRet = bRet &&
(sal::static_int_cast< unsigned int >(MinorVersion) ==
osvi.dwMinorVersion);
return bRet;
}
//------------------------------------------------------------ //------------------------------------------------------------
// determine if we are running under Vista or newer OS // determine if we are running under Vista or newer OS
//------------------------------------------------------------ //------------------------------------------------------------
...@@ -114,81 +95,6 @@ bool SAL_CALL IsWindowsVistaOrNewer() ...@@ -114,81 +95,6 @@ bool SAL_CALL IsWindowsVistaOrNewer()
return bRet; return bRet;
} }
//------------------------------------------------------------
// determine if we are running under Windows 7
//------------------------------------------------------------
bool SAL_CALL IsWindows7()
{
return IsWindowsVersion(VER_PLATFORM_WIN32_NT, 6, 1);
}
//------------------------------------------------------------
// determine if we are running under Windows Vista
//------------------------------------------------------------
bool SAL_CALL IsWindowsVista()
{
return IsWindowsVersion(VER_PLATFORM_WIN32_NT, 6, 0);
}
//------------------------------------------------------------
// determine if we are running under Windows XP
//------------------------------------------------------------
bool SAL_CALL IsWindowsXP()
{
return IsWindowsVersion(VER_PLATFORM_WIN32_NT, 5, 1);
}
//------------------------------------------------------------
// determine if we are running under Windows 2000
//------------------------------------------------------------
bool SAL_CALL IsWindows2000()
{
return IsWindowsVersion(VER_PLATFORM_WIN32_NT, 5, 0);
}
//------------------------------------------------------------
//
//------------------------------------------------------------
bool SAL_CALL IsWindows98()
{
return IsWindowsVersion(VER_PLATFORM_WIN32_WINDOWS, 4, 10);
}
//------------------------------------------------------------
//
//------------------------------------------------------------
bool SAL_CALL IsWindowsME()
{
return IsWindowsVersion(VER_PLATFORM_WIN32_WINDOWS, 4, 90);
}
//------------------------------------------------------------
//
//------------------------------------------------------------
bool SAL_CALL IsWindows2000Platform()
{
// POST: return true if we are at least on Windows 2000
// WRONG!: return IsWindowsVersion(VER_PLATFORM_WIN32_NT, 5);
OSVERSIONINFO osvi;
ZeroMemory(&osvi, sizeof(osvi));
osvi.dwOSVersionInfoSize = sizeof(osvi);
GetVersionEx(&osvi);
if ( osvi.dwMajorVersion >= 5 )
{
return true;
}
return false;
}
//------------------------------------------------------------ //------------------------------------------------------------
// //
//------------------------------------------------------------ //------------------------------------------------------------
......
...@@ -52,18 +52,6 @@ ...@@ -52,18 +52,6 @@
//------------------------------------------------------------------------ //------------------------------------------------------------------------
bool SAL_CALL IsWindowsVistaOrNewer(); bool SAL_CALL IsWindowsVistaOrNewer();
bool SAL_CALL IsWindows7();
bool SAL_CALL IsWindowsVista();
bool SAL_CALL IsWindows2000();
bool SAL_CALL IsWindowsXP();
bool SAL_CALL IsWindows98();
bool SAL_CALL IsWindowsME();
// returns true if the platform is
// Windows 2000 or above
bool SAL_CALL IsWindows2000Platform();
#define IsWin2000 IsWindows2000
// set actions // set actions
void SAL_CALL ListboxAddItem( void SAL_CALL ListboxAddItem(
......
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