diff options
Diffstat (limited to 'fpicker/source/win32/filepicker')
63 files changed, 1661 insertions, 1661 deletions
diff --git a/fpicker/source/win32/filepicker/FPServiceInfo.hxx b/fpicker/source/win32/filepicker/FPServiceInfo.hxx index 33a27f683494..528add7e5af1 100644 --- a/fpicker/source/win32/filepicker/FPServiceInfo.hxx +++ b/fpicker/source/win32/filepicker/FPServiceInfo.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -34,7 +34,7 @@ // defines //------------------------------------------------------------------------ -// 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) #define TMPL95_FILEOPEN_READONLY_VERSION_BOX_ID 1000 @@ -67,12 +67,12 @@ // the service names #define FILE_PICKER_SERVICE_NAME "com.sun.star.ui.dialogs.SystemFilePicker" -// the implementation names +// the implementation names #define FILE_PICKER_IMPL_NAME "com.sun.star.ui.dialogs.Win32FilePicker" // the registry key names // a key under which this service will be registered, Format: -> "/ImplName/UNO/SERVICES/ServiceName" -// < Implementation-Name ></UNO/SERVICES/>< Service-Name > +// < Implementation-Name ></UNO/SERVICES/>< Service-Name > #define FILE_PICKER_REGKEY_NAME "/com.sun.star.ui.dialogs.Win32FilePicker/UNO/SERVICES/com.sun.star.ui.dialogs.SystemFilePicker" #endif diff --git a/fpicker/source/win32/filepicker/FPentry.cxx b/fpicker/source/win32/filepicker/FPentry.cxx index 3adf90836013..68d367a9e09e 100644 --- a/fpicker/source/win32/filepicker/FPentry.cxx +++ b/fpicker/source/win32/filepicker/FPentry.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -30,7 +30,7 @@ #include "precompiled_fpicker.hxx" //---------------------------------------------- -// includes of other projects +// includes of other projects //---------------------------------------------- #include <cppuhelper/factory.hxx> #include <com/sun/star/container/XSet.hpp> @@ -47,37 +47,37 @@ // namespace directives //----------------------------------------------- -using namespace ::rtl ; -using namespace ::com::sun::star::uno ; -using namespace ::com::sun::star::container ; -using namespace ::com::sun::star::lang ; -using namespace ::com::sun::star::registry ; -using namespace ::cppu ; +using namespace ::rtl ; +using namespace ::com::sun::star::uno ; +using namespace ::com::sun::star::container ; +using namespace ::com::sun::star::lang ; +using namespace ::com::sun::star::registry ; +using namespace ::cppu ; using ::com::sun::star::ui::dialogs::XFilePicker; using ::com::sun::star::ui::dialogs::XFilePicker2; //------------------------------------------------ -// +// //------------------------------------------------ -static Reference< XInterface > SAL_CALL createInstance( +static Reference< XInterface > SAL_CALL createInstance( const Reference< XMultiServiceFactory >& rServiceManager ) { Reference< XInterface > xDlg; - bool bVistaOrNewer = IsWindowsVistaOrNewer(); + bool bVistaOrNewer = IsWindowsVistaOrNewer(); if (bVistaOrNewer) { OSL_TRACE("use special (vista) system file picker ..."); - xDlg.set( - static_cast< XFilePicker2* >( + xDlg.set( + static_cast< XFilePicker2* >( new ::fpicker::win32::vista::VistaFilePicker( rServiceManager ) ) ); } else { OSL_TRACE("use normal system file picker ..."); - xDlg.set( - static_cast< XFilePicker2* >( + xDlg.set( + static_cast< XFilePicker2* >( new CFilePicker( rServiceManager ) ) ); } @@ -88,7 +88,7 @@ static Reference< XInterface > SAL_CALL createInstance( // the three uno functions that will be exported //------------------------------------------------ -extern "C" +extern "C" { //------------------------------------------------ @@ -113,12 +113,12 @@ sal_Bool SAL_CALL component_writeInfo( void*, void* pRegistryKey ) { try { - Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) ); + Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) ); pXNewKey->createKey( OUString::createFromAscii( FILE_PICKER_REGKEY_NAME ) ); } catch( InvalidRegistryException& ) - { - OSL_ENSURE( sal_False, "InvalidRegistryException caught" ); + { + OSL_ENSURE( sal_False, "InvalidRegistryException caught" ); bRetVal = sal_False; } } @@ -130,7 +130,7 @@ sal_Bool SAL_CALL component_writeInfo( void*, void* pRegistryKey ) // //------------------------------------------------ -void* SAL_CALL component_getFactory( +void* SAL_CALL component_getFactory( const sal_Char* pImplName, uno_Interface* pSrvManager, uno_Interface* ) { void* pRet = 0; @@ -138,8 +138,8 @@ void* SAL_CALL component_getFactory( if ( pSrvManager && ( 0 == rtl_str_compare( pImplName, FILE_PICKER_IMPL_NAME ) ) ) { Sequence< OUString > aSNS( 1 ); - aSNS.getArray( )[0] = OUString::createFromAscii( FILE_PICKER_SERVICE_NAME ); - + aSNS.getArray( )[0] = OUString::createFromAscii( FILE_PICKER_SERVICE_NAME ); + Reference< XSingleServiceFactory > xFactory ( createSingleFactory( reinterpret_cast< XMultiServiceFactory* > ( pSrvManager ), OUString::createFromAscii( pImplName ), @@ -149,7 +149,7 @@ void* SAL_CALL component_getFactory( { xFactory->acquire(); pRet = xFactory.get(); - } + } } return pRet; diff --git a/fpicker/source/win32/filepicker/FileOpenDlg.cxx b/fpicker/source/win32/filepicker/FileOpenDlg.cxx index 125dd4e41eec..8155cc630fbe 100644 --- a/fpicker/source/win32/filepicker/FileOpenDlg.cxx +++ b/fpicker/source/win32/filepicker/FileOpenDlg.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -44,7 +44,7 @@ // constants //------------------------------------------------------------------------ -namespace /* private */ +namespace /* private */ { // we choose such large buffers because the size of // an single line edit field can be up to 32k; if @@ -61,79 +61,79 @@ namespace /* private */ const size_t MAX_FILTER_BUFF_SIZE = 4096; const LPTSTR CURRENT_INSTANCE = TEXT("CurrInst"); - + //------------------------------------------ // find an appropriate parent window //------------------------------------------ - + inline bool is_current_process_window(HWND hwnd) { - DWORD pid; - GetWindowThreadProcessId(hwnd, &pid); + DWORD pid; + GetWindowThreadProcessId(hwnd, &pid); return (pid == GetCurrentProcessId()); } - + HWND choose_parent_window() { - HWND hwnd_parent = GetForegroundWindow(); + HWND hwnd_parent = GetForegroundWindow(); if (!is_current_process_window(hwnd_parent)) hwnd_parent = GetDesktopWindow(); - + return hwnd_parent; } }; //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ -CFileOpenDialog::CFileOpenDialog( - bool bFileOpenDialog, - sal_uInt32 dwFlags, - sal_uInt32 dwTemplateId, +CFileOpenDialog::CFileOpenDialog( + bool bFileOpenDialog, + sal_uInt32 dwFlags, + sal_uInt32 dwTemplateId, HINSTANCE hInstance) : m_hwndFileOpenDlg(0), m_hwndFileOpenDlgChild(0), - m_bFileOpenDialog(bFileOpenDialog), + m_bFileOpenDialog(bFileOpenDialog), m_filterBuffer(MAX_FILTER_BUFF_SIZE), m_fileTitleBuffer(MAX_FILETITLE_BUFF_SIZE), - m_helperBuffer(MAX_FILENAME_BUFF_SIZE), - m_fileNameBuffer(MAX_FILENAME_BUFF_SIZE), + m_helperBuffer(MAX_FILENAME_BUFF_SIZE), + m_fileNameBuffer(MAX_FILENAME_BUFF_SIZE), 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 + // 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; + m_ofn.lStructSize = _OPENFILENAME_SIZE_VERSION_400; } // 0x02000000 for #97681, sfx will make the entry into // the recent document list - m_ofn.Flags |= dwFlags | + m_ofn.Flags |= dwFlags | OFN_EXPLORER | - OFN_ENABLEHOOK | - OFN_HIDEREADONLY | + OFN_ENABLEHOOK | + OFN_HIDEREADONLY | OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_OVERWRITEPROMPT | OFN_ENABLESIZING | OFN_DONTADDTORECENT; // 0x02000000 -> OFN_DONTADDTORECENT only available with new platform sdk - + // it is a little hack but how else could // we get a parent window (using a vcl window?) m_ofn.hwndOwner = choose_parent_window(); - + m_ofn.lpstrFile = reinterpret_cast<LPTSTR>(const_cast<sal_Unicode*>(m_fileNameBuffer.getStr())); m_ofn.nMaxFile = m_fileNameBuffer.getCapacity(); - + m_ofn.lpstrFileTitle = reinterpret_cast<LPTSTR>(const_cast<sal_Unicode*>(m_fileTitleBuffer.getStr())); m_ofn.nMaxFileTitle = m_fileTitleBuffer.getCapacity(); @@ -151,11 +151,11 @@ CFileOpenDialog::CFileOpenDialog( } // set a pointer to myself as ofn parameter - m_ofn.lCustData = reinterpret_cast<long>(this); + m_ofn.lCustData = reinterpret_cast<long>(this); } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ CFileOpenDialog::~CFileOpenDialog() @@ -163,7 +163,7 @@ CFileOpenDialog::~CFileOpenDialog() } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ void SAL_CALL CFileOpenDialog::setTitle(const rtl::OUString& aTitle) @@ -171,14 +171,14 @@ void SAL_CALL CFileOpenDialog::setTitle(const rtl::OUString& aTitle) m_dialogTitle = aTitle; m_ofn.lpstrTitle = reinterpret_cast<LPCTSTR>(m_dialogTitle.getStr()); } - + //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ void CFileOpenDialog::setFilter(const rtl::OUString& aFilter) -{ - // Format is like +{ + // Format is like // "*.TXT" or multiple separate by ';' like "*.TXT;*.DOC;*.SXW" // Do not include spaces in the pattern string m_filterBuffer.ensureCapacity(aFilter.getLength()); @@ -188,7 +188,7 @@ void CFileOpenDialog::setFilter(const rtl::OUString& aFilter) } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ bool CFileOpenDialog::setFilterIndex(sal_uInt32 aIndex) @@ -199,16 +199,16 @@ bool CFileOpenDialog::setFilterIndex(sal_uInt32 aIndex) } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ sal_uInt32 CFileOpenDialog::getSelectedFilterIndex() const { return m_ofn.nFilterIndex; } - + //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ void SAL_CALL CFileOpenDialog::setDefaultName(const rtl::OUString& aName) @@ -219,7 +219,7 @@ void SAL_CALL CFileOpenDialog::setDefaultName(const rtl::OUString& aName) } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ void SAL_CALL CFileOpenDialog::setDisplayDirectory(const rtl::OUString& aDirectory) @@ -229,7 +229,7 @@ void SAL_CALL CFileOpenDialog::setDisplayDirectory(const rtl::OUString& aDirecto } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ rtl::OUString SAL_CALL CFileOpenDialog::getLastDisplayDirectory() const @@ -238,39 +238,39 @@ rtl::OUString SAL_CALL CFileOpenDialog::getLastDisplayDirectory() const } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ rtl::OUString SAL_CALL CFileOpenDialog::getFullFileName() const -{ - return rtl::OUString(m_fileNameBuffer.getStr(), +{ + return rtl::OUString(m_fileNameBuffer.getStr(), _wcslenex(m_fileNameBuffer.getStr())); } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ rtl::OUString SAL_CALL CFileOpenDialog::getFileName() const -{ +{ return rtl::OUString(m_fileTitleBuffer); } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ rtl::OUString CFileOpenDialog::getFileExtension() { if (m_ofn.nFileExtension) - return rtl::OUString(m_fileNameBuffer.getStr() + m_ofn.nFileExtension, + return rtl::OUString(m_fileNameBuffer.getStr() + m_ofn.nFileExtension, rtl_ustr_getLength(m_fileNameBuffer.getStr() + m_ofn.nFileExtension)); return rtl::OUString(); } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ void CFileOpenDialog::setDefaultFileExtension(const rtl::OUString& aExtension) @@ -280,7 +280,7 @@ void CFileOpenDialog::setDefaultFileExtension(const rtl::OUString& aExtension) } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ void SAL_CALL CFileOpenDialog::setMultiSelectionMode(bool bMode) @@ -292,7 +292,7 @@ void SAL_CALL CFileOpenDialog::setMultiSelectionMode(bool bMode) } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ bool SAL_CALL CFileOpenDialog::getMultiSelectionMode() const @@ -301,7 +301,7 @@ bool SAL_CALL CFileOpenDialog::getMultiSelectionMode() const } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ sal_Int16 SAL_CALL CFileOpenDialog::doModal() @@ -312,7 +312,7 @@ sal_Int16 SAL_CALL CFileOpenDialog::doModal() if (preModal()) { bool bRet; - + if (m_bFileOpenDialog) bRet = m_GetFileNameWrapper.getOpenFileName( reinterpret_cast<LPOPENFILENAME>(&m_ofn)); @@ -321,7 +321,7 @@ sal_Int16 SAL_CALL CFileOpenDialog::doModal() reinterpret_cast<LPOPENFILENAME>(&m_ofn)); nRC = 1; - + if (!bRet) nRC = (0 == m_GetFileNameWrapper.commDlgExtendedError()) ? 0 : -1; @@ -333,7 +333,7 @@ sal_Int16 SAL_CALL CFileOpenDialog::doModal() } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ sal_uInt32 SAL_CALL CFileOpenDialog::getLastDialogError() const @@ -342,7 +342,7 @@ sal_uInt32 SAL_CALL CFileOpenDialog::getLastDialogError() const } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ bool SAL_CALL CFileOpenDialog::preModal() @@ -351,24 +351,24 @@ bool SAL_CALL CFileOpenDialog::preModal() } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ void SAL_CALL CFileOpenDialog::postModal(sal_Int16 nDialogResult) { OSL_ASSERT((-1 <= nDialogResult) && (nDialogResult <= 1)); - + if (1 == nDialogResult) { // Attention: assuming that nFileOffset is always greater 0 because under // Windows there is always a drive letter or a server in a complete path // the OPENFILENAME docu never says that nFileOffset can be 0 - m_displayDirectory = rtl::OUString(reinterpret_cast<const sal_Unicode*>(m_ofn.lpstrFile),m_ofn.nFileOffset); - } + m_displayDirectory = rtl::OUString(reinterpret_cast<const sal_Unicode*>(m_ofn.lpstrFile),m_ofn.nFileOffset); + } } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ rtl::OUString SAL_CALL CFileOpenDialog::getCurrentFilePath() const @@ -380,39 +380,39 @@ rtl::OUString SAL_CALL CFileOpenDialog::getCurrentFilePath() const CDM_GETFILEPATH, m_helperBuffer.getCapacity(), reinterpret_cast<LPARAM>(m_helperBuffer.getStr())); - + if (nLen > 0) { m_helperBuffer.setLength((nLen * sizeof(sal_Unicode)) - 1); return rtl::OUString(m_helperBuffer); - } + } return rtl::OUString(); } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ rtl::OUString SAL_CALL CFileOpenDialog::getCurrentFolderPath() const { OSL_ASSERT(IsWindow(m_hwndFileOpenDlg)); - + LPARAM nLen = SendMessage( m_hwndFileOpenDlg, CDM_GETFOLDERPATH, m_helperBuffer.getCapacity(), reinterpret_cast<LPARAM>(m_helperBuffer.getStr())); - + if (nLen > 0) { m_helperBuffer.setLength((nLen * sizeof(sal_Unicode)) - 1); return rtl::OUString(m_helperBuffer); - } + } return rtl::OUString(); } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ rtl::OUString SAL_CALL CFileOpenDialog::getCurrentFileName() const @@ -429,12 +429,12 @@ rtl::OUString SAL_CALL CFileOpenDialog::getCurrentFileName() const { m_helperBuffer.setLength((nLen * sizeof(sal_Unicode)) - 1); return rtl::OUString(m_helperBuffer); - } + } return rtl::OUString(); } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ sal_uInt32 SAL_CALL CFileOpenDialog::onShareViolation(const rtl::OUString&) @@ -443,7 +443,7 @@ sal_uInt32 SAL_CALL CFileOpenDialog::onShareViolation(const rtl::OUString&) } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ sal_uInt32 SAL_CALL CFileOpenDialog::onFileOk() @@ -452,7 +452,7 @@ sal_uInt32 SAL_CALL CFileOpenDialog::onFileOk() } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ void SAL_CALL CFileOpenDialog::onSelChanged(HWND) @@ -460,7 +460,7 @@ void SAL_CALL CFileOpenDialog::onSelChanged(HWND) } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ void SAL_CALL CFileOpenDialog::onHelp() @@ -468,7 +468,7 @@ void SAL_CALL CFileOpenDialog::onHelp() } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ void SAL_CALL CFileOpenDialog::onInitDone() @@ -477,7 +477,7 @@ void SAL_CALL CFileOpenDialog::onInitDone() } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ void SAL_CALL CFileOpenDialog::onFolderChanged() @@ -485,7 +485,7 @@ void SAL_CALL CFileOpenDialog::onFolderChanged() } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ void SAL_CALL CFileOpenDialog::onTypeChanged(sal_uInt32) @@ -493,7 +493,7 @@ void SAL_CALL CFileOpenDialog::onTypeChanged(sal_uInt32) } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ sal_uInt32 SAL_CALL CFileOpenDialog::onCtrlCommand(HWND, sal_uInt16, sal_uInt16) @@ -502,7 +502,7 @@ sal_uInt32 SAL_CALL CFileOpenDialog::onCtrlCommand(HWND, sal_uInt16, sal_uInt16) } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ sal_uInt32 SAL_CALL CFileOpenDialog::onWMNotify( HWND, LPOFNOTIFY lpOfNotify ) @@ -511,7 +511,7 @@ sal_uInt32 SAL_CALL CFileOpenDialog::onWMNotify( HWND, LPOFNOTIFY lpOfNotify ) { case CDN_SHAREVIOLATION: return onShareViolation(reinterpret_cast<const sal_Unicode*>(lpOfNotify->pszFile)); - + case CDN_FILEOK: return onFileOk(); @@ -541,56 +541,56 @@ sal_uInt32 SAL_CALL CFileOpenDialog::onWMNotify( HWND, LPOFNOTIFY lpOfNotify ) } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ void SAL_CALL CFileOpenDialog::handleInitDialog(HWND hwndDlg, HWND hwndChild) { m_hwndFileOpenDlg = hwndDlg; m_hwndFileOpenDlgChild = hwndChild; - + OSL_ASSERT(GetParent(hwndChild) == hwndDlg); - // calling virtual function which the + // calling virtual function which the // client can overload onInitDialog(hwndDlg); } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ -unsigned int CALLBACK CFileOpenDialog::ofnHookProc( +unsigned int CALLBACK CFileOpenDialog::ofnHookProc( HWND hChildDlg, unsigned int uiMsg, WPARAM wParam, LPARAM lParam) { HWND hwndDlg = GetParent(hChildDlg); CFileOpenDialog* pImpl = NULL; switch( uiMsg ) - { - case WM_INITDIALOG: + { + case WM_INITDIALOG: { _LPOPENFILENAME lpofn = reinterpret_cast<_LPOPENFILENAME>(lParam); - pImpl = reinterpret_cast<CFileOpenDialog*>(lpofn->lCustData); + pImpl = reinterpret_cast<CFileOpenDialog*>(lpofn->lCustData); OSL_ASSERT(pImpl); - - // subclass the base dialog for WM_NCDESTROY processing - pImpl->m_pfnBaseDlgProc = - reinterpret_cast<WNDPROC>( + + // subclass the base dialog for WM_NCDESTROY processing + pImpl->m_pfnBaseDlgProc = + reinterpret_cast<WNDPROC>( SetWindowLong( - hwndDlg, - GWL_WNDPROC, - reinterpret_cast<LONG>(CFileOpenDialog::BaseDlgProc))); - // connect the instance handle to the window + hwndDlg, + GWL_WNDPROC, + reinterpret_cast<LONG>(CFileOpenDialog::BaseDlgProc))); + // connect the instance handle to the window SetProp(hwndDlg, CURRENT_INSTANCE, pImpl); pImpl->handleInitDialog(hwndDlg, hChildDlg); } return 0; - + case WM_NOTIFY: { pImpl = getCurrentInstance(hwndDlg); - return pImpl->onWMNotify( + return pImpl->onWMNotify( hChildDlg, reinterpret_cast<LPOFNOTIFY>(lParam)); } @@ -599,8 +599,8 @@ unsigned int CALLBACK CFileOpenDialog::ofnHookProc( pImpl = getCurrentInstance(hwndDlg); OSL_ASSERT(pImpl); - return pImpl->onCtrlCommand( - hChildDlg, LOWORD(wParam), HIWORD(lParam)); + return pImpl->onCtrlCommand( + hChildDlg, LOWORD(wParam), HIWORD(lParam)); } } @@ -608,53 +608,53 @@ unsigned int CALLBACK CFileOpenDialog::ofnHookProc( } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ -LRESULT CALLBACK CFileOpenDialog::BaseDlgProc( +LRESULT CALLBACK CFileOpenDialog::BaseDlgProc( HWND hWnd, UINT wMessage, WPARAM wParam, LPARAM lParam) { CFileOpenDialog* pImpl = 0; - + if (WM_NCDESTROY == wMessage) { pImpl = reinterpret_cast<CFileOpenDialog*>( RemoveProp(hWnd,CURRENT_INSTANCE)); - - SetWindowLong(hWnd, GWL_WNDPROC, + + SetWindowLong(hWnd, GWL_WNDPROC, reinterpret_cast<LONG>(pImpl->m_pfnBaseDlgProc)); } else { pImpl = getCurrentInstance(hWnd); } - + OSL_ASSERT(pImpl); - + return CallWindowProc( reinterpret_cast<WNDPROC>(pImpl->m_pfnBaseDlgProc), hWnd,wMessage,wParam,lParam); } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ CFileOpenDialog* SAL_CALL CFileOpenDialog::getCurrentInstance(HWND hwnd) { OSL_ASSERT(IsWindow( hwnd)); - return reinterpret_cast<CFileOpenDialog*>( + return reinterpret_cast<CFileOpenDialog*>( GetProp(hwnd, CURRENT_INSTANCE)); } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ void SAL_CALL CFileOpenDialog::centerPositionToParent() const { OSL_PRECOND(IsWindow(m_hwndFileOpenDlg), "no dialog window, call method only after or in onInitDone"); - + HWND hwndParent = m_ofn.hwndOwner; if (!IsWindow(hwndParent)) @@ -667,13 +667,13 @@ void SAL_CALL CFileOpenDialog::centerPositionToParent() const RECT rcDlg; GetWindowRect(m_hwndFileOpenDlg, &rcDlg); - + int lDlgW = rcDlg.right - rcDlg.left; int lDlgH = rcDlg.bottom - rcDlg.top; int x = (rcPar.left + rcPar.right - lDlgW) / 2; int y = (rcPar.top + rcPar.bottom - lDlgH) / 2; - + HDC hdc = GetDC(m_hwndFileOpenDlg); int hResol = GetDeviceCaps(hdc, HORZRES); @@ -685,7 +685,7 @@ void SAL_CALL CFileOpenDialog::centerPositionToParent() const x = 0; else if ((x + lDlgW) > hResol) x = hResol - lDlgW; - + if (y < 0) y = 0; else if ((y + lDlgH) > vResol) @@ -694,7 +694,7 @@ void SAL_CALL CFileOpenDialog::centerPositionToParent() const SetWindowPos( m_hwndFileOpenDlg, NULL, x, y, 0, 0, - SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSIZE ); + SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSIZE ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/fpicker/source/win32/filepicker/FileOpenDlg.hxx b/fpicker/source/win32/filepicker/FileOpenDlg.hxx index a5297e7b07cf..a351a994a6e9 100644 --- a/fpicker/source/win32/filepicker/FileOpenDlg.hxx +++ b/fpicker/source/win32/filepicker/FileOpenDlg.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -75,7 +75,7 @@ typedef struct _tagOFNA { LPCSTR lpstrPrompt; #endif #if (_WIN32_WINNT >= 0x0500) - void * pvReserved; + void * pvReserved; DWORD dwReserved; DWORD FlagsEx; #endif // (_WIN32_WINNT >= 0x0500) @@ -132,7 +132,7 @@ typedef _LPOPENFILENAMEA _LPOPENFILENAME; //------------------------------------------------------------- // A simple wrapper class around the Win32 GetOpenFileName API. -// This class is not thread-safe and only one instance at a +// This class is not thread-safe and only one instance at a // time is allowed //------------------------------------------------------------- @@ -140,15 +140,15 @@ class CFileOpenDialog { public: // ctor - // bFileOpenDialog idicates if we want a FileOpen or FileSave + // bFileOpenDialog idicates if we want a FileOpen or FileSave // dialog // dwFlags see OPENFILENAME // dwTemplateId - an ID for custom templates // hInstance - an instance handle for the module // which provides the custom template, unused if dwTemplateId // is 0 - CFileOpenDialog( - bool bFileOpenDialog = sal_True, + CFileOpenDialog( + bool bFileOpenDialog = sal_True, sal_uInt32 dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, sal_uInt32 dwTemplateId = 0, HINSTANCE hInstance = 0); @@ -156,12 +156,12 @@ public: virtual ~CFileOpenDialog(); virtual void SAL_CALL setTitle(const rtl::OUString& aTitle); - + // to set a filter string using the M$ format // e.g. FltName\0*.txt;*.rtf\0...\0\0 void SAL_CALL setFilter(const rtl::OUString& aFilter); - // set the index of the current filter when the + // set the index of the current filter when the // dialog is about to shown, the index starts with 1 // the function succeeded if the given filter index // is greater than zero and is a valid position @@ -171,8 +171,8 @@ public: // get the index of the currently selected filter // the index of the returned filter starts with 1 sal_uInt32 SAL_CALL getSelectedFilterIndex() const; - - // set the name and optional the path of the + + // set the name and optional the path of the // file that will be initially be shown when // the dialog will be displayed virtual void SAL_CALL setDefaultName(const rtl::OUString& aName); @@ -205,8 +205,8 @@ public: // returns whether multi-selection mode is enabled or not bool SAL_CALL getMultiSelectionMode() const; - - // shows the dialog, calls preModal before + + // shows the dialog, calls preModal before // showing the dialog and postModal after // showing the dialog // the method returns: @@ -217,7 +217,7 @@ public: // returns the last dialog error that occured sal_uInt32 SAL_CALL getLastDialogError() const; - + // retrievs the currently selected file // including path and drive information // can be called only if the dialog is @@ -253,14 +253,14 @@ protected: virtual void SAL_CALL onHelp(); // only called back if OFN_EXPLORER is set - virtual void SAL_CALL onInitDone(); + virtual void SAL_CALL onInitDone(); virtual void SAL_CALL onFolderChanged(); virtual void SAL_CALL onTypeChanged(sal_uInt32 nFilterIndex); - + virtual void SAL_CALL onInitDialog(HWND hwndDlg) = 0; virtual sal_uInt32 SAL_CALL onCtrlCommand(HWND hwndDlg, sal_uInt16 ctrlId, sal_uInt16 notifyCode); - + sal_uInt32 SAL_CALL onWMNotify(HWND hwndChild, LPOFNOTIFYW lpOfNotify); // we use non-virtual functions to do necessary work before @@ -268,18 +268,18 @@ protected: void SAL_CALL handleInitDialog(HWND hwndDlg, HWND hwndChild); protected: - - // handle to the window of the + + // handle to the window of the // FileOpen/FileSave dialog - // will be set on message + // will be set on message // WM_INITDIALOG, before this // value is undefined - HWND m_hwndFileOpenDlg; - HWND m_hwndFileOpenDlgChild; + HWND m_hwndFileOpenDlg; + HWND m_hwndFileOpenDlgChild; - _OPENFILENAME m_ofn; + _OPENFILENAME m_ofn; - // we connect the instance with the dialog window using + // we connect the instance with the dialog window using // SetProp, with this function we can reconnect from // callback functions to this instance static CFileOpenDialog* SAL_CALL getCurrentInstance(HWND hwnd); @@ -288,33 +288,33 @@ protected: private: // FileOpen or FileSaveDialog - bool m_bFileOpenDialog; - rtl::OUString m_dialogTitle; - rtl::OUString m_displayDirectory; - rtl::OUString m_defaultExtension; - - mutable rtl::OUStringBuffer m_filterBuffer; - mutable rtl::OUStringBuffer m_fileTitleBuffer; - mutable rtl::OUStringBuffer m_helperBuffer; + bool m_bFileOpenDialog; + rtl::OUString m_dialogTitle; + rtl::OUString m_displayDirectory; + rtl::OUString m_defaultExtension; + + mutable rtl::OUStringBuffer m_filterBuffer; + mutable rtl::OUStringBuffer m_fileTitleBuffer; + mutable rtl::OUStringBuffer m_helperBuffer; mutable rtl::OUStringBuffer m_fileNameBuffer; CGetFileNameWrapper m_GetFileNameWrapper; - WNDPROC m_pfnBaseDlgProc; + WNDPROC m_pfnBaseDlgProc; // callback function - static unsigned int CALLBACK ofnHookProc( + static unsigned int CALLBACK ofnHookProc( HWND hChildDlg, // handle to child dialog box unsigned int uiMsg, // message identifier WPARAM wParam, // message parameter LPARAM lParam // message parameter ); - // we have to subclass the dialog in order - // to clean up the window property we are + // we have to subclass the dialog in order + // to clean up the window property we are // using to connect the window with a class // instance in WM_NCDESTROY - static LRESULT CALLBACK BaseDlgProc( + static LRESULT CALLBACK BaseDlgProc( HWND hWnd, UINT wMessage, WPARAM wParam, LPARAM lParam ); private: diff --git a/fpicker/source/win32/filepicker/FilePicker.cxx b/fpicker/source/win32/filepicker/FilePicker.cxx index 2021e8c93794..322c4ae2f2ab 100644 --- a/fpicker/source/win32/filepicker/FilePicker.cxx +++ b/fpicker/source/win32/filepicker/FilePicker.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -69,10 +69,10 @@ using namespace ::com::sun::star::ui::dialogs::TemplateDescription; namespace { - // controling event notifications + // controling event notifications const bool STARTUP_SUSPENDED = true; const bool STARTUP_ALIVE = false; - + uno::Sequence<rtl::OUString> SAL_CALL FilePicker_getSupportedServiceNames() { uno::Sequence<rtl::OUString> aRet(2); @@ -83,12 +83,12 @@ namespace } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- -CFilePicker::CFilePicker( const uno::Reference<lang::XMultiServiceFactory>& xServiceMgr) : +CFilePicker::CFilePicker( const uno::Reference<lang::XMultiServiceFactory>& xServiceMgr) : cppu::WeakComponentImplHelper10< - XFilterManager, + XFilterManager, XFilterGroupManager, XFilePickerControlAccess, XFilePickerNotifier, @@ -96,21 +96,21 @@ CFilePicker::CFilePicker( const uno::Reference<lang::XMultiServiceFactory>& xSer XFilePicker2, lang::XInitialization, util::XCancellable, - lang::XEventListener, + lang::XEventListener, lang::XServiceInfo>(m_rbHelperMtx), m_xServiceMgr(xServiceMgr), m_aAsyncEventNotifier(rBHelper) -{ +{ HINSTANCE hInstance = GetModuleHandle(FILE_PICKER_DLL_NAME); OSL_POSTCOND( hInstance, "The name of the service dll must have changed" ); - // create a default FileOpen dialog without any additional ui elements - m_pImpl = std::auto_ptr< CWinFileOpenImpl >( - new CWinFileOpenImpl( + // create a default FileOpen dialog without any additional ui elements + m_pImpl = std::auto_ptr< CWinFileOpenImpl >( + new CWinFileOpenImpl( this, - true, - 0, - 0, + true, + 0, + 0, hInstance ) ); } @@ -118,11 +118,11 @@ CFilePicker::CFilePicker( const uno::Reference<lang::XMultiServiceFactory>& xSer // XFPEventListenerManager //------------------------------------------------------------------------------------ -void SAL_CALL CFilePicker::addFilePickerListener(const uno::Reference<XFilePickerListener>& xListener) +void SAL_CALL CFilePicker::addFilePickerListener(const uno::Reference<XFilePickerListener>& xListener) throw(uno::RuntimeException) { if ( rBHelper.bDisposed ) - throw lang::DisposedException( + throw lang::DisposedException( rtl::OUString::createFromAscii( "object is already disposed" ), static_cast< XFilePicker2* >( this ) ); @@ -131,14 +131,14 @@ void SAL_CALL CFilePicker::addFilePickerListener(const uno::Reference<XFilePicke } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- -void SAL_CALL CFilePicker::removeFilePickerListener(const uno::Reference<XFilePickerListener>& xListener ) +void SAL_CALL CFilePicker::removeFilePickerListener(const uno::Reference<XFilePickerListener>& xListener ) throw(uno::RuntimeException) { if ( rBHelper.bDisposed ) - throw lang::DisposedException( + throw lang::DisposedException( rtl::OUString::createFromAscii( "object is already disposed" ), static_cast< XFilePicker2* >( this ) ); @@ -158,10 +158,10 @@ void SAL_CALL CFilePicker::disposing(const lang::EventObject& aEvent) throw(uno: } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- -void SAL_CALL CFilePicker::fileSelectionChanged(FilePickerEvent aEvent) +void SAL_CALL CFilePicker::fileSelectionChanged(FilePickerEvent aEvent) { aEvent.Source = uno::Reference<uno::XInterface>(static_cast<XFilePickerNotifier*>(this)); m_aAsyncEventNotifier.notifyEvent( @@ -169,10 +169,10 @@ void SAL_CALL CFilePicker::fileSelectionChanged(FilePickerEvent aEvent) } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- -void SAL_CALL CFilePicker::directoryChanged(FilePickerEvent aEvent) +void SAL_CALL CFilePicker::directoryChanged(FilePickerEvent aEvent) { aEvent.Source = uno::Reference<uno::XInterface>(static_cast<XFilePickerNotifier*>(this)); m_aAsyncEventNotifier.notifyEvent( @@ -180,21 +180,21 @@ void SAL_CALL CFilePicker::directoryChanged(FilePickerEvent aEvent) } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- -void SAL_CALL CFilePicker::controlStateChanged(FilePickerEvent aEvent) -{ +void SAL_CALL CFilePicker::controlStateChanged(FilePickerEvent aEvent) +{ aEvent.Source = uno::Reference<uno::XInterface>(static_cast<XFilePickerNotifier*>(this)); m_aAsyncEventNotifier.notifyEvent( new CFilePickerParamEventNotification(&XFilePickerListener::controlStateChanged,aEvent)); } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- -void SAL_CALL CFilePicker::dialogSizeChanged() +void SAL_CALL CFilePicker::dialogSizeChanged() { m_aAsyncEventNotifier.notifyEvent( new CFilePickerEventNotification(&XFilePickerListener::dialogSizeChanged)); @@ -208,7 +208,7 @@ rtl::OUString SAL_CALL CFilePicker::helpRequested(FilePickerEvent aEvent) const { rtl::OUString aHelpText; - ::cppu::OInterfaceContainerHelper* pICHelper = + ::cppu::OInterfaceContainerHelper* pICHelper = rBHelper.getContainer( getCppuType((uno::Reference<XFilePickerListener>*)0)); if (pICHelper) @@ -220,8 +220,8 @@ rtl::OUString SAL_CALL CFilePicker::helpRequested(FilePickerEvent aEvent) const try { /* - if there are multiple listeners responding - to this notification the next response + if there are multiple listeners responding + to this notification the next response overwrittes the one before if it is not empty */ @@ -235,28 +235,28 @@ rtl::OUString SAL_CALL CFilePicker::helpRequested(FilePickerEvent aEvent) const aHelpText = temp; } - } + } catch(uno::RuntimeException&) { OSL_ENSURE( false, "RuntimeException during event dispatching" ); } - } + } } return aHelpText; } //------------------------------------- -// +// //------------------------------------- -bool CFilePicker::startupEventNotification(bool bStartupSuspended) +bool CFilePicker::startupEventNotification(bool bStartupSuspended) { return m_aAsyncEventNotifier.startup(bStartupSuspended); } //------------------------------------- -// +// //------------------------------------- void CFilePicker::shutdownEventNotification() @@ -265,7 +265,7 @@ void CFilePicker::shutdownEventNotification() } //------------------------------------- -// +// //------------------------------------- void CFilePicker::suspendEventNotification() @@ -274,14 +274,14 @@ void CFilePicker::suspendEventNotification() } //------------------------------------- -// +// //------------------------------------- void CFilePicker::resumeEventNotification() { m_aAsyncEventNotifier.resume(); } - + //------------------------------------------------------------------------------------ // XFilePicker functions //------------------------------------------------------------------------------------ @@ -294,7 +294,7 @@ void SAL_CALL CFilePicker::setMultiSelectionMode(sal_Bool bMode) throw(uno::Runt } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- void SAL_CALL CFilePicker::setTitle(const rtl::OUString& aTitle) throw(uno::RuntimeException) @@ -305,10 +305,10 @@ void SAL_CALL CFilePicker::setTitle(const rtl::OUString& aTitle) throw(uno::Runt } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- -void SAL_CALL CFilePicker::appendFilter(const rtl::OUString& aTitle, const rtl::OUString& aFilter) +void SAL_CALL CFilePicker::appendFilter(const rtl::OUString& aTitle, const rtl::OUString& aFilter) throw(lang::IllegalArgumentException, uno::RuntimeException) { OSL_ASSERT(0 != m_pImpl.get()); @@ -317,10 +317,10 @@ void SAL_CALL CFilePicker::appendFilter(const rtl::OUString& aTitle, const rtl:: } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- -void SAL_CALL CFilePicker::setCurrentFilter(const rtl::OUString& aTitle) +void SAL_CALL CFilePicker::setCurrentFilter(const rtl::OUString& aTitle) throw(lang::IllegalArgumentException, uno::RuntimeException) { OSL_ASSERT(0 != m_pImpl.get()); @@ -329,7 +329,7 @@ void SAL_CALL CFilePicker::setCurrentFilter(const rtl::OUString& aTitle) } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- rtl::OUString SAL_CALL CFilePicker::getCurrentFilter() throw(uno::RuntimeException) @@ -340,10 +340,10 @@ rtl::OUString SAL_CALL CFilePicker::getCurrentFilter() throw(uno::RuntimeExcepti } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- -void SAL_CALL CFilePicker::appendFilterGroup(const rtl::OUString& sGroupTitle, const uno::Sequence<beans::StringPair>& aFilters) +void SAL_CALL CFilePicker::appendFilterGroup(const rtl::OUString& sGroupTitle, const uno::Sequence<beans::StringPair>& aFilters) throw (lang::IllegalArgumentException, uno::RuntimeException) { OSL_ASSERT(0 != m_pImpl.get()); @@ -352,10 +352,10 @@ void SAL_CALL CFilePicker::appendFilterGroup(const rtl::OUString& sGroupTitle, c } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- -void SAL_CALL CFilePicker::setDefaultName(const rtl::OUString& aName) +void SAL_CALL CFilePicker::setDefaultName(const rtl::OUString& aName) throw(uno::RuntimeException) { OSL_ASSERT(0 != m_pImpl.get()); @@ -364,10 +364,10 @@ void SAL_CALL CFilePicker::setDefaultName(const rtl::OUString& aName) } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- -void SAL_CALL CFilePicker::setDisplayDirectory(const rtl::OUString& aDirectory) +void SAL_CALL CFilePicker::setDisplayDirectory(const rtl::OUString& aDirectory) throw(lang::IllegalArgumentException, uno::RuntimeException) { OSL_ASSERT(0 != m_pImpl.get()); @@ -376,7 +376,7 @@ void SAL_CALL CFilePicker::setDisplayDirectory(const rtl::OUString& aDirectory) } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- rtl::OUString SAL_CALL CFilePicker::getDisplayDirectory() throw(uno::RuntimeException) @@ -387,7 +387,7 @@ rtl::OUString SAL_CALL CFilePicker::getDisplayDirectory() throw(uno::RuntimeExce } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- uno::Sequence<rtl::OUString> SAL_CALL CFilePicker::getFiles() throw(uno::RuntimeException) @@ -398,7 +398,7 @@ uno::Sequence<rtl::OUString> SAL_CALL CFilePicker::getFiles() throw(uno::Runtime } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- uno::Sequence< ::rtl::OUString > SAL_CALL CFilePicker::getSelectedFiles() throw (uno::RuntimeException) { @@ -409,7 +409,7 @@ uno::Sequence< ::rtl::OUString > SAL_CALL CFilePicker::getSelectedFiles() throw const ::sal_Int32 c = lSource.getLength(); if (c < 2) return lSource; - + const ::rtl::OUString sPath = lSource[0]; ::comphelper::SequenceAsVector< ::rtl::OUString > lTarget; ::sal_Int32 i = 1; @@ -425,26 +425,26 @@ uno::Sequence< ::rtl::OUString > SAL_CALL CFilePicker::getSelectedFiles() throw { // b) file is relative to given path ::rtl::OUStringBuffer sFull(256); - + sFull.append (sPath); sFull.appendAscii("/" ); sFull.append (sFile); - + lTarget.push_back(sFull.makeStringAndClear()); } } - + return lTarget.getAsConstList(); } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- sal_Int16 SAL_CALL CFilePicker::execute() throw(uno::RuntimeException) { OSL_ASSERT(0 != m_pImpl.get()); - + sal_Int16 ret; if (startupEventNotification(STARTUP_SUSPENDED)) @@ -461,7 +461,7 @@ sal_Int16 SAL_CALL CFilePicker::execute() throw(uno::RuntimeException) { OSL_ENSURE(sal_False, "Could not start event notifier thread!"); - throw uno::RuntimeException( + throw uno::RuntimeException( rtl::OUString::createFromAscii("Error executing dialog"), static_cast<XFilePicker2*>(this)); } @@ -473,20 +473,20 @@ sal_Int16 SAL_CALL CFilePicker::execute() throw(uno::RuntimeException) // XFilePicker functions //------------------------------------------------------------------------------------ -void SAL_CALL CFilePicker::setValue(sal_Int16 aControlId, sal_Int16 aControlAction, const uno::Any& aValue) +void SAL_CALL CFilePicker::setValue(sal_Int16 aControlId, sal_Int16 aControlAction, const uno::Any& aValue) throw(uno::RuntimeException) { OSL_ASSERT(0 != m_pImpl.get()); - + osl::MutexGuard aGuard(m_aMutex); m_pImpl->setValue(aControlId, aControlAction, aValue); } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- -uno::Any SAL_CALL CFilePicker::getValue(sal_Int16 aControlId, sal_Int16 aControlAction) +uno::Any SAL_CALL CFilePicker::getValue(sal_Int16 aControlId, sal_Int16 aControlAction) throw(uno::RuntimeException) { OSL_ASSERT(0 != m_pImpl.get()); @@ -496,10 +496,10 @@ uno::Any SAL_CALL CFilePicker::getValue(sal_Int16 aControlId, sal_Int16 aControl } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- -void SAL_CALL CFilePicker::enableControl(sal_Int16 aControlId, sal_Bool bEnable) +void SAL_CALL CFilePicker::enableControl(sal_Int16 aControlId, sal_Bool bEnable) throw(uno::RuntimeException) { OSL_ASSERT( 0 != m_pImpl.get( ) ); @@ -509,10 +509,10 @@ throw(uno::RuntimeException) } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- -void SAL_CALL CFilePicker::setLabel(sal_Int16 aControlId, const ::rtl::OUString& aLabel) +void SAL_CALL CFilePicker::setLabel(sal_Int16 aControlId, const ::rtl::OUString& aLabel) throw (uno::RuntimeException) { OSL_ASSERT(0 != m_pImpl.get()); @@ -522,10 +522,10 @@ void SAL_CALL CFilePicker::setLabel(sal_Int16 aControlId, const ::rtl::OUString& } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- -rtl::OUString SAL_CALL CFilePicker::getLabel(sal_Int16 aControlId) +rtl::OUString SAL_CALL CFilePicker::getLabel(sal_Int16 aControlId) throw (uno::RuntimeException) { OSL_ASSERT(0 != m_pImpl.get()); @@ -535,7 +535,7 @@ rtl::OUString SAL_CALL CFilePicker::getLabel(sal_Int16 aControlId) } //------------------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------------------ uno::Sequence<sal_Int16> SAL_CALL CFilePicker::getSupportedImageFormats() throw (uno::RuntimeException) @@ -547,7 +547,7 @@ uno::Sequence<sal_Int16> SAL_CALL CFilePicker::getSupportedImageFormats() throw } //------------------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------------------ sal_Int32 SAL_CALL CFilePicker::getTargetColorDepth() throw (uno::RuntimeException) @@ -559,7 +559,7 @@ sal_Int32 SAL_CALL CFilePicker::getTargetColorDepth() throw (uno::RuntimeExcepti } //------------------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------------------ sal_Int32 SAL_CALL CFilePicker::getAvailableWidth() throw (uno::RuntimeException) @@ -571,7 +571,7 @@ sal_Int32 SAL_CALL CFilePicker::getAvailableWidth() throw (uno::RuntimeException } //------------------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------------------ sal_Int32 SAL_CALL CFilePicker::getAvailableHeight() throw (uno::RuntimeException) @@ -583,10 +583,10 @@ sal_Int32 SAL_CALL CFilePicker::getAvailableHeight() throw (uno::RuntimeExceptio } //------------------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------------------ -void SAL_CALL CFilePicker::setImage(sal_Int16 aImageFormat, const uno::Any& aImage) +void SAL_CALL CFilePicker::setImage(sal_Int16 aImageFormat, const uno::Any& aImage) throw (lang::IllegalArgumentException, uno::RuntimeException) { OSL_ASSERT(0 != m_pImpl.get()); @@ -596,19 +596,19 @@ void SAL_CALL CFilePicker::setImage(sal_Int16 aImageFormat, const uno::Any& aIma } //------------------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------------------ sal_Bool SAL_CALL CFilePicker::setShowState(sal_Bool bShowState) throw (uno::RuntimeException) { OSL_ASSERT(0 != m_pImpl.get()); - osl::MutexGuard aGuard(m_aMutex); + osl::MutexGuard aGuard(m_aMutex); return m_pImpl->setShowState(bShowState); } //------------------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------------------ sal_Bool SAL_CALL CFilePicker::getShowState() throw (uno::RuntimeException) @@ -620,19 +620,19 @@ sal_Bool SAL_CALL CFilePicker::getShowState() throw (uno::RuntimeException) } //------------------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------------------ -void SAL_CALL CFilePicker::initialize(const uno::Sequence<uno::Any>& aArguments) +void SAL_CALL CFilePicker::initialize(const uno::Sequence<uno::Any>& aArguments) throw( uno::Exception, uno::RuntimeException) { - // parameter checking + // parameter checking uno::Any aAny; if ( 0 == aArguments.getLength( ) ) throw lang::IllegalArgumentException( rtl::OUString::createFromAscii( "no arguments" ), static_cast<XFilePicker2*>(this), 1); - + aAny = aArguments[0]; if ( (aAny.getValueType() != ::getCppuType((sal_Int16*)0)) && @@ -697,7 +697,7 @@ void SAL_CALL CFilePicker::initialize(const uno::Sequence<uno::Any>& aArguments) winResTemplateId = TMPL95_FILEOPEN_LINK_PREVIEW_BOX_ID; break; - case FILEOPEN_PLAY: + case FILEOPEN_PLAY: if ( bIsWin2000 ) winResTemplateId = TMPL2000_PLAY_PUSHBUTTON; else @@ -732,19 +732,19 @@ void SAL_CALL CFilePicker::initialize(const uno::Sequence<uno::Any>& aArguments) static_cast< XFilePicker2* >( this ), 1 ); } - + HINSTANCE hInstance = GetModuleHandle( FILE_PICKER_DLL_NAME ); OSL_POSTCOND( hInstance, "The name of the service dll must have changed" ); - // create a new impl-class here based on the + // create a new impl-class here based on the // given string, if the given string is empty // we do nothing - m_pImpl = std::auto_ptr< CWinFileOpenImpl >( - new CWinFileOpenImpl( - this, - bFileOpenDialog, - 0, - winResTemplateId, + m_pImpl = std::auto_ptr< CWinFileOpenImpl >( + new CWinFileOpenImpl( + this, + bFileOpenDialog, + 0, + winResTemplateId, hInstance ) ); } @@ -758,24 +758,24 @@ void SAL_CALL CFilePicker::cancel() OSL_ASSERT(m_pImpl.get()); osl::MutexGuard aGuard(m_aMutex); - m_pImpl->cancel(); + m_pImpl->cancel(); } // ------------------------------------------------- // XServiceInfo // ------------------------------------------------- -rtl::OUString SAL_CALL CFilePicker::getImplementationName() +rtl::OUString SAL_CALL CFilePicker::getImplementationName() throw(uno::RuntimeException) { return rtl::OUString::createFromAscii(FILE_PICKER_IMPL_NAME); } // ------------------------------------------------- -// XServiceInfo +// XServiceInfo // ------------------------------------------------- -sal_Bool SAL_CALL CFilePicker::supportsService(const rtl::OUString& ServiceName) +sal_Bool SAL_CALL CFilePicker::supportsService(const rtl::OUString& ServiceName) throw(uno::RuntimeException ) { uno::Sequence <rtl::OUString> SupportedServicesNames = FilePicker_getSupportedServiceNames(); @@ -788,10 +788,10 @@ sal_Bool SAL_CALL CFilePicker::supportsService(const rtl::OUString& ServiceName) } // ------------------------------------------------- -// XServiceInfo +// XServiceInfo // ------------------------------------------------- -uno::Sequence<rtl::OUString> SAL_CALL CFilePicker::getSupportedServiceNames() +uno::Sequence<rtl::OUString> SAL_CALL CFilePicker::getSupportedServiceNames() throw(uno::RuntimeException) { return FilePicker_getSupportedServiceNames(); diff --git a/fpicker/source/win32/filepicker/FilePicker.hxx b/fpicker/source/win32/filepicker/FilePicker.hxx index cb9722198fb6..6d17d3a478a4 100644 --- a/fpicker/source/win32/filepicker/FilePicker.hxx +++ b/fpicker/source/win32/filepicker/FilePicker.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -30,7 +30,7 @@ #define _FILEPICKER_HXX_ //_______________________________________________________________________________________________________________________ -// includes of other projects +// includes of other projects //_______________________________________________________________________________________________________________________ @@ -61,17 +61,17 @@ class CWinFileOpenImpl; //---------------------------------------------------------- -// class declaration +// class declaration //---------------------------------------------------------- class CFilePickerDummy { protected: - osl::Mutex m_aMutex; - osl::Mutex m_rbHelperMtx; + osl::Mutex m_aMutex; + osl::Mutex m_rbHelperMtx; }; -class CFilePicker : +class CFilePicker : public CFilePickerDummy, public cppu::WeakComponentImplHelper10< ::com::sun::star::ui::dialogs::XFilterManager, @@ -83,7 +83,7 @@ class CFilePicker : ::com::sun::star::lang::XInitialization, ::com::sun::star::util::XCancellable, ::com::sun::star::lang::XEventListener, - ::com::sun::star::lang::XServiceInfo > + ::com::sun::star::lang::XServiceInfo > { public: @@ -94,38 +94,38 @@ public: // XFilePickerNotifier //------------------------------------------------------------------------------------ - virtual void SAL_CALL addFilePickerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XFilePickerListener >& xListener ) + virtual void SAL_CALL addFilePickerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XFilePickerListener >& xListener ) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL removeFilePickerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XFilePickerListener >& xListener ) + virtual void SAL_CALL removeFilePickerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XFilePickerListener >& xListener ) throw( ::com::sun::star::uno::RuntimeException ); //------------------------------------------------------------------------------------ // XExecutableDialog functions //------------------------------------------------------------------------------------ - - virtual void SAL_CALL setTitle( const ::rtl::OUString& aTitle ) + + virtual void SAL_CALL setTitle( const ::rtl::OUString& aTitle ) throw( ::com::sun::star::uno::RuntimeException ); - virtual sal_Int16 SAL_CALL execute( ) + virtual sal_Int16 SAL_CALL execute( ) throw( ::com::sun::star::uno::RuntimeException ); //------------------------------------------------------------------------------------ // XFilePicker functions //------------------------------------------------------------------------------------ - virtual void SAL_CALL setMultiSelectionMode( sal_Bool bMode ) + virtual void SAL_CALL setMultiSelectionMode( sal_Bool bMode ) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL setDefaultName( const ::rtl::OUString& aName ) + virtual void SAL_CALL setDefaultName( const ::rtl::OUString& aName ) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL setDisplayDirectory( const ::rtl::OUString& aDirectory ) + virtual void SAL_CALL setDisplayDirectory( const ::rtl::OUString& aDirectory ) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); - virtual ::rtl::OUString SAL_CALL getDisplayDirectory( ) + virtual ::rtl::OUString SAL_CALL getDisplayDirectory( ) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getFiles( ) + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getFiles( ) throw( ::com::sun::star::uno::RuntimeException ); //------------------------------------------------------------------------------------ @@ -133,7 +133,7 @@ public: //------------------------------------------------------------------------------------ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSelectedFiles( ) throw (::com::sun::star::uno::RuntimeException); - + //------------------------------------------------------------------------------------ // XFilterManager functions //------------------------------------------------------------------------------------ @@ -141,36 +141,36 @@ public: virtual void SAL_CALL appendFilter( const ::rtl::OUString& aTitle, const ::rtl::OUString& aFilter ) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL setCurrentFilter( const ::rtl::OUString& aTitle ) + virtual void SAL_CALL setCurrentFilter( const ::rtl::OUString& aTitle ) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); - virtual ::rtl::OUString SAL_CALL getCurrentFilter( ) + virtual ::rtl::OUString SAL_CALL getCurrentFilter( ) throw( ::com::sun::star::uno::RuntimeException ); //------------------------------------------------------------------------------------ // XFilterGroupManager functions //------------------------------------------------------------------------------------ - virtual void SAL_CALL appendFilterGroup( const ::rtl::OUString& sGroupTitle, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair >& aFilters ) + virtual void SAL_CALL appendFilterGroup( const ::rtl::OUString& sGroupTitle, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair >& aFilters ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); //------------------------------------------------------------------------------------ // XFilePickerControlAccess functions //------------------------------------------------------------------------------------ - virtual void SAL_CALL setValue( sal_Int16 aControlId, sal_Int16 aControlAction, const ::com::sun::star::uno::Any& aValue ) + virtual void SAL_CALL setValue( sal_Int16 aControlId, sal_Int16 aControlAction, const ::com::sun::star::uno::Any& aValue ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getValue( sal_Int16 aControlId, sal_Int16 aControlAction ) + virtual ::com::sun::star::uno::Any SAL_CALL getValue( sal_Int16 aControlId, sal_Int16 aControlAction ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL enableControl( sal_Int16 aControlId, sal_Bool bEnable ) + virtual void SAL_CALL enableControl( sal_Int16 aControlId, sal_Bool bEnable ) throw(::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL setLabel( sal_Int16 aControlId, const ::rtl::OUString& aLabel ) + virtual void SAL_CALL setLabel( sal_Int16 aControlId, const ::rtl::OUString& aLabel ) throw (::com::sun::star::uno::RuntimeException); - virtual ::rtl::OUString SAL_CALL getLabel( sal_Int16 aControlId ) + virtual ::rtl::OUString SAL_CALL getLabel( sal_Int16 aControlId ) throw (::com::sun::star::uno::RuntimeException); //------------------------------------------------ @@ -209,26 +209,26 @@ public: // XEventListener //------------------------------------------------ - virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& aEvent ) + virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& aEvent ) throw(::com::sun::star::uno::RuntimeException); //------------------------------------------------ // XServiceInfo - //------------------------------------------------ + //------------------------------------------------ - virtual ::rtl::OUString SAL_CALL getImplementationName( ) + virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException); //------------------------------------------------------------------------------------ // FilePicker Event functions //------------------------------------------------------------------------------------ - + void SAL_CALL fileSelectionChanged( ::com::sun::star::ui::dialogs::FilePickerEvent aEvent ); void SAL_CALL directoryChanged( ::com::sun::star::ui::dialogs::FilePickerEvent aEvent ); rtl::OUString SAL_CALL helpRequested( ::com::sun::star::ui::dialogs::FilePickerEvent aEvent ) const; @@ -239,20 +239,20 @@ public: void shutdownEventNotification(); void suspendEventNotification(); void resumeEventNotification(); - + private: // prevent copy and assignment - CFilePicker( const CFilePicker& ); + CFilePicker( const CFilePicker& ); CFilePicker& operator=( const CFilePicker& ); using WeakComponentImplHelperBase::disposing; private: - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceMgr; // to instanciate own services - CAsyncEventNotifier m_aAsyncEventNotifier; - std::auto_ptr<CWinFileOpenImpl> m_pImpl; -}; + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceMgr; // to instanciate own services + CAsyncEventNotifier m_aAsyncEventNotifier; + std::auto_ptr<CWinFileOpenImpl> m_pImpl; +}; -#endif +#endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/fpicker/source/win32/filepicker/FilterContainer.cxx b/fpicker/source/win32/filepicker/FilterContainer.cxx index d2de0ac6d74b..2c609c4f9414 100644 --- a/fpicker/source/win32/filepicker/FilterContainer.cxx +++ b/fpicker/source/win32/filepicker/FilterContainer.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -54,7 +54,7 @@ using ::rtl::OUString; // ctor //------------------------------------------------------------------------------------- -CFilterContainer::CFilterContainer( sal_Int32 initSize ) : +CFilterContainer::CFilterContainer( sal_Int32 initSize ) : m_vFilters( initSize ), m_bIterInitialized( sal_False ) { @@ -64,12 +64,12 @@ CFilterContainer::CFilterContainer( sal_Int32 initSize ) : // add a name/filter pair //----------------------------------------------------------------------------------------- -sal_Bool SAL_CALL CFilterContainer::addFilter( +sal_Bool SAL_CALL CFilterContainer::addFilter( const OUString& aName, const OUString& aFilter, sal_Bool bAllowDuplicates ) { // check if the filter is already in the container sal_Int32 pos = -1; - + if ( !bAllowDuplicates ) { pos = getFilterTagPos( aName ); @@ -91,7 +91,7 @@ sal_Bool SAL_CALL CFilterContainer::addFilter( //----------------------------------------------------------------------------------------- // delete a filter // Precondition: the container is not empty -// there is a filter identified by the given name +// there is a filter identified by the given name //----------------------------------------------------------------------------------------- sal_Bool SAL_CALL CFilterContainer::delFilter( const OUString& aName ) @@ -129,14 +129,14 @@ void SAL_CALL CFilterContainer::empty() //----------------------------------------------------------------------------------------- // get a filter by name // Precondition: the container is not empty -// there is a filter identified by the name +// there is a filter identified by the name //----------------------------------------------------------------------------------------- sal_Bool SAL_CALL CFilterContainer::getFilter( const OUString& aName, OUString& theFilter ) const { OSL_PRECOND( m_vFilters.size() > 0, "Empty filter container" ); - sal_Int32 pos = getFilterTagPos( aName ); + sal_Int32 pos = getFilterTagPos( aName ); try { @@ -153,7 +153,7 @@ sal_Bool SAL_CALL CFilterContainer::getFilter( const OUString& aName, OUString& } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- sal_Bool SAL_CALL CFilterContainer::getFilter( sal_Int32 aIndex, OUString& theFilter ) const @@ -174,7 +174,7 @@ sal_Bool SAL_CALL CFilterContainer::getFilter( sal_Int32 aIndex, OUString& theFi } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- sal_Int32 SAL_CALL CFilterContainer::getFilterPos( const OUString& aName ) const @@ -189,14 +189,14 @@ sal_Int32 SAL_CALL CFilterContainer::getFilterPos( const OUString& aName ) const sal_Int32 SAL_CALL CFilterContainer::getFilterTagPos( const OUString& aName ) const { if ( m_vFilters.size( ) > 0 ) - { + { sal_Int32 i = 0; FILTER_VECTOR_T::const_iterator iter; FILTER_VECTOR_T::const_iterator iter_end = m_vFilters.end( ); for ( iter = m_vFilters.begin( ); iter != iter_end; ++iter, ++i ) if ( ( *iter ).first.equalsIgnoreAsciiCase( aName ) ) - return i; + return i; } return -1; @@ -247,13 +247,13 @@ void SAL_CALL CFilterContainer::setCurrentFilter( const ::rtl::OUString& aName ) //------------------------------------------------------------------- // calculates the length of a '\0' separated filter, that means -// length of the name + '\0' + length of the filter string + +// length of the name + '\0' + length of the filter string + // a trailing '\0' //------------------------------------------------------------------- static sal_uInt32 _getLengthFilter( CFilterContainer::FILTER_ENTRY_T aFilterEntry ) { - return ( + return ( aFilterEntry.first.getLength( ) + 1 + aFilterEntry.second.getLength( ) + 1 ); } @@ -286,8 +286,8 @@ void _wcsmemcpy( sal_Unicode* pDest, const sal_Unicode* pSrc, sal_uInt32 nLength } //------------------------------------------------------------------- -// a helper trivial helper function to create a filter buffer in the -// format the Win32 API requires, +// a helper trivial helper function to create a filter buffer in the +// format the Win32 API requires, // e.g. "Text\0*.txt\0Doc\0*.doc;*xls\0\0" //------------------------------------------------------------------- @@ -313,11 +313,11 @@ rtl::OUString SAL_CALL makeWinFilterBuffer( CFilterContainer& aFilterContainer ) while( aFilterContainer.getNextFilter( nextFilter ) ) { - _wcsmemcpy( - pBuff + memPos, + _wcsmemcpy( + pBuff + memPos, nextFilter.first.getStr( ), nextFilter.first.getLength( ) ); - + memPos += nextFilter.first.getLength( ) + 1; _wcsmemcpy( diff --git a/fpicker/source/win32/filepicker/FilterContainer.hxx b/fpicker/source/win32/filepicker/FilterContainer.hxx index 91ee54571418..44e0e15a139e 100644 --- a/fpicker/source/win32/filepicker/FilterContainer.hxx +++ b/fpicker/source/win32/filepicker/FilterContainer.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -47,17 +47,17 @@ public: public: explicit CFilterContainer( sal_Int32 initSize = 0 ); - - // add a new filter + + // add a new filter // returns true if the filter was successfully added // returns false if duplicates are not allowed and // the filter is already in the container - sal_Bool SAL_CALL addFilter( - const ::rtl::OUString& aName, + sal_Bool SAL_CALL addFilter( + const ::rtl::OUString& aName, const ::rtl::OUString& aFilter, sal_Bool bAllowDuplicates = sal_False ); - // delete the specified filter returns true on + // delete the specified filter returns true on // success and false if the filter was not found sal_Bool SAL_CALL delFilter( const ::rtl::OUString& aName ); @@ -67,13 +67,13 @@ public: // clear all entries void SAL_CALL empty( ); - // retrieve a filter from the container both methods - // return true on success and false if the specified + // retrieve a filter from the container both methods + // return true on success and false if the specified // filter was not found sal_Bool SAL_CALL getFilter( const ::rtl::OUString& aName, ::rtl::OUString& theFilter ) const; sal_Bool SAL_CALL getFilter( sal_Int32 aIndex, ::rtl::OUString& theFilter ) const; - // returns the position of the specified filter or -1 + // returns the position of the specified filter or -1 // if the filter was not found sal_Int32 SAL_CALL getFilterPos( const ::rtl::OUString& aName ) const; @@ -82,21 +82,21 @@ public: // returns true if another filter has been retrieved sal_Bool SAL_CALL getNextFilter( FILTER_ENTRY_T& nextFilterEntry ); - + // cache current filter void SAL_CALL setCurrentFilter( const ::rtl::OUString& aName ); - + // returns cached current filter ::rtl::OUString SAL_CALL getCurrentFilter() const; -protected: +protected: typedef std::vector< FILTER_ENTRY_T > FILTER_VECTOR_T; private: // prevent copy and assignment CFilterContainer( const CFilterContainer& ); CFilterContainer& SAL_CALL operator=( const CFilterContainer& ); - + sal_Int32 SAL_CALL getFilterTagPos( const ::rtl::OUString& aName ) const; private: diff --git a/fpicker/source/win32/filepicker/IVistaFilePickerInternalNotify.hxx b/fpicker/source/win32/filepicker/IVistaFilePickerInternalNotify.hxx index a03e6f3fe23c..9eb8ee779486 100644 --- a/fpicker/source/win32/filepicker/IVistaFilePickerInternalNotify.hxx +++ b/fpicker/source/win32/filepicker/IVistaFilePickerInternalNotify.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -65,7 +65,7 @@ namespace vista{ class IVistaFilePickerInternalNotify { public: - + virtual void onAutoExtensionChanged (bool bChecked) = 0; }; diff --git a/fpicker/source/win32/filepicker/PreviewCtrl.cxx b/fpicker/source/win32/filepicker/PreviewCtrl.cxx index 9dd419d5a19d..82a29ae05df0 100644 --- a/fpicker/source/win32/filepicker/PreviewCtrl.cxx +++ b/fpicker/source/win32/filepicker/PreviewCtrl.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -76,7 +76,7 @@ namespace // private { class CPreviewException { - // used when registering or creation + // used when registering or creation // of the preview window failed }; @@ -85,7 +85,7 @@ namespace // private //------------------------------------------------------------ inline - sal_Int32 SubDiv( sal_Int32 nNumber, sal_Int32 nMinuend, sal_Int32 nDenominator ) + sal_Int32 SubDiv( sal_Int32 nNumber, sal_Int32 nMinuend, sal_Int32 nDenominator ) { return ( static_cast<sal_Int32>( ( nNumber - nMinuend ) / nDenominator ) ); } @@ -114,7 +114,7 @@ namespace // private // //------------------------------------------------------------ - inline + inline sal_uInt32 _getHeightRect( const RECT& aRect ) { return ( aRect.bottom - aRect.top ); @@ -125,7 +125,7 @@ namespace // private // displayed centered within the given window //------------------------------------------------------------ - inline + inline POINT _calcULCorner( HWND hwnd, const CDimension& aPicSize ) { RECT rect; @@ -133,7 +133,7 @@ namespace // private sal_Int32 nWidthWnd = _getWidthRect( rect ); sal_Int32 nHeightWnd = _getHeightRect( rect ); - + POINT ulCorner; ulCorner.x = SubDiv( nWidthWnd, aPicSize.m_cx, 2 ); ulCorner.y = SubDiv( nHeightWnd, aPicSize.m_cy, 2 ); @@ -146,17 +146,17 @@ namespace // private // arbitrary window // we expect the width and height to be in pixel //------------------------------------------------------------ - + inline sal_Bool _pictureSizeFitsWindowSize( HWND hwnd, const CDimension& aPicSize ) { RECT rect; GetClientRect( hwnd, &rect ); - + sal_Int32 nWidthWnd = _getWidthRect( rect ); sal_Int32 nHeightWnd = _getHeightRect( rect ); - return ( ( ( nWidthWnd - HORZ_BODER_SPACE ) >= aPicSize.m_cx ) && + return ( ( ( nWidthWnd - HORZ_BODER_SPACE ) >= aPicSize.m_cx ) && ( ( nHeightWnd - VERT_BORDER_SPACE ) >= aPicSize.m_cy ) ); } @@ -170,13 +170,13 @@ namespace // private CDimension _scalePictureSize( HWND hwnd, const CDimension& aPicSize ) { CDimension scaledPicSize = aPicSize; - + if ( !_pictureSizeFitsWindowSize( hwnd, aPicSize ) ) { RECT rect; GetClientRect( hwnd, &rect ); - - // the dimensions of the preview wnd are not equal + + // the dimensions of the preview wnd are not equal // that's why we equalize it sal_Int32 nHeightWnd = _getHeightRect( rect ) - VERT_BORDER_SPACE; sal_Int32 nWidthWnd = nHeightWnd; @@ -184,14 +184,14 @@ namespace // private if ( aPicSize.m_cx >= aPicSize.m_cy ) { scaledPicSize.m_cx = nWidthWnd; - scaledPicSize.m_cy = - static_cast< sal_Int32 >( - aPicSize.m_cy * nWidthWnd / aPicSize.m_cx ); + scaledPicSize.m_cy = + static_cast< sal_Int32 >( + aPicSize.m_cy * nWidthWnd / aPicSize.m_cx ); } else { - scaledPicSize.m_cx = - static_cast< sal_Int32 >( + scaledPicSize.m_cx = + static_cast< sal_Int32 >( aPicSize.m_cx * nHeightWnd / aPicSize.m_cy ); scaledPicSize.m_cy = nHeightWnd; } @@ -202,24 +202,24 @@ namespace // private } // end namespace - + //--------------------------------------------------- // to ensure only one instance (singleton) //--------------------------------------------------- -CFilePreview* CFilePreview::createInstance( - HWND aParent, - POINT ulCorner, - const CDimension& aSize, - HINSTANCE hInstance, - sal_Bool bShow, +CFilePreview* CFilePreview::createInstance( + HWND aParent, + POINT ulCorner, + const CDimension& aSize, + HINSTANCE hInstance, + sal_Bool bShow, sal_Bool bEnabled ) { if ( !s_FilePreviewInst ) { try { - s_FilePreviewInst = new CFilePreview( + s_FilePreviewInst = new CFilePreview( aParent, ulCorner, aSize, hInstance, bShow, bEnabled ); s_SingletonDestroyer.reset( s_FilePreviewInst ); } @@ -242,41 +242,41 @@ CFilePreview* CFilePreview::createInstance( // //--------------------------------------------------- -CFilePreview::CFilePreview( - HWND aParent, - POINT ulCorner, - const CDimension& aSize, - HINSTANCE hInstance, - sal_Bool bShow, - sal_Bool bEnabled ) : +CFilePreview::CFilePreview( + HWND aParent, + POINT ulCorner, + const CDimension& aSize, + HINSTANCE hInstance, + sal_Bool bShow, + sal_Bool bEnabled ) : m_hInstance( hInstance ), m_bEnabled( bEnabled ) { - // register the preview window class - WNDCLASSEX wndClsEx; + // register the preview window class + WNDCLASSEX wndClsEx; ZeroMemory(&wndClsEx, sizeof(wndClsEx)); wndClsEx.cbSize = sizeof(wndClsEx); - wndClsEx.style = CS_HREDRAW | CS_VREDRAW; + wndClsEx.style = CS_HREDRAW | CS_VREDRAW; wndClsEx.lpfnWndProc = CFilePreview::WndProc; wndClsEx.hInstance = m_hInstance; wndClsEx.hbrBackground = (HBRUSH)( COLOR_INACTIVEBORDER + 1 ); wndClsEx.lpszClassName = PREVIEWWND_CLASS_NAME; - + // register the preview window class - // !!! Win95 - the window class will be unregistered automaticly - // if the dll is unloaded + // !!! Win95 - the window class will be unregistered automaticly + // if the dll is unloaded // Win2000 - the window class must be unregistered manually - // if the dll is unloaded + // if the dll is unloaded m_atomPrevWndClass = RegisterClassEx(&wndClsEx); if ( !m_atomPrevWndClass ) throw CPreviewException( ); - + // create the preview window in invisible state sal_uInt32 dwStyle = bShow ? (WS_CHILD | WS_VISIBLE) : WS_CHILD; - m_hwnd = CreateWindowEx( - WS_EX_CLIENTEDGE, - PREVIEWWND_CLASS_NAME, + m_hwnd = CreateWindowEx( + WS_EX_CLIENTEDGE, + PREVIEWWND_CLASS_NAME, TEXT(""), dwStyle, ulCorner.x, @@ -284,7 +284,7 @@ CFilePreview::CFilePreview( aSize.m_cx, aSize.m_cy, aParent, - (HMENU)100, // for child windows this will + (HMENU)100, // for child windows this will // be used as child window identifier m_hInstance, 0 ); @@ -297,12 +297,12 @@ CFilePreview::CFilePreview( //--------------------------------------------------- CFilePreview::~CFilePreview( ) -{ +{ // unregister preview window class - sal_Bool bRet = UnregisterClass( + sal_Bool bRet = UnregisterClass( (LPCTSTR)MAKELONG( m_atomPrevWndClass, 0 ), m_hInstance ); - OSL_POSTCOND( bRet, "Unregister preview window class failed" ); + OSL_POSTCOND( bRet, "Unregister preview window class failed" ); } //--------------------------------------------------- @@ -312,19 +312,19 @@ CFilePreview::~CFilePreview( ) sal_Bool SAL_CALL CFilePreview::setSize( const CDimension& aSize ) { OSL_PRECOND( IsWindow( m_hwnd ), "Preview window not initialized" ); - + // resize the fileopen file listbox - return SetWindowPos( - m_hwnd, - NULL, - 0, - 0, - aSize.m_cx, - aSize.m_cy, + return SetWindowPos( + m_hwnd, + NULL, + 0, + 0, + aSize.m_cx, + aSize.m_cy, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE ); } -//--------------------------------------------------- +//--------------------------------------------------- // returns the dimension of the preview //--------------------------------------------------- @@ -342,7 +342,7 @@ sal_Bool SAL_CALL CFilePreview::getSize( CDimension& theSize ) const } //--------------------------------------------------- -// sets the position of the upper left corner +// sets the position of the upper left corner // of the preview window relative to the // upper left corner of the parent window //--------------------------------------------------- @@ -352,13 +352,13 @@ sal_Bool SAL_CALL CFilePreview::setPos( POINT ulCorner ) OSL_PRECOND( IsWindow( m_hwnd ), "Preview window not initialized" ); // resize the fileopen file listbox - return SetWindowPos( - m_hwnd, - NULL, - ulCorner.x, - ulCorner.y, - 0, - 0, + return SetWindowPos( + m_hwnd, + NULL, + ulCorner.x, + ulCorner.y, + 0, + 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE ); } @@ -386,16 +386,16 @@ sal_Bool SAL_CALL CFilePreview::getPos( POINT& ulCorner ) const } //--------------------------------------------------- -// +// //--------------------------------------------------- void SAL_CALL CFilePreview::enable( sal_Bool bEnable ) { m_bEnabled = bEnable; - + // force a redraw InvalidateRect( m_hwnd, NULL, TRUE ); - UpdateWindow( m_hwnd ); + UpdateWindow( m_hwnd ); } //--------------------------------------------------- @@ -415,33 +415,33 @@ sal_Bool SAL_CALL CFilePreview::show( sal_Bool bShow ) return ShowWindow( m_hwnd, showState ); } -//--------------------------------------------------- -// if the preview is shown and enabled +//--------------------------------------------------- +// if the preview is shown and enabled // preview of the given file will be shown // returns true on success or false if an error // occured (the file in not there or not accessible etc.) //--------------------------------------------------- sal_Bool SAL_CALL CFilePreview::update( const rtl::OUString& aFileName ) -{ +{ OSL_PRECOND( IsWindow( m_hwnd ), "Preview window not initialized" ); try { if ( m_bEnabled ) - { + { if ( m_IPicture ) m_IPicture.Release( ); loadFile( aFileName ); - + // force a complete window redraw InvalidateRect( m_hwnd, NULL, TRUE ); - UpdateWindow( m_hwnd ); + UpdateWindow( m_hwnd ); } - } + } catch( _com_error& ) - { + { } return sal_True; @@ -456,8 +456,8 @@ void SAL_CALL CFilePreview::onPaint( HWND hWnd, HDC hDC ) OSL_PRECOND( IsWindow( m_hwnd ), "Preview window not initialized" ); try - { - if ( m_bEnabled ) + { + if ( m_bEnabled ) { // get width and height of picture long cxPicHIMETRIC; @@ -465,16 +465,16 @@ void SAL_CALL CFilePreview::onPaint( HWND hWnd, HDC hDC ) m_IPicture->get_Width( &cxPicHIMETRIC ); m_IPicture->get_Height( &cyPicHIMETRIC ); - + // convert himetric to pixels - int cxPicPIXEL = Himetric2Pixel( hDC, cxPicHIMETRIC, LOGPIXELSX ); - int cyPicPIXEL = Himetric2Pixel( hDC, cyPicHIMETRIC, LOGPIXELSY ); - + int cxPicPIXEL = Himetric2Pixel( hDC, cxPicHIMETRIC, LOGPIXELSX ); + int cyPicPIXEL = Himetric2Pixel( hDC, cyPicHIMETRIC, LOGPIXELSY ); + // scale the picture based on the size of the preview window RECT rcPrevWnd; GetClientRect(hWnd, &rcPrevWnd); - CDimension scaledPicSize = _scalePictureSize( + CDimension scaledPicSize = _scalePictureSize( hWnd, CDimension( cxPicPIXEL, cyPicPIXEL ) ); // calc the upper left corner so that the picture @@ -492,27 +492,27 @@ void SAL_CALL CFilePreview::onPaint( HWND hWnd, HDC hDC ) cyPicHIMETRIC, cxPicHIMETRIC, -cyPicHIMETRIC, - &rcPrevWnd ); + &rcPrevWnd ); } // end if ( m_bEnabled ) } catch( _com_error& ) - { + { } } //--------------------------------------------------- // //--------------------------------------------------- - + sal_Bool CFilePreview::loadFile( const rtl::OUString& aFileName ) { - HANDLE hFile = 0; - HGLOBAL hGlobal = 0; - LPVOID pData = NULL; - IStreamPtr pIStream; - HRESULT hr = E_FAIL; - sal_Bool bRet; - sal_uInt32 nBytesRead; + HANDLE hFile = 0; + HGLOBAL hGlobal = 0; + LPVOID pData = NULL; + IStreamPtr pIStream; + HRESULT hr = E_FAIL; + sal_Bool bRet; + sal_uInt32 nBytesRead; sal_uInt32 fszExtra; sal_uInt32 fsize; @@ -528,10 +528,10 @@ sal_Bool CFilePreview::loadFile( const rtl::OUString& aFileName ) goto CLEANUP_AND_EXIT; fszExtra = 0; - fsize = GetFileSize( hFile, &fszExtra ); + fsize = GetFileSize( hFile, &fszExtra ); // empty file, error or file to big - if ( -1 == fsize || 0 == fsize || fszExtra ) + if ( -1 == fsize || 0 == fsize || fszExtra ) goto CLEANUP_AND_EXIT; hGlobal = GlobalAlloc( GMEM_MOVEABLE, fsize ); @@ -541,23 +541,23 @@ sal_Bool CFilePreview::loadFile( const rtl::OUString& aFileName ) pData = GlobalLock( hGlobal ); if ( !pData ) goto CLEANUP_AND_EXIT; - + bRet = ReadFile( hFile, pData, fsize, &nBytesRead, NULL ); if ( !bRet ) goto CLEANUP_AND_EXIT; - + hr = CreateStreamOnHGlobal( hGlobal, FALSE, &pIStream ); if ( SUCCEEDED( hr ) ) { hr = OleLoadPicture( - pIStream, fsize, FALSE, + pIStream, fsize, FALSE, __uuidof( IPicture ), (LPVOID*)&m_IPicture ); } - + CLEANUP_AND_EXIT: if ( hFile ) CloseHandle( hFile ); @@ -574,8 +574,8 @@ CLEANUP_AND_EXIT: //--------------------------------------------------- // //--------------------------------------------------- - -LRESULT CALLBACK CFilePreview::WndProc( + +LRESULT CALLBACK CFilePreview::WndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ) { LRESULT lResult = 0; @@ -587,7 +587,7 @@ LRESULT CALLBACK CFilePreview::WndProc( OSL_PRECOND( s_FilePreviewInst, "Static member not initialized" ); HDC hDC; - PAINTSTRUCT ps; + PAINTSTRUCT ps; hDC = BeginPaint( hWnd, &ps ); s_FilePreviewInst->onPaint( hWnd, hDC ); @@ -595,8 +595,8 @@ LRESULT CALLBACK CFilePreview::WndProc( } break; - // under windows 95/98 the creation of the - // hidden target request window fails if + // under windows 95/98 the creation of the + // hidden target request window fails if // we don't handle this message ourself // because the DefWindowProc returns 0 as // a result of handling WM_NCCREATE what diff --git a/fpicker/source/win32/filepicker/PreviewCtrl.hxx b/fpicker/source/win32/filepicker/PreviewCtrl.hxx index 5cde69e5fa65..32937c7c69cf 100644 --- a/fpicker/source/win32/filepicker/PreviewCtrl.hxx +++ b/fpicker/source/win32/filepicker/PreviewCtrl.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -50,15 +50,15 @@ public: CDimension( ) : m_cx( 0 ), m_cy( 0 ) - { + { } CDimension( sal_Int32 cx, sal_Int32 cy ) : m_cx( cx ), m_cy( cy ) - { + { } - + sal_Int32 m_cx; sal_Int32 m_cy; }; @@ -67,9 +67,9 @@ public: // we use OleInitialize here because we are calling // some Ole functions to realize the picture preview // and we expect to be called from the main thread -// so that there will be no problem calling +// so that there will be no problem calling // OleInitialize (the main thread should be an STA) -// When OleInitialize should fail at worst the +// When OleInitialize should fail at worst the // preview doesn't work //-------------------------------------------------- @@ -77,7 +77,7 @@ class CAutoOleInit { public: - // used to communicate ole + // used to communicate ole // initialzation failures class COleInitException { }; @@ -97,7 +97,7 @@ public: //--------------------------------------------- // A simple file preview class to preview some // common picture formats like *.gif, *jpg, etc. -// This class is not thread-safe and is +// This class is not thread-safe and is // implmented as singleton, because the class // has only one static member to reconnect // from callback functions @@ -112,21 +112,21 @@ class CFilePreview { public: // to ensure only one instance (singleton) - static CFilePreview* createInstance( - HWND aParent, - POINT ulCorner, - const CDimension& aSize, - HINSTANCE hInstance, - sal_Bool bShow = sal_True, + static CFilePreview* createInstance( + HWND aParent, + POINT ulCorner, + const CDimension& aSize, + HINSTANCE hInstance, + sal_Bool bShow = sal_True, sal_Bool bEnabled = sal_True ); // sets the size of the preview window sal_Bool SAL_CALL setSize( const CDimension& aSize ); - + // returns the CDimension of the preview sal_Bool SAL_CALL getSize( CDimension& theSize ) const; - // sets the position of the upper left corner + // sets the position of the upper left corner // of the preview window relative to the // upper left corner of the parent window sal_Bool SAL_CALL setPos( POINT ulCorner ); @@ -136,7 +136,7 @@ public: // parent window sal_Bool SAL_CALL getPos( POINT& ulCorner ) const; - // enables or disables the preview window + // enables or disables the preview window // bEnable - true the window is enabled and updates its // view when update is called // bEnable - false the window shows itself in disabled @@ -147,22 +147,22 @@ public: // shows the preview window // possible values see SHOW_STATE sal_Bool SAL_CALL show( sal_Bool bShow ); - - - // if the preview is shown and enabled + + + // if the preview is shown and enabled // preview of the given file will be shown // returns true on success or false if an error // occured (the file in not there or not accessible etc.) virtual sal_Bool SAL_CALL update( const rtl::OUString& aFileName ); -protected: +protected: // clients can create instances only through the static create method - CFilePreview( - HWND aParent, - POINT ulCorner, - const CDimension& aSize, - HINSTANCE hInstance, - sal_Bool bShow = sal_True, + CFilePreview( + HWND aParent, + POINT ulCorner, + const CDimension& aSize, + HINSTANCE hInstance, + sal_Bool bShow = sal_True, sal_Bool bEnabled = sal_True ); // only the singleton destroyer class is allowed to delete the @@ -174,18 +174,18 @@ protected: protected: virtual void SAL_CALL onPaint( HWND hWnd, HDC hDC ); - + sal_Bool loadFile( const rtl::OUString& aFileName ); - + private: CAutoOleInit m_autoOleInit; - POINT m_pt; - CDimension m_dim; - HWND m_hwnd; - sal_Bool m_bEnabled; + POINT m_pt; + CDimension m_dim; + HWND m_hwnd; + sal_Bool m_bEnabled; IPicturePtr m_IPicture; - ATOM m_atomPrevWndClass; - HINSTANCE m_hInstance; + ATOM m_atomPrevWndClass; + HINSTANCE m_hInstance; static LRESULT CALLBACK WndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ); diff --git a/fpicker/source/win32/filepicker/SolarMutex.cxx b/fpicker/source/win32/filepicker/SolarMutex.cxx index b11d35a16aaf..393bd74836c3 100644 --- a/fpicker/source/win32/filepicker/SolarMutex.cxx +++ b/fpicker/source/win32/filepicker/SolarMutex.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/fpicker/source/win32/filepicker/SolarMutex.hxx b/fpicker/source/win32/filepicker/SolarMutex.hxx index d9c73ba6fe02..1f39a40beb77 100644 --- a/fpicker/source/win32/filepicker/SolarMutex.hxx +++ b/fpicker/source/win32/filepicker/SolarMutex.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/fpicker/source/win32/filepicker/VistaFilePicker.cxx b/fpicker/source/win32/filepicker/VistaFilePicker.cxx index 3770cdaa330c..397fac4f1473 100644 --- a/fpicker/source/win32/filepicker/VistaFilePicker.cxx +++ b/fpicker/source/win32/filepicker/VistaFilePicker.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -85,10 +85,10 @@ namespace vista{ namespace { - // controling event notifications + // controling event notifications const bool STARTUP_SUSPENDED = true; const bool STARTUP_ALIVE = false; - + css::uno::Sequence< ::rtl::OUString > SAL_CALL VistaFilePicker_getSupportedServiceNames() { css::uno::Sequence< ::rtl::OUString > aRet(2); @@ -118,20 +118,20 @@ namespace fprintf(pFile, PARAM_MESSAGE, PARAM_1); \ fclose(pFile); \ } - + #define LOG_FILE_2_PARAM(PARAM_MESSAGE, PARAM_1, PARAM_2) \ { \ FILE* pFile = fopen(LOGFILE_VISTA, "a"); \ fprintf(pFile, PARAM_MESSAGE, PARAM_1, PARAM_2); \ fclose(pFile); \ } - + #else #define LOG_FILE(PARAM_MESSAGE) #define LOG_FILE_1_PARAM(PARAM_MESSAGE, PARAM_1) #define LOG_FILE_2_PARAM(PARAM_MESSAGE, PARAM_1, PARAM_2) - + #endif //----------------------------------------------------------------------------------------- @@ -164,7 +164,7 @@ VistaFilePicker::VistaFilePicker(const css::uno::Reference< css::lang::XMultiSer , m_rDialog (new VistaFilePickerImpl()) , m_aAsyncExecute (m_rDialog ) , m_nFilePickerThreadId (0 ) - , m_bInitialized (false ) + , m_bInitialized (false ) { } @@ -174,7 +174,7 @@ VistaFilePicker::~VistaFilePicker() } //------------------------------------------------------------------------------------ -void SAL_CALL VistaFilePicker::addFilePickerListener(const css::uno::Reference< css::ui::dialogs::XFilePickerListener >& xListener) +void SAL_CALL VistaFilePicker::addFilePickerListener(const css::uno::Reference< css::ui::dialogs::XFilePickerListener >& xListener) throw(css::uno::RuntimeException) { RequestRef rRequest(new Request()); @@ -185,7 +185,7 @@ void SAL_CALL VistaFilePicker::addFilePickerListener(const css::uno::Reference< } //----------------------------------------------------------------------------------------- -void SAL_CALL VistaFilePicker::removeFilePickerListener(const css::uno::Reference< css::ui::dialogs::XFilePickerListener >& xListener ) +void SAL_CALL VistaFilePicker::removeFilePickerListener(const css::uno::Reference< css::ui::dialogs::XFilePickerListener >& xListener ) throw(css::uno::RuntimeException) { RequestRef rRequest(new Request()); @@ -264,7 +264,7 @@ void SAL_CALL VistaFilePicker::setCurrentFilter(const ::rtl::OUString& sTitle) //----------------------------------------------------------------------------------------- void SAL_CALL VistaFilePicker::appendFilterGroup(const ::rtl::OUString& /*sGroupTitle*/, - const css::uno::Sequence< css::beans::StringPair >& lFilters ) + const css::uno::Sequence< css::beans::StringPair >& lFilters ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException ) { @@ -278,7 +278,7 @@ void SAL_CALL VistaFilePicker::appendFilterGroup(const ::rtl::OUString& } //----------------------------------------------------------------------------------------- -void SAL_CALL VistaFilePicker::setDefaultName(const ::rtl::OUString& sName ) +void SAL_CALL VistaFilePicker::setDefaultName(const ::rtl::OUString& sName ) throw(css::uno::RuntimeException) { RequestRef rRequest(new Request()); @@ -289,7 +289,7 @@ void SAL_CALL VistaFilePicker::setDefaultName(const ::rtl::OUString& sName ) } //----------------------------------------------------------------------------------------- -void SAL_CALL VistaFilePicker::setDisplayDirectory(const ::rtl::OUString& sDirectory) +void SAL_CALL VistaFilePicker::setDisplayDirectory(const ::rtl::OUString& sDirectory) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException ) { @@ -299,7 +299,7 @@ void SAL_CALL VistaFilePicker::setDisplayDirectory(const ::rtl::OUString& sDirec css::uno::Any aValue = ::comphelper::ConfigurationHelper::readDirectKey( m_xSMGR, aPackage, aRelPath, aKey, ::comphelper::ConfigurationHelper::E_READONLY); - + bool bChanged(false); if (( aValue >>= bChanged ) && bChanged ) { @@ -323,7 +323,7 @@ void SAL_CALL VistaFilePicker::setDisplayDirectory(const ::rtl::OUString& sDirec rRequest->setRequest (VistaFilePickerImpl::E_GET_DIRECTORY); m_aAsyncExecute.triggerRequestThreadAware(rRequest, AsyncRequests::NON_BLOCKED); const ::rtl::OUString sDirectory = rRequest->getArgumentOrDefault(PROP_FILENAME, ::rtl::OUString()); - + return sDirectory; } @@ -376,7 +376,7 @@ css::uno::Sequence< ::rtl::OUString > SAL_CALL VistaFilePicker::getSelectedFiles RequestRef rRequest(new Request()); rRequest->setRequest (VistaFilePickerImpl::E_SHOW_DIALOG_MODAL); - + // if we want to show a modal window, the calling thread needs to process messages m_aAsyncExecute.triggerRequestThreadAware(rRequest, AsyncRequests::PROCESS_MESSAGES); @@ -395,7 +395,7 @@ css::uno::Sequence< ::rtl::OUString > SAL_CALL VistaFilePicker::getSelectedFiles void SAL_CALL VistaFilePicker::setValue( ::sal_Int16 nControlId , ::sal_Int16 nControlAction, - const css::uno::Any& aValue ) + const css::uno::Any& aValue ) throw(css::uno::RuntimeException) { RequestRef rRequest(new Request()); @@ -408,7 +408,7 @@ void SAL_CALL VistaFilePicker::setValue( ::sal_Int16 nControlId , } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- css::uno::Any SAL_CALL VistaFilePicker::getValue(::sal_Int16 nControlId , @@ -426,7 +426,7 @@ css::uno::Any SAL_CALL VistaFilePicker::getValue(::sal_Int16 nControlId , } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- void SAL_CALL VistaFilePicker::enableControl(::sal_Int16 nControlId, @@ -442,7 +442,7 @@ void SAL_CALL VistaFilePicker::enableControl(::sal_Int16 nControlId, } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- void SAL_CALL VistaFilePicker::setLabel( ::sal_Int16 nControlId, @@ -458,7 +458,7 @@ void SAL_CALL VistaFilePicker::setLabel( ::sal_Int16 nControlId, } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- ::rtl::OUString SAL_CALL VistaFilePicker::getLabel(::sal_Int16 nControlId) @@ -474,7 +474,7 @@ void SAL_CALL VistaFilePicker::setLabel( ::sal_Int16 nControlId, } //------------------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------------------ css::uno::Sequence< ::sal_Int16 > SAL_CALL VistaFilePicker::getSupportedImageFormats() @@ -484,7 +484,7 @@ css::uno::Sequence< ::sal_Int16 > SAL_CALL VistaFilePicker::getSupportedImageFor } //------------------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------------------ sal_Int32 SAL_CALL VistaFilePicker::getTargetColorDepth() @@ -494,7 +494,7 @@ sal_Int32 SAL_CALL VistaFilePicker::getTargetColorDepth() } //------------------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------------------ sal_Int32 SAL_CALL VistaFilePicker::getAvailableWidth() @@ -504,7 +504,7 @@ sal_Int32 SAL_CALL VistaFilePicker::getAvailableWidth() } //------------------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------------------ sal_Int32 SAL_CALL VistaFilePicker::getAvailableHeight() @@ -514,18 +514,18 @@ sal_Int32 SAL_CALL VistaFilePicker::getAvailableHeight() } //------------------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------------------ void SAL_CALL VistaFilePicker::setImage( sal_Int16 /*nImageFormat*/, - const css::uno::Any& /*aImage */) + const css::uno::Any& /*aImage */) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException ) { } //------------------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------------------ sal_Bool SAL_CALL VistaFilePicker::setShowState(sal_Bool /*bShowState*/) @@ -535,7 +535,7 @@ sal_Bool SAL_CALL VistaFilePicker::setShowState(sal_Bool /*bShowState*/) } //------------------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------------------ sal_Bool SAL_CALL VistaFilePicker::getShowState() @@ -545,33 +545,33 @@ sal_Bool SAL_CALL VistaFilePicker::getShowState() } //------------------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------------------ -void SAL_CALL VistaFilePicker::initialize(const css::uno::Sequence< css::uno::Any >& lArguments) +void SAL_CALL VistaFilePicker::initialize(const css::uno::Sequence< css::uno::Any >& lArguments) throw(css::uno::Exception , css::uno::RuntimeException) { /* // called twice ? if (m_pDlg) - throw css::uno::Exception( + throw css::uno::Exception( ::rtl::OUString::createFromAscii( "XInitialization::initialize() called twice." ), static_cast< css::ui::dialogs::XFilePicker* >( this )); */ if (lArguments.getLength() < 1) - throw css::lang::IllegalArgumentException( + throw css::lang::IllegalArgumentException( ::rtl::OUString::createFromAscii( "XInitialization::initialize() called without arguments." ), static_cast< css::ui::dialogs::XFilePicker2* >( this ), 1); sal_Int32 nTemplate = -1; lArguments[0] >>= nTemplate; - + ::sal_Bool bFileOpenDialog = sal_True; ::sal_Int32 nFeatures = 0; - + switch(nTemplate) { case css::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE : @@ -579,13 +579,13 @@ void SAL_CALL VistaFilePicker::initialize(const css::uno::Sequence< css::uno::An bFileOpenDialog = sal_True; } break; - + case css::ui::dialogs::TemplateDescription::FILESAVE_SIMPLE : { bFileOpenDialog = sal_False; } break; - + case css::ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION_PASSWORD : { bFileOpenDialog = sal_False; @@ -593,7 +593,7 @@ void SAL_CALL VistaFilePicker::initialize(const css::uno::Sequence< css::uno::An nFeatures |= FEATURE_PASSWORD; } break; - + case css::ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION_PASSWORD_FILTEROPTIONS : { bFileOpenDialog = sal_False; @@ -602,7 +602,7 @@ void SAL_CALL VistaFilePicker::initialize(const css::uno::Sequence< css::uno::An nFeatures |= FEATURE_FILTEROPTIONS; } break; - + case css::ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION_SELECTION : { bFileOpenDialog = sal_False; @@ -610,7 +610,7 @@ void SAL_CALL VistaFilePicker::initialize(const css::uno::Sequence< css::uno::An nFeatures |= FEATURE_SELECTION; } break; - + case css::ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION_TEMPLATE : { bFileOpenDialog = sal_False; @@ -618,7 +618,7 @@ void SAL_CALL VistaFilePicker::initialize(const css::uno::Sequence< css::uno::An nFeatures |= FEATURE_TEMPLATE; } break; - + case css::ui::dialogs::TemplateDescription::FILEOPEN_LINK_PREVIEW_IMAGE_TEMPLATE : { bFileOpenDialog = sal_True; @@ -627,14 +627,14 @@ void SAL_CALL VistaFilePicker::initialize(const css::uno::Sequence< css::uno::An nFeatures |= FEATURE_IMAGETEMPLATE; } break; - + case css::ui::dialogs::TemplateDescription::FILEOPEN_PLAY : { bFileOpenDialog = sal_True; nFeatures |= FEATURE_PLAY; } break; - + case css::ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION : { bFileOpenDialog = sal_True; @@ -642,7 +642,7 @@ void SAL_CALL VistaFilePicker::initialize(const css::uno::Sequence< css::uno::An nFeatures |= FEATURE_VERSION; } break; - + case css::ui::dialogs::TemplateDescription::FILEOPEN_LINK_PREVIEW : { bFileOpenDialog = sal_True; @@ -650,7 +650,7 @@ void SAL_CALL VistaFilePicker::initialize(const css::uno::Sequence< css::uno::An nFeatures |= FEATURE_PREVIEW; } break; - + case css::ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION : { bFileOpenDialog = sal_False; @@ -669,7 +669,7 @@ void SAL_CALL VistaFilePicker::initialize(const css::uno::Sequence< css::uno::An if ( ! m_aAsyncExecute.isRunning()) m_aAsyncExecute.create(); m_aAsyncExecute.triggerRequestThreadAware(rRequest, AsyncRequests::NON_BLOCKED); - + { osl::MutexGuard aGuard(m_aMutex); m_bInitialized = true; @@ -689,17 +689,17 @@ void SAL_CALL VistaFilePicker::cancel() // XServiceInfo // ------------------------------------------------- -::rtl::OUString SAL_CALL VistaFilePicker::getImplementationName() +::rtl::OUString SAL_CALL VistaFilePicker::getImplementationName() throw(css::uno::RuntimeException) { return ::rtl::OUString::createFromAscii("com.sun.star.comp.fpicker.VistaFileDialog"); } // ------------------------------------------------- -// XServiceInfo +// XServiceInfo // ------------------------------------------------- -sal_Bool SAL_CALL VistaFilePicker::supportsService(const ::rtl::OUString& sServiceName) +sal_Bool SAL_CALL VistaFilePicker::supportsService(const ::rtl::OUString& sServiceName) throw(css::uno::RuntimeException ) { css::uno::Sequence< ::rtl::OUString > lSupportedServicesNames = VistaFilePicker_getSupportedServiceNames(); @@ -712,10 +712,10 @@ sal_Bool SAL_CALL VistaFilePicker::supportsService(const ::rtl::OUString& sServi } // ------------------------------------------------- -// XServiceInfo +// XServiceInfo // ------------------------------------------------- -css::uno::Sequence< ::rtl::OUString > SAL_CALL VistaFilePicker::getSupportedServiceNames() +css::uno::Sequence< ::rtl::OUString > SAL_CALL VistaFilePicker::getSupportedServiceNames() throw(css::uno::RuntimeException) { return VistaFilePicker_getSupportedServiceNames(); diff --git a/fpicker/source/win32/filepicker/VistaFilePicker.hxx b/fpicker/source/win32/filepicker/VistaFilePicker.hxx index 1a46ca0e1504..09380c19056c 100644 --- a/fpicker/source/win32/filepicker/VistaFilePicker.hxx +++ b/fpicker/source/win32/filepicker/VistaFilePicker.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -71,7 +71,7 @@ namespace vista{ // types //----------------------------------------------------------------------------- -typedef ::cppu::WeakComponentImplHelper10< +typedef ::cppu::WeakComponentImplHelper10< css::ui::dialogs::XFilePicker2, css::ui::dialogs::XFilterManager, css::ui::dialogs::XFilterGroupManager, @@ -107,49 +107,49 @@ public: // XFilePickerNotifier //------------------------------------------------------------------------------------ - virtual void SAL_CALL addFilePickerListener( const css::uno::Reference< css::ui::dialogs::XFilePickerListener >& xListener ) + virtual void SAL_CALL addFilePickerListener( const css::uno::Reference< css::ui::dialogs::XFilePickerListener >& xListener ) throw( css::uno::RuntimeException ); - virtual void SAL_CALL removeFilePickerListener( const css::uno::Reference< css::ui::dialogs::XFilePickerListener >& xListener ) + virtual void SAL_CALL removeFilePickerListener( const css::uno::Reference< css::ui::dialogs::XFilePickerListener >& xListener ) throw( css::uno::RuntimeException ); //------------------------------------------------------------------------------------ // XExecutableDialog functions //------------------------------------------------------------------------------------ - - virtual void SAL_CALL setTitle( const ::rtl::OUString& sTitle ) + + virtual void SAL_CALL setTitle( const ::rtl::OUString& sTitle ) throw( css::uno::RuntimeException ); - virtual sal_Int16 SAL_CALL execute( ) + virtual sal_Int16 SAL_CALL execute( ) throw( css::uno::RuntimeException ); //------------------------------------------------------------------------------------ // XFilePicker functions //------------------------------------------------------------------------------------ - virtual void SAL_CALL setMultiSelectionMode( sal_Bool bMode ) + virtual void SAL_CALL setMultiSelectionMode( sal_Bool bMode ) throw( css::uno::RuntimeException ); - virtual void SAL_CALL setDefaultName( const ::rtl::OUString& sName ) + virtual void SAL_CALL setDefaultName( const ::rtl::OUString& sName ) throw( css::uno::RuntimeException ); - virtual void SAL_CALL setDisplayDirectory( const ::rtl::OUString& sDirectory ) + virtual void SAL_CALL setDisplayDirectory( const ::rtl::OUString& sDirectory ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException ); - virtual ::rtl::OUString SAL_CALL getDisplayDirectory( ) + virtual ::rtl::OUString SAL_CALL getDisplayDirectory( ) throw( css::uno::RuntimeException ); - virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getFiles( ) + virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getFiles( ) throw( css::uno::RuntimeException ); //------------------------------------------------------------------------------------ // XFilePicker2 functions //------------------------------------------------------------------------------------ - - virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getSelectedFiles( ) + + virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getSelectedFiles( ) throw( css::uno::RuntimeException ); - + //------------------------------------------------------------------------------------ // XFilterManager functions //------------------------------------------------------------------------------------ @@ -159,11 +159,11 @@ public: throw (css::lang::IllegalArgumentException, css::uno::RuntimeException ); - virtual void SAL_CALL setCurrentFilter( const ::rtl::OUString& sTitle ) + virtual void SAL_CALL setCurrentFilter( const ::rtl::OUString& sTitle ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException ); - virtual ::rtl::OUString SAL_CALL getCurrentFilter( ) + virtual ::rtl::OUString SAL_CALL getCurrentFilter( ) throw( css::uno::RuntimeException ); //------------------------------------------------------------------------------------ @@ -171,7 +171,7 @@ public: //------------------------------------------------------------------------------------ virtual void SAL_CALL appendFilterGroup( const ::rtl::OUString& sGroupTitle, - const css::uno::Sequence< css::beans::StringPair >& lFilters ) + const css::uno::Sequence< css::beans::StringPair >& lFilters ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException ); @@ -185,7 +185,7 @@ public: throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL getValue( sal_Int16 nControlId , - sal_Int16 nControlAction ) + sal_Int16 nControlAction ) throw (css::uno::RuntimeException); virtual void SAL_CALL enableControl( sal_Int16 nControlId, @@ -196,7 +196,7 @@ public: const ::rtl::OUString& sLabel ) throw (css::uno::RuntimeException); - virtual ::rtl::OUString SAL_CALL getLabel( sal_Int16 nControlId ) + virtual ::rtl::OUString SAL_CALL getLabel( sal_Int16 nControlId ) throw (css::uno::RuntimeException); //------------------------------------------------ @@ -244,27 +244,27 @@ public: // XEventListener //------------------------------------------------ - virtual void SAL_CALL disposing( const css::lang::EventObject& aEvent ) + virtual void SAL_CALL disposing( const css::lang::EventObject& aEvent ) throw(css::uno::RuntimeException); //------------------------------------------------ // XServiceInfo - //------------------------------------------------ + //------------------------------------------------ - virtual ::rtl::OUString SAL_CALL getImplementationName( ) + virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(css::uno::RuntimeException); - virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(css::uno::RuntimeException); - virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) + virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(css::uno::RuntimeException); /* //------------------------------------------------------------------------------------ // FilePicker Event functions //------------------------------------------------------------------------------------ - + void SAL_CALL fileSelectionChanged(const css::ui::dialogs::FilePickerEvent& aEvent ); void SAL_CALL directoryChanged(const css::ui::dialogs::FilePickerEvent& aEvent ); ::rtl::OUString SAL_CALL helpRequested(const css::ui::dialogs::FilePickerEvent& aEvent ) const; @@ -276,36 +276,36 @@ public: void suspendEventNotification(); void resumeEventNotification(); */ - + private: - + // prevent copy and assignment - VistaFilePicker( const VistaFilePicker& ); + VistaFilePicker( const VistaFilePicker& ); VistaFilePicker& operator=( const VistaFilePicker& ); - + using WeakComponentImplHelperBase::disposing; private: - + //--------------------------------------------------------------------- /// service manager to create own used uno services css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR; - + //--------------------------------------------------------------------- css::uno::Sequence< ::rtl::OUString > m_lLastFiles; - + //--------------------------------------------------------------------- /** execute the COM dialog within a STA thread * Must be used on the heap ... because it's implemented as OSL thread .-) */ RequestHandlerRef m_rDialog; AsyncRequests m_aAsyncExecute; - + //--------------------------------------------------------------------- oslThreadIdentifier m_nFilePickerThreadId; bool m_bInitialized; -}; +}; } // namespace vista } // namespace win32 diff --git a/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx b/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx index 42bab08800b0..48dbfcaa3735 100644 --- a/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx +++ b/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -87,7 +87,7 @@ HRESULT STDMETHODCALLTYPE VistaFilePickerEventHandler::QueryInterface(REFIID rII if ( rIID == IID_IFileDialogControlEvents ) *ppObject = (IFileDialogControlEvents*)this; - + if ( *ppObject != NULL ) { ((IUnknown*)*ppObject)->AddRef(); @@ -170,7 +170,7 @@ void lcl_updateVersionListDirectly(IFileDialog* pDialog) TFileDialog iDialog (pDialog); TFileOpenDialog iOpen ; TFileDialogCustomize iCustomize; - + #ifdef __MINGW32__ iDialog->QueryInterface(IID_IFileOpenDialog, (void**)(&iOpen)); iDialog->QueryInterface(IID_IFileDialogCustomize, (void**)(&iCustomize)); @@ -182,7 +182,7 @@ void lcl_updateVersionListDirectly(IFileDialog* pDialog) // make sure version list match to the current selection always ... // at least an empty version list will be better then the wrong one .-) iCustomize->RemoveAllControlItems(CONTROL_VERSIONLIST); - + HRESULT hResult = E_FAIL; ComPtr< IShellItemArray > iItems; ComPtr< IShellItem > iItem; @@ -201,16 +201,16 @@ void lcl_updateVersionListDirectly(IFileDialog* pDialog) // we can show one version list only within control if (nCount != 1) return; - + hResult = iItems->GetItemAt(0, &iItem); - } + } else if (iDialog.is()) hResult = iDialog->GetCurrentSelection(&iItem); if ( FAILED(hResult) ) return; - + const ::rtl::OUString sURL = lcl_getURLFromShellItem2(iItem); if (sURL.getLength() < 1) return; @@ -218,21 +218,21 @@ void lcl_updateVersionListDirectly(IFileDialog* pDialog) INetURLObject aURL(sURL); if (aURL.GetProtocol() != INET_PROT_FILE) return; - + ::rtl::OUString sMain = aURL.GetMainURL(INetURLObject::NO_DECODE); if ( ! ::utl::UCBContentHelper::IsDocument(sURL)) return; -*/ +*/ try { css::uno::Reference< css::embed::XStorage > xStorage = ::comphelper::OStorageHelper::GetStorageFromURL(sURL, css::embed::ElementModes::READ); if ( ! xStorage.is() ) return; - + css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory(); css::uno::Reference< css::document::XDocumentRevisionListPersistence > xReader (xSMGR->createInstance(SERVICENAME_REVISIONPERSISTENCE), css::uno::UNO_QUERY_THROW); css::uno::Sequence< css::util::RevisionTag > lVersions = xReader->load(xStorage); - + for (::sal_Int32 i=0; i<lVersions.getLength(); ++i) { const css::util::RevisionTag& aTag = lVersions[i]; @@ -369,14 +369,14 @@ STDMETHODIMP VistaFilePickerEventHandler::OnControlActivating(IFileDialogCustomi } //----------------------------------------------------------------------------------------- -void SAL_CALL VistaFilePickerEventHandler::addFilePickerListener( const css::uno::Reference< css::ui::dialogs::XFilePickerListener >& xListener ) +void SAL_CALL VistaFilePickerEventHandler::addFilePickerListener( const css::uno::Reference< css::ui::dialogs::XFilePickerListener >& xListener ) throw( css::uno::RuntimeException ) { m_lListener.addInterface(::getCppuType( (const css::uno::Reference< css::ui::dialogs::XFilePickerListener >*)NULL ), xListener); } //----------------------------------------------------------------------------------------- -void SAL_CALL VistaFilePickerEventHandler::removeFilePickerListener( const css::uno::Reference< css::ui::dialogs::XFilePickerListener >& xListener ) +void SAL_CALL VistaFilePickerEventHandler::removeFilePickerListener( const css::uno::Reference< css::ui::dialogs::XFilePickerListener >& xListener ) throw( css::uno::RuntimeException ) { m_lListener.removeInterface(::getCppuType( (const css::uno::Reference< css::ui::dialogs::XFilePickerListener >*)NULL ), xListener); @@ -390,7 +390,7 @@ void VistaFilePickerEventHandler::startListening( const TFileDialog& pBroadcaste if (m_pDialog.is()) return; - + m_pDialog = pBroadcaster; m_pDialog->Advise(this, &m_nListenerHandle); } @@ -412,54 +412,54 @@ static const ::rtl::OUString PROP_PICKER_LISTENER = ::rtl::OUString::createFromA class AsyncPickerEvents : public RequestHandler { public: - + AsyncPickerEvents() {} - + virtual ~AsyncPickerEvents() {} virtual void before() {} - + virtual void doRequest(const RequestRef& rRequest) { const ::sal_Int32 nEventID = rRequest->getRequest(); const ::sal_Int16 nControlID = rRequest->getArgumentOrDefault(PROP_CONTROL_ID, (::sal_Int16)0); const css::uno::Reference< css::ui::dialogs::XFilePickerListener > xListener = rRequest->getArgumentOrDefault(PROP_PICKER_LISTENER, css::uno::Reference< css::ui::dialogs::XFilePickerListener >()); - + if ( ! xListener.is()) return; - + css::ui::dialogs::FilePickerEvent aEvent; aEvent.ElementId = nControlID; - + switch (nEventID) { case VistaFilePickerEventHandler::E_FILE_SELECTION_CHANGED : xListener->fileSelectionChanged(aEvent); break; - + case VistaFilePickerEventHandler::E_DIRECTORY_CHANGED : xListener->directoryChanged(aEvent); break; - + case VistaFilePickerEventHandler::E_HELP_REQUESTED : xListener->helpRequested(aEvent); break; - + case VistaFilePickerEventHandler::E_CONTROL_STATE_CHANGED : xListener->controlStateChanged(aEvent); break; - + case VistaFilePickerEventHandler::E_DIALOG_SIZE_CHANGED : xListener->dialogSizeChanged(); break; - + // no default here. Let compiler detect changes on enum set ! } } - + virtual void after() {} }; @@ -473,20 +473,20 @@ void VistaFilePickerEventHandler::impl_sendEvent( EEventType eEventType, ::cppu::OInterfaceContainerHelper* pContainer = m_lListener.getContainer( ::getCppuType( ( const css::uno::Reference< css::ui::dialogs::XFilePickerListener >*) NULL ) ); if ( ! pContainer) return; - + ::cppu::OInterfaceIteratorHelper pIterator(*pContainer); while (pIterator.hasMoreElements()) { try { css::uno::Reference< css::ui::dialogs::XFilePickerListener > xListener (pIterator.next(), css::uno::UNO_QUERY); - + RequestRef rRequest(new Request()); rRequest->setRequest (eEventType); rRequest->setArgument(PROP_PICKER_LISTENER, xListener); if ( nControlID ) rRequest->setArgument(PROP_CONTROL_ID, nControlID); - + aNotify.triggerRequestDirectly(rRequest); //aNotify.triggerRequestNonBlocked(rRequest); } diff --git a/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.hxx b/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.hxx index 85eed3ca39e0..de9983d0cf53 100644 --- a/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.hxx +++ b/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -76,14 +76,14 @@ class VistaFilePickerEventHandler : public ::cppu::BaseMutex , public IFileDialogControlEvents { public: - + //------------------------------------------------------------------------------------ // ctor/dtor //------------------------------------------------------------------------------------ - + VistaFilePickerEventHandler(IVistaFilePickerInternalNotify* pInternalNotify); virtual ~VistaFilePickerEventHandler(); - + //------------------------------------------------------------------------------------ // IUnknown //------------------------------------------------------------------------------------ @@ -91,62 +91,62 @@ class VistaFilePickerEventHandler : public ::cppu::BaseMutex void** ppObject); virtual ULONG STDMETHODCALLTYPE AddRef(); virtual ULONG STDMETHODCALLTYPE Release(); - + //------------------------------------------------------------------------------------ // IFileDialogEvents //------------------------------------------------------------------------------------ - + STDMETHODIMP OnFileOk(IFileDialog* pDialog); - + STDMETHODIMP OnFolderChanging(IFileDialog* pDialog, IShellItem* pFolder); - + STDMETHODIMP OnFolderChange(IFileDialog* pDialog); - + STDMETHODIMP OnSelectionChange(IFileDialog* pDialog); - + STDMETHODIMP OnShareViolation(IFileDialog* pDialog , IShellItem* pItem , FDE_SHAREVIOLATION_RESPONSE* pResponse); - + STDMETHODIMP OnTypeChange(IFileDialog* pDialog); - + STDMETHODIMP OnOverwrite(IFileDialog* pDialog , IShellItem* pItem , FDE_OVERWRITE_RESPONSE* pResponse); - + //------------------------------------------------------------------------------------ // IFileDialogControlEvents //------------------------------------------------------------------------------------ - + STDMETHODIMP OnItemSelected(IFileDialogCustomize* pCustomize, DWORD nIDCtl , DWORD nIDItem ); - + STDMETHODIMP OnButtonClicked(IFileDialogCustomize* pCustomize, DWORD nIDCtl ); - + STDMETHODIMP OnCheckButtonToggled(IFileDialogCustomize* pCustomize, DWORD nIDCtl , BOOL bChecked ); - + STDMETHODIMP OnControlActivating(IFileDialogCustomize* pCustomize, DWORD nIDCtl ); - + //------------------------------------------------------------------------------------ // XFilePickerNotifier //------------------------------------------------------------------------------------ - - virtual void SAL_CALL addFilePickerListener( const css::uno::Reference< css::ui::dialogs::XFilePickerListener >& xListener ) + + virtual void SAL_CALL addFilePickerListener( const css::uno::Reference< css::ui::dialogs::XFilePickerListener >& xListener ) throw( css::uno::RuntimeException ); - - virtual void SAL_CALL removeFilePickerListener( const css::uno::Reference< css::ui::dialogs::XFilePickerListener >& xListener ) + + virtual void SAL_CALL removeFilePickerListener( const css::uno::Reference< css::ui::dialogs::XFilePickerListener >& xListener ) throw( css::uno::RuntimeException ); - + //------------------------------------------------------------------------------------ // native interface //------------------------------------------------------------------------------------ - + //------------------------------------------------------------------------------------ /** start listening for file picker events on the given file open dialog COM object. * @@ -161,7 +161,7 @@ class VistaFilePickerEventHandler : public ::cppu::BaseMutex * reference to the dialog, where we should start listening. */ void startListening( const TFileDialog& pBroadcaster ); - + //------------------------------------------------------------------------------------ /** stop listening for file picker events on the internaly cached dialog COM object. * @@ -170,7 +170,7 @@ class VistaFilePickerEventHandler : public ::cppu::BaseMutex * listener handle is used. If listener was not already registered - nothing will happen. */ void stopListening(); - + public: enum EEventType @@ -181,20 +181,20 @@ class VistaFilePickerEventHandler : public ::cppu::BaseMutex E_CONTROL_STATE_CHANGED, E_DIALOG_SIZE_CHANGED }; - + private: //------------------------------------------------------------------------------------ /// @todo document me void impl_sendEvent( EEventType eEventType, ::sal_Int16 nControlID); - + private: - + //------------------------------------------------------------------------------------ /// ref count for AddRef/Release() oslInterlockedCount m_nRefCount; - + //------------------------------------------------------------------------------------ /// unique handle for this listener provided by the broadcaster on registration time DWORD m_nListenerHandle; @@ -202,10 +202,10 @@ class VistaFilePickerEventHandler : public ::cppu::BaseMutex //------------------------------------------------------------------------------------ /// cached file dialog instance (there we listen for events) TFileDialog m_pDialog; - + //--------------------------------------------------------------------- IVistaFilePickerInternalNotify* m_pInternalNotify; - + //--------------------------------------------------------------------- /** used to inform file picker listener asynchronously. * Those listener must be called asynchronously .. because diff --git a/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx b/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx index 5c9760b26d7c..9f006d69259a 100644 --- a/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx +++ b/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -45,14 +45,14 @@ inline bool is_current_process_window(HWND hwnd) { - DWORD pid; - GetWindowThreadProcessId(hwnd, &pid); + DWORD pid; + GetWindowThreadProcessId(hwnd, &pid); return (pid == GetCurrentProcessId()); } - + HWND choose_parent_window() { - HWND hwnd_parent = GetForegroundWindow(); + HWND hwnd_parent = GetForegroundWindow(); if (!is_current_process_window(hwnd_parent)) hwnd_parent = GetDesktopWindow(); return hwnd_parent; @@ -79,15 +79,15 @@ static const ::sal_Int16 INVALID_CONTROL_ACTION = -1; typedef ::comphelper::SequenceAsVector< ::rtl::OUString > TStringList; // Guids used for IFileDialog::SetClientGuid -static const GUID CLIENTID_FILEDIALOG_SIMPLE = {0xB8628FD3, 0xA3F5, 0x4845, 0x9B, 0x62, 0xD5, 0x1E, 0xDF, 0x97, 0xC4, 0x83}; -static const GUID CLIENTID_FILEDIALOG_OPTIONS = {0x93ED486F, 0x0D04, 0x4807, 0x8C, 0x44, 0xAC, 0x26, 0xCB, 0x6C, 0x5D, 0x36}; -static const GUID CLIENTID_FILESAVE = {0x3B2E2261, 0x402D, 0x4049, 0xB0, 0xC0, 0x91, 0x13, 0xF8, 0x6E, 0x84, 0x7C}; -static const GUID CLIENTID_FILESAVE_PASSWORD = {0xC12D4F4C, 0x4D41, 0x4D4F, 0x97, 0xEF, 0x87, 0xF9, 0x8D, 0xB6, 0x1E, 0xA6}; -static const GUID CLIENTID_FILESAVE_SELECTION = {0x5B2482B3, 0x0358, 0x4E09, 0xAA, 0x64, 0x2B, 0x76, 0xB2, 0xA0, 0xDD, 0xFE}; -static const GUID CLIENTID_FILESAVE_TEMPLATE = {0x9996D877, 0x20D5, 0x424B, 0x9C, 0x2E, 0xD3, 0xB6, 0x31, 0xEC, 0xF7, 0xCE}; -static const GUID CLIENTID_FILEOPEN_LINK_TEMPLATE = {0x32237796, 0x1509, 0x49D1, 0xBB, 0x7E, 0x63, 0xAD, 0x36, 0xAE, 0x86, 0x8C}; -static const GUID CLIENTID_FILEOPEN_PLAY = {0x32CFB147, 0xF5AE, 0x4F90, 0xA1, 0xF1, 0x81, 0x20, 0x72, 0xBB, 0x2F, 0xC5}; -static const GUID CLIENTID_FILEOPEN_LINK = {0x39AC4BAE, 0x7D2D, 0x46BC, 0xBE, 0x2E, 0xF8, 0x8C, 0xB5, 0x65, 0x5E, 0x6A}; +static const GUID CLIENTID_FILEDIALOG_SIMPLE = {0xB8628FD3, 0xA3F5, 0x4845, 0x9B, 0x62, 0xD5, 0x1E, 0xDF, 0x97, 0xC4, 0x83}; +static const GUID CLIENTID_FILEDIALOG_OPTIONS = {0x93ED486F, 0x0D04, 0x4807, 0x8C, 0x44, 0xAC, 0x26, 0xCB, 0x6C, 0x5D, 0x36}; +static const GUID CLIENTID_FILESAVE = {0x3B2E2261, 0x402D, 0x4049, 0xB0, 0xC0, 0x91, 0x13, 0xF8, 0x6E, 0x84, 0x7C}; +static const GUID CLIENTID_FILESAVE_PASSWORD = {0xC12D4F4C, 0x4D41, 0x4D4F, 0x97, 0xEF, 0x87, 0xF9, 0x8D, 0xB6, 0x1E, 0xA6}; +static const GUID CLIENTID_FILESAVE_SELECTION = {0x5B2482B3, 0x0358, 0x4E09, 0xAA, 0x64, 0x2B, 0x76, 0xB2, 0xA0, 0xDD, 0xFE}; +static const GUID CLIENTID_FILESAVE_TEMPLATE = {0x9996D877, 0x20D5, 0x424B, 0x9C, 0x2E, 0xD3, 0xB6, 0x31, 0xEC, 0xF7, 0xCE}; +static const GUID CLIENTID_FILEOPEN_LINK_TEMPLATE = {0x32237796, 0x1509, 0x49D1, 0xBB, 0x7E, 0x63, 0xAD, 0x36, 0xAE, 0x86, 0x8C}; +static const GUID CLIENTID_FILEOPEN_PLAY = {0x32CFB147, 0xF5AE, 0x4F90, 0xA1, 0xF1, 0x81, 0x20, 0x72, 0xBB, 0x2F, 0xC5}; +static const GUID CLIENTID_FILEOPEN_LINK = {0x39AC4BAE, 0x7D2D, 0x46BC, 0xBE, 0x2E, 0xF8, 0x8C, 0xB5, 0x65, 0x5E, 0x6A}; //----------------------------------------------------------------------------- ::rtl::OUString lcl_getURLFromShellItem (IShellItem* pItem) @@ -129,10 +129,10 @@ static const GUID CLIENTID_FILEOPEN_LINK = {0x39AC4BAE, 0x7D2D, 0x46B while( rContainer.getNextFilter(aFilter) ) { COMDLG_FILTERSPEC aSpec; - + aSpec.pszName = reinterpret_cast<LPCTSTR>(aFilter.first.getStr()) ; aSpec.pszSpec = reinterpret_cast<LPCTSTR>(aFilter.second.getStr()); - + lList.push_back(aSpec); } @@ -152,9 +152,9 @@ VistaFilePickerImpl::VistaFilePickerImpl() , m_sDirectory () , m_sFilename () { - m_hParentWindow = choose_parent_window(); + m_hParentWindow = choose_parent_window(); } - + //------------------------------------------------------------------------------- VistaFilePickerImpl::~VistaFilePickerImpl() { @@ -191,39 +191,39 @@ void VistaFilePickerImpl::doRequest(const RequestRef& rRequest) case E_ADD_PICKER_LISTENER : impl_sta_addFilePickerListener(rRequest); break; - + case E_REMOVE_PICKER_LISTENER : impl_sta_removeFilePickerListener(rRequest); break; - + case E_APPEND_FILTER : impl_sta_appendFilter(rRequest); break; - + case E_SET_CURRENT_FILTER : impl_sta_setCurrentFilter(rRequest); break; - + case E_GET_CURRENT_FILTER : impl_sta_getCurrentFilter(rRequest); break; - + case E_CREATE_OPEN_DIALOG : impl_sta_CreateOpenDialog(rRequest); break; - + case E_CREATE_SAVE_DIALOG : impl_sta_CreateSaveDialog(rRequest); break; - + case E_SET_MULTISELECTION_MODE : impl_sta_SetMultiSelectionMode(rRequest); break; - + case E_SET_TITLE : impl_sta_SetTitle(rRequest); break; - + case E_SET_FILENAME: impl_sta_SetFileName(rRequest); break; @@ -239,35 +239,35 @@ void VistaFilePickerImpl::doRequest(const RequestRef& rRequest) case E_SET_DEFAULT_NAME : impl_sta_SetDefaultName(rRequest); break; - + case E_GET_SELECTED_FILES : impl_sta_getSelectedFiles(rRequest); break; - + case E_SHOW_DIALOG_MODAL : impl_sta_ShowDialogModal(rRequest); break; - + case E_SET_CONTROL_VALUE : impl_sta_SetControlValue(rRequest); break; - + case E_GET_CONTROL_VALUE : impl_sta_GetControlValue(rRequest); break; - + case E_SET_CONTROL_LABEL : impl_sta_SetControlLabel(rRequest); break; - + case E_GET_CONTROL_LABEL : impl_sta_GetControlLabel(rRequest); break; - + case E_ENABLE_CONTROL : impl_sta_EnableControl(rRequest); break; - + // no default: let the compiler detect changes on enum ERequest ! } } @@ -288,13 +288,13 @@ void VistaFilePickerImpl::impl_sta_addFilePickerListener(const RequestRef& rRequ const css::uno::Reference< css::ui::dialogs::XFilePickerListener > xListener = rRequest->getArgumentOrDefault(PROP_PICKER_LISTENER, css::uno::Reference< css::ui::dialogs::XFilePickerListener >()); if ( ! xListener.is()) return; - + // SYNCHRONIZED-> ::osl::ResettableMutexGuard aLock(m_aMutex); TFileDialogEvents iHandler = m_iEventHandler; aLock.clear(); // <- SYNCHRONIZED - + VistaFilePickerEventHandler* pHandlerImpl = (VistaFilePickerEventHandler*)iHandler.get(); if (pHandlerImpl) pHandlerImpl->addFilePickerListener(xListener); @@ -307,13 +307,13 @@ void VistaFilePickerImpl::impl_sta_removeFilePickerListener(const RequestRef& rR const css::uno::Reference< css::ui::dialogs::XFilePickerListener > xListener = rRequest->getArgumentOrDefault(PROP_PICKER_LISTENER, css::uno::Reference< css::ui::dialogs::XFilePickerListener >()); if ( ! xListener.is()) return; - + // SYNCHRONIZED-> ::osl::ResettableMutexGuard aLock(m_aMutex); TFileDialogEvents iHandler = m_iEventHandler; aLock.clear(); // <- SYNCHRONIZED - + VistaFilePickerEventHandler* pHandlerImpl = (VistaFilePickerEventHandler*)iHandler.get(); if (pHandlerImpl) pHandlerImpl->removeFilePickerListener(xListener); @@ -356,7 +356,7 @@ void VistaFilePickerImpl::impl_sta_getCurrentFilter(const RequestRef& rRequest) // SYNCHRONIZED-> ::osl::ResettableMutexGuard aLock(m_aMutex); - + ::rtl::OUString sTitle; ::sal_Int32 nRealIndex = (nIndex-1); // COM dialog base on 1 ... filter container on 0 .-) if ( @@ -481,10 +481,10 @@ void VistaFilePickerImpl::impl_sta_enableFeatures(::sal_Int32 nFeatures, ::sal_I case css::ui::dialogs::TemplateDescription::FILESAVE_SIMPLE : aGUID = CLIENTID_FILEDIALOG_SIMPLE; break; - + case css::ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION : case css::ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION_PASSWORD_FILTEROPTIONS : - aGUID = CLIENTID_FILEDIALOG_OPTIONS; + aGUID = CLIENTID_FILEDIALOG_OPTIONS; break; case css::ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION : @@ -494,23 +494,23 @@ void VistaFilePickerImpl::impl_sta_enableFeatures(::sal_Int32 nFeatures, ::sal_I case css::ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION_PASSWORD : aGUID = CLIENTID_FILESAVE_PASSWORD; break; - + case css::ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION_SELECTION : aGUID = CLIENTID_FILESAVE_SELECTION; break; - + case css::ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION_TEMPLATE : aGUID = CLIENTID_FILESAVE_TEMPLATE; break; - + case css::ui::dialogs::TemplateDescription::FILEOPEN_LINK_PREVIEW_IMAGE_TEMPLATE : aGUID = CLIENTID_FILEOPEN_LINK_TEMPLATE; break; - + case css::ui::dialogs::TemplateDescription::FILEOPEN_PLAY : aGUID = CLIENTID_FILEOPEN_PLAY; break; - + case css::ui::dialogs::TemplateDescription::FILEOPEN_LINK_PREVIEW : aGUID = CLIENTID_FILEOPEN_LINK; break; @@ -553,35 +553,35 @@ void VistaFilePickerImpl::impl_sta_enableFeatures(::sal_Int32 nFeatures, ::sal_I iCustom->AddCheckButton (nControlId, L"Auto Extension", true); setLabelToControl(m_ResProvider, iCustom, nControlId); } - + if ((nFeatures & FEATURE_PASSWORD) == FEATURE_PASSWORD) { nControlId = css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_PASSWORD; iCustom->AddCheckButton (nControlId, L"Password", false); setLabelToControl(m_ResProvider, iCustom, nControlId); } - + if ((nFeatures & FEATURE_READONLY) == FEATURE_READONLY) { nControlId = css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_READONLY; iCustom->AddCheckButton (nControlId, L"Readonly", false); setLabelToControl(m_ResProvider, iCustom, nControlId); } - + if ((nFeatures & FEATURE_FILTEROPTIONS) == FEATURE_FILTEROPTIONS) { nControlId = css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_FILTEROPTIONS; iCustom->AddCheckButton (nControlId, L"Filter Options", false); setLabelToControl(m_ResProvider, iCustom, nControlId); } - + if ((nFeatures & FEATURE_LINK) == FEATURE_LINK) { nControlId = css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_LINK; iCustom->AddCheckButton (nControlId, L"Link", false); setLabelToControl(m_ResProvider, iCustom, nControlId); } - + if ((nFeatures & FEATURE_SELECTION) == FEATURE_SELECTION) { nControlId = css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_SELECTION; @@ -593,12 +593,12 @@ void VistaFilePickerImpl::impl_sta_enableFeatures(::sal_Int32 nFeatures, ::sal_I if ((nFeatures & FEATURE_PREVIEW) == FEATURE_PREVIEW) iCustom->AddCheckButton (css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_PREVIEW, L"Preview", false); */ - + iCustom->EndVisualGroup(); if ((nFeatures & FEATURE_PLAY) == FEATURE_PLAY) iCustom->AddPushButton (css::ui::dialogs::ExtendedFilePickerElementIds::PUSHBUTTON_PLAY, L"Play"); - + } //------------------------------------------------------------------------------- @@ -614,12 +614,12 @@ void VistaFilePickerImpl::impl_sta_SetMultiSelectionMode(const RequestRef& rRequ DWORD nFlags = 0; m_hLastResult = iDialog->GetOptions ( &nFlags ); - + if (bMultiSelection) nFlags |= FOS_ALLOWMULTISELECT; else nFlags &= ~FOS_ALLOWMULTISELECT; - + iDialog->SetOptions ( nFlags ); } @@ -656,7 +656,7 @@ void VistaFilePickerImpl::impl_sta_SetDirectory(const RequestRef& rRequest) { ::rtl::OUString sDirectory = rRequest->getArgumentOrDefault(PROP_DIRECTORY, ::rtl::OUString()); bool bForce = rRequest->getArgumentOrDefault(PROP_FORCE, false); - + if( !m_bInExecute) { // Vista stores last used folders for file dialogs @@ -681,7 +681,7 @@ void VistaFilePickerImpl::impl_sta_SetDirectory(const RequestRef& rRequest) #endif if ( FAILED(hResult) ) return; - + if ( m_bInExecute || bForce ) iDialog->SetFolder(pFolder); else @@ -723,7 +723,7 @@ void VistaFilePickerImpl::impl_sta_SetDefaultName(const RequestRef& rRequest) if ( -1 != nSepPos ) sFilename = sFilename.copy(0, nSepPos); } - + iDialog->SetFileName ( reinterpret_cast<LPCTSTR>(sFilename.getStr())); m_sFilename = sFilename; } @@ -743,7 +743,7 @@ void VistaFilePickerImpl::impl_sta_setFiltersOnDialog() aLock.clear(); // <- SYNCHRONIZED - COMDLG_FILTERSPEC *pFilt = &lFilters[0]; + COMDLG_FILTERSPEC *pFilt = &lFilters[0]; iDialog->SetFileTypes(lFilters.size(), pFilt/*&lFilters[0]*/); iDialog->SetFileTypeIndex(nCurrentFilter + 1); @@ -759,7 +759,7 @@ void VistaFilePickerImpl::impl_sta_setFiltersOnDialog() lpFilterExt++; iDialog->SetDefaultExtension( lpFilterExt ); } - + } //------------------------------------------------------------------------------- @@ -772,7 +772,7 @@ void VistaFilePickerImpl::impl_sta_getSelectedFiles(const RequestRef& rRequest) TFileSaveDialog iSave = m_iDialogSave; ::sal_Bool bInExecute = m_bInExecute; - aLock.clear(); + aLock.clear(); // <- SYNCHRONIZED // ask dialog for results @@ -803,8 +803,8 @@ void VistaFilePickerImpl::impl_sta_getSelectedFiles(const RequestRef& rRequest) } if (FAILED(hResult)) - return; - + return; + // convert and pack results TStringList lFiles; if (iItem.is()) @@ -813,7 +813,7 @@ void VistaFilePickerImpl::impl_sta_getSelectedFiles(const RequestRef& rRequest) if (sURL.getLength() > 0) lFiles.push_back(sURL); } - + if (iItems.is()) { DWORD nCount; @@ -855,13 +855,13 @@ void VistaFilePickerImpl::impl_sta_ShowDialogModal(const RequestRef& rRequest) m_bWasExecuted = sal_True; - aLock.clear(); + aLock.clear(); // <- SYNCHRONIZED // we set the directory only if we have a save dialog and a filename // for the other cases, the file dialog remembers its last location // according to its client guid. - if( m_sDirectory.getLength()) + if( m_sDirectory.getLength()) { ComPtr< IShellItem > pFolder; #ifdef __MINGW32__ @@ -878,9 +878,9 @@ void VistaFilePickerImpl::impl_sta_ShowDialogModal(const RequestRef& rRequest) if (nIndex != aFileURL.getLength()-1) aFileURL += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/")); aFileURL += m_sFilename; - + TFileDialogCustomize iCustom = impl_getCustomizeInterface(); - + BOOL bValue = FALSE; HRESULT hResult = iCustom->GetCheckButtonState( css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION, &bValue); if ( bValue ) @@ -904,8 +904,8 @@ void VistaFilePickerImpl::impl_sta_ShowDialogModal(const RequestRef& rRequest) ::rtl::OUString aSystemPath; osl_getSystemPathFromFileURL( aFileURL.pData, &aSystemPath.pData ); - WIN32_FIND_DATA aFindFileData; - HANDLE hFind = FindFirstFile( reinterpret_cast<LPCWSTR>(aSystemPath.getStr()), &aFindFileData ); + WIN32_FIND_DATA aFindFileData; + HANDLE hFind = FindFirstFile( reinterpret_cast<LPCWSTR>(aSystemPath.getStr()), &aFindFileData ); if (hFind != INVALID_HANDLE_VALUE) iDialog->SetFolder(pFolder); else @@ -917,7 +917,7 @@ void VistaFilePickerImpl::impl_sta_ShowDialogModal(const RequestRef& rRequest) hResult = iDialog->AddPlace(pFolder, FDAP_TOP); } } - + HRESULT hResult = E_FAIL; try @@ -931,16 +931,16 @@ void VistaFilePickerImpl::impl_sta_ShowDialogModal(const RequestRef& rRequest) } catch(...) {} - + // SYNCHRONIZED-> aLock.reset(); m_bInExecute = sal_False; - aLock.clear(); + aLock.clear(); // <- SYNCHRONIZED - + if ( FAILED(hResult) ) return; - + impl_sta_getSelectedFiles(rRequest); rRequest->setArgument(PROP_DIALOG_SHOW_RESULT, (::sal_Bool)sal_True); } @@ -965,7 +965,7 @@ TFileDialog VistaFilePickerImpl::impl_getBaseDialogInterface() #else m_iDialogSave.query(&iDialog); #endif - + return iDialog; } @@ -990,7 +990,7 @@ TFileDialogCustomize VistaFilePickerImpl::impl_getCustomizeInterface() #else m_iDialogSave.query(&iCustom); #endif - + return iCustom; } @@ -1020,7 +1020,7 @@ void VistaFilePickerImpl::impl_sta_SetControlValue(const RequestRef& rRequest) TFileDialogCustomize iCustom = impl_getCustomizeInterface(); if ( ! iCustom.is()) return; - + switch (nId) { case css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION : @@ -1036,7 +1036,7 @@ void VistaFilePickerImpl::impl_sta_SetControlValue(const RequestRef& rRequest) iCustom->SetCheckButtonState(nId, bValue); } break; - + case css::ui::dialogs::ExtendedFilePickerElementIds::LISTBOX_VERSION : case css::ui::dialogs::ExtendedFilePickerElementIds::LISTBOX_TEMPLATE : case css::ui::dialogs::ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE : @@ -1051,7 +1051,7 @@ void VistaFilePickerImpl::impl_sta_SetControlValue(const RequestRef& rRequest) lcl_removeControlItemsWorkaround(iCustom, nId); } break; - + case css::ui::dialogs::ControlActions::ADD_ITEMS : { css::uno::Sequence< ::rtl::OUString > lItems; @@ -1063,7 +1063,7 @@ void VistaFilePickerImpl::impl_sta_SetControlValue(const RequestRef& rRequest) } } break; - + case css::ui::dialogs::ControlActions::SET_SELECT_ITEM : { ::sal_Int32 nItem = 0; @@ -1074,7 +1074,7 @@ void VistaFilePickerImpl::impl_sta_SetControlValue(const RequestRef& rRequest) } } break; - + case css::ui::dialogs::ExtendedFilePickerElementIds::PUSHBUTTON_PLAY : { } @@ -1094,7 +1094,7 @@ void VistaFilePickerImpl::impl_sta_GetControlValue(const RequestRef& rRequest) TFileDialogCustomize iCustom = impl_getCustomizeInterface(); if ( ! iCustom.is()) return; - + css::uno::Any aValue; if( m_bWasExecuted ) switch (nId) @@ -1150,13 +1150,13 @@ void VistaFilePickerImpl::impl_sta_EnableControl(const RequestRef& rRequest) TFileDialogCustomize iCustom = impl_getCustomizeInterface(); if ( ! iCustom.is()) return; - + CDCONTROLSTATEF eState = CDCS_VISIBLE; if (bEnabled) eState |= CDCS_ENABLED; else eState |= CDCS_INACTIVE; - + iCustom->SetControlState(nId, eState); } //------------------------------------------------------------------------------- @@ -1167,12 +1167,12 @@ void VistaFilePickerImpl::impl_SetDefaultExtension( const rtl::OUString& current { rtl::OUString FilterExt; m_lFilters.getFilter(currentFilter, FilterExt); - + sal_Int32 posOfPoint = FilterExt.indexOf(L'.'); const sal_Unicode* pFirstExtStart = FilterExt.getStr() + posOfPoint + 1; sal_Int32 posOfSemiColon = FilterExt.indexOf(L';') - 1; - if (posOfSemiColon < 0) + if (posOfSemiColon < 0) posOfSemiColon = FilterExt.getLength() - 1; FilterExt = rtl::OUString(pFirstExtStart, posOfSemiColon - posOfPoint); diff --git a/fpicker/source/win32/filepicker/VistaFilePickerImpl.hxx b/fpicker/source/win32/filepicker/VistaFilePickerImpl.hxx index c07a476b3671..c902cf9f2dcf 100644 --- a/fpicker/source/win32/filepicker/VistaFilePickerImpl.hxx +++ b/fpicker/source/win32/filepicker/VistaFilePickerImpl.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -98,10 +98,10 @@ static const ::rtl::OUString PROP_DIALOG_SHOW_RESULT = ::rtl::OUString::createF static const ::rtl::OUString PROP_SELECTED_FILES = ::rtl::OUString::createFromAscii("selected_files" ); // [seq< OUString >] contains all user selected files (can be empty!) static const ::rtl::OUString PROP_MULTISELECTION_MODE = ::rtl::OUString::createFromAscii("multiselection_mode"); // [sal_Bool] true=ON, false=OFF static const ::rtl::OUString PROP_TITLE = ::rtl::OUString::createFromAscii("title" ); // [OUString] -static const ::rtl::OUString PROP_FILENAME = ::rtl::OUString::createFromAscii("filename" ); // [OUString] +static const ::rtl::OUString PROP_FILENAME = ::rtl::OUString::createFromAscii("filename" ); // [OUString] static const ::rtl::OUString PROP_DIRECTORY = ::rtl::OUString::createFromAscii("directory" ); // [OUString] static const ::rtl::OUString PROP_FEATURES = ::rtl::OUString::createFromAscii("features" ); // [sal_Int32] -static const ::rtl::OUString PROP_TEMPLATE_DESCR = ::rtl::OUString::createFromAscii("templatedescription"); // [sal_Int32] +static const ::rtl::OUString PROP_TEMPLATE_DESCR = ::rtl::OUString::createFromAscii("templatedescription"); // [sal_Int32] static const ::rtl::OUString PROP_FILTER_TITLE = ::rtl::OUString::createFromAscii("filter_title" ); // [OUString] static const ::rtl::OUString PROP_FILTER_VALUE = ::rtl::OUString::createFromAscii("filter_value" ); // [OUString] static const ::rtl::OUString PROP_FORCE = ::rtl::OUString::createFromAscii("force" ); // [sal_Bool] @@ -123,7 +123,7 @@ class VistaFilePickerImpl : private ::cppu::BaseMutex , public IVistaFilePickerInternalNotify { public: - + //--------------------------------------------------------------------- /** used for marshalling requests. * Will be used to map requests to the right implementations. @@ -152,68 +152,68 @@ class VistaFilePickerImpl : private ::cppu::BaseMutex E_GET_CONTROL_LABEL, E_ENABLE_CONTROL }; - + public: - + //--------------------------------------------------------------------- // ctor/dtor - nothing special //--------------------------------------------------------------------- VistaFilePickerImpl(); virtual ~VistaFilePickerImpl(); - + //--------------------------------------------------------------------- // RequestHandler //--------------------------------------------------------------------- - + virtual void before(); virtual void doRequest(const RequestRef& rRequest); virtual void after(); - + //--------------------------------------------------------------------- virtual void onAutoExtensionChanged (bool bChecked); - + private: - + //--------------------------------------------------------------------- /// implementation of request E_ADD_FILEPICKER_LISTENER void impl_sta_addFilePickerListener(const RequestRef& rRequest); - + //--------------------------------------------------------------------- /// implementation of request E_REMOVE_FILEPICKER_LISTENER void impl_sta_removeFilePickerListener(const RequestRef& rRequest); - + //--------------------------------------------------------------------- /// implementation of request E_APPEND_FILTER void impl_sta_appendFilter(const RequestRef& rRequest); - + //--------------------------------------------------------------------- /// implementation of request E_SET_CURRENT_FILTER void impl_sta_setCurrentFilter(const RequestRef& rRequest); - + //--------------------------------------------------------------------- /// implementation of request E_GET_CURRENT_FILTER void impl_sta_getCurrentFilter(const RequestRef& rRequest); - + //--------------------------------------------------------------------- /// implementation of request E_CREATE_OPEN_DIALOG void impl_sta_CreateOpenDialog(const RequestRef& rRequest); - + //--------------------------------------------------------------------- /// implementation of request E_CREATE_SAVE_DIALOG void impl_sta_CreateSaveDialog(const RequestRef& rRequest); - + //--------------------------------------------------------------------- /// implementation of request E_SET_MULTISELECTION_MODE void impl_sta_SetMultiSelectionMode(const RequestRef& rRequest); - + //--------------------------------------------------------------------- /// implementation of request E_SET_TITLE void impl_sta_SetTitle(const RequestRef& rRequest); - + //--------------------------------------------------------------------- /// implementation of request E_SET_FILENAME void impl_sta_SetFileName(const RequestRef& rRequest); - + //--------------------------------------------------------------------- /// implementation of request E_SET_DIRECTORY void impl_sta_SetDirectory(const RequestRef& rRequest); @@ -225,35 +225,35 @@ class VistaFilePickerImpl : private ::cppu::BaseMutex //--------------------------------------------------------------------- /// implementation of request E_SET_DEFAULT_NAME void impl_sta_SetDefaultName(const RequestRef& rRequest); - + //--------------------------------------------------------------------- /// implementation of request E_GET_SELECTED_FILES void impl_sta_getSelectedFiles(const RequestRef& rRequest); - + //--------------------------------------------------------------------- /// implementation of request E_SHOW_DIALOG_MODAL void impl_sta_ShowDialogModal(const RequestRef& rRequest); - + //--------------------------------------------------------------------- /// implementation of request E_SET_CONTROL_VALUE void impl_sta_SetControlValue(const RequestRef& rRequest); - + //--------------------------------------------------------------------- /// implementation of request E_GET_CONTROL_VALUE void impl_sta_GetControlValue(const RequestRef& rRequest); - + //--------------------------------------------------------------------- /// implementation of request E_SET_CONTROL_LABEL void impl_sta_SetControlLabel(const RequestRef& rRequest); - + //--------------------------------------------------------------------- /// implementation of request E_GET_CONTROL_LABEL void impl_sta_GetControlLabel(const RequestRef& rRequest); - + //--------------------------------------------------------------------- /// implementation of request E_ENABLE_CONTROL void impl_sta_EnableControl(const RequestRef& rRequest); - + //--------------------------------------------------------------------- /** create all needed (optional!) UI controls adressed by the field nFeatures. * The given number nFeatures is used as a flag field. Use const values FEATURE_XXX @@ -273,7 +273,7 @@ class VistaFilePickerImpl : private ::cppu::BaseMutex * flag field(!) knows all features wich must be enabled. */ void impl_sta_enableFeatures(::sal_Int32 nFeatures, ::sal_Int32 nTemplate); - + //--------------------------------------------------------------------- /** returns an interface, which can be used to customize the internaly used * COM dialog. @@ -286,19 +286,19 @@ class VistaFilePickerImpl : private ::cppu::BaseMutex */ TFileDialogCustomize impl_getCustomizeInterface(); TFileDialog impl_getBaseDialogInterface(); - + //--------------------------------------------------------------------- /// fill filter list of internal used dialog. void impl_sta_setFiltersOnDialog(); - + void impl_SetDefaultExtension( const rtl::OUString& currentFilter ); - + private: - + //--------------------------------------------------------------------- /// COM object representing a file open dialog TFileOpenDialog m_iDialogOpen; - + //--------------------------------------------------------------------- /// COM object representing a file save dialog TFileSaveDialog m_iDialogSave; @@ -306,11 +306,11 @@ class VistaFilePickerImpl : private ::cppu::BaseMutex //--------------------------------------------------------------------- /// knows the return state of the last COM call HRESULT m_hLastResult; - + //--------------------------------------------------------------------- /// @todo document me CFilterContainer m_lFilters; - + //--------------------------------------------------------------------- /** cache last selected list of files * Because those list must be retrieved directly after closing the dialog @@ -319,13 +319,13 @@ class VistaFilePickerImpl : private ::cppu::BaseMutex * and asking for results .-) */ css::uno::Sequence< ::rtl::OUString > m_lLastFiles; - + //--------------------------------------------------------------------- /** help us to handle dialog events and provide them to interested office * listener. */ TFileDialogEvents m_iEventHandler; - + //--------------------------------------------------------------------- /// @todo document me ::sal_Bool m_bInExecute; @@ -342,7 +342,7 @@ class VistaFilePickerImpl : private ::cppu::BaseMutex ::rtl::OUString m_sFilename; // Resource provider - CResourceProvider m_ResProvider; + CResourceProvider m_ResProvider; }; } // namespace vista diff --git a/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx b/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx index b7751a6f83a4..9a0cb5b7b164 100644 --- a/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx +++ b/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -71,7 +71,7 @@ using namespace ::com::sun::star::ui::dialogs::ListboxControlActions; //------------------------------------------------------------------------- enum ECW_ACTION_T -{ +{ INIT_CUSTOM_CONTROLS, CACHE_CONTROL_VALUES }; @@ -91,24 +91,24 @@ struct EnumParam // ctor //------------------------------------------------------------------------- -CWinFileOpenImpl::CWinFileOpenImpl( - CFilePicker* aFilePicker, +CWinFileOpenImpl::CWinFileOpenImpl( + CFilePicker* aFilePicker, sal_Bool bFileOpenDialog, sal_uInt32 dwFlags, - sal_uInt32 dwTemplateId, - HINSTANCE hInstance) : - CFileOpenDialog(bFileOpenDialog, dwFlags, dwTemplateId, hInstance), - m_filterContainer(new CFilterContainer()), + sal_uInt32 dwTemplateId, + HINSTANCE hInstance) : + CFileOpenDialog(bFileOpenDialog, dwFlags, dwTemplateId, hInstance), + m_filterContainer(new CFilterContainer()), m_Preview(new CPreviewAdapter(hInstance)), m_CustomControlFactory(new CCustomControlFactory()), m_CustomControls(m_CustomControlFactory->CreateCustomControlContainer()), - m_FilePicker(aFilePicker), + m_FilePicker(aFilePicker), m_bInitialSelChanged(sal_True), m_HelpPopupWindow(hInstance, m_hwndFileOpenDlg), m_ExecuteFilePickerState(new CExecuteFilePickerState()), m_NonExecuteFilePickerState(new CNonExecuteFilePickerState()) { - m_FilePickerState = m_NonExecuteFilePickerState; + m_FilePickerState = m_NonExecuteFilePickerState; } //------------------------------------------------------------------------ @@ -125,28 +125,28 @@ CWinFileOpenImpl::~CWinFileOpenImpl() // we expect the directory in URL format //------------------------------------------------------------------------ -void CWinFileOpenImpl::setDisplayDirectory(const rtl::OUString& aDirectory) +void CWinFileOpenImpl::setDisplayDirectory(const rtl::OUString& aDirectory) throw( IllegalArgumentException, uno::RuntimeException ) { rtl::OUString aSysDirectory; if( aDirectory.getLength() > 0) - { - if ( ::osl::FileBase::E_None != + { + if ( ::osl::FileBase::E_None != ::osl::FileBase::getSystemPathFromFileURL(aDirectory,aSysDirectory)) - throw IllegalArgumentException( + throw IllegalArgumentException( rtl::OUString::createFromAscii("Invalid directory"), static_cast<XFilePicker2*>(m_FilePicker), 1); // we ensure that there is a trailing '/' at the end of // he given file url, because the windows functions only // works correctly when providing "c:\" or an environment - // variable like "=c:=c:\.." etc. is set, else the - // FolderPicker would stand in the root of the shell - // hierarchie which is the desktop folder + // variable like "=c:=c:\.." etc. is set, else the + // FolderPicker would stand in the root of the shell + // hierarchie which is the desktop folder if ( aSysDirectory.lastIndexOf(BACKSLASH) != (aSysDirectory.getLength() - 1)) aSysDirectory += BACKSLASH; } - + // call base class method CFileOpenDialog::setDisplayDirectory(aSysDirectory); } @@ -156,23 +156,23 @@ void CWinFileOpenImpl::setDisplayDirectory(const rtl::OUString& aDirectory) //------------------------------------------------------------------------ rtl::OUString CWinFileOpenImpl::getDisplayDirectory() throw(uno::RuntimeException) -{ +{ return m_FilePickerState->getDisplayDirectory(this); } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- -void SAL_CALL CWinFileOpenImpl::setDefaultName(const rtl::OUString& aName) +void SAL_CALL CWinFileOpenImpl::setDefaultName(const rtl::OUString& aName) throw( IllegalArgumentException, uno::RuntimeException ) -{ - // we don't set the default name directly +{ + // we don't set the default name directly // because this influences how the file open // dialog sets the initial path when it is about // to open (see MSDN: OPENFILENAME) - // so we save the default name which should - // appear in the file-name-box and set + // so we save the default name which should + // appear in the file-name-box and set // this name when processing onInitDone m_defaultName = aName; } @@ -185,9 +185,9 @@ void SAL_CALL CWinFileOpenImpl::setDefaultName(const rtl::OUString& aName) // the first entry is the path url, all other entries are file names //----------------------------------------------------------------------------------------- -uno::Sequence<rtl::OUString> SAL_CALL CWinFileOpenImpl::getFiles() +uno::Sequence<rtl::OUString> SAL_CALL CWinFileOpenImpl::getFiles() throw(uno::RuntimeException) -{ +{ return m_FilePickerState->getFiles(this); } @@ -198,13 +198,13 @@ uno::Sequence<rtl::OUString> SAL_CALL CWinFileOpenImpl::getFiles() sal_Int16 SAL_CALL CWinFileOpenImpl::execute( ) throw(uno::RuntimeException) { sal_Int16 rc = CFileOpenDialog::doModal(); - + if (1 == rc) rc = ::com::sun::star::ui::dialogs::ExecutableDialogResults::OK; else if (0 == rc) rc = ::com::sun::star::ui::dialogs::ExecutableDialogResults::CANCEL; else - throw uno::RuntimeException( + throw uno::RuntimeException( rtl::OUString::createFromAscii("Error executing dialog"), static_cast<XFilePicker2*>(m_FilePicker)); @@ -212,15 +212,15 @@ sal_Int16 SAL_CALL CWinFileOpenImpl::execute( ) throw(uno::RuntimeException) } //----------------------------------------------------------------------------------------- -// appends a new filter +// appends a new filter // returns false if the title (aTitle) was already added or the title or the filter are // empty //----------------------------------------------------------------------------------------- -void SAL_CALL CWinFileOpenImpl::appendFilter(const rtl::OUString& aTitle, const rtl::OUString& aFilter) +void SAL_CALL CWinFileOpenImpl::appendFilter(const rtl::OUString& aTitle, const rtl::OUString& aFilter) throw(IllegalArgumentException, uno::RuntimeException) -{ - sal_Bool bRet = m_filterContainer->addFilter(aTitle, aFilter); +{ + sal_Bool bRet = m_filterContainer->addFilter(aTitle, aFilter); if (!bRet) throw IllegalArgumentException( @@ -228,12 +228,12 @@ void SAL_CALL CWinFileOpenImpl::appendFilter(const rtl::OUString& aTitle, const static_cast<XFilePicker2*>(m_FilePicker), 1); // #95345# see MSDN OPENFILENAME - // If nFilterIndex is zero and lpstrCustomFilter is NULL, + // If nFilterIndex is zero and lpstrCustomFilter is NULL, // the system uses the first filter in the lpstrFilter buffer. - // to reflect this we must set the filter index so that calls - // to getSelectedFilterIndex without explicitly calling - // setFilterIndex before does not return 0 which leads to a - // false state + // to reflect this we must set the filter index so that calls + // to getSelectedFilterIndex without explicitly calling + // setFilterIndex before does not return 0 which leads to a + // false state if (0 == getSelectedFilterIndex()) CFileOpenDialog::setFilterIndex(1); } @@ -242,16 +242,16 @@ void SAL_CALL CWinFileOpenImpl::appendFilter(const rtl::OUString& aTitle, const // sets a current filter //----------------------------------------------------------------------------------------- -void SAL_CALL CWinFileOpenImpl::setCurrentFilter(const rtl::OUString& aTitle) +void SAL_CALL CWinFileOpenImpl::setCurrentFilter(const rtl::OUString& aTitle) throw( IllegalArgumentException, uno::RuntimeException) { sal_Int32 filterPos = m_filterContainer->getFilterPos(aTitle); if (filterPos < 0) - throw IllegalArgumentException( + throw IllegalArgumentException( rtl::OUString::createFromAscii("filter doesn't exist"), - static_cast<XFilePicker2*>(m_FilePicker), 1); - + static_cast<XFilePicker2*>(m_FilePicker), 1); + // filter index of the base class starts with 1 CFileOpenDialog::setFilterIndex(filterPos + 1); } @@ -277,10 +277,10 @@ rtl::OUString SAL_CALL CWinFileOpenImpl::getCurrentFilter() throw(uno::RuntimeEx } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- -inline void SAL_CALL CWinFileOpenImpl::appendFilterGroupSeparator() +inline void SAL_CALL CWinFileOpenImpl::appendFilterGroupSeparator() { m_filterContainer->addFilter(FILTER_SEPARATOR, ALL_FILES_WILDCARD, ALLOW_DUPLICATES); } @@ -289,19 +289,19 @@ inline void SAL_CALL CWinFileOpenImpl::appendFilterGroupSeparator() // XFilterGroupManager //----------------------------------------------------------------------------------------- -void SAL_CALL CWinFileOpenImpl::appendFilterGroup(const rtl::OUString& sGroupTitle, const uno::Sequence<beans::StringPair>& aFilters) +void SAL_CALL CWinFileOpenImpl::appendFilterGroup(const rtl::OUString& sGroupTitle, const uno::Sequence<beans::StringPair>& aFilters) throw (IllegalArgumentException, uno::RuntimeException) { (void) sGroupTitle; // avoid warning OSL_ENSURE(0 == sGroupTitle.getLength(), "appendFilterGroup: Parameter 'GroupTitle' currently ignored"); - + sal_Int32 nFilters = aFilters.getLength(); OSL_PRECOND(nFilters > 0, "Empty filter list"); if (nFilters > 0) { - // append a separator before the next group if + // append a separator before the next group if // there is already a group of filters if (m_filterContainer->numFilter() > 0) appendFilterGroupSeparator(); @@ -315,7 +315,7 @@ void SAL_CALL CWinFileOpenImpl::appendFilterGroup(const rtl::OUString& sGroupTit // XExtendedFilePicker //================================================================================================================= -void SAL_CALL CWinFileOpenImpl::setValue(sal_Int16 aControlId, sal_Int16 aControlAction, const uno::Any& aValue) +void SAL_CALL CWinFileOpenImpl::setValue(sal_Int16 aControlId, sal_Int16 aControlAction, const uno::Any& aValue) throw(uno::RuntimeException) { OSL_ASSERT(m_FilePickerState); @@ -323,22 +323,22 @@ void SAL_CALL CWinFileOpenImpl::setValue(sal_Int16 aControlId, sal_Int16 aContro } //----------------------------------------------------------------------------------------- -// returns the value of an custom template element +// returns the value of an custom template element // we assume that there are only checkboxes or comboboxes //----------------------------------------------------------------------------------------- -uno::Any SAL_CALL CWinFileOpenImpl::getValue(sal_Int16 aControlId, sal_Int16 aControlAction) +uno::Any SAL_CALL CWinFileOpenImpl::getValue(sal_Int16 aControlId, sal_Int16 aControlAction) throw(uno::RuntimeException) -{ +{ OSL_ASSERT(m_FilePickerState); - return m_FilePickerState->getValue(aControlId, aControlAction); + return m_FilePickerState->getValue(aControlId, aControlAction); } //----------------------------------------------------------------------------------------- // enables a custom template element //----------------------------------------------------------------------------------------- -void SAL_CALL CWinFileOpenImpl::enableControl(sal_Int16 ControlID, sal_Bool bEnable) +void SAL_CALL CWinFileOpenImpl::enableControl(sal_Int16 ControlID, sal_Bool bEnable) throw(uno::RuntimeException) { OSL_ASSERT(m_FilePickerState); @@ -349,7 +349,7 @@ void SAL_CALL CWinFileOpenImpl::enableControl(sal_Int16 ControlID, sal_Bool bEna // //----------------------------------------------------------------------------------------- -void SAL_CALL CWinFileOpenImpl::setLabel( sal_Int16 aControlId, const rtl::OUString& aLabel ) +void SAL_CALL CWinFileOpenImpl::setLabel( sal_Int16 aControlId, const rtl::OUString& aLabel ) throw (uno::RuntimeException) { m_FilePickerState->setLabel(aControlId, aLabel); @@ -359,17 +359,17 @@ void SAL_CALL CWinFileOpenImpl::setLabel( sal_Int16 aControlId, const rtl::OUStr // //----------------------------------------------------------------------------------------- -rtl::OUString SAL_CALL CWinFileOpenImpl::getLabel( sal_Int16 aControlId ) +rtl::OUString SAL_CALL CWinFileOpenImpl::getLabel( sal_Int16 aControlId ) throw (uno::RuntimeException) -{ +{ return m_FilePickerState->getLabel(aControlId); } - + //----------------------------------------------------------------------------------------- // //----------------------------------------------------------------------------------------- -uno::Sequence<sal_Int16> SAL_CALL CWinFileOpenImpl::getSupportedImageFormats() +uno::Sequence<sal_Int16> SAL_CALL CWinFileOpenImpl::getSupportedImageFormats() throw (uno::RuntimeException) { return m_Preview->getSupportedImageFormats(); @@ -379,9 +379,9 @@ uno::Sequence<sal_Int16> SAL_CALL CWinFileOpenImpl::getSupportedImageFormats() // //----------------------------------------------------------------------------------------- -sal_Int32 SAL_CALL CWinFileOpenImpl::getTargetColorDepth() +sal_Int32 SAL_CALL CWinFileOpenImpl::getTargetColorDepth() throw (uno::RuntimeException) -{ +{ return m_Preview->getTargetColorDepth(); } @@ -389,7 +389,7 @@ sal_Int32 SAL_CALL CWinFileOpenImpl::getTargetColorDepth() // //----------------------------------------------------------------------------------------- -sal_Int32 SAL_CALL CWinFileOpenImpl::getAvailableWidth() +sal_Int32 SAL_CALL CWinFileOpenImpl::getAvailableWidth() throw (uno::RuntimeException) { return m_Preview->getAvailableWidth(); @@ -399,7 +399,7 @@ sal_Int32 SAL_CALL CWinFileOpenImpl::getAvailableWidth() // //----------------------------------------------------------------------------------------- -sal_Int32 SAL_CALL CWinFileOpenImpl::getAvailableHeight() +sal_Int32 SAL_CALL CWinFileOpenImpl::getAvailableHeight() throw (uno::RuntimeException) { return m_Preview->getAvailableHeight(); @@ -409,7 +409,7 @@ sal_Int32 SAL_CALL CWinFileOpenImpl::getAvailableHeight() // //----------------------------------------------------------------------------------------- -void SAL_CALL CWinFileOpenImpl::setImage(sal_Int16 aImageFormat, const uno::Any& aImage) +void SAL_CALL CWinFileOpenImpl::setImage(sal_Int16 aImageFormat, const uno::Any& aImage) throw (IllegalArgumentException, uno::RuntimeException) { m_Preview->setImage(aImageFormat,aImage); @@ -419,17 +419,17 @@ void SAL_CALL CWinFileOpenImpl::setImage(sal_Int16 aImageFormat, const uno::Any& // //----------------------------------------------------------------------------------------- -sal_Bool SAL_CALL CWinFileOpenImpl::setShowState(sal_Bool bShowState) +sal_Bool SAL_CALL CWinFileOpenImpl::setShowState(sal_Bool bShowState) throw (uno::RuntimeException) { - return m_Preview->setShowState(bShowState); + return m_Preview->setShowState(bShowState); } //----------------------------------------------------------------------------------------- // //----------------------------------------------------------------------------------------- -sal_Bool SAL_CALL CWinFileOpenImpl::getShowState() +sal_Bool SAL_CALL CWinFileOpenImpl::getShowState() throw (uno::RuntimeException) { return m_Preview->getShowState(); @@ -443,13 +443,13 @@ void SAL_CALL CWinFileOpenImpl::cancel() { if (IsWindow(m_hwndFileOpenDlg)) { - // simulate a mouse click to the + // simulate a mouse click to the // cancel button - PostMessage( - m_hwndFileOpenDlg, - WM_COMMAND, - MAKEWPARAM(IDCANCEL,BN_CLICKED), - (LPARAM)GetDlgItem(m_hwndFileOpenDlg, IDCANCEL)); + PostMessage( + m_hwndFileOpenDlg, + WM_COMMAND, + MAKEWPARAM(IDCANCEL,BN_CLICKED), + (LPARAM)GetDlgItem(m_hwndFileOpenDlg, IDCANCEL)); } } @@ -460,13 +460,13 @@ void SAL_CALL CWinFileOpenImpl::cancel() sal_Int16 SAL_CALL CWinFileOpenImpl::getFocused() { int nID = GetDlgCtrlID(GetFocus()); - + // we don't forward id's of standard file open // dialog elements (ctlFirst is defined in dlgs.h // in MS Platform SDK) if (nID >= ctlFirst) nID = 0; - + return sal::static_int_cast< sal_Int16 >(nID); } @@ -484,40 +484,40 @@ inline sal_Bool SAL_CALL CWinFileOpenImpl::IsCustomControlHelpRequested(LPHELPIN // we catch the WM_NCDESTROY message in order to erase an entry in our static map // if one instance dies //----------------------------------------------------------------------------------------- - -LRESULT CALLBACK CWinFileOpenImpl::SubClassFunc( + +LRESULT CALLBACK CWinFileOpenImpl::SubClassFunc( HWND hWnd, UINT wMessage, WPARAM wParam, LPARAM lParam) { unsigned int lResult = 0; CWinFileOpenImpl* pImpl = dynamic_cast<CWinFileOpenImpl*>(getCurrentInstance(hWnd)); - + switch(wMessage) { case WM_HELP: - { + { LPHELPINFO lphi = reinterpret_cast<LPHELPINFO>(lParam); - + if (pImpl->IsCustomControlHelpRequested(lphi)) pImpl->onCustomControlHelpRequest(lphi); else - lResult = CallWindowProc( - reinterpret_cast<WNDPROC>(pImpl->m_pfnOldDlgProc), - hWnd,wMessage,wParam,lParam); + lResult = CallWindowProc( + reinterpret_cast<WNDPROC>(pImpl->m_pfnOldDlgProc), + hWnd,wMessage,wParam,lParam); } break; - + case WM_SIZE: lResult = CallWindowProc( - reinterpret_cast<WNDPROC>(pImpl->m_pfnOldDlgProc), - hWnd,wMessage,wParam,lParam); + reinterpret_cast<WNDPROC>(pImpl->m_pfnOldDlgProc), + hWnd,wMessage,wParam,lParam); pImpl->onWMSize(); break; case WM_WINDOWPOSCHANGED: lResult = CallWindowProc( - reinterpret_cast<WNDPROC>(pImpl->m_pfnOldDlgProc), + reinterpret_cast<WNDPROC>(pImpl->m_pfnOldDlgProc), hWnd,wMessage,wParam,lParam); pImpl->onWMWindowPosChanged(); @@ -525,37 +525,37 @@ LRESULT CALLBACK CWinFileOpenImpl::SubClassFunc( case WM_SHOWWINDOW: lResult = CallWindowProc( - reinterpret_cast<WNDPROC>(pImpl->m_pfnOldDlgProc), + reinterpret_cast<WNDPROC>(pImpl->m_pfnOldDlgProc), hWnd,wMessage,wParam,lParam); pImpl->onWMShow((BOOL)wParam); break; - + case WM_NCDESTROY: // restore the old window proc - SetWindowLong(hWnd, GWL_WNDPROC, + SetWindowLong(hWnd, GWL_WNDPROC, reinterpret_cast<LONG>(pImpl->m_pfnOldDlgProc)); - lResult = CallWindowProc( - reinterpret_cast<WNDPROC>(pImpl->m_pfnOldDlgProc), + lResult = CallWindowProc( + reinterpret_cast<WNDPROC>(pImpl->m_pfnOldDlgProc), hWnd,wMessage,wParam,lParam); break; - - default: - lResult = CallWindowProc( - reinterpret_cast<WNDPROC>(pImpl->m_pfnOldDlgProc), + + default: + lResult = CallWindowProc( + reinterpret_cast<WNDPROC>(pImpl->m_pfnOldDlgProc), hWnd,wMessage,wParam,lParam); break; - + } // switch - + return lResult; -} +} //----------------------------------------------------------------- -// +// //----------------------------------------------------------------- - + void SAL_CALL CWinFileOpenImpl::InitControlLabel(HWND hWnd) { //----------------------------------------- @@ -570,15 +570,15 @@ void SAL_CALL CWinFileOpenImpl::InitControlLabel(HWND hWnd) //----------------------------------------------------------------- // There may be problems with the layout of our custom controls, -// so that they are not aligned with the standard controls of the +// so that they are not aligned with the standard controls of the // FileOpen dialog. // We use a simple algorithm to move the custom controls to their // proper position and resize them. -// Our approach is to align all static text controls with the +// Our approach is to align all static text controls with the // static text control "File name" of the FileOpen dialog, // all checkboxes and all list/comboboxes will be left aligned with // the standard combobox edt1 (defined in MS platform sdk dlgs.h) -// and all push buttons will be left aligned with the standard +// and all push buttons will be left aligned with the standard // "OK" button //----------------------------------------------------------------- @@ -589,24 +589,24 @@ void SAL_CALL CWinFileOpenImpl::InitCustomControlContainer(HWND hCustomControl) } //----------------------------------------------------------------- -// +// //----------------------------------------------------------------- void SAL_CALL CWinFileOpenImpl::CacheControlState(HWND hWnd) { OSL_ASSERT(m_FilePickerState && m_NonExecuteFilePickerState); - m_ExecuteFilePickerState->cacheControlState(hWnd, m_NonExecuteFilePickerState); + m_ExecuteFilePickerState->cacheControlState(hWnd, m_NonExecuteFilePickerState); } //----------------------------------------------------------------- -// +// //----------------------------------------------------------------- BOOL CALLBACK CWinFileOpenImpl::EnumChildWndProc(HWND hWnd, LPARAM lParam) { EnumParam* enumParam = (EnumParam*)lParam; CWinFileOpenImpl* pImpl = enumParam->m_instance; - + OSL_ASSERT(pImpl); BOOL bRet = TRUE; @@ -614,19 +614,19 @@ BOOL CALLBACK CWinFileOpenImpl::EnumChildWndProc(HWND hWnd, LPARAM lParam) switch(enumParam->m_action) { case INIT_CUSTOM_CONTROLS: - pImpl->InitControlLabel(hWnd); + pImpl->InitControlLabel(hWnd); pImpl->InitCustomControlContainer(hWnd); break; case CACHE_CONTROL_VALUES: pImpl->CacheControlState(hWnd); - break; - + break; + default: // should not end here - OSL_ASSERT(sal_False); + OSL_ASSERT(sal_False); } - + return bRet; } @@ -635,16 +635,16 @@ BOOL CALLBACK CWinFileOpenImpl::EnumChildWndProc(HWND hWnd, LPARAM lParam) //----------------------------------------------------------------- sal_uInt32 SAL_CALL CWinFileOpenImpl::onFileOk() -{ +{ m_NonExecuteFilePickerState->reset(); EnumParam enumParam(CACHE_CONTROL_VALUES,this); - EnumChildWindows( - m_hwndFileOpenDlgChild, - CWinFileOpenImpl::EnumChildWndProc, + EnumChildWindows( + m_hwndFileOpenDlgChild, + CWinFileOpenImpl::EnumChildWndProc, (LPARAM)&enumParam); - + return 0; } @@ -653,22 +653,22 @@ sal_uInt32 SAL_CALL CWinFileOpenImpl::onFileOk() //----------------------------------------------------------------- void SAL_CALL CWinFileOpenImpl::onSelChanged(HWND) -{ +{ // the windows file open dialog sends an initial // SelChanged message after the InitDone message // when the dialog is about to be opened // if the lpstrFile buffer of the OPENFILENAME is - // empty (zero length string) the windows file open + // empty (zero length string) the windows file open // dialog sends a WM_SETTEXT message with an empty // string to the file name edit line // this would overwritte our text when we would set - // the default name in onInitDone, so we have to + // the default name in onInitDone, so we have to // remeber that this is the first SelChanged message // and set the default name here to overwrite the // windows setting InitialSetDefaultName(); - FilePickerEvent evt; + FilePickerEvent evt; m_FilePicker->fileSelectionChanged(evt); } @@ -676,7 +676,7 @@ void SAL_CALL CWinFileOpenImpl::onSelChanged(HWND) // and 'File type' is to short in some cases when the // label will be changed (e.g. in the Brazil version). // We just make sure that the labels are using the maximum -// available space. +// available space. void CWinFileOpenImpl::EnlargeStdControlLabels() const { HWND hFilterBoxLabel = GetDlgItem(m_hwndFileOpenDlg, stc2); @@ -684,25 +684,25 @@ void CWinFileOpenImpl::EnlargeStdControlLabels() const HWND hFileNameBox = GetDlgItem(m_hwndFileOpenDlg, cmb13); if (!hFileNameBox) hFileNameBox = GetDlgItem(m_hwndFileOpenDlg, edt1); // under Win98 it is edt1 instead of cmb13 - + HWND hFilterBox = GetDlgItem(m_hwndFileOpenDlg, cmb1); HWND hOkButton = GetDlgItem(m_hwndFileOpenDlg, IDOK); - + // Move filter and file name box nearer to OK and Cancel button RECT rcOkButton; GetWindowRect(hOkButton, &rcOkButton); - + const int MAX_GAP = IsWindows98() ? 5 : 10; const int OFFSET = IsWindows98() ? 10 : 0; - + RECT rcFileNameBox; GetWindowRect(hFileNameBox, &rcFileNameBox); int w = rcFileNameBox.right - rcFileNameBox.left; int h = rcFileNameBox.bottom - rcFileNameBox.top; - + int gap = rcOkButton.left - rcFileNameBox.right; gap = (gap > MAX_GAP) ? gap - MAX_GAP : gap; - + ScreenToClient(m_hwndFileOpenDlg, (LPPOINT)&rcFileNameBox); MoveWindow(hFileNameBox, rcFileNameBox.left + gap + OFFSET, rcFileNameBox.top, w - OFFSET, h, true); @@ -714,17 +714,17 @@ void CWinFileOpenImpl::EnlargeStdControlLabels() const MoveWindow(hFilterBox, rcFilterBox.left + gap + OFFSET, rcFilterBox.top, w - OFFSET, h, true); // get the new window rect - GetWindowRect(hFileNameBox, &rcFileNameBox); - + GetWindowRect(hFileNameBox, &rcFileNameBox); + RECT rcFilterBoxLabel; GetWindowRect(hFilterBoxLabel, &rcFilterBoxLabel); int offset = rcFileNameBox.left - rcFilterBoxLabel.right - 1; - + w = rcFilterBoxLabel.right - rcFilterBoxLabel.left + offset; h = rcFilterBoxLabel.bottom - rcFilterBoxLabel.top; ScreenToClient(m_hwndFileOpenDlg, (LPPOINT)&rcFilterBoxLabel); MoveWindow(hFilterBoxLabel, rcFilterBoxLabel.left, rcFilterBoxLabel.top, w, h, true); - + RECT rcFileNameBoxLabel; GetWindowRect(hFileNameBoxLabel, &rcFileNameBoxLabel); w = rcFileNameBoxLabel.right - rcFileNameBoxLabel.left + offset; @@ -739,27 +739,27 @@ void SAL_CALL CWinFileOpenImpl::onInitDone() // but now we have a valid parent handle m_HelpPopupWindow.setParent(m_hwndFileOpenDlg); - + EnlargeStdControlLabels(); - - // #99826 + + // #99826 // Set the online filepicker state before initializing - // the control labels from the resource else we are + // the control labels from the resource else we are // overriding the offline settings m_ExecuteFilePickerState->setHwnd(m_hwndFileOpenDlgChild); - + m_FilePickerState = m_ExecuteFilePickerState; - + // initialize controls from cache - + EnumParam enumParam(INIT_CUSTOM_CONTROLS,this); - - EnumChildWindows( - m_hwndFileOpenDlgChild, - CWinFileOpenImpl::EnumChildWndProc, - (LPARAM)&enumParam); - - m_ExecuteFilePickerState->initFilePickerControls( + + EnumChildWindows( + m_hwndFileOpenDlgChild, + CWinFileOpenImpl::EnumChildWndProc, + (LPARAM)&enumParam); + + m_ExecuteFilePickerState->initFilePickerControls( m_NonExecuteFilePickerState->getControlCommand()); SetDefaultExtension(); @@ -769,7 +769,7 @@ void SAL_CALL CWinFileOpenImpl::onInitDone() m_CustomControls->SetFont( reinterpret_cast<HFONT>(SendMessage(m_hwndFileOpenDlg, WM_GETFONT, 0, 0))); - // resume event notification that was + // resume event notification that was // defered in onInitDialog m_FilePicker->resumeEventNotification(); @@ -779,8 +779,8 @@ void SAL_CALL CWinFileOpenImpl::onInitDone() RegisterWindowMessage(TEXT("SYSTEM_WINDOW_ACTIVATED")), 0, 0); - - // call the parent function to center the + + // call the parent function to center the // dialog to it's parent CFileOpenDialog::onInitDone(); } @@ -791,7 +791,7 @@ void SAL_CALL CWinFileOpenImpl::onInitDone() void SAL_CALL CWinFileOpenImpl::onFolderChanged() { - FilePickerEvent evt; + FilePickerEvent evt; m_FilePicker->directoryChanged(evt); } @@ -803,8 +803,8 @@ void SAL_CALL CWinFileOpenImpl::onTypeChanged(sal_uInt32) { SetDefaultExtension(); - FilePickerEvent evt; - evt.ElementId = LISTBOX_FILTER; + FilePickerEvent evt; + evt.ElementId = LISTBOX_FILTER; m_FilePicker->controlStateChanged(evt); } @@ -812,15 +812,15 @@ void SAL_CALL CWinFileOpenImpl::onTypeChanged(sal_uInt32) // onMessageCommand handler //----------------------------------------------------------------------------------------- -sal_uInt32 SAL_CALL CWinFileOpenImpl::onCtrlCommand( +sal_uInt32 SAL_CALL CWinFileOpenImpl::onCtrlCommand( HWND, sal_uInt16 ctrlId, sal_uInt16) { SetDefaultExtension(); if (ctrlId < ctlFirst) { - FilePickerEvent evt; - evt.ElementId = ctrlId; + FilePickerEvent evt; + evt.ElementId = ctrlId; m_FilePicker->controlStateChanged(evt); } @@ -828,7 +828,7 @@ sal_uInt32 SAL_CALL CWinFileOpenImpl::onCtrlCommand( } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- void CWinFileOpenImpl::onWMSize() @@ -839,16 +839,16 @@ void CWinFileOpenImpl::onWMSize() } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- void CWinFileOpenImpl::onWMShow(BOOL bShow) -{ +{ m_Preview->notifyParentShow(bShow); } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- void CWinFileOpenImpl::onWMWindowPosChanged() @@ -857,7 +857,7 @@ void CWinFileOpenImpl::onWMWindowPosChanged() } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- void CWinFileOpenImpl::onCustomControlHelpRequest(LPHELPINFO lphi) @@ -866,7 +866,7 @@ void CWinFileOpenImpl::onCustomControlHelpRequest(LPHELPINFO lphi) evt.ElementId = sal::static_int_cast< sal_Int16 >(lphi->iCtrlId); rtl::OUString aPopupHelpText = m_FilePicker->helpRequested(evt); - + if (aPopupHelpText.getLength()) { m_HelpPopupWindow.setText(aPopupHelpText); @@ -877,32 +877,32 @@ void CWinFileOpenImpl::onCustomControlHelpRequest(LPHELPINFO lphi) } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- void SAL_CALL CWinFileOpenImpl::onInitDialog(HWND hwndDlg) { // subclass the dialog window - m_pfnOldDlgProc = - reinterpret_cast<WNDPROC>( - SetWindowLong( hwndDlg, GWL_WNDPROC, - reinterpret_cast<LONG>(SubClassFunc))); + m_pfnOldDlgProc = + reinterpret_cast<WNDPROC>( + SetWindowLong( hwndDlg, GWL_WNDPROC, + reinterpret_cast<LONG>(SubClassFunc))); } //----------------------------------------------------------------------------------------- -// processing before showing the dialog +// processing before showing the dialog //----------------------------------------------------------------------------------------- bool SAL_CALL CWinFileOpenImpl::preModal() -{ - CFileOpenDialog::setFilter( +{ + CFileOpenDialog::setFilter( makeWinFilterBuffer(*m_filterContainer.get())); - + return true; } //----------------------------------------------------------------------------------------- -// processing after showing the dialog +// processing after showing the dialog //----------------------------------------------------------------------------------------- void CWinFileOpenImpl::postModal(sal_Int16 nDialogResult) @@ -913,8 +913,8 @@ void CWinFileOpenImpl::postModal(sal_Int16 nDialogResult) // invalid controls in case someone calls execute // twice in sequence with the same instance m_CustomControls->RemoveAllControls(); - - m_FilePickerState = m_NonExecuteFilePickerState; + + m_FilePickerState = m_NonExecuteFilePickerState; } //----------------------------------------------------------------------------------------- @@ -922,7 +922,7 @@ void CWinFileOpenImpl::postModal(sal_Int16 nDialogResult) //----------------------------------------------------------------------------------------- void SAL_CALL CWinFileOpenImpl::SetDefaultExtension() -{ +{ HWND hwndChkSaveWithExt = GetDlgItem(m_hwndFileOpenDlgChild, 100); if (hwndChkSaveWithExt) @@ -944,26 +944,26 @@ void SAL_CALL CWinFileOpenImpl::SetDefaultExtension() { rtl::OUString FilterExt; m_filterContainer->getFilter(currentFilter, FilterExt); - + sal_Int32 posOfPoint = FilterExt.indexOf(L'.'); const sal_Unicode* pFirstExtStart = FilterExt.getStr() + posOfPoint + 1; - + sal_Int32 posOfSemiColon = FilterExt.indexOf(L';') - 1; - if (posOfSemiColon < 0) + if (posOfSemiColon < 0) posOfSemiColon = FilterExt.getLength() - 1; FilterExt = rtl::OUString(pFirstExtStart, posOfSemiColon - posOfPoint); - SendMessage(m_hwndFileOpenDlg, CDM_SETDEFEXT, 0, reinterpret_cast<LPARAM>(FilterExt.getStr())); + SendMessage(m_hwndFileOpenDlg, CDM_SETDEFEXT, 0, reinterpret_cast<LPARAM>(FilterExt.getStr())); } } } else - { + { SendMessage(m_hwndFileOpenDlg, CDM_SETDEFEXT, 0, reinterpret_cast<LPARAM>(TEXT(""))); } } - + // !!! HACK !!! } @@ -972,7 +972,7 @@ void SAL_CALL CWinFileOpenImpl::SetDefaultExtension() //----------------------------------------------------------------------------------------- void SAL_CALL CWinFileOpenImpl::InitialSetDefaultName() -{ +{ // manually setting the file name that appears // initially in the file-name-box of the file // open dialog (reason: see above setDefaultName) @@ -985,13 +985,13 @@ void SAL_CALL CWinFileOpenImpl::InitialSetDefaultName() // 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())); + SetWindowText(hwndEdt1, reinterpret_cast<LPCTSTR>(m_defaultName.getStr())); } - m_bInitialSelChanged = sal_False; + m_bInitialSelChanged = sal_False; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/fpicker/source/win32/filepicker/WinFileOpenImpl.hxx b/fpicker/source/win32/filepicker/WinFileOpenImpl.hxx index e20fbf58ff1a..379a2dd49646 100644 --- a/fpicker/source/win32/filepicker/WinFileOpenImpl.hxx +++ b/fpicker/source/win32/filepicker/WinFileOpenImpl.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -63,32 +63,32 @@ class CNonExecuteFilePickerState; class CWinFileOpenImpl : public CFileOpenDialog { public: - CWinFileOpenImpl( - CFilePicker* aFilePicker, - sal_Bool bFileOpenDialog = sal_True, + CWinFileOpenImpl( + CFilePicker* aFilePicker, + sal_Bool bFileOpenDialog = sal_True, sal_uInt32 dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, sal_uInt32 dwTemplateId = 0, HINSTANCE hInstance = 0 ); virtual ~CWinFileOpenImpl( ); - + //----------------------------------------------------------------------------------------- // XExecutableDialog //----------------------------------------------------------------------------------------- - + virtual sal_Int16 SAL_CALL execute( ) throw( ::com::sun::star::uno::RuntimeException ); //----------------------------------------------------------------------------------------- // XFilePicker //----------------------------------------------------------------------------------------- - - virtual void SAL_CALL setDefaultName( const ::rtl::OUString& aName ) + + virtual void SAL_CALL setDefaultName( const ::rtl::OUString& aName ) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); - - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getFiles( ) + + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getFiles( ) throw(::com::sun::star::uno::RuntimeException ); - - virtual void SAL_CALL setDisplayDirectory( const ::rtl::OUString& aDirectory ) + + virtual void SAL_CALL setDisplayDirectory( const ::rtl::OUString& aDirectory ) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); virtual ::rtl::OUString SAL_CALL getDisplayDirectory( ) throw ( ::com::sun::star::uno::RuntimeException ); @@ -97,64 +97,64 @@ public: // XFilterManager //----------------------------------------------------------------------------------------- - virtual void SAL_CALL appendFilter( const ::rtl::OUString& aTitle, const ::rtl::OUString& aFilter ) + virtual void SAL_CALL appendFilter( const ::rtl::OUString& aTitle, const ::rtl::OUString& aFilter ) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL setCurrentFilter( const ::rtl::OUString& aTitle ) + virtual void SAL_CALL setCurrentFilter( const ::rtl::OUString& aTitle ) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); - virtual ::rtl::OUString SAL_CALL getCurrentFilter( ) + virtual ::rtl::OUString SAL_CALL getCurrentFilter( ) throw( ::com::sun::star::uno::RuntimeException ); //----------------------------------------------------------------------------------------- // XFilterGroupManager //----------------------------------------------------------------------------------------- - virtual void SAL_CALL appendFilterGroup( const ::rtl::OUString& sGroupTitle, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair >& aFilters ) + virtual void SAL_CALL appendFilterGroup( const ::rtl::OUString& sGroupTitle, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair >& aFilters ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); //----------------------------------------------------------------------------------------- // XFilePickerControlAccess //----------------------------------------------------------------------------------------- - - virtual void SAL_CALL setValue( sal_Int16 aControlId, sal_Int16 aControlAction, const ::com::sun::star::uno::Any& aValue ) + + virtual void SAL_CALL setValue( sal_Int16 aControlId, sal_Int16 aControlAction, const ::com::sun::star::uno::Any& aValue ) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Any SAL_CALL getValue( sal_Int16 aControlId, sal_Int16 aControlAction ) + virtual ::com::sun::star::uno::Any SAL_CALL getValue( sal_Int16 aControlId, sal_Int16 aControlAction ) throw( ::com::sun::star::uno::RuntimeException ); - - virtual void SAL_CALL enableControl( sal_Int16 aControlId, sal_Bool bEnable ) + + virtual void SAL_CALL enableControl( sal_Int16 aControlId, sal_Bool bEnable ) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL setLabel( sal_Int16 aControlId, const ::rtl::OUString& aLabel ) + virtual void SAL_CALL setLabel( sal_Int16 aControlId, const ::rtl::OUString& aLabel ) throw (::com::sun::star::uno::RuntimeException); - virtual ::rtl::OUString SAL_CALL getLabel( sal_Int16 aControlId ) + virtual ::rtl::OUString SAL_CALL getLabel( sal_Int16 aControlId ) throw ( ::com::sun::star::uno::RuntimeException); - + //------------------------------------------------ // XFilePreview //------------------------------------------------ - virtual ::com::sun::star::uno::Sequence< sal_Int16 > SAL_CALL getSupportedImageFormats( ) + virtual ::com::sun::star::uno::Sequence< sal_Int16 > SAL_CALL getSupportedImageFormats( ) throw (::com::sun::star::uno::RuntimeException); - virtual sal_Int32 SAL_CALL getTargetColorDepth( ) + virtual sal_Int32 SAL_CALL getTargetColorDepth( ) throw (::com::sun::star::uno::RuntimeException); - virtual sal_Int32 SAL_CALL getAvailableWidth( ) + virtual sal_Int32 SAL_CALL getAvailableWidth( ) throw (::com::sun::star::uno::RuntimeException); - virtual sal_Int32 SAL_CALL getAvailableHeight( ) + virtual sal_Int32 SAL_CALL getAvailableHeight( ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setImage( sal_Int16 aImageFormat, const ::com::sun::star::uno::Any& aImage ) + virtual void SAL_CALL setImage( sal_Int16 aImageFormat, const ::com::sun::star::uno::Any& aImage ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL setShowState( sal_Bool bShowState ) + virtual sal_Bool SAL_CALL setShowState( sal_Bool bShowState ) throw (::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL getShowState( ) + virtual sal_Bool SAL_CALL getShowState( ) throw (::com::sun::star::uno::RuntimeException); //------------------------------------------------ @@ -174,59 +174,59 @@ protected: virtual void SAL_CALL postModal( sal_Int16 nDialogResult ); virtual sal_uInt32 SAL_CALL onFileOk(); - virtual void SAL_CALL onSelChanged( HWND hwndListBox ); + virtual void SAL_CALL onSelChanged( HWND hwndListBox ); // only called back if OFN_EXPLORER is set - virtual void SAL_CALL onInitDone(); + virtual void SAL_CALL onInitDone(); virtual void SAL_CALL onFolderChanged(); virtual void SAL_CALL onTypeChanged( sal_uInt32 nFilterIndex ); - + // call base class method first when overloading virtual void SAL_CALL onInitDialog( HWND hwndDlg ); virtual sal_uInt32 SAL_CALL onCtrlCommand( HWND hwndDlg, sal_uInt16 ctrlId, sal_uInt16 notifyCode ); - + void onWMSize(); void onWMShow(BOOL bShow); void onWMWindowPosChanged(); void onCustomControlHelpRequest(LPHELPINFO lphi); -private: +private: inline void SAL_CALL appendFilterGroupSeparator( ); - + inline sal_Bool SAL_CALL IsCustomControlHelpRequested(LPHELPINFO lphi) const; void EnlargeStdControlLabels() const; - + // initialize all controls from cache void SAL_CALL InitControlLabel( HWND hWnd ); void SAL_CALL InitCustomControlContainer(HWND hCustomControl); - - // save the control state + + // save the control state void SAL_CALL CacheControlState(HWND hWnd); void SAL_CALL SetDefaultExtension(); void SAL_CALL InitialSetDefaultName(); - + static LRESULT CALLBACK SubClassFunc(HWND hWnd, UINT wMessage, WPARAM wParam, LPARAM lParam); static BOOL CALLBACK EnumChildWndProc( HWND hWnd, LPARAM lParam ); - -private: - std::auto_ptr<CFilterContainer> m_filterContainer; - std::auto_ptr<CPreviewAdapter> m_Preview; - std::auto_ptr<CCustomControlFactory> m_CustomControlFactory; - std::auto_ptr<CCustomControl> m_CustomControls; - CFilePicker* m_FilePicker; - WNDPROC m_pfnOldDlgProc; - rtl::OUString m_defaultName; - sal_Bool m_bInitialSelChanged; - CHelpPopupWindow m_HelpPopupWindow; - CFilePickerState* m_FilePickerState; - CExecuteFilePickerState* m_ExecuteFilePickerState; - CNonExecuteFilePickerState* m_NonExecuteFilePickerState; - CResourceProvider m_ResProvider; + +private: + std::auto_ptr<CFilterContainer> m_filterContainer; + std::auto_ptr<CPreviewAdapter> m_Preview; + std::auto_ptr<CCustomControlFactory> m_CustomControlFactory; + std::auto_ptr<CCustomControl> m_CustomControls; + CFilePicker* m_FilePicker; + WNDPROC m_pfnOldDlgProc; + rtl::OUString m_defaultName; + sal_Bool m_bInitialSelChanged; + CHelpPopupWindow m_HelpPopupWindow; + CFilePickerState* m_FilePickerState; + CExecuteFilePickerState* m_ExecuteFilePickerState; + CNonExecuteFilePickerState* m_NonExecuteFilePickerState; + CResourceProvider m_ResProvider; }; diff --git a/fpicker/source/win32/filepicker/asynceventnotifier.cxx b/fpicker/source/win32/filepicker/asynceventnotifier.cxx index 0e71ec966b3d..d69746fd07cd 100644 --- a/fpicker/source/win32/filepicker/asynceventnotifier.cxx +++ b/fpicker/source/win32/filepicker/asynceventnotifier.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -52,25 +52,25 @@ using ::com::sun::star::ui::dialogs::XFilePickerListener; // //------------------------------------------------ -CAsyncEventNotifier::CAsyncEventNotifier(cppu::OBroadcastHelper& rBroadcastHelper) : +CAsyncEventNotifier::CAsyncEventNotifier(cppu::OBroadcastHelper& rBroadcastHelper) : m_hThread(0), m_bRun(false), m_ThreadId(0), m_rBroadcastHelper(rBroadcastHelper), m_NotifyEvent(m_hEvents[0]), m_ResumeNotifying(m_hEvents[1]) -{ +{ // m_NotifyEvent - m_hEvents[0] = CreateEvent(0, /* no security */ - true, /* manual reset */ - false, /* initial state not signaled */ - 0); /* automatic name */ - - // m_ResumeNotifying - m_hEvents[1] = CreateEvent(0, /* no security */ - true, /* manual reset */ - false, /* initial state not signaled */ - 0); /* automatic name */ + m_hEvents[0] = CreateEvent(0, /* no security */ + true, /* manual reset */ + false, /* initial state not signaled */ + 0); /* automatic name */ + + // m_ResumeNotifying + m_hEvents[1] = CreateEvent(0, /* no security */ + true, /* manual reset */ + false, /* initial state not signaled */ + 0); /* automatic name */ } //------------------------------------------------ @@ -80,7 +80,7 @@ CAsyncEventNotifier::CAsyncEventNotifier(cppu::OBroadcastHelper& rBroadcastHelpe CAsyncEventNotifier::~CAsyncEventNotifier() { OSL_ENSURE(0 == m_hThread,"Thread not stopped, destroying this instance leads to desaster"); - + CloseHandle(m_hEvents[0]); CloseHandle(m_hEvents[1]); } @@ -93,15 +93,15 @@ void SAL_CALL CAsyncEventNotifier::addListener(const uno::Type& const uno::Reference< uno::XInterface >& xListener) { if ( m_rBroadcastHelper.bDisposed ) - throw lang::DisposedException( + throw lang::DisposedException( ::rtl::OUString::createFromAscii( "FilePicker is already disposed" ), uno::Reference< uno::XInterface >() ); if ( m_rBroadcastHelper.bInDispose ) - throw lang::DisposedException( + throw lang::DisposedException( ::rtl::OUString::createFromAscii( "FilePicker will be disposed now." ), uno::Reference< uno::XInterface >() ); - + m_rBroadcastHelper.aLC.addInterface( aType, xListener ); } @@ -113,7 +113,7 @@ void SAL_CALL CAsyncEventNotifier::removeListener(const uno::Type& const uno::Reference< uno::XInterface >& xListener) { if ( m_rBroadcastHelper.bDisposed ) - throw lang::DisposedException( + throw lang::DisposedException( ::rtl::OUString::createFromAscii( "FilePicker is already disposed." ), uno::Reference< uno::XInterface >() ); @@ -131,13 +131,13 @@ bool SAL_CALL CAsyncEventNotifier::startup(bool bCreateSuspended) // m_bRun may already be false because of a // call to stop but the thread did not yet // terminate so m_hEventNotifierThread is - // yet a valid thread handle that should + // yet a valid thread handle that should // not be overwritten if (!m_bRun) { if (!bCreateSuspended) SetEvent(m_ResumeNotifying); - + m_hThread = (HANDLE)_beginthreadex( NULL, 0, CAsyncEventNotifier::ThreadProc, this, 0, &m_ThreadId); @@ -159,20 +159,20 @@ bool SAL_CALL CAsyncEventNotifier::startup(bool bCreateSuspended) void SAL_CALL CAsyncEventNotifier::shutdown() { unsigned nThreadId = GetCurrentThreadId(); - + OSL_PRECOND(nThreadId != m_ThreadId, "Method called in wrong thread context!"); osl::ResettableMutexGuard aGuard(m_Mutex); - + OSL_PRECOND(m_bRun,"Event notifier does not run!"); m_bRun = false; - m_EventList.clear(); - + m_EventList.clear(); + // awake the the notifier thread SetEvent(m_ResumeNotifying); SetEvent(m_NotifyEvent); - + // releas the mutex here because the event // notifier thread may need it to finish aGuard.clear(); @@ -186,7 +186,7 @@ void SAL_CALL CAsyncEventNotifier::shutdown() // lock mutex again to reset m_hThread // and prevent a race with start() aGuard.reset(); - + CloseHandle(m_hThread); m_hThread = 0; } @@ -199,7 +199,7 @@ void CAsyncEventNotifier::suspend() { ResetEvent(m_ResumeNotifying); } - + //------------------------------------------------ // //------------------------------------------------ @@ -208,7 +208,7 @@ void CAsyncEventNotifier::resume() { SetEvent(m_ResumeNotifying); } - + //------------------------------------------------ // //------------------------------------------------ @@ -243,8 +243,8 @@ size_t SAL_CALL CAsyncEventNotifier::getEventListSize() void SAL_CALL CAsyncEventNotifier::resetNotifyEvent() { osl::MutexGuard aGuard(m_Mutex); - if (0 == m_EventList.size()) - ResetEvent(m_NotifyEvent); + if (0 == m_EventList.size()) + ResetEvent(m_NotifyEvent); } //------------------------------------------------ @@ -263,28 +263,28 @@ CEventNotification* SAL_CALL CAsyncEventNotifier::getNextEventRecord() void SAL_CALL CAsyncEventNotifier::removeNextEventRecord() { - osl::MutexGuard aGuard(m_Mutex); - m_EventList.pop_front(); + osl::MutexGuard aGuard(m_Mutex); + m_EventList.pop_front(); } //------------------------------------------------ // //------------------------------------------------ -void SAL_CALL CAsyncEventNotifier::run() +void SAL_CALL CAsyncEventNotifier::run() { while (m_bRun) - { + { WaitForMultipleObjects(2, m_hEvents, true, INFINITE); - + if (m_bRun) - { + { while (getEventListSize() > 0) - { + { std::auto_ptr<CEventNotification> EventNotification(getNextEventRecord()); removeNextEventRecord(); - ::cppu::OInterfaceContainerHelper* pICHelper = + ::cppu::OInterfaceContainerHelper* pICHelper = m_rBroadcastHelper.getContainer(getCppuType((uno::Reference<XFilePickerListener>*)0)); if (pICHelper) @@ -292,9 +292,9 @@ void SAL_CALL CAsyncEventNotifier::run() ::cppu::OInterfaceIteratorHelper iter(*pICHelper); while(iter.hasMoreElements()) - { + { try - { + { EventNotification->notifyEventListener(iter.next()); } catch(uno::RuntimeException&) @@ -305,10 +305,10 @@ void SAL_CALL CAsyncEventNotifier::run() } } // while(getEventListSize() > 0) + + resetNotifyEvent(); - resetNotifyEvent(); - - } // if (m_bRun) + } // if (m_bRun) } // while(m_bRun) } diff --git a/fpicker/source/win32/filepicker/asynceventnotifier.hxx b/fpicker/source/win32/filepicker/asynceventnotifier.hxx index d7fd8ea0cefb..fa50a03e82fd 100644 --- a/fpicker/source/win32/filepicker/asynceventnotifier.hxx +++ b/fpicker/source/win32/filepicker/asynceventnotifier.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -63,14 +63,14 @@ public: void SAL_CALL shutdown(); // notifications may be added the - // the event queue but will only + // the event queue but will only // be notified to the clients after // resume was called void suspend(); - + // resume notifying events void resume(); - + // this class is responsible for the memory management of // the CEventNotification instance void SAL_CALL notifyEvent(CEventNotification* EventNotification); @@ -90,16 +90,16 @@ private: static unsigned int WINAPI ThreadProc(LPVOID pParam); -private: +private: std::list<CEventNotification*> m_EventList; - HANDLE m_hThread; - bool m_bRun; - unsigned m_ThreadId; - ::cppu::OBroadcastHelper& m_rBroadcastHelper; + HANDLE m_hThread; + bool m_bRun; + unsigned m_ThreadId; + ::cppu::OBroadcastHelper& m_rBroadcastHelper; HANDLE m_hEvents[2]; HANDLE& m_NotifyEvent; - HANDLE& m_ResumeNotifying; - osl::Mutex m_Mutex; + HANDLE& m_ResumeNotifying; + osl::Mutex m_Mutex; // prevent copy and assignment private: diff --git a/fpicker/source/win32/filepicker/asyncrequests.cxx b/fpicker/source/win32/filepicker/asyncrequests.cxx index 7dcf6dac9a0f..ed197cd9b402 100644 --- a/fpicker/source/win32/filepicker/asyncrequests.cxx +++ b/fpicker/source/win32/filepicker/asyncrequests.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -110,7 +110,7 @@ void AsyncRequests::triggerRequestProcessMessages (const RequestRef& rRequest) if ( ! isRunning()) create(); - + rRequest->waitProcessMessages(); } @@ -195,7 +195,7 @@ void SAL_CALL AsyncRequests::run() { // SYNCHRONIZED -> aLock.reset(); - + RequestRef rRequest; if ( ! m_lRequests.empty()) { @@ -203,7 +203,7 @@ void SAL_CALL AsyncRequests::run() m_lRequests.pop(); } bFinished = m_bFinish; - + aLock.clear(); // <- SYNCHRONIZED diff --git a/fpicker/source/win32/filepicker/asyncrequests.hxx b/fpicker/source/win32/filepicker/asyncrequests.hxx index ba9b07eae995..6075a247d032 100644 --- a/fpicker/source/win32/filepicker/asyncrequests.hxx +++ b/fpicker/source/win32/filepicker/asyncrequests.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -62,15 +62,15 @@ class Request { //------------------------------------------------------------------------- public: - + static const ::sal_Int32 WAIT_INFINITE = 0; - + //------------------------------------------------------------------------- // interface //------------------------------------------------------------------------- - + public: - + //--------------------------------------------------------------------- explicit Request() : m_aJoiner ( ) @@ -79,28 +79,28 @@ class Request { m_aJoiner.reset(); } - + //--------------------------------------------------------------------- virtual ~Request() {}; - + //--------------------------------------------------------------------- void setRequest(::sal_Int32 nRequest) { m_nRequest = nRequest; } - + //--------------------------------------------------------------------- ::sal_Int32 getRequest() { return m_nRequest; } - + //--------------------------------------------------------------------- void clearArguments() { m_lArguments.clear(); } - + //--------------------------------------------------------------------- template< class TArgumentType > void setArgument(const ::rtl::OUString& sName , @@ -108,7 +108,7 @@ class Request { m_lArguments[sName] <<= aValue; } - + //--------------------------------------------------------------------- template< class TArgumentType > TArgumentType getArgumentOrDefault(const ::rtl::OUString& sName , @@ -116,21 +116,21 @@ class Request { return m_lArguments.getUnpackedValueOrDefault(sName, aDefault); } - + //--------------------------------------------------------------------- void wait(::sal_Int32 nMilliSeconds = WAIT_INFINITE); - + void waitProcessMessages(); - + //--------------------------------------------------------------------- void notify(); //------------------------------------------------------------------------- // member //------------------------------------------------------------------------- - + private: - + ::osl::Condition m_aJoiner; ::sal_Int32 m_nRequest; ::comphelper::SequenceAsHashMap m_lArguments; @@ -157,7 +157,7 @@ class AsyncRequests : private ::cppu::BaseMutex , public ::osl::Thread { public: - static const ::sal_Int16 PROCESS_MESSAGES = 2; + static const ::sal_Int16 PROCESS_MESSAGES = 2; static const ::sal_Int16 BLOCKED = 1; static const ::sal_Int16 NON_BLOCKED = 0; @@ -165,55 +165,55 @@ class AsyncRequests : private ::cppu::BaseMutex /** creates the new asynchronous request executor. */ explicit AsyncRequests(const RequestHandlerRef& rHandler); - + void setHandler(const RequestHandlerRef& rHandler) { m_rHandler = rHandler; } - + //--------------------------------------------------------------------- /** does nothing special / excepting to make sure our class wont be inline .-) */ virtual ~AsyncRequests(); - + //--------------------------------------------------------------------- /** @todo document me */ void triggerRequestProcessMessages (const RequestRef& rRequest); - + //--------------------------------------------------------------------- /** @todo document me */ void triggerRequestBlocked(const RequestRef& rRequest); - + //--------------------------------------------------------------------- /** @todo document me */ void triggerRequestNonBlocked(const RequestRef& rRequest); - + //--------------------------------------------------------------------- /** @todo document me */ void triggerRequestDirectly(const RequestRef& rRequest); - + //--------------------------------------------------------------------- /** @todo document me */ void triggerRequestThreadAware(const RequestRef& rRequest, ::sal_Int16 nWait ); - + private: - + //--------------------------------------------------------------------- /** our STA .-) - * Will run between start() & finish(). Internaly it runs a loop ... + * Will run between start() & finish(). Internaly it runs a loop ... * waiting for requests. Every request will be executed synchronously * in blocked mode. */ virtual void SAL_CALL run(); - + private: - + ::sal_Bool m_bFinish; RequestHandlerRef m_rHandler; RequestQueue m_lRequests; diff --git a/fpicker/source/win32/filepicker/comptr.hxx b/fpicker/source/win32/filepicker/comptr.hxx index 2eb4796921c2..ee4b1b55385e 100644 --- a/fpicker/source/win32/filepicker/comptr.hxx +++ b/fpicker/source/win32/filepicker/comptr.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -39,7 +39,7 @@ template< class T_INTERFACE , class ComPtr { public: - + //--------------------------------------------------------------------- /** initialize com ptr with null. */ @@ -47,7 +47,7 @@ class ComPtr { m_pInterface = NULL; } - + //--------------------------------------------------------------------- /** initialize com ptr with given interface. */ @@ -57,7 +57,7 @@ class ComPtr if (m_pInterface) m_pInterface->AddRef(); } - + //--------------------------------------------------------------------- /** copy ctor. */ @@ -67,7 +67,7 @@ class ComPtr if (m_pInterface) m_pInterface->AddRef(); } - + //--------------------------------------------------------------------- /** initialize object by quering external object for the right interface. */ @@ -76,7 +76,7 @@ class ComPtr if (pIUnknown) pIUnknown->QueryInterface(P_IID, (void**)&m_pInterface); } - + //--------------------------------------------------------------------- /** deinitialize com object right. */ @@ -86,51 +86,51 @@ class ComPtr } public: - + //--------------------------------------------------------------------- HRESULT create() { return CoCreateInstance(P_CLSID, NULL, CLSCTX_ALL, P_IID, (void**)&m_pInterface); } - + //--------------------------------------------------------------------- operator T_INTERFACE*() const { return m_pInterface; } - + //--------------------------------------------------------------------- T_INTERFACE& operator*() const { return *m_pInterface; } - + //--------------------------------------------------------------------- T_INTERFACE** operator&() { return &m_pInterface; } - + //--------------------------------------------------------------------- T_INTERFACE* operator->() const { return m_pInterface; } - + //--------------------------------------------------------------------- T_INTERFACE* operator=(T_INTERFACE* pInterface) { if ( equals(pInterface) ) return m_pInterface; - + m_pInterface->Release(); m_pInterface = pInterface; if (m_pInterface) m_pInterface->AddRef(); - + return m_pInterface; } - + //--------------------------------------------------------------------- T_INTERFACE* operator=(IUnknown* pIUnknown) { @@ -138,23 +138,23 @@ class ComPtr pIUnknown->QueryInterface(P_IID, (void**)&m_pInterface); return m_pInterface; } - + //--------------------------------------------------------------------- T_INTERFACE* operator=(const ComPtr< T_INTERFACE, P_IID, P_CLSID >& aCopy) { m_pInterface = aCopy.m_pInterface; if (m_pInterface) m_pInterface->AddRef(); - + return m_pInterface; } - + //--------------------------------------------------------------------- T_INTERFACE* get() const { return m_pInterface; } - + //--------------------------------------------------------------------- void attach(T_INTERFACE* pInterface) { @@ -164,7 +164,7 @@ class ComPtr m_pInterface = pInterface; } } - + //--------------------------------------------------------------------- T_INTERFACE* detach() { @@ -172,7 +172,7 @@ class ComPtr m_pInterface = NULL; return pInterface; } - + //--------------------------------------------------------------------- void release() { @@ -182,7 +182,7 @@ class ComPtr m_pInterface = NULL; } } - + #ifndef __MINGW32__ //--------------------------------------------------------------------- template< class T_QUERYINTERFACE > @@ -191,7 +191,7 @@ class ComPtr return m_pInterface->QueryInterface(__uuidof(T_QUERYINTERFACE), (void**)pQuery); } #endif - + //--------------------------------------------------------------------- ::sal_Bool equals(IUnknown* pCheck) { @@ -200,16 +200,16 @@ class ComPtr ( ! pCheck ) ) return sal_True; - + IUnknown* pCurrent = NULL; m_pInterface->QueryInterface(IID_IUnknown, (void**)&pCurrent); - + ::sal_Bool bEquals = (pCheck == pCurrent); pCurrent->Release(); - + return bEquals; } - + //--------------------------------------------------------------------- ::sal_Bool is() { diff --git a/fpicker/source/win32/filepicker/controlaccess.cxx b/fpicker/source/win32/filepicker/controlaccess.cxx index 8831d017f82d..cde1ee52f6dc 100644 --- a/fpicker/source/win32/filepicker/controlaccess.cxx +++ b/fpicker/source/win32/filepicker/controlaccess.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -40,9 +40,9 @@ #include "..\misc\WinImplHelper.hxx" //------------------------------------------------------------ -// we are using a table based algorithm to dispatch control -// actions there is one table containing one action table for -// each control class and one action table per control class +// we are using a table based algorithm to dispatch control +// actions there is one table containing one action table for +// each control class and one action table per control class // which contains function pointer to control action functions //------------------------------------------------------------ @@ -106,16 +106,16 @@ namespace // private size_t TableSize; }; - // an array of function tables, one for each control class + // an array of function tables, one for each control class _ENTRY CtrlClassSetValueFunctionTable[] = { { NULL, 0 }, - { CheckboxSetValueFunctionTable, SIZE_CHECKBOX_SETVALUE_FUNCTION_TABLE }, + { CheckboxSetValueFunctionTable, SIZE_CHECKBOX_SETVALUE_FUNCTION_TABLE }, { ListboxSetValueFunctionTable, SIZE_LISTBOX_SETVALUE_FUNCTION_TABLE }, { NULL, 0 } }; - - // an array of function tables, one for each control class + + // an array of function tables, one for each control class _ENTRY CtrlClassGetValueFunctionTable[] = { { NULL, 0 }, @@ -123,41 +123,41 @@ namespace // private { ListboxGetValueFunctionTable, SIZE_LISTBOX_GETVALUE_ACTION_TABLE }, { NULL, 0 } }; - + //------------------------------------------------------------ // //------------------------------------------------------------ - CTRL_SETVALUE_FUNCTION_T SAL_CALL GetCtrlSetValueFunction( + CTRL_SETVALUE_FUNCTION_T SAL_CALL GetCtrlSetValueFunction( CTRL_SETVALUE_FUNCTION_T* aCtrlSetValueFunctionTable, size_t aTableSize, sal_Int16 aCtrlAction ) - { + { if ( !aCtrlSetValueFunctionTable || aCtrlAction < 0 || sal::static_int_cast< sal_uInt16 >(aCtrlAction) >= aTableSize ) return NULL; - return aCtrlSetValueFunctionTable[aCtrlAction]; + return aCtrlSetValueFunctionTable[aCtrlAction]; } //------------------------------------------------------------ // //------------------------------------------------------------ - CTRL_GETVALUE_FUNCTION_T SAL_CALL GetCtrlGetValueFunction( + CTRL_GETVALUE_FUNCTION_T SAL_CALL GetCtrlGetValueFunction( CTRL_GETVALUE_FUNCTION_T* aCtrlGetValueFunctionTable, size_t aTableSize, sal_Int16 aCtrlAction ) - { + { if ( !aCtrlGetValueFunctionTable || aCtrlAction < 0 || sal::static_int_cast< sal_uInt16 >(aCtrlAction) >= aTableSize ) return NULL; - return aCtrlGetValueFunctionTable[aCtrlAction]; + return aCtrlGetValueFunctionTable[aCtrlAction]; } //------------------------------------------------------------ // //------------------------------------------------------------ - + inline _ENTRY SAL_CALL GetCtrlClassSetValueFunctionTable( CTRL_CLASS aCtrlClass ) { @@ -167,7 +167,7 @@ namespace // private //------------------------------------------------------------ // //------------------------------------------------------------ - + inline _ENTRY SAL_CALL GetCtrlClassGetValueFunctionTable( CTRL_CLASS aCtrlClass ) { @@ -187,7 +187,7 @@ namespace // private }; const int SIZE_WINDOWS_FILEOPEN_CTRL_IDS = SAL_N_ELEMENTS(WindowsFileOpenCtrlIds); -}; // end namespace +}; // end namespace //------------------------------------------------------------ // @@ -198,9 +198,9 @@ CTRL_SETVALUE_FUNCTION_T SAL_CALL GetCtrlSetValueFunction( CTRL_CLASS aCtrlClass _ENTRY aEntry = GetCtrlClassSetValueFunctionTable( aCtrlClass ); - return GetCtrlSetValueFunction( - reinterpret_cast< CTRL_SETVALUE_FUNCTION_T* >( aEntry.lpFunctionTable ), - aEntry.TableSize, + return GetCtrlSetValueFunction( + reinterpret_cast< CTRL_SETVALUE_FUNCTION_T* >( aEntry.lpFunctionTable ), + aEntry.TableSize, aCtrlAction ); } @@ -213,9 +213,9 @@ CTRL_GETVALUE_FUNCTION_T SAL_CALL GetCtrlGetValueFunction( CTRL_CLASS aCtrlClass _ENTRY aEntry = GetCtrlClassGetValueFunctionTable( aCtrlClass ); - return GetCtrlGetValueFunction( - reinterpret_cast< CTRL_GETVALUE_FUNCTION_T* >( aEntry.lpFunctionTable ), - aEntry.TableSize, + return GetCtrlGetValueFunction( + reinterpret_cast< CTRL_GETVALUE_FUNCTION_T* >( aEntry.lpFunctionTable ), + aEntry.TableSize, aCtrlAction ); } diff --git a/fpicker/source/win32/filepicker/controlaccess.hxx b/fpicker/source/win32/filepicker/controlaccess.hxx index d62819286b52..5731297eb4ea 100644 --- a/fpicker/source/win32/filepicker/controlaccess.hxx +++ b/fpicker/source/win32/filepicker/controlaccess.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -53,7 +53,7 @@ typedef void ( SAL_CALL *CTRL_SETVALUE_FUNCTION_T)( HWND, const ::com::sun::star::uno::Any&, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >&, sal_Int16 ); typedef ::com::sun::star::uno::Any ( SAL_CALL *CTRL_GETVALUE_FUNCTION_T )( HWND ); -// the currently supported control classes +// the currently supported control classes enum CTRL_CLASS { UNKNOWN = 0, @@ -62,14 +62,14 @@ enum CTRL_CLASS PUSHBUTTON }; -// returns the class of a control +// returns the class of a control CTRL_CLASS SAL_CALL GetCtrlClass( HWND hwndCtrl ); -// returns a pointer to a setValue function based on the control class +// returns a pointer to a setValue function based on the control class // and the control action, if no function was found NULL will be returned CTRL_SETVALUE_FUNCTION_T SAL_CALL GetCtrlSetValueFunction( CTRL_CLASS aCtrlClass, sal_Int16 aCtrlAction ); -// returns a pointer to a getValue function based on the control class +// returns a pointer to a getValue function based on the control class // and the control action, if no function was found NULL will be returned CTRL_GETVALUE_FUNCTION_T SAL_CALL GetCtrlGetValueFunction( CTRL_CLASS aCtrlClass, sal_Int16 aCtrlAction ); diff --git a/fpicker/source/win32/filepicker/controlcommand.cxx b/fpicker/source/win32/filepicker/controlcommand.cxx index 464d7c72df3f..77385fe5fa49 100644 --- a/fpicker/source/win32/filepicker/controlcommand.cxx +++ b/fpicker/source/win32/filepicker/controlcommand.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -115,8 +115,8 @@ sal_Int16 SAL_CALL CControlCommand::getControlId( ) const // //--------------------------------------------- -CValueControlCommand::CValueControlCommand( - sal_Int16 aControlId, +CValueControlCommand::CValueControlCommand( + sal_Int16 aControlId, sal_Int16 aControlAction, const ::com::sun::star::uno::Any& aValue ) : CControlCommand( aControlId ), @@ -133,7 +133,7 @@ void SAL_CALL CValueControlCommand::exec( CFilePickerState* aFilePickerState ) { OSL_ENSURE( aFilePickerState, "empty reference" ); - aFilePickerState->setValue( + aFilePickerState->setValue( getControlId( ), m_aControlAction, m_aValue ); @@ -145,14 +145,14 @@ void SAL_CALL CValueControlCommand::exec( CFilePickerState* aFilePickerState ) CControlCommandResult* SAL_CALL CValueControlCommand::handleRequest( CControlCommandRequest* aRequest ) { - CValueControlCommandRequest* value_request = + CValueControlCommandRequest* value_request = dynamic_cast< CValueControlCommandRequest* >( aRequest ); CControlCommandResult* result; CControlCommand* nextCommand; - if ( value_request && - (value_request->getControlId( ) == getControlId( )) && + if ( value_request && + (value_request->getControlId( ) == getControlId( )) && (value_request->getControlAction( ) == m_aControlAction) ) { result = new CValueCommandResult( sal_True, m_aValue ); @@ -190,15 +190,15 @@ sal_Int16 SAL_CALL CValueControlCommand::getControlAction( ) const { return m_aValue; } - + //--------------------------------------------- // //--------------------------------------------- -CLabelControlCommand::CLabelControlCommand( - sal_Int16 aControlId, - const rtl::OUString& aLabel ) : +CLabelControlCommand::CLabelControlCommand( + sal_Int16 aControlId, + const rtl::OUString& aLabel ) : CControlCommand( aControlId ), m_aLabel( aLabel ) { @@ -226,10 +226,10 @@ CControlCommandResult* SAL_CALL CLabelControlCommand::handleRequest( CControlCom CControlCommandResult* result; CControlCommand* nextCommand; - CValueControlCommandRequest* value_request = + CValueControlCommandRequest* value_request = dynamic_cast< CValueControlCommandRequest* >( aRequest ); - if ( !value_request && + if ( !value_request && (aRequest->getControlId( ) == getControlId( )) ) { result = new CLabelCommandResult( sal_True, m_aLabel ); @@ -263,8 +263,8 @@ rtl::OUString SAL_CALL CLabelControlCommand::getLabel( ) const // //--------------------------------------------- -CEnableControlCommand::CEnableControlCommand( - sal_Int16 aControlId, +CEnableControlCommand::CEnableControlCommand( + sal_Int16 aControlId, sal_Bool bEnable ) : CControlCommand( aControlId ), m_bEnable( bEnable ) diff --git a/fpicker/source/win32/filepicker/controlcommand.hxx b/fpicker/source/win32/filepicker/controlcommand.hxx index f44050cf8842..362aa78f81fc 100644 --- a/fpicker/source/win32/filepicker/controlcommand.hxx +++ b/fpicker/source/win32/filepicker/controlcommand.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -57,7 +57,7 @@ public: virtual void SAL_CALL exec( CFilePickerState* aFilePickerState ) = 0; - // the client inherits the ownership of the returned + // the client inherits the ownership of the returned // CControlCommandResult and has to delete it or he may // use the auto_ptr template for automatic deletion virtual CControlCommandResult* SAL_CALL handleRequest( CControlCommandRequest* aRequest ); @@ -66,7 +66,7 @@ public: // pointer only temporary because it's not ref-counted // and the ownerhsip belongs to this instance CControlCommand* SAL_CALL getNextCommand( ) const; - + // transfers the ownership to this class void SAL_CALL setNextCommand( CControlCommand* nextCommand ); @@ -85,8 +85,8 @@ private: class CValueControlCommand : public CControlCommand { public: - CValueControlCommand( - sal_Int16 aControlId, + CValueControlCommand( + sal_Int16 aControlId, sal_Int16 aControlAction, const ::com::sun::star::uno::Any& aValue ); @@ -97,10 +97,10 @@ public: sal_Int16 SAL_CALL getControlAction( ) const; ::com::sun::star::uno::Any SAL_CALL getValue( ) const; - + private: sal_Int16 m_aControlAction; - ::com::sun::star::uno::Any m_aValue; + ::com::sun::star::uno::Any m_aValue; }; //--------------------------------------------- @@ -110,8 +110,8 @@ private: class CLabelControlCommand : public CControlCommand { public: - CLabelControlCommand( - sal_Int16 aControlId, + CLabelControlCommand( + sal_Int16 aControlId, const rtl::OUString& aLabel ); virtual void SAL_CALL exec( CFilePickerState* aFilePickerState ); @@ -131,8 +131,8 @@ private: class CEnableControlCommand : public CControlCommand { public: - CEnableControlCommand( - sal_Int16 controlId, + CEnableControlCommand( + sal_Int16 controlId, sal_Bool bEnable ); virtual void SAL_CALL exec( CFilePickerState* aFilePickerState ); diff --git a/fpicker/source/win32/filepicker/controlcommandrequest.hxx b/fpicker/source/win32/filepicker/controlcommandrequest.hxx index 53c28c69ebfd..6f7a94704cd9 100644 --- a/fpicker/source/win32/filepicker/controlcommandrequest.hxx +++ b/fpicker/source/win32/filepicker/controlcommandrequest.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -46,7 +46,7 @@ public: m_aControlId( aControlId ) { } - + virtual ~CControlCommandRequest( ) { } @@ -67,8 +67,8 @@ private: class CValueControlCommandRequest : public CControlCommandRequest { public: - CValueControlCommandRequest( - sal_Int16 aControlId, + CValueControlCommandRequest( + sal_Int16 aControlId, sal_Int16 aControlAction ) : CControlCommandRequest( aControlId ), m_aControlAction( aControlAction ) diff --git a/fpicker/source/win32/filepicker/controlcommandresult.hxx b/fpicker/source/win32/filepicker/controlcommandresult.hxx index 99fc66d5bfe1..ed601218ad26 100644 --- a/fpicker/source/win32/filepicker/controlcommandresult.hxx +++ b/fpicker/source/win32/filepicker/controlcommandresult.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/fpicker/source/win32/filepicker/customcontrol.cxx b/fpicker/source/win32/filepicker/customcontrol.cxx index c7d78fa8b294..7a5e20793c5b 100644 --- a/fpicker/source/win32/filepicker/customcontrol.cxx +++ b/fpicker/source/win32/filepicker/customcontrol.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -31,7 +31,7 @@ #include "customcontrol.hxx" //----------------------------------- -// +// //----------------------------------- CCustomControl::~CCustomControl() @@ -39,7 +39,7 @@ CCustomControl::~CCustomControl() } //----------------------------------- -// +// //----------------------------------- void SAL_CALL CCustomControl::AddControl(CCustomControl*) @@ -48,7 +48,7 @@ void SAL_CALL CCustomControl::AddControl(CCustomControl*) } //----------------------------------- -// +// //----------------------------------- void SAL_CALL CCustomControl::RemoveControl(CCustomControl*) @@ -57,7 +57,7 @@ void SAL_CALL CCustomControl::RemoveControl(CCustomControl*) } //----------------------------------- -// +// //----------------------------------- void SAL_CALL CCustomControl::RemoveAllControls() diff --git a/fpicker/source/win32/filepicker/customcontrol.hxx b/fpicker/source/win32/filepicker/customcontrol.hxx index ea74c7c4710d..6d961147e6fa 100644 --- a/fpicker/source/win32/filepicker/customcontrol.hxx +++ b/fpicker/source/win32/filepicker/customcontrol.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -40,7 +40,7 @@ #endif //----------------------------------- -// +// //----------------------------------- class CCustomControl @@ -50,9 +50,9 @@ public: // align the control to a reference object/control virtual void SAL_CALL Align() = 0; - + virtual void SAL_CALL SetFont(HFONT hFont) = 0; - + virtual void SAL_CALL AddControl(CCustomControl* aCustomControl); virtual void SAL_CALL RemoveControl(CCustomControl* aCustomControl); virtual void SAL_CALL RemoveAllControls(); diff --git a/fpicker/source/win32/filepicker/customcontrolcontainer.cxx b/fpicker/source/win32/filepicker/customcontrolcontainer.cxx index 24ea12111990..00bcbddb1479 100644 --- a/fpicker/source/win32/filepicker/customcontrolcontainer.cxx +++ b/fpicker/source/win32/filepicker/customcontrolcontainer.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -48,20 +48,20 @@ namespace /* private */ { aCustomControl->Align(); }; - + class CSetFontHelper { public: - CSetFontHelper(HFONT hFont) : + CSetFontHelper(HFONT hFont) : m_hFont(hFont) { } - + void SAL_CALL operator()(CCustomControl* aCustomControl) { aCustomControl->SetFont(m_hFont); } - + private: HFONT m_hFont; }; @@ -95,7 +95,7 @@ void SAL_CALL CCustomControlContainer::Align() void SAL_CALL CCustomControlContainer::SetFont(HFONT hFont) { CSetFontHelper aSetFontHelper(hFont); - + std::for_each( m_ControlContainer.begin(), m_ControlContainer.end(), @@ -105,7 +105,7 @@ void SAL_CALL CCustomControlContainer::SetFont(HFONT hFont) //----------------------------------- // //----------------------------------- - + void SAL_CALL CCustomControlContainer::AddControl(CCustomControl* aCustomControl) { m_ControlContainer.push_back(aCustomControl); @@ -116,12 +116,12 @@ void SAL_CALL CCustomControlContainer::AddControl(CCustomControl* aCustomControl //----------------------------------- void SAL_CALL CCustomControlContainer::RemoveControl(CCustomControl* aCustomControl) -{ +{ ControlContainer_t::iterator iter_end = m_ControlContainer.end(); - ControlContainer_t::iterator iter = + ControlContainer_t::iterator iter = std::find(m_ControlContainer.begin(),iter_end,aCustomControl); - + if (iter != iter_end) { delete *iter; diff --git a/fpicker/source/win32/filepicker/customcontrolcontainer.hxx b/fpicker/source/win32/filepicker/customcontrolcontainer.hxx index dc63c8cb355f..6dcc9d486de9 100644 --- a/fpicker/source/win32/filepicker/customcontrolcontainer.hxx +++ b/fpicker/source/win32/filepicker/customcontrolcontainer.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -37,7 +37,7 @@ // A container for custom controls // the container is resposible for // the destruction of the custom -// controls +// controls //----------------------------------- class CCustomControlContainer : public CCustomControl @@ -47,7 +47,7 @@ public: virtual void SAL_CALL Align(); virtual void SAL_CALL SetFont(HFONT hFont); - + virtual void SAL_CALL AddControl(CCustomControl* aCustomControl); virtual void SAL_CALL RemoveControl(CCustomControl* aCustomControl); virtual void SAL_CALL RemoveAllControls(); @@ -55,7 +55,7 @@ public: private: typedef std::list<CCustomControl*> ControlContainer_t; - ControlContainer_t m_ControlContainer; + ControlContainer_t m_ControlContainer; }; #endif diff --git a/fpicker/source/win32/filepicker/customcontrolfactory.cxx b/fpicker/source/win32/filepicker/customcontrolfactory.cxx index d21afa49a7c9..5332fe4087ad 100644 --- a/fpicker/source/win32/filepicker/customcontrolfactory.cxx +++ b/fpicker/source/win32/filepicker/customcontrolfactory.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -36,7 +36,7 @@ #include <osl/diagnose.h> //----------------------------------- -// +// //----------------------------------- CCustomControl* CCustomControlFactory::CreateCustomControl(HWND aControlHandle, HWND aParentHandle) @@ -44,8 +44,8 @@ CCustomControl* CCustomControlFactory::CreateCustomControl(HWND aControlHandle, OSL_PRECOND(IsWindow(aControlHandle),"Invalid control handle"); OSL_PRECOND(IsWindow(aControlHandle),"Invalid parent handle"); - // get window class - // if static text create static text control etc. + // get window class + // if static text create static text control etc. TCHAR aClsName[256]; ZeroMemory(aClsName,sizeof(aClsName)); @@ -67,18 +67,18 @@ CCustomControl* CCustomControlFactory::CreateCustomControl(HWND aControlHandle, return new CDummyCustomControl(aControlHandle,aParentHandle); } - + if (0 == _tcsicmp(aClsName,TEXT("listbox")) || 0 == _tcsicmp(aClsName,TEXT("combobox"))) return new CComboboxCustomControl(aControlHandle,aParentHandle); if (0 == _tcsicmp(aClsName,TEXT("static"))) return new CStaticCustomControl(aControlHandle,aParentHandle); - + return new CDummyCustomControl(aControlHandle,aParentHandle); } //----------------------------------- -// +// //----------------------------------- CCustomControl* CCustomControlFactory::CreateCustomControlContainer() diff --git a/fpicker/source/win32/filepicker/customcontrolfactory.hxx b/fpicker/source/win32/filepicker/customcontrolfactory.hxx index 8222531f72e7..de5961e6fc27 100644 --- a/fpicker/source/win32/filepicker/customcontrolfactory.hxx +++ b/fpicker/source/win32/filepicker/customcontrolfactory.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -44,7 +44,7 @@ class CCustomControl; //----------------------------------- -// +// //----------------------------------- class CCustomControlFactory diff --git a/fpicker/source/win32/filepicker/dialogcustomcontrols.cxx b/fpicker/source/win32/filepicker/dialogcustomcontrols.cxx index 0be7a7e72b93..afe673c77adb 100644 --- a/fpicker/source/win32/filepicker/dialogcustomcontrols.cxx +++ b/fpicker/source/win32/filepicker/dialogcustomcontrols.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -35,7 +35,7 @@ #include <osl/diagnose.h> //----------------------------------- -// +// //----------------------------------- CDialogCustomControlBase::CDialogCustomControlBase(HWND aControlHandle, HWND aParentHandle) : @@ -45,7 +45,7 @@ CDialogCustomControlBase::CDialogCustomControlBase(HWND aControlHandle, HWND aPa } //----------------------------------- -// +// //----------------------------------- void SAL_CALL CDialogCustomControlBase::SetFont(HFONT hFont) @@ -58,7 +58,7 @@ void SAL_CALL CDialogCustomControlBase::SetFont(HFONT hFont) } //----------------------------------- -// +// //----------------------------------- void SAL_CALL CDialogCustomControlBase::AlignToBuddy(HWND aBuddyHandle) @@ -70,7 +70,7 @@ void SAL_CALL CDialogCustomControlBase::AlignToBuddy(HWND aBuddyHandle) POINT pt = {rcBuddy.left,rcBuddy.top}; ScreenToClient(m_ParentHandle,&pt); - + int cx_new = rcBuddy.right - rcBuddy.left; int cy_new = rcBuddy.bottom - rcBuddy.top; @@ -79,30 +79,30 @@ void SAL_CALL CDialogCustomControlBase::AlignToBuddy(HWND aBuddyHandle) // this job RECT rcMe; GetWindowRect(m_CustomControlHandle,&rcMe); - + POINT ptMe = {rcMe.left,rcMe.top}; ScreenToClient(m_ParentHandle,&ptMe); SetWindowPos( m_CustomControlHandle, - HWND_TOP, - pt.x, - ptMe.y, - cx_new, - cy_new, + HWND_TOP, + pt.x, + ptMe.y, + cx_new, + cy_new, SWP_NOACTIVATE); } //----------------------------------- -// +// //----------------------------------- -CDummyCustomControl::CDummyCustomControl(HWND, HWND) +CDummyCustomControl::CDummyCustomControl(HWND, HWND) { } //----------------------------------- -// +// //----------------------------------- void SAL_CALL CDummyCustomControl::Align() @@ -111,7 +111,7 @@ void SAL_CALL CDummyCustomControl::Align() } //----------------------------------- -// +// //----------------------------------- void SAL_CALL CDummyCustomControl::SetFont(HFONT) @@ -120,7 +120,7 @@ void SAL_CALL CDummyCustomControl::SetFont(HFONT) } //----------------------------------- -// +// //----------------------------------- CStaticCustomControl::CStaticCustomControl(HWND aControlHandle, HWND aParentHandle) : @@ -129,17 +129,17 @@ CStaticCustomControl::CStaticCustomControl(HWND aControlHandle, HWND aParentHand } //----------------------------------- -// Align to the "File name" static +// Align to the "File name" static // text of the standard FileOpen dlg //----------------------------------- void SAL_CALL CStaticCustomControl::Align() { - AlignToBuddy(GetDlgItem(m_ParentHandle,stc3)); + AlignToBuddy(GetDlgItem(m_ParentHandle,stc3)); } //----------------------------------- -// +// //----------------------------------- CPushButtonCustomControl::CPushButtonCustomControl(HWND aControlHandle, HWND aParentHandle) : @@ -148,7 +148,7 @@ CPushButtonCustomControl::CPushButtonCustomControl(HWND aControlHandle, HWND aPa } //----------------------------------- -// Align to the "OK" button of the +// Align to the "OK" button of the // standard FileOpen dlg //----------------------------------- @@ -158,7 +158,7 @@ void SAL_CALL CPushButtonCustomControl::Align() } //----------------------------------- -// +// //----------------------------------- CComboboxCustomControl::CComboboxCustomControl(HWND aControlHandle, HWND aParentHandle) : @@ -177,7 +177,7 @@ void SAL_CALL CComboboxCustomControl::Align() } //----------------------------------- -// +// //----------------------------------- CCheckboxCustomControl::CCheckboxCustomControl(HWND aControlHandle, HWND aParentHandle) : @@ -186,7 +186,7 @@ CCheckboxCustomControl::CCheckboxCustomControl(HWND aControlHandle, HWND aParent } //----------------------------------- -// Align to the "File name" combobox +// Align to the "File name" combobox // of the standard FileOpen dlg //----------------------------------- diff --git a/fpicker/source/win32/filepicker/dialogcustomcontrols.hxx b/fpicker/source/win32/filepicker/dialogcustomcontrols.hxx index b7f64dc13ef2..d3b62867c96c 100644 --- a/fpicker/source/win32/filepicker/dialogcustomcontrols.hxx +++ b/fpicker/source/win32/filepicker/dialogcustomcontrols.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -40,7 +40,7 @@ #endif //----------------------------------- -// +// //----------------------------------- class CDummyCustomControl : public CCustomControl @@ -53,7 +53,7 @@ public: }; //----------------------------------- -// +// //----------------------------------- class CDialogCustomControlBase : public CCustomControl @@ -62,11 +62,11 @@ protected: CDialogCustomControlBase(HWND aControlHandle, HWND aParentHandle); virtual void SAL_CALL SetFont(HFONT hFont); - + // aligns the specific control class to a reference // buddy - // - void SAL_CALL AlignToBuddy(HWND aBuddyHandle); + // + void SAL_CALL AlignToBuddy(HWND aBuddyHandle); protected: HWND m_CustomControlHandle; @@ -74,7 +74,7 @@ protected: }; //----------------------------------- -// +// //----------------------------------- class CStaticCustomControl : public CDialogCustomControlBase @@ -82,11 +82,11 @@ class CStaticCustomControl : public CDialogCustomControlBase public: CStaticCustomControl(HWND aControlHandle, HWND aParentHandle); - virtual void SAL_CALL Align(); + virtual void SAL_CALL Align(); }; //----------------------------------- -// +// //----------------------------------- class CPushButtonCustomControl : public CDialogCustomControlBase @@ -94,11 +94,11 @@ class CPushButtonCustomControl : public CDialogCustomControlBase public: CPushButtonCustomControl(HWND aControlHandle, HWND aParentHandle); - virtual void SAL_CALL Align(); + virtual void SAL_CALL Align(); }; //----------------------------------- -// +// //----------------------------------- class CComboboxCustomControl : public CDialogCustomControlBase @@ -106,11 +106,11 @@ class CComboboxCustomControl : public CDialogCustomControlBase public: CComboboxCustomControl(HWND aControlHandle, HWND aParentHandle); - virtual void SAL_CALL Align(); + virtual void SAL_CALL Align(); }; //----------------------------------- -// +// //----------------------------------- class CCheckboxCustomControl : public CDialogCustomControlBase @@ -118,7 +118,7 @@ class CCheckboxCustomControl : public CDialogCustomControlBase public: CCheckboxCustomControl(HWND aControlHandle, HWND aParentHandle); - virtual void SAL_CALL Align(); + virtual void SAL_CALL Align(); }; #endif diff --git a/fpicker/source/win32/filepicker/dibpreview.cxx b/fpicker/source/win32/filepicker/dibpreview.cxx index 2ba23b0fa38f..ede628d2b673 100644 --- a/fpicker/source/win32/filepicker/dibpreview.cxx +++ b/fpicker/source/win32/filepicker/dibpreview.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -277,7 +277,7 @@ void SAL_CALL CDIBPreview::onPaint(HWND hWnd, HDC hDC) hDC, nX, nY, cxDib, cyDib, 0, 0, cxDib, cyDib, pBits, pbmi, DIB_RGB_COLORS, SRCCOPY); - + OSL_ASSERT(GDI_ERROR != GDIError); // paint the border @@ -286,15 +286,15 @@ void SAL_CALL CDIBPreview::onPaint(HWND hWnd, HDC hDC) if (nY > 0) { // top - rc.left = 0; - rc.top = 0; + rc.left = 0; + rc.top = 0; rc.right = nWidth; rc.bottom = nY; FillRect(hDC,&rc,(HBRUSH)(COLOR_INACTIVEBORDER + 1)); // bottom - rc.left = 0; - rc.top = nHeight - nY - 1; + rc.left = 0; + rc.top = nHeight - nY - 1; rc.right = nWidth; rc.bottom = nHeight; FillRect(hDC,&rc,(HBRUSH)(COLOR_INACTIVEBORDER + 1)); @@ -303,15 +303,15 @@ void SAL_CALL CDIBPreview::onPaint(HWND hWnd, HDC hDC) if (nX > 0) { // left - rc.left = 0; - rc.top = nY; + rc.left = 0; + rc.top = nY; rc.right = nX; rc.bottom = nHeight - nY; FillRect(hDC,&rc,(HBRUSH)(COLOR_INACTIVEBORDER + 1)); // right - rc.left = nWidth - nX - 1; - rc.top = nY; + rc.left = nWidth - nX - 1; + rc.top = nY; rc.right = nWidth; rc.bottom = nHeight - nY; FillRect(hDC,&rc,(HBRUSH)(COLOR_INACTIVEBORDER + 1)); @@ -413,7 +413,7 @@ ATOM SAL_CALL CDIBPreview::RegisterDibPreviewWindowClass() ZeroMemory(&wndClsEx, sizeof(wndClsEx)); wndClsEx.cbSize = sizeof(wndClsEx); - wndClsEx.style = CS_HREDRAW | CS_VREDRAW; + wndClsEx.style = CS_HREDRAW | CS_VREDRAW; wndClsEx.lpfnWndProc = CDIBPreview::WndProc; wndClsEx.hInstance = m_Instance; wndClsEx.hbrBackground = (HBRUSH)(COLOR_INACTIVEBORDER + 1); @@ -421,9 +421,9 @@ ATOM SAL_CALL CDIBPreview::RegisterDibPreviewWindowClass() // register the preview window class // !!! Win95 - the window class will be unregistered automaticly - // if the dll is unloaded + // if the dll is unloaded // Win2000 - the window class must be unregistered manually - // if the dll is unloaded + // if the dll is unloaded s_ClassAtom = RegisterClassEx(&wndClsEx); OSL_POSTCOND(s_ClassAtom,"Could not register preview window class"); diff --git a/fpicker/source/win32/filepicker/dibpreview.hxx b/fpicker/source/win32/filepicker/dibpreview.hxx index 2269fce065c7..0cf568b66eb6 100644 --- a/fpicker/source/win32/filepicker/dibpreview.hxx +++ b/fpicker/source/win32/filepicker/dibpreview.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -57,7 +57,7 @@ class CDIBPreview : public PreviewBase { public: - + // ctor CDIBPreview(HINSTANCE instance,HWND parent,sal_Bool bShowWindow = sal_False); @@ -66,23 +66,23 @@ public: // preview interface implementation - virtual sal_Int32 SAL_CALL getTargetColorDepth() + virtual sal_Int32 SAL_CALL getTargetColorDepth() throw (::com::sun::star::uno::RuntimeException); - virtual sal_Int32 SAL_CALL getAvailableWidth() + virtual sal_Int32 SAL_CALL getAvailableWidth() throw (::com::sun::star::uno::RuntimeException); - virtual sal_Int32 SAL_CALL getAvailableHeight() + virtual sal_Int32 SAL_CALL getAvailableHeight() throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setImage(sal_Int16 aImageFormat, const ::com::sun::star::uno::Any& aImage) + virtual void SAL_CALL setImage(sal_Int16 aImageFormat, const ::com::sun::star::uno::Any& aImage) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); virtual sal_Bool SAL_CALL setShowState(sal_Bool bShowState) throw (::com::sun::star::uno::RuntimeException); virtual sal_Bool SAL_CALL getShowState() - throw (::com::sun::star::uno::RuntimeException); + throw (::com::sun::star::uno::RuntimeException); virtual HWND SAL_CALL getWindowHandle() const; @@ -93,12 +93,12 @@ private: void SAL_CALL UnregisterDibPreviewWindowClass( ); static LRESULT CALLBACK WndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ); - -private: + +private: HINSTANCE m_Instance; - HWND m_Hwnd; + HWND m_Hwnd; com::sun::star::uno::Sequence<sal_Int8> m_Image; - osl::Mutex m_PaintLock; + osl::Mutex m_PaintLock; // the preview window class has to be registered only // once per process, so multiple instance of this class @@ -106,7 +106,7 @@ private: static ATOM s_ClassAtom; static osl::Mutex s_Mutex; static sal_Int32 s_RegisterDibPreviewWndCount; - + // prevent copy and assignment private: CDIBPreview(const CDIBPreview&); diff --git a/fpicker/source/win32/filepicker/eventnotification.hxx b/fpicker/source/win32/filepicker/eventnotification.hxx index 3866ca59946f..f0cefd679465 100644 --- a/fpicker/source/win32/filepicker/eventnotification.hxx +++ b/fpicker/source/win32/filepicker/eventnotification.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -37,7 +37,7 @@ // notification, because there are // two types of filepicker notifications // with and without parameter -// this is an application of the +// this is an application of the // "command" pattern see GoF //----------------------------------- diff --git a/fpicker/source/win32/filepicker/filepickereventnotification.cxx b/fpicker/source/win32/filepicker/filepickereventnotification.cxx index 13001fdcd81a..e79bc9b2f958 100644 --- a/fpicker/source/win32/filepicker/filepickereventnotification.cxx +++ b/fpicker/source/win32/filepicker/filepickereventnotification.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -39,11 +39,11 @@ using namespace com::sun::star::uno; using namespace com::sun::star::ui::dialogs; //----------------------------------- -// A FilePicker event without +// A FilePicker event without // parameter //----------------------------------- -CFilePickerEventNotification::CFilePickerEventNotification(EventListenerMethod_t EventListenerMethod) : +CFilePickerEventNotification::CFilePickerEventNotification(EventListenerMethod_t EventListenerMethod) : m_EventListenerMethod(EventListenerMethod) { } diff --git a/fpicker/source/win32/filepicker/filepickereventnotification.hxx b/fpicker/source/win32/filepicker/filepickereventnotification.hxx index 4a64c0ffcf80..d2230455c00d 100644 --- a/fpicker/source/win32/filepicker/filepickereventnotification.hxx +++ b/fpicker/source/win32/filepicker/filepickereventnotification.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -34,7 +34,7 @@ #include <com/sun/star/ui/dialogs/FilePickerEvent.hpp> //----------------------------------- -// A FilePicker event without +// A FilePicker event without // parameter //----------------------------------- @@ -66,7 +66,7 @@ public: virtual void SAL_CALL notifyEventListener( com::sun::star::uno::Reference< com::sun::star::uno::XInterface > xListener ); private: - EventListenerMethod_t m_EventListenerMethod; + EventListenerMethod_t m_EventListenerMethod; com::sun::star::ui::dialogs::FilePickerEvent m_FilePickerEvent; }; diff --git a/fpicker/source/win32/filepicker/filepickerstate.cxx b/fpicker/source/win32/filepicker/filepickerstate.cxx index dedc63b3458a..1ec72dcec0ef 100644 --- a/fpicker/source/win32/filepicker/filepickerstate.cxx +++ b/fpicker/source/win32/filepicker/filepickerstate.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -101,7 +101,7 @@ CNonExecuteFilePickerState::~CNonExecuteFilePickerState( ) void SAL_CALL CNonExecuteFilePickerState::setValue( sal_Int16 aControlId, sal_Int16 aControlAction, const Any& aValue ) { - CValueControlCommand* value_command = new CValueControlCommand( + CValueControlCommand* value_command = new CValueControlCommand( aControlId, aControlAction, aValue ); addControlCommand( value_command ); @@ -113,8 +113,8 @@ void SAL_CALL CNonExecuteFilePickerState::setValue( sal_Int16 aControlId, sal_In Any SAL_CALL CNonExecuteFilePickerState::getValue( sal_Int16 aControlId, sal_Int16 aControlAction ) { - CValueControlCommandRequest value_request( aControlId, aControlAction ); - Any aAny; + CValueControlCommandRequest value_request( aControlId, aControlAction ); + Any aAny; if (m_FirstControlCommand) { @@ -127,9 +127,9 @@ Any SAL_CALL CNonExecuteFilePickerState::getValue( sal_Int16 aControlId, sal_Int { // #101753 must remove assertion else running into deadlock // because getValue may be called asynchronously from main thread - // with locked SOLAR_MUTEX but we also need SOLAR_MUTEX in + // with locked SOLAR_MUTEX but we also need SOLAR_MUTEX in // WinFileOpenDialog::onInitDone ... but we cannot dismiss the - // assertion dialog because at this point the FileOpen Dialog + // assertion dialog because at this point the FileOpen Dialog // has aleady the focus but is not yet visible :-( // The real cure is to remove the VCL/SOLAR_MUTEX dependency // cause by the use of our resource manager and not being able to @@ -153,10 +153,10 @@ Any SAL_CALL CNonExecuteFilePickerState::getValue( sal_Int16 aControlId, sal_Int //--------------------------------------------- // //--------------------------------------------- - + void SAL_CALL CNonExecuteFilePickerState::enableControl( sal_Int16 aControlId, sal_Bool bEnable ) { - CEnableControlCommand* enable_command = new CEnableControlCommand( + CEnableControlCommand* enable_command = new CEnableControlCommand( aControlId, bEnable ); addControlCommand( enable_command ); @@ -200,7 +200,7 @@ OUString SAL_CALL CNonExecuteFilePickerState::getLabel( sal_Int16 aControlId ) return aLabel; } -/* #i26224# +/* #i26224# When typing file names with drive letter but without '\' in the "File name" box of the FileOpen dialog the FileOpen dialog makes strange paths out of them e.g. "d:.\test.sxw". @@ -209,22 +209,22 @@ OUString SAL_CALL CNonExecuteFilePickerState::getLabel( sal_Int16 aControlId ) OUString MatchFixBrokenPath(const OUString& path) { OSL_ASSERT(path.getLength() >= 4); - + if (path[1] == ':' && path[2] == '.' && path[3] == '\\') { // skip the '.' - return OUString(path, 2) + path.copy(3, path.getLength() - 3); - } - return path; + return OUString(path, 2) + path.copy(3, path.getLength() - 3); + } + return path; } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- static ::rtl::OUString trimTrailingSpaces(const ::rtl::OUString& rString) { rtl::OUString aResult(rString); - + sal_Int32 nIndex = rString.lastIndexOf(' '); if (nIndex == rString.getLength()-1) { @@ -237,7 +237,7 @@ static ::rtl::OUString trimTrailingSpaces(const ::rtl::OUString& rString) } return aResult; } - + Sequence< OUString > SAL_CALL CNonExecuteFilePickerState::getFiles( CFileOpenDialog* aFileOpenDialog ) { OSL_PRECOND( aFileOpenDialog, "invalid parameter" ); @@ -253,33 +253,33 @@ Sequence< OUString > SAL_CALL CNonExecuteFilePickerState::getFiles( CFileOpenDia { // tokenize the returned string and copy the // sub-strings separately into a sequence - const sal_Unicode* pTemp = aFilePath.getStr(); + const sal_Unicode* pTemp = aFilePath.getStr(); const sal_Unicode* pStrEnd = pTemp + aFilePath.getLength(); - sal_uInt32 lSubStr; + sal_uInt32 lSubStr; while (pTemp < pStrEnd) { - // detect the length of the next sub string + // detect the length of the next sub string lSubStr = rtl_ustr_getLength(pTemp); - + aFilePathList.realloc(aFilePathList.getLength() + 1); - - aFilePathList[aFilePathList.getLength() - 1] = + + aFilePathList[aFilePathList.getLength() - 1] = MatchFixBrokenPath(OUString(pTemp, lSubStr)); pTemp += (lSubStr + 1); } - // change all entries to file URLs + // change all entries to file URLs sal_Int32 lenFileList = aFilePathList.getLength( ); OSL_ASSERT( lenFileList >= 1 ); for ( sal_Int32 i = 0; i < lenFileList; i++ ) - { + { aFilePath = trimTrailingSpaces(aFilePathList[i]); - rc = ::osl::FileBase::getFileURLFromSystemPath( + rc = ::osl::FileBase::getFileURLFromSystemPath( aFilePath, aFilePathURL ); - + // we do return all or nothing, that means // in case of failures we destroy the sequence // and return an empty sequence @@ -308,10 +308,10 @@ OUString SAL_CALL CNonExecuteFilePickerState::getDisplayDirectory( CFileOpenDial OUString displayDir; displayDir = aFileOpenDialog->getLastDisplayDirectory( ); - + if ( displayDir.getLength( ) ) ::osl::FileBase::getFileURLFromSystemPath( displayDir, pathURL ); - + return pathURL; } @@ -323,7 +323,7 @@ void SAL_CALL CNonExecuteFilePickerState::reset( ) { CControlCommand* nextCommand; CControlCommand* currentCommand = m_FirstControlCommand; - + while( currentCommand ) { nextCommand = currentCommand->getNextCommand( ); @@ -376,7 +376,7 @@ void SAL_CALL CNonExecuteFilePickerState::addControlCommand( CControlCommand* aC CExecuteFilePickerState::CExecuteFilePickerState( HWND hwndDlg ) : m_hwndDlg( hwndDlg ) -{ +{ } //--------------------------------------------- @@ -388,13 +388,13 @@ void SAL_CALL CExecuteFilePickerState::setValue( sal_Int16 aControlId, sal_Int16 // we do not support SET_HELP_URL/GET_HELP_URL if ( com::sun::star::ui::dialogs::ControlActions::SET_HELP_URL == aControlAction ) return; - + HWND hwndCtrl = GetHwndDlgItem( aControlId ); - // the filter listbox can be manipulated via this + // the filter listbox can be manipulated via this // method the caller should use XFilterManager if ( !hwndCtrl || (aControlId == LISTBOX_FILTER) ) - { + { OSL_ENSURE( sal_False, "invalid control id" ); return; } @@ -411,11 +411,11 @@ void SAL_CALL CExecuteFilePickerState::setValue( sal_Int16 aControlId, sal_Int16 if ( !lpfnSetValue ) { - OSL_ENSURE( sal_False, "unsupported control action" ); + OSL_ENSURE( sal_False, "unsupported control action" ); return; } - // the function that we call should throw an IllegalArgumentException if + // the function that we call should throw an IllegalArgumentException if // the given value is invalid or empty, that's why we provide a Reference // to an XInterface and a argument position lpfnSetValue( hwndCtrl, aValue, Reference< XInterface >( ), 3 ); @@ -433,7 +433,7 @@ Any SAL_CALL CExecuteFilePickerState::getValue( sal_Int16 aControlId, sal_Int16 HWND hwndCtrl = GetHwndDlgItem( aControlId ); - // the filter listbox can be manipulated via this + // the filter listbox can be manipulated via this // method the caller should use XFilterManager if ( !hwndCtrl || (aControlId == LISTBOX_FILTER) ) { @@ -463,13 +463,13 @@ Any SAL_CALL CExecuteFilePickerState::getValue( sal_Int16 aControlId, sal_Int16 //--------------------------------------------- // //--------------------------------------------- - + void SAL_CALL CExecuteFilePickerState::enableControl( sal_Int16 aControlId, sal_Bool bEnable ) { HWND hwndCtrl = GetHwndDlgItem( aControlId ); OSL_ENSURE( IsWindow( hwndCtrl ), "invalid element id"); - + EnableWindow( hwndCtrl, bEnable ); } @@ -480,9 +480,9 @@ void SAL_CALL CExecuteFilePickerState::enableControl( sal_Int16 aControlId, sal_ void SAL_CALL CExecuteFilePickerState::setLabel( sal_Int16 aControlId, const OUString& aLabel ) { HWND hwndCtrl = GetHwndDlgItem( aControlId ); - + OSL_ENSURE( IsWindow( hwndCtrl ), "invalid element id"); - + if ( IsListboxControl( hwndCtrl ) ) hwndCtrl = GetListboxLabelItem( aControlId ); @@ -500,15 +500,15 @@ void SAL_CALL CExecuteFilePickerState::setLabel( sal_Int16 aControlId, const OUS OUString SAL_CALL CExecuteFilePickerState::getLabel( sal_Int16 aControlId ) { HWND hwndCtrl = GetHwndDlgItem( aControlId ); - + OSL_ENSURE( IsWindow( hwndCtrl ), "invalid element id"); - + if ( IsListboxControl( hwndCtrl ) ) hwndCtrl = GetListboxLabelItem( aControlId ); sal_Unicode aLabel[MAX_LABEL]; int nRet = GetWindowText( hwndCtrl, reinterpret_cast<LPTSTR>(aLabel), MAX_LABEL ); - + OUString ctrlLabel; if ( nRet ) { @@ -534,24 +534,24 @@ Sequence< OUString > SAL_CALL CExecuteFilePickerState::getFiles( CFileOpenDialog // in execution mode getFullFileName doesn't // return anything, so we must use another way - - // returns the currently selected file(s) + + // returns the currently selected file(s) // including path information - aFilePath = aFileOpenDialog->getCurrentFilePath( ); + aFilePath = aFileOpenDialog->getCurrentFilePath( ); // if multiple files are selected or the user // typed anything that doesn't seem to be a valid // file name getFileURLFromSystemPath fails // and we return an empty file list - rc = ::osl::FileBase::getFileURLFromSystemPath( + rc = ::osl::FileBase::getFileURLFromSystemPath( aFilePath, aFilePathURL ); if ( ::osl::FileBase::E_None == rc ) { aFilePathList.realloc( 1 ); aFilePathList[0] = aFilePathURL; - } - + } + return aFilePathList; } @@ -570,7 +570,7 @@ OUString SAL_CALL CExecuteFilePickerState::getDisplayDirectory( CFileOpenDialog* if ( displayDir.getLength( ) ) ::osl::FileBase::getFileURLFromSystemPath( displayDir, pathURL ); - + return pathURL; } @@ -597,24 +597,24 @@ void SAL_CALL CExecuteFilePickerState::cacheControlState( HWND hwndControl, CFil { OSL_ENSURE( hwndControl && aNonExecFilePickerState, "invalid parameters" ); - CTRL_CLASS aCtrlClass = GetCtrlClass( hwndControl ); - + CTRL_CLASS aCtrlClass = GetCtrlClass( hwndControl ); + sal_Int16 aControlAction; CTRL_GETVALUE_FUNCTION_T lpfnGetValue; if ( CHECKBOX == aCtrlClass ) - { + { aControlAction = 0; - + lpfnGetValue = GetCtrlGetValueFunction( aCtrlClass, aControlAction ); OSL_ASSERT( lpfnGetValue ); - aNonExecFilePickerState->setValue( + aNonExecFilePickerState->setValue( sal::static_int_cast< sal_Int16 >( GetDlgCtrlID( hwndControl ) ), aControlAction, - lpfnGetValue( hwndControl ) ); - + lpfnGetValue( hwndControl ) ); + aNonExecFilePickerState->setLabel( sal::static_int_cast< sal_Int16 >( GetDlgCtrlID( hwndControl ) ), getLabel( @@ -624,27 +624,27 @@ void SAL_CALL CExecuteFilePickerState::cacheControlState( HWND hwndControl, CFil else if ( LISTBOX == aCtrlClass ) { // for listboxes we save only the - // last selected item and the last + // last selected item and the last // selected item index aControlAction = GET_SELECTED_ITEM; - + lpfnGetValue = GetCtrlGetValueFunction( aCtrlClass, aControlAction ); - aNonExecFilePickerState->setValue( + aNonExecFilePickerState->setValue( sal::static_int_cast< sal_Int16 >( GetDlgCtrlID( hwndControl ) ), aControlAction, lpfnGetValue( hwndControl ) ); aControlAction = ::com::sun::star::ui::dialogs::ControlActions::GET_SELECTED_ITEM_INDEX; - + lpfnGetValue = GetCtrlGetValueFunction( aCtrlClass, aControlAction ); - aNonExecFilePickerState->setValue( + aNonExecFilePickerState->setValue( sal::static_int_cast< sal_Int16 >( GetDlgCtrlID( hwndControl ) ), aControlAction, lpfnGetValue( hwndControl ) ); - } + } } //--------------------------------------------- @@ -664,7 +664,7 @@ inline sal_Bool SAL_CALL CExecuteFilePickerState::IsListboxControl( HWND hwndCon { OSL_PRECOND( IsWindow( hwndControl ), "invalid parameter" ); - CTRL_CLASS aCtrlClass = GetCtrlClass( hwndControl ); + CTRL_CLASS aCtrlClass = GetCtrlClass( hwndControl ); return ( LISTBOX == aCtrlClass ); } @@ -705,7 +705,7 @@ HWND SAL_CALL CExecuteFilePickerState::GetHwndDlgItem( sal_Int16 aControlId, sal HWND hwndCtrl = GetDlgItem( m_hwndDlg, aControlId ); - // maybe it's a control of the dialog itself for instance + // maybe it's a control of the dialog itself for instance // the ok and cancel button if ( !hwndCtrl && bIncludeStdCtrls ) { diff --git a/fpicker/source/win32/filepicker/filepickerstate.hxx b/fpicker/source/win32/filepicker/filepickerstate.hxx index 1255e9325619..956082e4acbf 100644 --- a/fpicker/source/win32/filepicker/filepickerstate.hxx +++ b/fpicker/source/win32/filepicker/filepickerstate.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -66,7 +66,7 @@ public: virtual void SAL_CALL setValue( sal_Int16 aControlId, sal_Int16 aControlAction, const ::com::sun::star::uno::Any& aValue ) = 0; virtual ::com::sun::star::uno::Any SAL_CALL getValue( sal_Int16 aControlId, sal_Int16 aControlAction ) = 0; - + virtual void SAL_CALL enableControl( sal_Int16 aControlId, sal_Bool bEnable ) = 0; virtual void SAL_CALL setLabel( sal_Int16 aControlId, const ::rtl::OUString& aLabel ) = 0; @@ -92,7 +92,7 @@ public: virtual void SAL_CALL setValue( sal_Int16 aControlId, sal_Int16 aControlAction, const ::com::sun::star::uno::Any& aValue ); virtual ::com::sun::star::uno::Any SAL_CALL getValue( sal_Int16 aControlId, sal_Int16 aControlAction ); - + virtual void SAL_CALL enableControl( sal_Int16 aControlId, sal_Bool bEnable ); virtual void SAL_CALL setLabel( sal_Int16 aControlId, const ::rtl::OUString& aLabel ); @@ -126,7 +126,7 @@ public: virtual void SAL_CALL setValue( sal_Int16 aControlId, sal_Int16 aControlAction, const ::com::sun::star::uno::Any& aValue ); virtual ::com::sun::star::uno::Any SAL_CALL getValue( sal_Int16 aControlId, sal_Int16 aControlAction ); - + virtual void SAL_CALL enableControl( sal_Int16 aControlId, sal_Bool bEnable ); virtual void SAL_CALL setLabel( sal_Int16 aControlId, const ::rtl::OUString& aLabel ); @@ -146,12 +146,12 @@ public: private: inline sal_Bool SAL_CALL IsListboxControl( HWND hwndControl ) const; - + inline sal_Int16 SAL_CALL ListboxIdToListboxLabelId( sal_Int16 aListboxId ) const; inline HWND SAL_CALL GetListboxLabelItem( sal_Int16 aControlId ) const; - // returns a hwnd for a control if successful + // returns a hwnd for a control if successful // if bIncludeStdCtrls is false, the standard file dialog // controls like OK button, etc. will not be considered // the function return 0 on failure diff --git a/fpicker/source/win32/filepicker/fps.xml b/fpicker/source/win32/filepicker/fps.xml index 93530780956b..445faaafdbd3 100644 --- a/fpicker/source/win32/filepicker/fps.xml +++ b/fpicker/source/win32/filepicker/fps.xml @@ -4,48 +4,48 @@ <module-name>fps</module-name> <component-description> <author> Tino Rachui </author> - <name> com.sun.star.comp.ui.dialogs.FilePicker </name> + <name> com.sun.star.comp.ui.dialogs.FilePicker </name> <description> The win32 implementation of the FilePicker service. </description> <loader-name>com.sun.star.loader.SharedLibrary</loader-name> - <language> c++ </language> + <language> c++ </language> <status value="beta"/> - <supported-service> com.sun.star.ui.dialogs.FilePicker </supported-service> + <supported-service> com.sun.star.ui.dialogs.FilePicker </supported-service> <service-dependency>...</service-dependency> - <type> com.sun.star.ui.dialogs.XExecutableDialog </type> - <type> com.sun.star.ui.dialogs.XFilePicker </type> - <type> com.sun.star.ui.dialogs.XFilterManager </type> - <type> com.sun.star.ui.dialogs.XFilterGroupManager </type> - <type> com.sun.star.ui.dialogs.XFilePickerListener </type> - <type> com.sun.star.ui.dialogs.ExecutableDialogException </type> - <type> com.sun.star.ui.dialogs.XFilePickerNotifier </type> - <type> com.sun.star.ui.dialogs.XFilePickerControlAccess </type> + <type> com.sun.star.ui.dialogs.XExecutableDialog </type> + <type> com.sun.star.ui.dialogs.XFilePicker </type> + <type> com.sun.star.ui.dialogs.XFilterManager </type> + <type> com.sun.star.ui.dialogs.XFilterGroupManager </type> + <type> com.sun.star.ui.dialogs.XFilePickerListener </type> + <type> com.sun.star.ui.dialogs.ExecutableDialogException </type> + <type> com.sun.star.ui.dialogs.XFilePickerNotifier </type> + <type> com.sun.star.ui.dialogs.XFilePickerControlAccess </type> <type> com.sun.star.ui.dialogs.XFilePreview </type> <type> com.sun.star.ui.dialogs.ExtendedFilePickerElementIds </type> - <type> com.sun.star.ui.dialogs.ExecutableDialogResults </type> - <type> com.sun.star.ui.dialogs.FilePickerEvent </type> + <type> com.sun.star.ui.dialogs.ExecutableDialogResults </type> + <type> com.sun.star.ui.dialogs.FilePickerEvent </type> <type> com.sun.star.ui.dialogs.CommonFilePickerElementIds </type> <type> com.sun.star.ui.dialogs.ListboxControlActions </type> - <type> com.sun.star.ui.dialogs.TemplateDescription </type> - <type> com.sun.star.ui.dialogs.FilePreviewImageFormats </type> - <type> com.sun.star.util.XCancellable </type> - <type> com.sun.star.lang.XComponent </type> - <type> com.sun.star.lang.XMultiServiceFactory </type> - <type> com.sun.star.lang.XSingleServiceFactory </type> - <type> com.sun.star.lang.XServiceInfo </type> - <type> com.sun.star.lang.XTypeProvider </type> - <type> com.sun.star.lang.IllegalArgumentException </type> - <type> com.sun.star.uno.TypeClass </type> - <type> com.sun.star.uno.XWeak </type> - <type> com.sun.star.uno.XAggregation </type> - <type> com.sun.star.registry.XRegistryKey </type> - <type> com.sun.star.container.XSet </type> + <type> com.sun.star.ui.dialogs.TemplateDescription </type> + <type> com.sun.star.ui.dialogs.FilePreviewImageFormats </type> + <type> com.sun.star.util.XCancellable </type> + <type> com.sun.star.lang.XComponent </type> + <type> com.sun.star.lang.XMultiServiceFactory </type> + <type> com.sun.star.lang.XSingleServiceFactory </type> + <type> com.sun.star.lang.XServiceInfo </type> + <type> com.sun.star.lang.XTypeProvider </type> + <type> com.sun.star.lang.IllegalArgumentException </type> + <type> com.sun.star.uno.TypeClass </type> + <type> com.sun.star.uno.XWeak </type> + <type> com.sun.star.uno.XAggregation </type> + <type> com.sun.star.registry.XRegistryKey </type> + <type> com.sun.star.container.XSet </type> </component-description> - <project-build-dependency> cppuhelper </project-build-dependency> - <project-build-dependency> cppu </project-build-dependency> - <project-build-dependency> sal </project-build-dependency> - <runtime-module-dependency> cppuhelper </runtime-module-dependency> - <runtime-module-dependency> cppu2 </runtime-module-dependency> - <runtime-module-dependency> sal2 </runtime-module-dependency> + <project-build-dependency> cppuhelper </project-build-dependency> + <project-build-dependency> cppu </project-build-dependency> + <project-build-dependency> sal </project-build-dependency> + <runtime-module-dependency> cppuhelper </runtime-module-dependency> + <runtime-module-dependency> cppu2 </runtime-module-dependency> + <runtime-module-dependency> sal2 </runtime-module-dependency> </module-description> diff --git a/fpicker/source/win32/filepicker/getfilenamewrapper.cxx b/fpicker/source/win32/filepicker/getfilenamewrapper.cxx index 107112a1b1b7..70977b627252 100644 --- a/fpicker/source/win32/filepicker/getfilenamewrapper.cxx +++ b/fpicker/source/win32/filepicker/getfilenamewrapper.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -58,7 +58,7 @@ namespace /* private */ BOOL m_bValid; wchar_t* m_pBuffer; DWORD m_nBufLen; - + public: CurDirGuard() : m_bValid( FALSE ) @@ -135,7 +135,7 @@ namespace /* private */ //----------------------------------------------- struct GetFileNameParam - { + { GetFileNameParam(bool bOpen, LPOPENFILENAME lpofn) : m_bOpen(bOpen), m_lpofn(lpofn), @@ -143,10 +143,10 @@ namespace /* private */ m_ExtErr(0) {} - bool m_bOpen; + bool m_bOpen; LPOPENFILENAME m_lpofn; - bool m_bRet; - int m_ExtErr; + bool m_bRet; + int m_ExtErr; }; //----------------------------------------------- @@ -157,10 +157,10 @@ namespace /* private */ { CurDirGuard aGuard; - GetFileNameParam* lpgfnp = + GetFileNameParam* lpgfnp = reinterpret_cast<GetFileNameParam*>(pParam); - HRESULT hr = OleInitialize( NULL ); + HRESULT hr = OleInitialize( NULL ); if (lpgfnp->m_bOpen) lpgfnp->m_bRet = GetOpenFileName(lpgfnp->m_lpofn); @@ -176,30 +176,30 @@ namespace /* private */ } //----------------------------------------------- - // exceutes GetOpenFileName/GetSaveFileName in + // exceutes GetOpenFileName/GetSaveFileName in // a separat thread //----------------------------------------------- bool ThreadExecGetFileName(LPOPENFILENAME lpofn, bool bOpen, /*out*/ int& ExtErr) { - GetFileNameParam gfnp(bOpen,lpofn); - unsigned id; + GetFileNameParam gfnp(bOpen,lpofn); + unsigned id; HANDLE hThread = reinterpret_cast<HANDLE>( _beginthreadex(0, 0, ThreadProc, &gfnp, 0, &id)); - + OSL_POSTCOND(hThread, "could not create STA thread"); WaitForSingleObject(hThread, INFINITE); - CloseHandle(hThread); - + CloseHandle(hThread); + ExtErr = gfnp.m_ExtErr; return gfnp.m_bRet; } //----------------------------------------------- - // This function returns true if the calling + // This function returns true if the calling // thread belongs to a Multithreaded Appartment // (MTA) //----------------------------------------------- @@ -207,10 +207,10 @@ namespace /* private */ bool IsMTA() { HRESULT hr = CoInitialize(NULL); - + if (RPC_E_CHANGED_MODE == hr) return true; - + if(SUCCEEDED(hr)) CoUninitialize(); @@ -234,7 +234,7 @@ CGetFileNameWrapper::CGetFileNameWrapper() : //----------------------------------------------- bool CGetFileNameWrapper::getOpenFileName(LPOPENFILENAME lpofn) -{ +{ OSL_PRECOND(lpofn,"invalid parameter"); bool bRet = false; @@ -242,18 +242,18 @@ bool CGetFileNameWrapper::getOpenFileName(LPOPENFILENAME lpofn) if (IsMTA()) { bRet = ThreadExecGetFileName( - lpofn, true, m_ExtendedDialogError); + lpofn, true, m_ExtendedDialogError); } else { CurDirGuard aGuard; - HRESULT hr = OleInitialize( NULL ); + HRESULT hr = OleInitialize( NULL ); bRet = GetOpenFileName(lpofn); m_ExtendedDialogError = CommDlgExtendedError(); - if ( SUCCEEDED( hr ) ) + if ( SUCCEEDED( hr ) ) OleUninitialize(); } @@ -265,7 +265,7 @@ bool CGetFileNameWrapper::getOpenFileName(LPOPENFILENAME lpofn) //----------------------------------------------- bool CGetFileNameWrapper::getSaveFileName(LPOPENFILENAME lpofn) -{ +{ OSL_PRECOND(lpofn,"invalid parameter"); bool bRet = false; @@ -273,7 +273,7 @@ bool CGetFileNameWrapper::getSaveFileName(LPOPENFILENAME lpofn) if (IsMTA()) { bRet = ThreadExecGetFileName( - lpofn, false, m_ExtendedDialogError); + lpofn, false, m_ExtendedDialogError); } else { diff --git a/fpicker/source/win32/filepicker/getfilenamewrapper.hxx b/fpicker/source/win32/filepicker/getfilenamewrapper.hxx index 2e028b4df210..9e7b4cfe8ecb 100644 --- a/fpicker/source/win32/filepicker/getfilenamewrapper.hxx +++ b/fpicker/source/win32/filepicker/getfilenamewrapper.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -47,8 +47,8 @@ /* A simple wrapper around the GetOpenFileName/GetSaveFileName API. - Because currently the Win32 API functions GetOpenFileName/GetSaveFileName - work only properly in an Single Threaded Appartment. + Because currently the Win32 API functions GetOpenFileName/GetSaveFileName + work only properly in an Single Threaded Appartment. */ class CGetFileNameWrapper diff --git a/fpicker/source/win32/filepicker/helppopupwindow.cxx b/fpicker/source/win32/filepicker/helppopupwindow.cxx index f1faf3928416..42c1ec1327dd 100644 --- a/fpicker/source/win32/filepicker/helppopupwindow.cxx +++ b/fpicker/source/win32/filepicker/helppopupwindow.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -72,7 +72,7 @@ const DWORD OUTER_FRAME_COLOR = 0; // black const sal_Int32 OUTER_FRAME_WIDTH = 1; // pixel // it's the standard windows color of an inactive window border -const DWORD INNER_FRAME_COLOR = 0xC8D0D4; +const DWORD INNER_FRAME_COLOR = 0xC8D0D4; const sal_Int32 INNER_FRAME_WIDTH = 1; // pixel //--------------------------------------------------- @@ -87,9 +87,9 @@ sal_Int32 CHelpPopupWindow::s_RegisterWndClassCount = 0; // //--------------------------------------------------- -CHelpPopupWindow::CHelpPopupWindow( - HINSTANCE hInstance, - HWND hwndParent ) : +CHelpPopupWindow::CHelpPopupWindow( + HINSTANCE hInstance, + HWND hwndParent ) : m_hMargins( 0 ), m_vMargins( 0 ), m_avCharWidth( 0 ), @@ -99,13 +99,13 @@ CHelpPopupWindow::CHelpPopupWindow( m_hInstance( hInstance ), m_hBitmapShadow( NULL ), m_hBrushShadow( NULL ) -{ - m_bWndClassRegistered = RegisterWindowClass( ) ? sal_True : sal_False; +{ + m_bWndClassRegistered = RegisterWindowClass( ) ? sal_True : sal_False; // create a pattern brush for the window shadow WORD aPattern[] = { 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55 }; - - m_hBitmapShadow = CreateBitmap( 8, 8, 1, 1, aPattern ); + + m_hBitmapShadow = CreateBitmap( 8, 8, 1, 1, aPattern ); m_hBrushShadow = CreatePatternBrush( m_hBitmapShadow ); } @@ -114,7 +114,7 @@ CHelpPopupWindow::CHelpPopupWindow( //--------------------------------------------------- CHelpPopupWindow::~CHelpPopupWindow( ) -{ +{ // remember: we don't have to destroy the // preview window because it will be destroyed // by it's parent window (the FileOpen dialog) @@ -127,7 +127,7 @@ CHelpPopupWindow::~CHelpPopupWindow( ) } //--------------------------------------------------- -// +// //--------------------------------------------------- void SAL_CALL CHelpPopupWindow::setText( const rtl::OUString& aHelpText ) @@ -136,7 +136,7 @@ void SAL_CALL CHelpPopupWindow::setText( const rtl::OUString& aHelpText ) } //--------------------------------------------------- -// +// //--------------------------------------------------- void SAL_CALL CHelpPopupWindow::show( sal_Int32 x, sal_Int32 y ) @@ -144,11 +144,11 @@ void SAL_CALL CHelpPopupWindow::show( sal_Int32 x, sal_Int32 y ) OSL_ENSURE( NULL == m_hwnd, "method should not be called twice in sequence" ); // we create a window with length and heigth of 0 - // first in order to get a device context of this + // first in order to get a device context of this // window, then we calculate the upper left corner // and the dimensions and resize the window - m_hwnd = CreateWindowEx( + m_hwnd = CreateWindowEx( NULL, HELPPOPUPWND_CLASS_NAME, NULL, @@ -195,40 +195,40 @@ HWND SAL_CALL CHelpPopupWindow::setParent( HWND hwndNewParent ) void SAL_CALL CHelpPopupWindow::calcWindowRect( LPRECT lprect ) { OSL_ASSERT( m_hwnd && lprect ); - + SetRect( lprect, 0, 0, MAX_CHARS_PER_LINE * m_avCharWidth, 0 ); HDC hdc = GetDC( m_hwnd ); // set the font we are using later - HGDIOBJ oldFont = SelectObject( + HGDIOBJ oldFont = SelectObject( hdc, GetStockObject( DEFAULT_GUI_FONT ) ); - + UINT nFormat = DT_WORDBREAK | DT_CALCRECT | DT_EXTERNALLEADING | DT_LEFT; if ( m_HelpText.getLength( ) <= MAX_CHARS_PER_LINE ) nFormat |= DT_SINGLELINE; - DrawText( - hdc, - reinterpret_cast<LPCTSTR>(m_HelpText.getStr( )), - m_HelpText.getLength( ), - lprect, + DrawText( + hdc, + reinterpret_cast<LPCTSTR>(m_HelpText.getStr( )), + m_HelpText.getLength( ), + lprect, nFormat ); - + // add the necessary space for the frames // and margins - lprect->bottom += - m_vMargins + - SHADOW_HEIGHT + - OUTER_FRAME_WIDTH * 2 + + lprect->bottom += + m_vMargins + + SHADOW_HEIGHT + + OUTER_FRAME_WIDTH * 2 + INNER_FRAME_WIDTH * 2; - - lprect->right += - SHADOW_WIDTH + - 2 * m_avCharWidth + - OUTER_FRAME_WIDTH * 2 + + + lprect->right += + SHADOW_WIDTH + + 2 * m_avCharWidth + + OUTER_FRAME_WIDTH * 2 + INNER_FRAME_WIDTH * 2; SelectObject( hdc, oldFont ); @@ -265,19 +265,19 @@ void SAL_CALL CHelpPopupWindow::adjustWindowSize( sal_Int32* cx_new, sal_Int32* // //--------------------------------------------------- -void SAL_CALL CHelpPopupWindow::adjustWindowPos( +void SAL_CALL CHelpPopupWindow::adjustWindowPos( sal_Int32 x, sal_Int32 y, sal_Int32 cx, sal_Int32 cy ) -{ +{ int popX; int popY; int popWidth; int popHeight; - + OSL_ASSERT( m_hwnd ); HDC hdc = GetDC( m_hwnd ); - // assuming these are screen coordinates + // assuming these are screen coordinates popWidth = cx; popHeight = cy; popX = x - ( popWidth / 2 ); @@ -288,13 +288,13 @@ void SAL_CALL CHelpPopupWindow::adjustWindowPos( if (popX < 0) popX = 0; - + if (popY < 0) popY = 0; - + if ((popX + popWidth) > xScreen) popX = xScreen - popWidth; - + if ((popY + popHeight) > yScreen) popY = yScreen - popHeight; @@ -305,7 +305,7 @@ void SAL_CALL CHelpPopupWindow::adjustWindowPos( popY, 0, 0, - SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSIZE ); + SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSIZE ); ReleaseDC( m_hwnd, hdc ); } @@ -319,20 +319,20 @@ void SAL_CALL CHelpPopupWindow::onPaint( HWND hWnd, HDC hdc ) RECT rc; RECT rect; HGDIOBJ hpen, hpenOld; - HGDIOBJ hbrOld; + HGDIOBJ hbrOld; COLORREF oldBkColor; COLORREF oldTextColor; HGDIOBJ oldFont; HGDIOBJ oldBrush; HGDIOBJ hBrush; - + GetClientRect( hWnd, &rc ); - // draw the black border + // draw the black border hBrush = CreateSolidBrush( GetSysColor( COLOR_INFOBK ) ); oldBrush = SelectObject( hdc, hBrush ); - + hpen = CreatePen( PS_SOLID, 0, OUTER_FRAME_COLOR ); hpenOld = SelectObject( hdc, hpen ); @@ -367,7 +367,7 @@ void SAL_CALL CHelpPopupWindow::onPaint( HWND hWnd, HDC hdc ) DeleteObject( hBrush ); DeleteObject( hpen ); - + // Write some text to this window rect.left = rc.left + OUTER_FRAME_WIDTH + INNER_FRAME_WIDTH + 1 + m_hMargins; @@ -377,26 +377,26 @@ void SAL_CALL CHelpPopupWindow::onPaint( HWND hWnd, HDC hdc ) oldBkColor = SetBkColor( hdc, GetSysColor( COLOR_INFOBK ) ); oldTextColor = SetTextColor( hdc, COLOR_INFOTEXT ); - + oldFont = SelectObject( hdc, GetStockObject( DEFAULT_GUI_FONT ) ); UINT nFormat = DT_WORDBREAK | DT_EXTERNALLEADING | DT_LEFT; - + if ( m_HelpText.getLength( ) <= MAX_CHARS_PER_LINE ) nFormat |= DT_SINGLELINE; - DrawText( - hdc, - (LPWSTR)m_HelpText.getStr( ), - m_HelpText.getLength( ), - &rect, + DrawText( + hdc, + (LPWSTR)m_HelpText.getStr( ), + m_HelpText.getLength( ), + &rect, nFormat ); SelectObject( hdc, oldFont ); SetTextColor( hdc, oldTextColor ); SetBkColor( hdc, oldBkColor ); - // set text color and text background color + // set text color and text background color // see MSDN PatBlt oldBkColor = SetBkColor( hdc, RGB( 0, 0, 0 ) ); @@ -449,7 +449,7 @@ void SAL_CALL CHelpPopupWindow::onCreate( HWND hwnd ) HDC hdc = GetDC( m_hwnd ); - HGDIOBJ oldFont = SelectObject( + HGDIOBJ oldFont = SelectObject( hdc, GetStockObject( DEFAULT_GUI_FONT ) ); TEXTMETRIC tm; @@ -461,7 +461,7 @@ void SAL_CALL CHelpPopupWindow::onCreate( HWND hwnd ) if ( 0 == m_hMargins ) m_hMargins = m_avCharWidth; - if ( 0 == m_vMargins ) + if ( 0 == m_vMargins ) m_vMargins = m_avCharHeight; SelectObject( hdc, oldFont ); @@ -472,8 +472,8 @@ void SAL_CALL CHelpPopupWindow::onCreate( HWND hwnd ) //--------------------------------------------------- // //--------------------------------------------------- - -LRESULT CALLBACK CHelpPopupWindow::WndProc( + +LRESULT CALLBACK CHelpPopupWindow::WndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ) { LRESULT lResult = 0; @@ -481,17 +481,17 @@ LRESULT CALLBACK CHelpPopupWindow::WndProc( switch ( uMsg ) { case WM_CREATE: - { - LPCREATESTRUCT lpcs = + { + LPCREATESTRUCT lpcs = reinterpret_cast< LPCREATESTRUCT >( lParam ); OSL_ASSERT( lpcs->lpCreateParams ); - + CHelpPopupWindow* pImpl = reinterpret_cast< CHelpPopupWindow* >( lpcs->lpCreateParams ); - - // connect the instance handle to the window - SetProp( hWnd, CURRENT_INSTANCE, pImpl ); + + // connect the instance handle to the window + SetProp( hWnd, CURRENT_INSTANCE, pImpl ); pImpl->onCreate( hWnd ); @@ -507,7 +507,7 @@ LRESULT CALLBACK CHelpPopupWindow::WndProc( OSL_ASSERT( pImpl ); - PAINTSTRUCT ps; + PAINTSTRUCT ps; BeginPaint(hWnd, &ps); pImpl->onPaint( hWnd, ps.hdc ); @@ -518,7 +518,7 @@ LRESULT CALLBACK CHelpPopupWindow::WndProc( case WM_NCDESTROY: { // RemoveProp returns the saved value on success - CHelpPopupWindow* pImpl = reinterpret_cast< CHelpPopupWindow* >( + CHelpPopupWindow* pImpl = reinterpret_cast< CHelpPopupWindow* >( RemoveProp( hWnd, CURRENT_INSTANCE ) ); OSL_ASSERT( pImpl ); @@ -527,16 +527,16 @@ LRESULT CALLBACK CHelpPopupWindow::WndProc( } break; - case WM_LBUTTONDOWN: + case WM_LBUTTONDOWN: case WM_KEYDOWN: - case WM_SYSKEYDOWN: + case WM_SYSKEYDOWN: case WM_MBUTTONDOWN: case WM_RBUTTONDOWN: - ReleaseCapture(); + ReleaseCapture(); DestroyWindow(hWnd); break; - default: + default: return DefWindowProc(hWnd, uMsg, wParam, lParam); } @@ -548,30 +548,30 @@ LRESULT CALLBACK CHelpPopupWindow::WndProc( //--------------------------------------------------- ATOM SAL_CALL CHelpPopupWindow::RegisterWindowClass( ) -{ +{ osl::MutexGuard aGuard( s_Mutex ); if ( 0 == s_ClassAtom ) - { - // register the window class - WNDCLASSEX wndClsEx; + { + // register the window class + WNDCLASSEX wndClsEx; ZeroMemory(&wndClsEx, sizeof(wndClsEx)); - wndClsEx.cbSize = sizeof(wndClsEx); + wndClsEx.cbSize = sizeof(wndClsEx); wndClsEx.lpfnWndProc = CHelpPopupWindow::WndProc; wndClsEx.hInstance = m_hInstance; wndClsEx.hCursor = LoadCursor(NULL, IDC_ARROW); wndClsEx.hbrBackground = (HBRUSH)GetStockObject( NULL_BRUSH ); wndClsEx.lpszClassName = HELPPOPUPWND_CLASS_NAME; - + // register the preview window class - // !!! Win95 - the window class will be unregistered automaticly - // if the dll is unloaded + // !!! Win95 - the window class will be unregistered automaticly + // if the dll is unloaded // Win2000 - the window class must be unregistered manually - // if the dll is unloaded + // if the dll is unloaded s_ClassAtom = RegisterClassEx( &wndClsEx ); - OSL_ASSERT(s_ClassAtom); + OSL_ASSERT(s_ClassAtom); } // increment the register class counter @@ -590,13 +590,13 @@ ATOM SAL_CALL CHelpPopupWindow::RegisterWindowClass( ) void SAL_CALL CHelpPopupWindow::UnregisterWindowClass( ) { osl::MutexGuard aGuard( s_Mutex ); - - OSL_ASSERT( ( (0 != s_ClassAtom) && (s_RegisterWndClassCount > 0)) || + + OSL_ASSERT( ( (0 != s_ClassAtom) && (s_RegisterWndClassCount > 0)) || ( (0 == s_ClassAtom) && (0 == s_RegisterWndClassCount) ) ); - // update the register class counter + // update the register class counter // and unregister the window class if - // counter drops to zero + // counter drops to zero if ( 0 != s_ClassAtom ) { s_RegisterWndClassCount--; @@ -612,7 +612,7 @@ void SAL_CALL CHelpPopupWindow::UnregisterWindowClass( ) } s_ClassAtom = 0; - } + } } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/fpicker/source/win32/filepicker/helppopupwindow.hxx b/fpicker/source/win32/filepicker/helppopupwindow.hxx index 71f74ad5a055..ddb74e1f30e5 100644 --- a/fpicker/source/win32/filepicker/helppopupwindow.hxx +++ b/fpicker/source/win32/filepicker/helppopupwindow.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -74,10 +74,10 @@ public: a default value will be taken. The values are in pixel. */ - CHelpPopupWindow( + CHelpPopupWindow( HINSTANCE hInstance, HWND hwndParent ); - + /* dtor */ @@ -115,26 +115,26 @@ private: static LRESULT CALLBACK WndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ); -private: +private: sal_Int32 m_hMargins; sal_Int32 m_vMargins; sal_Int32 m_avCharWidth; sal_Int32 m_avCharHeight; - HWND m_hwnd; + HWND m_hwnd; HWND m_hwndParent; - HINSTANCE m_hInstance; + HINSTANCE m_hInstance; sal_Bool m_bWndClassRegistered; ::rtl::OUString m_HelpText; HBITMAP m_hBitmapShadow; HBRUSH m_hBrushShadow; - + // the window class has to be registered only // once per process, so multiple instance of this class // share the registered window class static ATOM s_ClassAtom; static osl::Mutex s_Mutex; static sal_Int32 s_RegisterWndClassCount; - + // prevent copy and assignment private: CHelpPopupWindow( const CHelpPopupWindow& ); diff --git a/fpicker/source/win32/filepicker/platform_vista.h b/fpicker/source/win32/filepicker/platform_vista.h index c6fd8688bbd7..84479c2c9e41 100644 --- a/fpicker/source/win32/filepicker/platform_vista.h +++ b/fpicker/source/win32/filepicker/platform_vista.h @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/fpicker/source/win32/filepicker/platform_xp.h b/fpicker/source/win32/filepicker/platform_xp.h index 41b034070425..d6d8e650cbaa 100644 --- a/fpicker/source/win32/filepicker/platform_xp.h +++ b/fpicker/source/win32/filepicker/platform_xp.h @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/fpicker/source/win32/filepicker/previewadapter.cxx b/fpicker/source/win32/filepicker/previewadapter.cxx index 407f000a7e6c..b0f7effb8b9d 100644 --- a/fpicker/source/win32/filepicker/previewadapter.cxx +++ b/fpicker/source/win32/filepicker/previewadapter.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -47,7 +47,7 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; //--------------------------------------------- -// An impl class to hide implementation details +// An impl class to hide implementation details // from clients //--------------------------------------------- @@ -57,22 +57,22 @@ public: CPreviewAdapterImpl(HINSTANCE instance); virtual ~CPreviewAdapterImpl(); - + virtual sal_Int32 SAL_CALL getTargetColorDepth(); - + virtual sal_Int32 SAL_CALL getAvailableWidth(); - + virtual sal_Int32 SAL_CALL getAvailableHeight(); - - virtual void SAL_CALL setImage( sal_Int16 aImageFormat, const Any& aImage ) + + virtual void SAL_CALL setImage( sal_Int16 aImageFormat, const Any& aImage ) throw (IllegalArgumentException,RuntimeException); virtual sal_Bool SAL_CALL setShowState(sal_Bool bShowState); - + virtual sal_Bool SAL_CALL getShowState(); - + virtual void SAL_CALL setParent(HWND parent); - + virtual HWND SAL_CALL getParent(); //------------------------------------- @@ -80,12 +80,12 @@ public: //------------------------------------- virtual void SAL_CALL notifyParentShow(sal_Bool bShow); - + virtual void SAL_CALL notifyParentSizeChanged(); virtual void SAL_CALL notifyParentWindowPosChanged(); -protected: +protected: virtual void SAL_CALL calcRightMargin(); virtual void SAL_CALL rearrangeLayout(); @@ -96,10 +96,10 @@ protected: // member protected: - HINSTANCE m_Instance; + HINSTANCE m_Instance; std::auto_ptr<PreviewBase> m_Preview; - HWND m_FileDialog; - int m_RightMargin; + HWND m_FileDialog; + int m_RightMargin; //prevent copy/assignment private: @@ -111,7 +111,7 @@ private: // //----------------------------------------- -CPreviewAdapterImpl::CPreviewAdapterImpl(HINSTANCE instance) : +CPreviewAdapterImpl::CPreviewAdapterImpl(HINSTANCE instance) : m_Instance(instance), m_Preview(new PreviewBase()), // create dummy preview (NULL-Object pattern) m_FileDialog(0), @@ -158,7 +158,7 @@ sal_Int32 SAL_CALL CPreviewAdapterImpl::getAvailableHeight() // //----------------------------------------- -void SAL_CALL CPreviewAdapterImpl::setImage( sal_Int16 aImageFormat, const Any& aImage ) +void SAL_CALL CPreviewAdapterImpl::setImage( sal_Int16 aImageFormat, const Any& aImage ) throw (IllegalArgumentException,RuntimeException) { m_Preview->setImage(aImageFormat,aImage); @@ -193,7 +193,7 @@ void SAL_CALL CPreviewAdapterImpl::setParent(HWND parent) OSL_PRECOND(IsWindow(parent),"Invalid FileDialog handle"); m_FileDialog = parent; - calcRightMargin(); + calcRightMargin(); } //----------------------------------------- @@ -225,7 +225,7 @@ void SAL_CALL CPreviewAdapterImpl::calcRightMargin() // even if the size of the dialog changes HWND flb = GetDlgItem(m_FileDialog,lst1); - + OSL_ENSURE(IsWindow(flb),"Filelistbox not found"); RECT rcFlb; @@ -248,7 +248,7 @@ void SAL_CALL CPreviewAdapterImpl::notifyParentShow(sal_Bool) //----------------------------------------- // //----------------------------------------- - + void SAL_CALL CPreviewAdapterImpl::notifyParentSizeChanged() { rearrangeLayout(); @@ -269,7 +269,7 @@ void SAL_CALL CPreviewAdapterImpl::notifyParentWindowPosChanged() void SAL_CALL CPreviewAdapterImpl::rearrangeLayout() { // try to get a handle to the filelistbox - // if there is no new-style filelistbox like + // if there is no new-style filelistbox like // in Win2000/XP there should be at least the // old listbox, so we take this one // lst1 - identifies the old-style filelistbox @@ -279,25 +279,25 @@ void SAL_CALL CPreviewAdapterImpl::rearrangeLayout() // under Windows NT 4.0 the size of the old // filelistbox will be used as reference for - // sizing the new filelistbox, so we have + // sizing the new filelistbox, so we have // to change the size of it too HWND flb_old = GetDlgItem(m_FileDialog,lst1); RECT rcFlbNew; GetWindowRect(flb_new,&rcFlbNew); - RECT rcFileDlg; + RECT rcFileDlg; GetWindowRect(m_FileDialog,&rcFileDlg); rcFileDlg.right -= m_RightMargin; // the available area for the filelistbox should be - // the left edge of the filelistbox and the right + // the left edge of the filelistbox and the right // edge of the OK button, we take this as reference int height = rcFlbNew.bottom - rcFlbNew.top; int width = rcFileDlg.right - rcFlbNew.left; - + HWND prvwnd = m_Preview->getWindowHandle(); - + // we use GetWindowLong to ask for the visibility // of the preview window because IsWindowVisible // only returns true the specified window including @@ -315,45 +315,45 @@ void SAL_CALL CPreviewAdapterImpl::rearrangeLayout() { cx = width/2; - // resize the filelistbox to the half of the + // resize the filelistbox to the half of the // available space BOOL bRet = SetWindowPos(flb_new, NULL, 0, 0, cx, height, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); - + bRet = SetWindowPos(flb_old, - NULL, 0, 0, cx, height, + NULL, 0, 0, cx, height, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); // get the new dimensions of the filelistbox after // resizing and take the right,top corner as starting // point for the preview window - GetWindowRect(flb_new,&rcFlbNew); + GetWindowRect(flb_new,&rcFlbNew); POINT pt = { rcFlbNew.right, rcFlbNew.top }; ScreenToClient(m_FileDialog,&pt); - + // resize the preview window to fit within // the available space and set the window - // to the top of the z-order else it will + // to the top of the z-order else it will // be invisible SetWindowPos(prvwnd, - HWND_TOP, pt.x, pt.y, cx, height, SWP_NOACTIVATE); + HWND_TOP, pt.x, pt.y, cx, height, SWP_NOACTIVATE); } else { - // resize the filelistbox to the maximum available + // resize the filelistbox to the maximum available // space cx = rcFileDlg.right - rcFlbNew.left; - + // resize the old filelistbox SetWindowPos(flb_old, - NULL, 0, 0, cx, height, + NULL, 0, 0, cx, height, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); // resize the new filelistbox SetWindowPos(flb_new, NULL, 0, 0, cx, height, - SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE ); + SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE ); } } @@ -364,18 +364,18 @@ void SAL_CALL CPreviewAdapterImpl::rearrangeLayout() void SAL_CALL CPreviewAdapterImpl::initializeActivePreview() throw(std::runtime_error) { sal_Bool bShowState = m_Preview->getImaginaryShowState(); - + sal_Int16 aImgFrmt; Any aImg; m_Preview->getImage(aImgFrmt,aImg); HWND flb = findFileListbox(); - + PreviewBase* prv = new CDIBPreview( m_Instance, GetParent(flb), bShowState); - - m_Preview.reset(prv); - + + m_Preview.reset(prv); + m_Preview->setImage(aImgFrmt,aImg); } @@ -383,17 +383,17 @@ void SAL_CALL CPreviewAdapterImpl::initializeActivePreview() throw(std::runtime_ // //----------------------------------------- -HWND SAL_CALL CPreviewAdapterImpl::findFileListbox() const +HWND SAL_CALL CPreviewAdapterImpl::findFileListbox() const { // try to get a handle to the filelistbox - // if there is no new-style filelistbox like + // if there is no new-style filelistbox like // in Win2000/XP there should be at least the // old listbox, so we take this one // lst1 - identifies the old-style filelistbox // lst2 - identifies the new-style filelistbox // see dlgs.h - HWND flb = GetDlgItem(m_FileDialog,lst2); - if (!IsWindow(flb)) + HWND flb = GetDlgItem(m_FileDialog,lst2); + if (!IsWindow(flb)) flb = GetDlgItem(m_FileDialog,lst1); return flb; @@ -418,15 +418,15 @@ public: 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; + sal_Bool m_PreviewActive; + int m_ToolbarPosX; + int m_ToolbarPosY; + int m_ToolbarWidth; + int m_ToolbarHeight; }; //-------------------------------------------- @@ -451,26 +451,26 @@ void SAL_CALL CWin98PreviewAdapterImpl::notifyParentWindowPosChanged() { try { - // the reason for this condition is + // the reason for this condition is // Windows 98 // Under Windows 98 the message WM_SHOWWINDOW - // will be sent only the first time the + // 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(); + 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); @@ -481,23 +481,23 @@ void SAL_CALL CWin98PreviewAdapterImpl::notifyParentWindowPosChanged() // 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) + if (rcStc1.left >= rcCmb2.right) { // important: save the upper left corner in - // client coordinates + // 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; + m_ToolbarHeight = rcStc1.bottom - rcStc1.top; } } } catch(std::runtime_error&) - { - } + { + } } //-------------------------------------------- @@ -507,11 +507,11 @@ void SAL_CALL CWin98PreviewAdapterImpl::notifyParentWindowPosChanged() 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 + // so if we have changed the size of the // FileListbox we would run into trouble else if (isValidToolbarDimension()) { @@ -519,12 +519,12 @@ void SAL_CALL CWin98PreviewAdapterImpl::rearrangeLayout() m_FileDialog,NULL,TEXT("ToolbarWindow32"),NULL); SetWindowPos(hwndTlb, - HWND_TOP, + HWND_TOP, m_ToolbarPosX, m_ToolbarPosY, m_ToolbarWidth, m_ToolbarHeight, - SWP_NOACTIVATE); + SWP_NOACTIVATE); } } @@ -534,9 +534,9 @@ void SAL_CALL CWin98PreviewAdapterImpl::rearrangeLayout() bool CWin98PreviewAdapterImpl::isValidToolbarDimension() const { - return (m_ToolbarPosX > 0 && - m_ToolbarPosY > 0 && - m_ToolbarWidth > 0 && + return (m_ToolbarPosX > 0 && + m_ToolbarPosY > 0 && + m_ToolbarWidth > 0 && m_ToolbarHeight > 0); } @@ -546,7 +546,7 @@ bool CWin98PreviewAdapterImpl::isValidToolbarDimension() const //-------------------------------------------- // Implementation for Windows 95/NT/ME/2000/XP // because: -// +// //-------------------------------------------- class CWin95NTPreviewAdapterImpl : public CPreviewAdapterImpl @@ -575,14 +575,14 @@ void SAL_CALL CWin95NTPreviewAdapterImpl::notifyParentShow(sal_Bool bShow) try { if (bShow) - { - initializeActivePreview(); + { + initializeActivePreview(); rearrangeLayout(); } } catch(std::runtime_error&) - { - } + { + } } @@ -593,7 +593,7 @@ void SAL_CALL CWin95NTPreviewAdapterImpl::notifyParentShow(sal_Bool bShow) // ctor //------------------------------- -CPreviewAdapter::CPreviewAdapter(HINSTANCE instance) +CPreviewAdapter::CPreviewAdapter(HINSTANCE instance) { if (!IsWindows98()) m_pImpl.reset(new CWin95NTPreviewAdapterImpl(instance)); @@ -651,7 +651,7 @@ sal_Int32 SAL_CALL CPreviewAdapter::getAvailableHeight() // //------------------------------- -void SAL_CALL CPreviewAdapter::setImage( sal_Int16 aImageFormat, const Any& aImage ) +void SAL_CALL CPreviewAdapter::setImage( sal_Int16 aImageFormat, const Any& aImage ) throw (IllegalArgumentException, RuntimeException) { m_pImpl->setImage(aImageFormat,aImage); @@ -663,7 +663,7 @@ void SAL_CALL CPreviewAdapter::setImage( sal_Int16 aImageFormat, const Any& aIma sal_Bool SAL_CALL CPreviewAdapter::setShowState( sal_Bool bShowState ) { - return m_pImpl->setShowState(bShowState); + return m_pImpl->setShowState(bShowState); } //------------------------------- @@ -696,7 +696,7 @@ void SAL_CALL CPreviewAdapter::notifyParentShow(bool bShow) //------------------------------- // //------------------------------- - + void SAL_CALL CPreviewAdapter::notifyParentSizeChanged() { m_pImpl->notifyParentSizeChanged(); diff --git a/fpicker/source/win32/filepicker/previewadapter.hxx b/fpicker/source/win32/filepicker/previewadapter.hxx index 0efc2e60245a..e10b2e5d31df 100644 --- a/fpicker/source/win32/filepicker/previewadapter.hxx +++ b/fpicker/source/win32/filepicker/previewadapter.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -53,17 +53,17 @@ class CPreviewAdapterImpl; // window may only become visible if there is // a valid parent window (means, the FilePicker) // is in execution mode. So unless someone sets -// the preview active with a valid parent +// the preview active with a valid parent // window the preview may not be visible //--------------------------------------------- class CPreviewAdapter { public: - + // ctor CPreviewAdapter(HINSTANCE instance); - + ~CPreviewAdapter(); ::com::sun::star::uno::Sequence<sal_Int16> SAL_CALL getSupportedImageFormats(); @@ -74,13 +74,13 @@ public: sal_Int32 SAL_CALL getAvailableHeight(); - void SAL_CALL setImage(sal_Int16 aImageFormat, const ::com::sun::star::uno::Any& aImage) + void SAL_CALL setImage(sal_Int16 aImageFormat, const ::com::sun::star::uno::Any& aImage) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); sal_Bool SAL_CALL setShowState(sal_Bool bShowState); - sal_Bool SAL_CALL getShowState(); - + sal_Bool SAL_CALL getShowState(); + void SAL_CALL setParent(HWND parent); //-------------------------------------- @@ -88,9 +88,9 @@ public: //-------------------------------------- void SAL_CALL notifyParentShow(bool bShow); - + void SAL_CALL notifyParentSizeChanged(); - + void SAL_CALL notifyParentWindowPosChanged(); private: diff --git a/fpicker/source/win32/filepicker/previewbase.cxx b/fpicker/source/win32/filepicker/previewbase.cxx index 4047e693a50a..ae505af164d4 100644 --- a/fpicker/source/win32/filepicker/previewbase.cxx +++ b/fpicker/source/win32/filepicker/previewbase.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -85,7 +85,7 @@ sal_Int32 SAL_CALL PreviewBase::getAvailableHeight() throw (RuntimeException) // //------------------------------- -void SAL_CALL PreviewBase::setImage( sal_Int16 aImageFormat, const ::com::sun::star::uno::Any& aImage ) +void SAL_CALL PreviewBase::setImage( sal_Int16 aImageFormat, const ::com::sun::star::uno::Any& aImage ) throw (IllegalArgumentException, RuntimeException) { if (aImageFormat != ::com::sun::star::ui::dialogs::FilePreviewImageFormats::BITMAP) diff --git a/fpicker/source/win32/filepicker/previewbase.hxx b/fpicker/source/win32/filepicker/previewbase.hxx index d4b36a618c7f..b05e3fb3bfa7 100644 --- a/fpicker/source/win32/filepicker/previewbase.hxx +++ b/fpicker/source/win32/filepicker/previewbase.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -54,24 +54,24 @@ public: // dtor virtual ~PreviewBase(); - - virtual sal_Int32 SAL_CALL getTargetColorDepth() + + virtual sal_Int32 SAL_CALL getTargetColorDepth() throw (::com::sun::star::uno::RuntimeException); - virtual sal_Int32 SAL_CALL getAvailableWidth() + virtual sal_Int32 SAL_CALL getAvailableWidth() throw (::com::sun::star::uno::RuntimeException); - virtual sal_Int32 SAL_CALL getAvailableHeight() + virtual sal_Int32 SAL_CALL getAvailableHeight() throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setImage( sal_Int16 aImageFormat, const ::com::sun::star::uno::Any& aImage ) + virtual void SAL_CALL setImage( sal_Int16 aImageFormat, const ::com::sun::star::uno::Any& aImage ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); virtual sal_Bool SAL_CALL setShowState( sal_Bool bShowState ) throw (::com::sun::star::uno::RuntimeException); virtual sal_Bool SAL_CALL getShowState() - throw (::com::sun::star::uno::RuntimeException); + throw (::com::sun::star::uno::RuntimeException); virtual void SAL_CALL getImage(sal_Int16& aImageFormat,com::sun::star::uno::Any& aImage); @@ -81,8 +81,8 @@ public: protected: ::com::sun::star::uno::Any m_ImageData; - sal_Int16 m_ImageFormat; - sal_Bool m_bShowState; + sal_Int16 m_ImageFormat; + sal_Bool m_bShowState; }; diff --git a/fpicker/source/win32/filepicker/propmap.hxx b/fpicker/source/win32/filepicker/propmap.hxx index a37cfefd0fcd..2eed6fce1335 100644 --- a/fpicker/source/win32/filepicker/propmap.hxx +++ b/fpicker/source/win32/filepicker/propmap.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -41,11 +41,11 @@ typedef ::std::hash_map< ::rtl::OUString , class TPropMap { private: - + TPropMapBase m_aMap; public: - + template< class TValueType > void put(const ::rtl::OUString& sKey , const TValueType& rValue) @@ -53,15 +53,15 @@ class TPropMap void* pValue = (void*)&rValue; m_aMap[sKey] = pValue; } - + template< class TValueType > - void put_copy(const ::rtl::OUString& sKey , + void put_copy(const ::rtl::OUString& sKey , const TValueType& rValue) { TValueType* pCopy = new TValueType(rValue); m_aMap[sKey] = (void*)pCopy; } - + template< class TValueType > sal_Bool get(const ::rtl::OUString& sKey , TValueType** pValue) @@ -69,7 +69,7 @@ class TPropMap TPropMapBase::iterator pIt = m_aMap.find(sKey); if (pIt == m_aMap.end()) return sal_False; - + void* pItem = pIt->second; *pValue = (TValueType*)pItem; return (pItem != 0); @@ -82,17 +82,17 @@ class TPropMap TPropMapBase::iterator pIt = m_aMap.find(sKey); if (pIt == m_aMap.end()) return sal_False; - + void* pValue = pIt->second; if ( ! pValue) return sal_False; - + rValue = *((TValueType*)pValue); //delete pValue; m_aMap.erase(pIt); return sal_True; } - + void clear() { m_aMap.clear(); diff --git a/fpicker/source/win32/filepicker/resource.h b/fpicker/source/win32/filepicker/resource.h index f99ffe34cf5a..3a3f56b5c722 100644 --- a/fpicker/source/win32/filepicker/resource.h +++ b/fpicker/source/win32/filepicker/resource.h @@ -11,7 +11,7 @@ #define IDC_STATIC -1 // Next default values for new objects -// +// #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 119 diff --git a/fpicker/source/win32/filepicker/shared.hxx b/fpicker/source/win32/filepicker/shared.hxx index a1334518b17b..cfec9032f36d 100644 --- a/fpicker/source/win32/filepicker/shared.hxx +++ b/fpicker/source/win32/filepicker/shared.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -25,12 +25,12 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - + #ifndef FPICKER_WIN32_FILEPICKER_SHARED_HXX #define FPICKER_WIN32_FILEPICKER_SHARED_HXX - + #include <rtl/ustring.hxx> - + const ::rtl::OUString BACKSLASH = ::rtl::OUString::createFromAscii( "\\" ); const ::rtl::OUString FILTER_SEPARATOR = ::rtl::OUString::createFromAscii( "------------------------------------------" ); const ::rtl::OUString ALL_FILES_WILDCARD = ::rtl::OUString::createFromAscii( "*.*" ); diff --git a/fpicker/source/win32/filepicker/vistatypes.h b/fpicker/source/win32/filepicker/vistatypes.h index 08b4613f6d25..9237dbada227 100644 --- a/fpicker/source/win32/filepicker/vistatypes.h +++ b/fpicker/source/win32/filepicker/vistatypes.h @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/fpicker/source/win32/filepicker/workbench/Test_fps.cxx b/fpicker/source/win32/filepicker/workbench/Test_fps.cxx index 776268b6e2d2..ada72efb6eee 100644 --- a/fpicker/source/win32/filepicker/workbench/Test_fps.cxx +++ b/fpicker/source/win32/filepicker/workbench/Test_fps.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -31,14 +31,14 @@ //_________________________________________________________________________________________________________________________ -// interface includes +// interface includes //_________________________________________________________________________________________________________________________ #include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/registry/XSimpleRegistry.hpp> #include <osl/file.hxx> //_________________________________________________________________________________________________________________________ -// other includes +// other includes //_________________________________________________________________________________________________________________________ #include <cppuhelper/servicefactory.hxx> @@ -69,21 +69,21 @@ #include "..\FPServiceInfo.hxx" // -// namesapces +// namesapces // -using namespace ::rtl ; -using namespace ::cppu ; -using namespace ::com::sun::star::uno ; -using namespace ::com::sun::star::lang ; -using namespace ::com::sun::star::ui::dialogs ; +using namespace ::rtl ; +using namespace ::cppu ; +using namespace ::com::sun::star::uno ; +using namespace ::com::sun::star::lang ; +using namespace ::com::sun::star::ui::dialogs ; using namespace ::com::sun::star::ui::dialogs::TemplateDescription; using namespace ::com::sun::star::ui::dialogs::CommonFilePickerElementIds; using namespace ::com::sun::star::ui::dialogs::ExtendedFilePickerElementIds; using namespace ::com::sun::star::ui::dialogs::ListboxControlActions; -using namespace std ; +using namespace std ; // forward @@ -93,10 +93,10 @@ void TestFilterManager( Reference< XFilePicker > xFilePicker ); #define RDB_SYSPATH "D:\\Projects\\gsl\\sysui\\wntmsci7\\bin\\applicat.rdb" //_________________________________________________________________________________________________________________________ -// global variables +// global variables //_________________________________________________________________________________________________________________________ -Reference< XMultiServiceFactory > g_xFactory; +Reference< XMultiServiceFactory > g_xFactory; const OUString BMP_EXTENSION = OUString::createFromAscii( "bmp" ); @@ -109,32 +109,32 @@ class FilePickerListener : public WeakImplHelper1< XFilePickerListener > public: // XEventListener - virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) + virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException); // XFilePickerListener - virtual void SAL_CALL fileSelectionChanged( const ::com::sun::star::ui::dialogs::FilePickerEvent& aEvent ) + virtual void SAL_CALL fileSelectionChanged( const ::com::sun::star::ui::dialogs::FilePickerEvent& aEvent ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL directoryChanged( const ::com::sun::star::ui::dialogs::FilePickerEvent& aEvent ) + virtual void SAL_CALL directoryChanged( const ::com::sun::star::ui::dialogs::FilePickerEvent& aEvent ) throw(::com::sun::star::uno::RuntimeException); - virtual OUString SAL_CALL helpRequested( const ::com::sun::star::ui::dialogs::FilePickerEvent& aEvent ) + virtual OUString SAL_CALL helpRequested( const ::com::sun::star::ui::dialogs::FilePickerEvent& aEvent ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL controlStateChanged( const ::com::sun::star::ui::dialogs::FilePickerEvent& aEvent ) + virtual void SAL_CALL controlStateChanged( const ::com::sun::star::ui::dialogs::FilePickerEvent& aEvent ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL dialogSizeChanged( ) + virtual void SAL_CALL dialogSizeChanged( ) throw (::com::sun::star::uno::RuntimeException); }; -void SAL_CALL FilePickerListener::disposing( const ::com::sun::star::lang::EventObject& Source ) +void SAL_CALL FilePickerListener::disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { } -void SAL_CALL FilePickerListener::fileSelectionChanged( const ::com::sun::star::ui::dialogs::FilePickerEvent& aEvent ) +void SAL_CALL FilePickerListener::fileSelectionChanged( const ::com::sun::star::ui::dialogs::FilePickerEvent& aEvent ) throw(::com::sun::star::uno::RuntimeException) { try @@ -153,13 +153,13 @@ void SAL_CALL FilePickerListener::fileSelectionChanged( const ::com::sun::star:: // detect file extension sal_Int32 nIndex = FilePath.lastIndexOf( BMP_EXTENSION ); if ( (FilePath.getLength( ) - 3) == nIndex ) - { + { OUString FileSysPath; - ::osl::FileBase::getSystemPathFromFileURL( + ::osl::FileBase::getSystemPathFromFileURL( FilePath, FileSysPath ); HANDLE hFile = CreateFileW( - FileSysPath.getStr( ), + FileSysPath.getStr( ), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL) ; @@ -176,25 +176,25 @@ void SAL_CALL FilePickerListener::fileSelectionChanged( const ::com::sun::star:: } Sequence< sal_Int8 > aDIB( dwFileSize ); - + DWORD dwBytesRead; BOOL bSuccess = ReadFile (hFile, aDIB.getArray( ), dwFileSize, &dwBytesRead, NULL) ; CloseHandle (hFile); BITMAPFILEHEADER* pbmfh = (BITMAPFILEHEADER*)aDIB.getConstArray( ); - if (!bSuccess || (dwBytesRead != dwFileSize) - || (pbmfh->bfType != * (WORD *) "BM") + if (!bSuccess || (dwBytesRead != dwFileSize) + || (pbmfh->bfType != * (WORD *) "BM") || (pbmfh->bfSize != dwFileSize)) { return; } - + Any aAny; aAny <<= aDIB; - rXFilePreview->setImage( 1, aAny ); + rXFilePreview->setImage( 1, aAny ); } - } + } } catch( IllegalArgumentException& ex ) { @@ -202,27 +202,27 @@ void SAL_CALL FilePickerListener::fileSelectionChanged( const ::com::sun::star:: } } -void SAL_CALL FilePickerListener::directoryChanged( const ::com::sun::star::ui::dialogs::FilePickerEvent& aEvent ) +void SAL_CALL FilePickerListener::directoryChanged( const ::com::sun::star::ui::dialogs::FilePickerEvent& aEvent ) throw(::com::sun::star::uno::RuntimeException) { Reference< XFilePickerControlAccess > rFilePickerCtrlAccess( aEvent.Source, UNO_QUERY ); } -OUString SAL_CALL FilePickerListener::helpRequested( const ::com::sun::star::ui::dialogs::FilePickerEvent& aEvent ) +OUString SAL_CALL FilePickerListener::helpRequested( const ::com::sun::star::ui::dialogs::FilePickerEvent& aEvent ) throw(::com::sun::star::uno::RuntimeException) { return OUString( ); } -void SAL_CALL FilePickerListener::controlStateChanged( const ::com::sun::star::ui::dialogs::FilePickerEvent& aEvent ) +void SAL_CALL FilePickerListener::controlStateChanged( const ::com::sun::star::ui::dialogs::FilePickerEvent& aEvent ) throw(::com::sun::star::uno::RuntimeException) { try - { + { Reference< XFilePickerControlAccess > rFPCtrlAccess( aEvent.Source, UNO_QUERY ); Any aValue; - + OUString lbString( L"Ein Eintrag 1" ); aValue <<= lbString; rFPCtrlAccess->setValue( LISTBOX_VERSION, ADD_ITEM, aValue ); @@ -234,14 +234,14 @@ void SAL_CALL FilePickerListener::controlStateChanged( const ::com::sun::star::u lbString = OUString( L"Ein Eintrag 3" ); aValue <<= lbString; rFPCtrlAccess->setValue( LISTBOX_VERSION, ADD_ITEM, aValue ); - + sal_Int16 nSel = 1; aValue <<= nSel; - rFPCtrlAccess->setValue( LISTBOX_VERSION, SET_SELECT_ITEM, aValue ); + rFPCtrlAccess->setValue( LISTBOX_VERSION, SET_SELECT_ITEM, aValue ); sal_Int32 nDel = 0; aValue <<= nDel; - rFPCtrlAccess->setValue( LISTBOX_VERSION, DELETE_ITEM, aValue ); + rFPCtrlAccess->setValue( LISTBOX_VERSION, DELETE_ITEM, aValue ); } catch( ... ) { @@ -254,11 +254,11 @@ void SAL_CALL FilePickerListener::dialogSizeChanged( ) } //-------------------------------------------------------- -// main +// main //-------------------------------------------------------- -int SAL_CALL main(int nArgc, char* Argv[], char* Env[] ) +int SAL_CALL main(int nArgc, char* Argv[], char* Env[] ) { printf("Starting test of FPS-Service\n"); @@ -281,7 +281,7 @@ int SAL_CALL main(int nArgc, char* Argv[], char* Env[] ) // try to get an Interface to a XFilePicker Service //------------------------------------------------- - Sequence< Any > arguments(1); + Sequence< Any > arguments(1); //arguments[0] = makeAny( FILEOPEN_SIMPLE ); //arguments[0] = makeAny( FILESAVE_SIMPLE ); //arguments[0] = makeAny( FILESAVE_AUTOEXTENSION_PASSWORD ); @@ -292,12 +292,12 @@ int SAL_CALL main(int nArgc, char* Argv[], char* Env[] ) //arguments[0] = makeAny( FILEOPEN_PLAY ); arguments[0] = makeAny( FILEOPEN_READONLY_VERSION ); - Reference< XFilePicker > xFilePicker = Reference< XFilePicker >( - g_xFactory->createInstanceWithArguments( + Reference< XFilePicker > xFilePicker = Reference< XFilePicker >( + g_xFactory->createInstanceWithArguments( OUString::createFromAscii( FILE_PICKER_SERVICE_NAME ), arguments ), UNO_QUERY ); // install a FilePicker notifier - Reference< XFilePickerListener > xFPListener( + Reference< XFilePickerListener > xFPListener( static_cast< XFilePickerListener* >( new FilePickerListener()), UNO_QUERY ); Reference< XFilePickerNotifier > xFPNotifier( xFilePicker, UNO_QUERY ); @@ -307,7 +307,7 @@ int SAL_CALL main(int nArgc, char* Argv[], char* Env[] ) xFilePicker->setTitle( OUString::createFromAscii("FileOpen Simple...")); xFilePicker->setMultiSelectionMode( sal_True ); xFilePicker->setDefaultName( OUString::createFromAscii("d:\\test2.sxw")); - + OUString aDirURL; OUString aSysPath = OStringToOUString( "d:\\ueaeoe", osl_getThreadTextEncoding( ) ); ::osl::FileBase::getFileURLFromSystemPath( aSysPath, aDirURL ); @@ -319,17 +319,17 @@ int SAL_CALL main(int nArgc, char* Argv[], char* Env[] ) xFilterMgr->appendFilter( L"Alle", L"*.*" ); xFilterMgr->appendFilter( L"BMP", L"*.bmp" ); xFilterMgr->appendFilter( L"SDW", L"*.sdw;*.sdc;*.sdi" ); - xFilterMgr->appendFilter( L"SXW", L"*.sxw;*.sxi" ); + xFilterMgr->appendFilter( L"SXW", L"*.sxw;*.sxi" ); } Reference< XFilePickerControlAccess > xFPControlAccess( xFilePicker, UNO_QUERY ); - + Any aAny; sal_Bool bChkState = sal_False; aAny.setValue( &bChkState, getCppuType( (sal_Bool*)0 ) ); xFPControlAccess->setValue( CHECKBOX_AUTOEXTENSION, 0, aAny ); - + OUString aVersion( L"Version 1" ); aAny <<= aVersion; xFPControlAccess->setValue( LISTBOX_VERSION, ADD_ITEM, aAny ); |