summaryrefslogtreecommitdiff
path: root/fpicker
diff options
context:
space:
mode:
authorTor Lillqvist <tlillqvist@novell.com>2011-07-20 21:51:04 +0300
committerTor Lillqvist <tlillqvist@novell.com>2011-07-20 21:56:12 +0300
commitb30f91c58419e90a789f79a1391b13f2064997ab (patch)
treeb4c7f218f879ff821de898ade0724acc7bb9e2d2 /fpicker
parentf1c4c90a5bb54acd01befe2f77c5173ab3814949 (diff)
Drop Win9x stuff
Diffstat (limited to 'fpicker')
-rw-r--r--fpicker/source/win32/filepicker/FPServiceInfo.hxx9
-rw-r--r--fpicker/source/win32/filepicker/FileOpenDlg.cxx14
-rw-r--r--fpicker/source/win32/filepicker/FilePicker.cxx46
-rw-r--r--fpicker/source/win32/filepicker/WinFileOpenImpl.cxx7
-rw-r--r--fpicker/source/win32/filepicker/previewadapter.cxx145
-rw-r--r--fpicker/source/win32/misc/WinImplHelper.cxx94
-rw-r--r--fpicker/source/win32/misc/WinImplHelper.hxx12
7 files changed, 15 insertions, 312 deletions
diff --git a/fpicker/source/win32/filepicker/FPServiceInfo.hxx b/fpicker/source/win32/filepicker/FPServiceInfo.hxx
index 33a27f683494..658c78a50106 100644
--- a/fpicker/source/win32/filepicker/FPServiceInfo.hxx
+++ b/fpicker/source/win32/filepicker/FPServiceInfo.hxx
@@ -37,31 +37,22 @@
// the service name is a description of a set of
// 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 TMPL95_FILEOPEN_LINK_PREVIEW_BOX_ID 2000
#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 TMPL95_FILESAVE_AUTOEXT_PASSWORD_BOX_ID 4000
#define TMPL2000_FILESAVE_AUTOEXT_PASSWORD_BOX_ID 4001
-#define TMPL95_AUTOEXT_PASSWORD_FILTEROPTION_BOX 5000
#define TMPL2000_AUTOEXT_PASSWORD_FILTEROPTION_BOX 5001
-#define TMPL95_PLAY_PUSHBUTTON 6000
#define TMPL2000_PLAY_PUSHBUTTON 6001
-#define TMPL95_AUTOEXT_SELECTION_BOX 7000
#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 TMPL95_FILESAVE_AUTOEXT 9000
#define TMPL2000_FILESAVE_AUTOEXT 9001
// the service names
diff --git a/fpicker/source/win32/filepicker/FileOpenDlg.cxx b/fpicker/source/win32/filepicker/FileOpenDlg.cxx
index ab1f396ad34e..cb1c446ed5b0 100644
--- a/fpicker/source/win32/filepicker/FileOpenDlg.cxx
+++ b/fpicker/source/win32/filepicker/FileOpenDlg.cxx
@@ -102,18 +102,8 @@ CFileOpenDialog::CFileOpenDialog(
m_pfnBaseDlgProc(0)
{
// initialize the OPENFILENAME struct
- if (IsWindows2000Platform() || IsWindowsME())
- {
- 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;
- }
+ ZeroMemory(&m_ofn, sizeof(m_ofn));
+ m_ofn.lStructSize = sizeof(m_ofn);
// 0x02000000 for #97681, sfx will make the entry into
// the recent document list
diff --git a/fpicker/source/win32/filepicker/FilePicker.cxx b/fpicker/source/win32/filepicker/FilePicker.cxx
index 360061978bae..c149d7b24f60 100644
--- a/fpicker/source/win32/filepicker/FilePicker.cxx
+++ b/fpicker/source/win32/filepicker/FilePicker.cxx
@@ -646,7 +646,6 @@ void SAL_CALL CFilePicker::initialize(const uno::Sequence<uno::Any>& aArguments)
sal_Bool bFileOpenDialog = sal_True;
sal_uInt32 winResTemplateId = 0;
- sal_Bool bIsWin2000 = IsWindows2000Platform();
switch ( templateId )
{
@@ -660,70 +659,43 @@ void SAL_CALL CFilePicker::initialize(const uno::Sequence<uno::Any>& aArguments)
case FILESAVE_AUTOEXTENSION_PASSWORD:
bFileOpenDialog = sal_False;
- if ( bIsWin2000 )
- winResTemplateId = TMPL2000_FILESAVE_AUTOEXT_PASSWORD_BOX_ID;
- else
- winResTemplateId = TMPL95_FILESAVE_AUTOEXT_PASSWORD_BOX_ID;
+ winResTemplateId = TMPL2000_FILESAVE_AUTOEXT_PASSWORD_BOX_ID;
break;
case FILESAVE_AUTOEXTENSION_PASSWORD_FILTEROPTIONS:
bFileOpenDialog = sal_False;
- if ( bIsWin2000 )
- winResTemplateId = TMPL2000_AUTOEXT_PASSWORD_FILTEROPTION_BOX;
- else
- winResTemplateId = TMPL95_AUTOEXT_PASSWORD_FILTEROPTION_BOX;
+ winResTemplateId = TMPL2000_AUTOEXT_PASSWORD_FILTEROPTION_BOX;
break;
case FILESAVE_AUTOEXTENSION_SELECTION:
bFileOpenDialog = sal_False;
- if ( bIsWin2000 )
- winResTemplateId = TMPL2000_AUTOEXT_SELECTION_BOX;
- else
- winResTemplateId = TMPL95_AUTOEXT_SELECTION_BOX;
+ winResTemplateId = TMPL2000_AUTOEXT_SELECTION_BOX;
break;
case FILESAVE_AUTOEXTENSION_TEMPLATE:
bFileOpenDialog = sal_False;
- if ( bIsWin2000 )
- winResTemplateId = TMPL2000_FILEOPEN_AUTOEXT_TEMPLATE_BOX_ID;
- else
- winResTemplateId = TMPL95_FILEOPEN_AUTOEXT_TEMPLATE_BOX_ID;
+ winResTemplateId = TMPL2000_FILEOPEN_AUTOEXT_TEMPLATE_BOX_ID;
break;
case FILEOPEN_LINK_PREVIEW_IMAGE_TEMPLATE:
- if ( bIsWin2000 )
- winResTemplateId = TMPL2000_FILEOPEN_LINK_PREVIEW_BOX_ID;
- else
- winResTemplateId = TMPL95_FILEOPEN_LINK_PREVIEW_BOX_ID;
+ winResTemplateId = TMPL2000_FILEOPEN_LINK_PREVIEW_BOX_ID;
break;
case FILEOPEN_PLAY:
- if ( bIsWin2000 )
- winResTemplateId = TMPL2000_PLAY_PUSHBUTTON;
- else
- winResTemplateId = TMPL95_PLAY_PUSHBUTTON;
+ winResTemplateId = TMPL2000_PLAY_PUSHBUTTON;
break;
case FILEOPEN_READONLY_VERSION:
- if ( bIsWin2000 )
- winResTemplateId = TMPL2000_FILEOPEN_READONLY_VERSION_BOX_ID;
- else
- winResTemplateId = TMPL95_FILEOPEN_READONLY_VERSION_BOX_ID;
+ winResTemplateId = TMPL2000_FILEOPEN_READONLY_VERSION_BOX_ID;
break;
case FILEOPEN_LINK_PREVIEW:
- if ( bIsWin2000 )
- winResTemplateId = TMPL2000_FILEOPEN_LINK_PREVIEW_BOX_SIMPLE_ID;
- else
- winResTemplateId = TMPL95_FILEOPEN_LINK_PREVIEW_BOX_SIMPLE_ID;
+ winResTemplateId = TMPL2000_FILEOPEN_LINK_PREVIEW_BOX_SIMPLE_ID;
break;
case FILESAVE_AUTOEXTENSION:
bFileOpenDialog = sal_False;
- if ( bIsWin2000 )
- winResTemplateId = TMPL2000_FILESAVE_AUTOEXT;
- else
- winResTemplateId = TMPL95_FILESAVE_AUTOEXT;
+ winResTemplateId = TMPL2000_FILESAVE_AUTOEXT;
break;
default:
diff --git a/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx b/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx
index 6d8423910949..7b26dcba8743 100644
--- a/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx
+++ b/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx
@@ -715,8 +715,8 @@ void CWinFileOpenImpl::EnlargeStdControlLabels() const
RECT rcOkButton;
GetWindowRect(hOkButton, &rcOkButton);
- const int MAX_GAP = IsWindows98() ? 5 : 10;
- const int OFFSET = IsWindows98() ? 10 : 0;
+ const int MAX_GAP = 10;
+ const int OFFSET = 0;
RECT rcFileNameBox;
GetWindowRect(hFileNameBox, &rcFileNameBox);
@@ -1007,8 +1007,7 @@ void SAL_CALL CWinFileOpenImpl::InitialSetDefaultName()
// of an edit field for the file name edit field
// the control id of this box is cmb13 and not
// edt1 as before so we must use this id
- if (IsWindows2000Platform())
- edt1Id = cmb13;
+ edt1Id = cmb13;
HWND hwndEdt1 = GetDlgItem(m_hwndFileOpenDlg, edt1Id);
SetWindowText(hwndEdt1, reinterpret_cast<LPCTSTR>(m_defaultName.getStr()));
diff --git a/fpicker/source/win32/filepicker/previewadapter.cxx b/fpicker/source/win32/filepicker/previewadapter.cxx
index 994a8ee6538e..51eb8b599860 100644
--- a/fpicker/source/win32/filepicker/previewadapter.cxx
+++ b/fpicker/source/win32/filepicker/previewadapter.cxx
@@ -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
// because:
@@ -595,10 +455,7 @@ void SAL_CALL CWin95NTPreviewAdapterImpl::notifyParentShow(sal_Bool bShow)
CPreviewAdapter::CPreviewAdapter(HINSTANCE instance)
{
- if (!IsWindows98())
- m_pImpl.reset(new CWin95NTPreviewAdapterImpl(instance));
- else
- m_pImpl.reset(new CWin98PreviewAdapterImpl(instance));
+ m_pImpl.reset(new CWin95NTPreviewAdapterImpl(instance));
}
//-------------------------------
diff --git a/fpicker/source/win32/misc/WinImplHelper.cxx b/fpicker/source/win32/misc/WinImplHelper.cxx
index 301a5bc9e6bc..d51f29b17a49 100644
--- a/fpicker/source/win32/misc/WinImplHelper.cxx
+++ b/fpicker/source/win32/misc/WinImplHelper.cxx
@@ -73,25 +73,6 @@ const sal_Unicode AMPERSAND_SIGN = L'&';
// 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
//------------------------------------------------------------
@@ -115,81 +96,6 @@ bool SAL_CALL IsWindowsVistaOrNewer()
}
//------------------------------------------------------------
-// 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;
-}
-
-//------------------------------------------------------------
//
//------------------------------------------------------------
diff --git a/fpicker/source/win32/misc/WinImplHelper.hxx b/fpicker/source/win32/misc/WinImplHelper.hxx
index 03cefe901124..da0e1a0ac542 100644
--- a/fpicker/source/win32/misc/WinImplHelper.hxx
+++ b/fpicker/source/win32/misc/WinImplHelper.hxx
@@ -52,18 +52,6 @@
//------------------------------------------------------------------------
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
void SAL_CALL ListboxAddItem(