From 432e3162e6cf4e90137699d45934b5db56a89aaf Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 14 Oct 2016 16:55:19 +0200 Subject: clang-cl loplugin: fpicker Change-Id: Ib19175affd48610fc164a996d609b369256d4f72 Reviewed-on: https://gerrit.libreoffice.org/29865 Reviewed-by: Stephan Bergmann Tested-by: Stephan Bergmann --- fpicker/source/win32/filepicker/FPentry.cxx | 6 +- fpicker/source/win32/filepicker/FileOpenDlg.cxx | 26 ++--- fpicker/source/win32/filepicker/FileOpenDlg.hxx | 24 ++-- fpicker/source/win32/filepicker/FilePicker.cxx | 66 +++++------ fpicker/source/win32/filepicker/FilePicker.hxx | 62 +++++----- .../source/win32/filepicker/FilterContainer.cxx | 50 ++++---- .../source/win32/filepicker/FilterContainer.hxx | 14 +-- .../source/win32/filepicker/VistaFilePicker.cxx | 34 +++--- .../source/win32/filepicker/VistaFilePicker.hxx | 64 +++++----- .../filepicker/VistaFilePickerEventHandler.cxx | 20 ++-- .../filepicker/VistaFilePickerEventHandler.hxx | 28 ++--- .../win32/filepicker/VistaFilePickerImpl.cxx | 58 +++++---- .../win32/filepicker/VistaFilePickerImpl.hxx | 18 +-- .../source/win32/filepicker/WinFileOpenImpl.cxx | 46 ++++---- .../source/win32/filepicker/WinFileOpenImpl.hxx | 42 +++---- .../source/win32/filepicker/asynceventnotifier.cxx | 22 ++-- fpicker/source/win32/filepicker/asyncrequests.cxx | 20 ++-- fpicker/source/win32/filepicker/asyncrequests.hxx | 6 +- fpicker/source/win32/filepicker/comptr.hxx | 14 +-- fpicker/source/win32/filepicker/controlaccess.cxx | 44 +++---- fpicker/source/win32/filepicker/controlcommand.cxx | 8 +- fpicker/source/win32/filepicker/controlcommand.hxx | 14 +-- .../win32/filepicker/controlcommandresult.hxx | 10 +- .../win32/filepicker/customcontrolcontainer.hxx | 12 +- .../win32/filepicker/dialogcustomcontrols.cxx | 4 +- .../win32/filepicker/dialogcustomcontrols.hxx | 14 +-- fpicker/source/win32/filepicker/dibpreview.cxx | 40 +++---- fpicker/source/win32/filepicker/dibpreview.hxx | 22 ++-- .../filepicker/filepickereventnotification.hxx | 4 +- .../source/win32/filepicker/filepickerstate.cxx | 18 +-- .../source/win32/filepicker/filepickerstate.hxx | 40 +++---- .../source/win32/filepicker/getfilenamewrapper.cxx | 20 ++-- .../source/win32/filepicker/helppopupwindow.cxx | 36 +++--- .../source/win32/filepicker/helppopupwindow.hxx | 2 +- fpicker/source/win32/filepicker/previewadapter.cxx | 38 +++--- fpicker/source/win32/filepicker/previewadapter.hxx | 6 +- fpicker/source/win32/filepicker/previewbase.cxx | 18 +-- fpicker/source/win32/filepicker/previewbase.hxx | 8 +- fpicker/source/win32/filepicker/shared.hxx | 2 +- fpicker/source/win32/folderpicker/FolderPicker.hxx | 20 ++-- fpicker/source/win32/folderpicker/MtaFop.cxx | 130 ++++++++++----------- fpicker/source/win32/folderpicker/MtaFop.hxx | 14 +-- fpicker/source/win32/folderpicker/WinFOPImpl.hxx | 8 +- fpicker/source/win32/misc/WinImplHelper.cxx | 8 +- fpicker/source/win32/misc/WinImplHelper.hxx | 2 +- fpicker/source/win32/misc/resourceprovider.cxx | 4 +- 46 files changed, 582 insertions(+), 584 deletions(-) (limited to 'fpicker') diff --git a/fpicker/source/win32/filepicker/FPentry.cxx b/fpicker/source/win32/filepicker/FPentry.cxx index 665007c47006..c21317207003 100644 --- a/fpicker/source/win32/filepicker/FPentry.cxx +++ b/fpicker/source/win32/filepicker/FPentry.cxx @@ -80,14 +80,14 @@ extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL fps_win32_component_getFactory( const sal_Char* pImplName, void* pSrvManager, void* ) { - void* pRet = 0; + void* pRet = nullptr; if ( pSrvManager && ( 0 == rtl_str_compare( pImplName, FILE_PICKER_IMPL_NAME ) ) ) { Sequence aSNS { FILE_PICKER_SERVICE_NAME }; Reference< XSingleServiceFactory > xFactory ( createSingleFactory( - reinterpret_cast< XMultiServiceFactory* > ( pSrvManager ), + static_cast< XMultiServiceFactory* > ( pSrvManager ), OUString::createFromAscii( pImplName ), createInstance, aSNS ) ); @@ -103,7 +103,7 @@ SAL_DLLPUBLIC_EXPORT void* SAL_CALL fps_win32_component_getFactory( Sequence aSNS { FOLDER_PICKER_SERVICE_NAME }; Reference< XSingleServiceFactory > xFactory ( createSingleFactory( - reinterpret_cast< XMultiServiceFactory* > ( pSrvManager ), + static_cast< XMultiServiceFactory* > ( pSrvManager ), OUString::createFromAscii( pImplName ), createInstance_fop, aSNS ) ); diff --git a/fpicker/source/win32/filepicker/FileOpenDlg.cxx b/fpicker/source/win32/filepicker/FileOpenDlg.cxx index 5f5e4a839028..8d4537c7dcc8 100644 --- a/fpicker/source/win32/filepicker/FileOpenDlg.cxx +++ b/fpicker/source/win32/filepicker/FileOpenDlg.cxx @@ -70,14 +70,14 @@ CFileOpenDialog::CFileOpenDialog( sal_uInt32 dwFlags, sal_uInt32 dwTemplateId, HINSTANCE hInstance) : - m_hwndFileOpenDlg(0), - m_hwndFileOpenDlgChild(0), + m_hwndFileOpenDlg(nullptr), + m_hwndFileOpenDlgChild(nullptr), 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_pfnBaseDlgProc(0) + m_pfnBaseDlgProc(nullptr) { // initialize the OPENFILENAME struct ZeroMemory(&m_ofn, sizeof(m_ofn)); @@ -151,7 +151,7 @@ bool CFileOpenDialog::setFilterIndex(sal_uInt32 aIndex) { OSL_ASSERT(aIndex > 0); m_ofn.nFilterIndex = aIndex; - return sal_True; + return true; } @@ -185,7 +185,7 @@ OUString SAL_CALL CFileOpenDialog::getLastDisplayDirectory() const OUString SAL_CALL CFileOpenDialog::getFullFileName() const { return OUString(m_fileNameBuffer.getStr(), - _wcslenex(m_fileNameBuffer.getStr())); + wcslenex(m_fileNameBuffer.getStr())); } @@ -256,7 +256,7 @@ sal_Int16 SAL_CALL CFileOpenDialog::doModal() } -sal_uInt32 SAL_CALL CFileOpenDialog::getLastDialogError() const +sal_uInt32 SAL_CALL CFileOpenDialog::getLastDialogError() { return CommDlgExtendedError(); } @@ -264,7 +264,7 @@ sal_uInt32 SAL_CALL CFileOpenDialog::getLastDialogError() const bool SAL_CALL CFileOpenDialog::preModal() { - return sal_True; + return true; } @@ -435,13 +435,13 @@ UINT_PTR CALLBACK CFileOpenDialog::ofnHookProc( HWND hChildDlg, UINT uiMsg, WPARAM wParam, LPARAM lParam) { HWND hwndDlg = GetParent(hChildDlg); - CFileOpenDialog* pImpl = NULL; + CFileOpenDialog* pImpl = nullptr; switch( uiMsg ) { case WM_INITDIALOG: { - _LPOPENFILENAME lpofn = reinterpret_cast<_LPOPENFILENAME>(lParam); + LPOPENFILENAME_ lpofn = reinterpret_cast(lParam); pImpl = reinterpret_cast(lpofn->lCustData); OSL_ASSERT(pImpl); @@ -482,11 +482,11 @@ UINT_PTR CALLBACK CFileOpenDialog::ofnHookProc( LRESULT CALLBACK CFileOpenDialog::BaseDlgProc( HWND hWnd, UINT wMessage, WPARAM wParam, LPARAM lParam) { - CFileOpenDialog* pImpl = 0; + CFileOpenDialog* pImpl = nullptr; if (WM_NCDESTROY == wMessage) { - pImpl = reinterpret_cast( + pImpl = static_cast( RemovePropW(hWnd,CURRENT_INSTANCE)); SetWindowLongPtr(hWnd, GWLP_WNDPROC, @@ -508,7 +508,7 @@ LRESULT CALLBACK CFileOpenDialog::BaseDlgProc( CFileOpenDialog* SAL_CALL CFileOpenDialog::getCurrentInstance(HWND hwnd) { OSL_ASSERT(IsWindow( hwnd)); - return reinterpret_cast( + return static_cast( GetPropW(hwnd, CURRENT_INSTANCE)); } @@ -555,7 +555,7 @@ void SAL_CALL CFileOpenDialog::centerPositionToParent() const SetWindowPos( m_hwndFileOpenDlg, - NULL, x, y, 0, 0, + nullptr, x, y, 0, 0, SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSIZE ); } diff --git a/fpicker/source/win32/filepicker/FileOpenDlg.hxx b/fpicker/source/win32/filepicker/FileOpenDlg.hxx index d3d09d5f1e34..36e38e6f1df0 100644 --- a/fpicker/source/win32/filepicker/FileOpenDlg.hxx +++ b/fpicker/source/win32/filepicker/FileOpenDlg.hxx @@ -32,7 +32,7 @@ // into our build environment if have stolen the definition // for the new OPENFILENAME structure from the new headers -typedef struct _tagOFNA { +typedef struct { DWORD lStructSize; HWND hwndOwner; HINSTANCE hInstance; @@ -60,9 +60,9 @@ typedef struct _tagOFNA { void * pvReserved; DWORD dwReserved; DWORD FlagsEx; -} _OPENFILENAMEA, *_LPOPENFILENAMEA; +} OPENFILENAMEA_, *LPOPENFILENAMEA_; -typedef struct _tagOFNW { +typedef struct { DWORD lStructSize; HWND hwndOwner; HINSTANCE hInstance; @@ -86,14 +86,14 @@ typedef struct _tagOFNW { void * pvReserved; DWORD dwReserved; DWORD FlagsEx; -} _OPENFILENAMEW, *_LPOPENFILENAMEW; +} OPENFILENAMEW_, *LPOPENFILENAMEW_; #ifdef UNICODE -typedef _OPENFILENAMEW _OPENFILENAME; -typedef _LPOPENFILENAMEW _LPOPENFILENAME; +typedef OPENFILENAMEW_ OPENFILENAME_; +typedef LPOPENFILENAMEW_ LPOPENFILENAME_; #else -typedef _OPENFILENAMEA _OPENFILENAME; -typedef _LPOPENFILENAMEA _LPOPENFILENAME; +typedef OPENFILENAMEA_ OPENFILENAME_; +typedef LPOPENFILENAMEA_ LPOPENFILENAME_; #endif // UNICODE // A simple wrapper class around the Win32 GetOpenFileName API. @@ -113,10 +113,10 @@ public: // which provides the custom template, unused if dwTemplateId // is 0 CFileOpenDialog( - bool bFileOpenDialog = sal_True, + bool bFileOpenDialog = true, sal_uInt32 dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, sal_uInt32 dwTemplateId = 0, - HINSTANCE hInstance = 0); + HINSTANCE hInstance = nullptr); virtual ~CFileOpenDialog(); @@ -181,7 +181,7 @@ public: sal_Int16 SAL_CALL doModal(); // returns the last dialog error that occurred - sal_uInt32 SAL_CALL getLastDialogError() const; + static sal_uInt32 SAL_CALL getLastDialogError(); // retrievs the currently selected file // including path and drive information @@ -242,7 +242,7 @@ protected: HWND m_hwndFileOpenDlg; HWND m_hwndFileOpenDlgChild; - _OPENFILENAME m_ofn; + OPENFILENAME_ m_ofn; // we connect the instance with the dialog window using // SetProp, with this function we can reconnect from diff --git a/fpicker/source/win32/filepicker/FilePicker.cxx b/fpicker/source/win32/filepicker/FilePicker.cxx index 4acf64f0bc00..bc8ab0821708 100644 --- a/fpicker/source/win32/filepicker/FilePicker.cxx +++ b/fpicker/source/win32/filepicker/FilePicker.cxx @@ -201,14 +201,14 @@ void CFilePicker::resumeEventNotification() void SAL_CALL CFilePicker::setMultiSelectionMode(sal_Bool bMode) throw(uno::RuntimeException) { - OSL_ASSERT(0 != m_pImpl.get()); + OSL_ASSERT(nullptr != m_pImpl.get()); osl::MutexGuard aGuard(m_aMutex); m_pImpl->setMultiSelectionMode(bMode); } void SAL_CALL CFilePicker::setTitle(const OUString& aTitle) throw(uno::RuntimeException) { - OSL_ASSERT(0 != m_pImpl.get()); + OSL_ASSERT(nullptr != m_pImpl.get()); osl::MutexGuard aGuard(m_aMutex); m_pImpl->setTitle(aTitle); } @@ -216,7 +216,7 @@ void SAL_CALL CFilePicker::setTitle(const OUString& aTitle) throw(uno::RuntimeEx void SAL_CALL CFilePicker::appendFilter(const OUString& aTitle, const OUString& aFilter) throw(lang::IllegalArgumentException, uno::RuntimeException) { - OSL_ASSERT(0 != m_pImpl.get()); + OSL_ASSERT(nullptr != m_pImpl.get()); osl::MutexGuard aGuard(m_aMutex); m_pImpl->appendFilter(aTitle, aFilter); } @@ -224,14 +224,14 @@ void SAL_CALL CFilePicker::appendFilter(const OUString& aTitle, const OUString& void SAL_CALL CFilePicker::setCurrentFilter(const OUString& aTitle) throw(lang::IllegalArgumentException, uno::RuntimeException) { - OSL_ASSERT(0 != m_pImpl.get()); + OSL_ASSERT(nullptr != m_pImpl.get()); osl::MutexGuard aGuard(m_aMutex); m_pImpl->setCurrentFilter(aTitle); } OUString SAL_CALL CFilePicker::getCurrentFilter() throw(uno::RuntimeException) { - OSL_ASSERT(0 != m_pImpl.get()); + OSL_ASSERT(nullptr != m_pImpl.get()); osl::MutexGuard aGuard(m_aMutex); return m_pImpl->getCurrentFilter(); } @@ -239,7 +239,7 @@ OUString SAL_CALL CFilePicker::getCurrentFilter() throw(uno::RuntimeException) void SAL_CALL CFilePicker::appendFilterGroup(const OUString& sGroupTitle, const uno::Sequence& aFilters) throw (lang::IllegalArgumentException, uno::RuntimeException) { - OSL_ASSERT(0 != m_pImpl.get()); + OSL_ASSERT(nullptr != m_pImpl.get()); osl::MutexGuard aGuard(m_aMutex); m_pImpl->appendFilterGroup(sGroupTitle, aFilters); } @@ -247,7 +247,7 @@ void SAL_CALL CFilePicker::appendFilterGroup(const OUString& sGroupTitle, const void SAL_CALL CFilePicker::setDefaultName(const OUString& aName) throw(uno::RuntimeException) { - OSL_ASSERT(0 != m_pImpl.get()); + OSL_ASSERT(nullptr != m_pImpl.get()); osl::MutexGuard aGuard(m_aMutex); m_pImpl->setDefaultName(aName); } @@ -255,28 +255,28 @@ void SAL_CALL CFilePicker::setDefaultName(const OUString& aName) void SAL_CALL CFilePicker::setDisplayDirectory(const OUString& aDirectory) throw(lang::IllegalArgumentException, uno::RuntimeException) { - OSL_ASSERT(0 != m_pImpl.get()); + OSL_ASSERT(nullptr != m_pImpl.get()); osl::MutexGuard aGuard(m_aMutex); m_pImpl->setDisplayDirectory(aDirectory); } OUString SAL_CALL CFilePicker::getDisplayDirectory() throw(uno::RuntimeException) { - OSL_ASSERT(0 != m_pImpl.get()); + OSL_ASSERT(nullptr != m_pImpl.get()); osl::MutexGuard aGuard(m_aMutex); return m_pImpl->getDisplayDirectory(); } uno::Sequence SAL_CALL CFilePicker::getFiles() throw(uno::RuntimeException) { - OSL_ASSERT(0 != m_pImpl.get()); + OSL_ASSERT(nullptr != m_pImpl.get()); osl::MutexGuard aGuard(m_aMutex); return m_pImpl->getFiles(); } uno::Sequence< OUString > SAL_CALL CFilePicker::getSelectedFiles() throw (uno::RuntimeException, std::exception) { - OSL_ASSERT(0 != m_pImpl.get()); + OSL_ASSERT(nullptr != m_pImpl.get()); osl::MutexGuard aGuard(m_aMutex); const uno::Sequence< OUString > lSource = m_pImpl->getFiles(); @@ -301,7 +301,7 @@ uno::Sequence< OUString > SAL_CALL CFilePicker::getSelectedFiles() throw (uno::R OUStringBuffer sFull(256); sFull.append (sPath); - sFull.appendAscii("/" ); + sFull.append("/" ); sFull.append (sFile); lTarget.push_back(sFull.makeStringAndClear()); @@ -313,7 +313,7 @@ uno::Sequence< OUString > SAL_CALL CFilePicker::getSelectedFiles() throw (uno::R sal_Int16 SAL_CALL CFilePicker::execute() throw(uno::RuntimeException) { - OSL_ASSERT(0 != m_pImpl.get()); + OSL_ASSERT(nullptr != m_pImpl.get()); sal_Int16 ret; @@ -342,7 +342,7 @@ sal_Int16 SAL_CALL CFilePicker::execute() throw(uno::RuntimeException) 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_ASSERT(nullptr != m_pImpl.get()); osl::MutexGuard aGuard(m_aMutex); m_pImpl->setValue(aControlId, aControlAction, aValue); @@ -351,7 +351,7 @@ void SAL_CALL CFilePicker::setValue(sal_Int16 aControlId, sal_Int16 aControlActi uno::Any SAL_CALL CFilePicker::getValue(sal_Int16 aControlId, sal_Int16 aControlAction) throw(uno::RuntimeException) { - OSL_ASSERT(0 != m_pImpl.get()); + OSL_ASSERT(nullptr != m_pImpl.get()); osl::MutexGuard aGuard(m_aMutex); return m_pImpl->getValue(aControlId, aControlAction); @@ -360,7 +360,7 @@ uno::Any SAL_CALL CFilePicker::getValue(sal_Int16 aControlId, sal_Int16 aControl void SAL_CALL CFilePicker::enableControl(sal_Int16 aControlId, sal_Bool bEnable) throw(uno::RuntimeException) { - OSL_ASSERT( 0 != m_pImpl.get( ) ); + OSL_ASSERT( nullptr != m_pImpl.get( ) ); osl::MutexGuard aGuard( m_aMutex ); m_pImpl->enableControl( aControlId, bEnable ); @@ -369,7 +369,7 @@ throw(uno::RuntimeException) void SAL_CALL CFilePicker::setLabel(sal_Int16 aControlId, const OUString& aLabel) throw (uno::RuntimeException) { - OSL_ASSERT(0 != m_pImpl.get()); + OSL_ASSERT(nullptr != m_pImpl.get()); osl::MutexGuard aGuard(m_aMutex); m_pImpl->setLabel(aControlId, aLabel); @@ -378,7 +378,7 @@ void SAL_CALL CFilePicker::setLabel(sal_Int16 aControlId, const OUString& aLabel OUString SAL_CALL CFilePicker::getLabel(sal_Int16 aControlId) throw (uno::RuntimeException) { - OSL_ASSERT(0 != m_pImpl.get()); + OSL_ASSERT(nullptr != m_pImpl.get()); osl::MutexGuard aGuard(m_aMutex); return m_pImpl->getLabel(aControlId); @@ -386,7 +386,7 @@ OUString SAL_CALL CFilePicker::getLabel(sal_Int16 aControlId) uno::Sequence SAL_CALL CFilePicker::getSupportedImageFormats() throw (uno::RuntimeException) { - OSL_ASSERT(0 != m_pImpl.get()); + OSL_ASSERT(nullptr != m_pImpl.get()); osl::MutexGuard aGuard(m_aMutex); return m_pImpl->getSupportedImageFormats(); @@ -394,7 +394,7 @@ uno::Sequence SAL_CALL CFilePicker::getSupportedImageFormats() throw sal_Int32 SAL_CALL CFilePicker::getTargetColorDepth() throw (uno::RuntimeException) { - OSL_ASSERT(0 != m_pImpl.get()); + OSL_ASSERT(nullptr != m_pImpl.get()); osl::MutexGuard aGuard(m_aMutex); return m_pImpl->getTargetColorDepth(); @@ -402,7 +402,7 @@ sal_Int32 SAL_CALL CFilePicker::getTargetColorDepth() throw (uno::RuntimeExcepti sal_Int32 SAL_CALL CFilePicker::getAvailableWidth() throw (uno::RuntimeException) { - OSL_ASSERT(0 != m_pImpl.get()); + OSL_ASSERT(nullptr != m_pImpl.get()); osl::MutexGuard aGuard(m_aMutex); return m_pImpl->getAvailableWidth(); @@ -410,7 +410,7 @@ sal_Int32 SAL_CALL CFilePicker::getAvailableWidth() throw (uno::RuntimeException sal_Int32 SAL_CALL CFilePicker::getAvailableHeight() throw (uno::RuntimeException) { - OSL_ASSERT(0 != m_pImpl.get()); + OSL_ASSERT(nullptr != m_pImpl.get()); osl::MutexGuard aGuard(m_aMutex); return m_pImpl->getAvailableHeight(); @@ -419,7 +419,7 @@ sal_Int32 SAL_CALL CFilePicker::getAvailableHeight() throw (uno::RuntimeExceptio void SAL_CALL CFilePicker::setImage(sal_Int16 aImageFormat, const uno::Any& aImage) throw (lang::IllegalArgumentException, uno::RuntimeException) { - OSL_ASSERT(0 != m_pImpl.get()); + OSL_ASSERT(nullptr != m_pImpl.get()); osl::MutexGuard aGuard(m_aMutex); m_pImpl->setImage(aImageFormat, aImage); @@ -427,7 +427,7 @@ 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_ASSERT(nullptr != m_pImpl.get()); osl::MutexGuard aGuard(m_aMutex); return m_pImpl->setShowState(bShowState); @@ -435,7 +435,7 @@ sal_Bool SAL_CALL CFilePicker::setShowState(sal_Bool bShowState) throw (uno::Run sal_Bool SAL_CALL CFilePicker::getShowState() throw (uno::RuntimeException) { - OSL_ASSERT(0 != m_pImpl.get()); + OSL_ASSERT(nullptr != m_pImpl.get()); osl::MutexGuard aGuard(m_aMutex); return m_pImpl->getShowState(); @@ -462,36 +462,36 @@ void SAL_CALL CFilePicker::initialize(const uno::Sequence& aArguments) sal_Int16 templateId = -1; aAny >>= templateId; - sal_Bool bFileOpenDialog = sal_True; + bool bFileOpenDialog = true; sal_uInt32 winResTemplateId = 0; switch ( templateId ) { case FILEOPEN_SIMPLE: - bFileOpenDialog = sal_True; + bFileOpenDialog = true; break; case FILESAVE_SIMPLE: - bFileOpenDialog = sal_False; + bFileOpenDialog = false; break; case FILESAVE_AUTOEXTENSION_PASSWORD: - bFileOpenDialog = sal_False; + bFileOpenDialog = false; winResTemplateId = TMPL2000_FILESAVE_AUTOEXT_PASSWORD_BOX_ID; break; case FILESAVE_AUTOEXTENSION_PASSWORD_FILTEROPTIONS: - bFileOpenDialog = sal_False; + bFileOpenDialog = false; winResTemplateId = TMPL2000_AUTOEXT_PASSWORD_FILTEROPTION_BOX; break; case FILESAVE_AUTOEXTENSION_SELECTION: - bFileOpenDialog = sal_False; + bFileOpenDialog = false; winResTemplateId = TMPL2000_AUTOEXT_SELECTION_BOX; break; case FILESAVE_AUTOEXTENSION_TEMPLATE: - bFileOpenDialog = sal_False; + bFileOpenDialog = false; winResTemplateId = TMPL2000_FILEOPEN_AUTOEXT_TEMPLATE_BOX_ID; break; @@ -514,7 +514,7 @@ void SAL_CALL CFilePicker::initialize(const uno::Sequence& aArguments) break; case FILESAVE_AUTOEXTENSION: - bFileOpenDialog = sal_False; + bFileOpenDialog = false; winResTemplateId = TMPL2000_FILESAVE_AUTOEXT; break; diff --git a/fpicker/source/win32/filepicker/FilePicker.hxx b/fpicker/source/win32/filepicker/FilePicker.hxx index 63029ef4bbf5..aa4d12e25d56 100644 --- a/fpicker/source/win32/filepicker/FilePicker.hxx +++ b/fpicker/source/win32/filepicker/FilePicker.hxx @@ -63,98 +63,98 @@ public: // XFilePickerNotifier virtual void SAL_CALL addFilePickerListener( const css::uno::Reference< css::ui::dialogs::XFilePickerListener >& xListener ) - throw( css::uno::RuntimeException ); + throw( css::uno::RuntimeException ) override; virtual void SAL_CALL removeFilePickerListener( const css::uno::Reference< css::ui::dialogs::XFilePickerListener >& xListener ) - throw( css::uno::RuntimeException ); + throw( css::uno::RuntimeException ) override; // XExecutableDialog functions virtual void SAL_CALL setTitle( const OUString& aTitle ) - throw( css::uno::RuntimeException ); + throw( css::uno::RuntimeException ) override; virtual sal_Int16 SAL_CALL execute( ) - throw( css::uno::RuntimeException ); + throw( css::uno::RuntimeException ) override; // XFilePicker functions virtual void SAL_CALL setMultiSelectionMode( sal_Bool bMode ) - throw( css::uno::RuntimeException ); + throw( css::uno::RuntimeException ) override; virtual void SAL_CALL setDefaultName( const OUString& aName ) - throw( css::uno::RuntimeException ); + throw( css::uno::RuntimeException ) override; virtual void SAL_CALL setDisplayDirectory( const OUString& aDirectory ) - throw( css::lang::IllegalArgumentException, css::uno::RuntimeException ); + throw( css::lang::IllegalArgumentException, css::uno::RuntimeException ) override; virtual OUString SAL_CALL getDisplayDirectory( ) - throw( css::uno::RuntimeException ); + throw( css::uno::RuntimeException ) override; virtual css::uno::Sequence< OUString > SAL_CALL getFiles( ) - throw( css::uno::RuntimeException ); + throw( css::uno::RuntimeException ) override; // XFilePicker2 functions virtual css::uno::Sequence< OUString > SAL_CALL getSelectedFiles( ) - throw (css::uno::RuntimeException, std::exception); + throw (css::uno::RuntimeException, std::exception) override; // XFilterManager functions virtual void SAL_CALL appendFilter( const OUString& aTitle, const OUString& aFilter ) - throw( css::lang::IllegalArgumentException, css::uno::RuntimeException ); + throw( css::lang::IllegalArgumentException, css::uno::RuntimeException ) override; virtual void SAL_CALL setCurrentFilter( const OUString& aTitle ) - throw( css::lang::IllegalArgumentException, css::uno::RuntimeException ); + throw( css::lang::IllegalArgumentException, css::uno::RuntimeException ) override; virtual OUString SAL_CALL getCurrentFilter( ) - throw( css::uno::RuntimeException ); + throw( css::uno::RuntimeException ) override; // XFilterGroupManager functions virtual void SAL_CALL appendFilterGroup( const OUString& sGroupTitle, const css::uno::Sequence< css::beans::StringPair >& aFilters ) - throw (css::lang::IllegalArgumentException, css::uno::RuntimeException); + throw (css::lang::IllegalArgumentException, css::uno::RuntimeException) override; // XFilePickerControlAccess functions virtual void SAL_CALL setValue( sal_Int16 aControlId, sal_Int16 aControlAction, const css::uno::Any& aValue ) - throw (css::uno::RuntimeException); + throw (css::uno::RuntimeException) override; virtual css::uno::Any SAL_CALL getValue( sal_Int16 aControlId, sal_Int16 aControlAction ) - throw (css::uno::RuntimeException); + throw (css::uno::RuntimeException) override; virtual void SAL_CALL enableControl( sal_Int16 aControlId, sal_Bool bEnable ) - throw(css::uno::RuntimeException ); + throw(css::uno::RuntimeException ) override; virtual void SAL_CALL setLabel( sal_Int16 aControlId, const OUString& aLabel ) - throw (css::uno::RuntimeException); + throw (css::uno::RuntimeException) override; virtual OUString SAL_CALL getLabel( sal_Int16 aControlId ) - throw (css::uno::RuntimeException); + throw (css::uno::RuntimeException) override; // XFilePreview - virtual css::uno::Sequence< sal_Int16 > SAL_CALL getSupportedImageFormats( ) throw (css::uno::RuntimeException); + virtual css::uno::Sequence< sal_Int16 > SAL_CALL getSupportedImageFormats( ) throw (css::uno::RuntimeException) override; - virtual sal_Int32 SAL_CALL getTargetColorDepth( ) throw (css::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getTargetColorDepth( ) throw (css::uno::RuntimeException) override; - virtual sal_Int32 SAL_CALL getAvailableWidth( ) throw (css::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getAvailableWidth( ) throw (css::uno::RuntimeException) override; - virtual sal_Int32 SAL_CALL getAvailableHeight( ) throw (css::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getAvailableHeight( ) throw (css::uno::RuntimeException) override; - virtual void SAL_CALL setImage( sal_Int16 aImageFormat, const css::uno::Any& aImage ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException); + virtual void SAL_CALL setImage( sal_Int16 aImageFormat, const css::uno::Any& aImage ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException) override; - virtual sal_Bool SAL_CALL setShowState( sal_Bool bShowState ) throw (css::uno::RuntimeException); + virtual sal_Bool SAL_CALL setShowState( sal_Bool bShowState ) throw (css::uno::RuntimeException) override; - virtual sal_Bool SAL_CALL getShowState( ) throw (css::uno::RuntimeException); + virtual sal_Bool SAL_CALL getShowState( ) throw (css::uno::RuntimeException) override; // XInitialization virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) - throw(css::uno::Exception, css::uno::RuntimeException); + throw(css::uno::Exception, css::uno::RuntimeException) override; // XCancellable virtual void SAL_CALL cancel( ) - throw(css::uno::RuntimeException); + throw(css::uno::RuntimeException) override; // XEventListener @@ -164,13 +164,13 @@ public: // XServiceInfo virtual OUString SAL_CALL getImplementationName( ) - throw(css::uno::RuntimeException); + throw(css::uno::RuntimeException) override; virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) - throw(css::uno::RuntimeException); + throw(css::uno::RuntimeException) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) - throw(css::uno::RuntimeException); + throw(css::uno::RuntimeException) override; // FilePicker Event functions diff --git a/fpicker/source/win32/filepicker/FilterContainer.cxx b/fpicker/source/win32/filepicker/FilterContainer.cxx index c23c2443f4ee..f428e45e390b 100644 --- a/fpicker/source/win32/filepicker/FilterContainer.cxx +++ b/fpicker/source/win32/filepicker/FilterContainer.cxx @@ -33,14 +33,14 @@ CFilterContainer::CFilterContainer( sal_Int32 initSize ) : m_vFilters( initSize ), - m_bIterInitialized( sal_False ) + m_bIterInitialized( false ) { } // add a name/filter pair -sal_Bool SAL_CALL CFilterContainer::addFilter( - const OUString& aName, const OUString& aFilter, sal_Bool bAllowDuplicates ) +bool SAL_CALL CFilterContainer::addFilter( + const OUString& aName, const OUString& aFilter, bool bAllowDuplicates ) { // check if the filter is already in the container sal_Int32 pos = -1; @@ -51,23 +51,23 @@ sal_Bool SAL_CALL CFilterContainer::addFilter( if ( pos < 0 ) // if not there, append { m_vFilters.push_back( std::make_pair( aName, aFilter ) ); - m_bIterInitialized = sal_False; + m_bIterInitialized = false; } } else { m_vFilters.push_back( std::make_pair( aName, aFilter ) ); - m_bIterInitialized = sal_False; + m_bIterInitialized = false; } - return ( pos < 0 ) ? sal_True : sal_False; + return pos < 0; } // delete a filter // Precondition: the container is not empty // there is a filter identified by the given name -sal_Bool SAL_CALL CFilterContainer::delFilter( const OUString& aName ) +bool SAL_CALL CFilterContainer::delFilter( const OUString& aName ) { OSL_ASSERT( !m_vFilters.empty() ); @@ -75,10 +75,10 @@ sal_Bool SAL_CALL CFilterContainer::delFilter( const OUString& aName ) if ( pos > -1 ) { m_vFilters.erase( ( m_vFilters.begin() + pos ) ); - m_bIterInitialized = sal_False; + m_bIterInitialized = false; } - return ( pos > -1 ) ? sal_True : sal_False; + return pos > -1; } // return the number of filters currently in the container @@ -99,7 +99,7 @@ void SAL_CALL CFilterContainer::empty() // Precondition: the container is not empty // there is a filter identified by the name -sal_Bool SAL_CALL CFilterContainer::getFilter( const OUString& aName, OUString& theFilter ) const +bool SAL_CALL CFilterContainer::getFilter( const OUString& aName, OUString& theFilter ) const { OSL_PRECOND( !m_vFilters.empty() , "Empty filter container" ); @@ -116,12 +116,12 @@ sal_Bool SAL_CALL CFilterContainer::getFilter( const OUString& aName, OUString& pos = -1; } - return (pos > -1 ) ? sal_True : sal_False; + return pos > -1; } -sal_Bool SAL_CALL CFilterContainer::getFilter( sal_Int32 aIndex, OUString& theFilter ) const +bool SAL_CALL CFilterContainer::getFilter( sal_Int32 aIndex, OUString& theFilter ) const { - sal_Bool bRet = sal_True; + bool bRet = true; try { @@ -130,7 +130,7 @@ sal_Bool SAL_CALL CFilterContainer::getFilter( sal_Int32 aIndex, OUString& theFi catch( std::out_of_range& ) { OSL_FAIL( "Filter index out of range" ); - bRet = sal_False; + bRet = false; } return bRet; @@ -164,21 +164,21 @@ sal_Int32 SAL_CALL CFilterContainer::getFilterTagPos( const OUString& aName ) co void SAL_CALL CFilterContainer::beginEnumFilter( ) { m_iter = m_vFilters.begin( ); - m_bIterInitialized = sal_True; + m_bIterInitialized = true; } // returns true if another filter has been retrieved -sal_Bool SAL_CALL CFilterContainer::getNextFilter( FILTER_ENTRY_T& nextFilterEntry ) +bool SAL_CALL CFilterContainer::getNextFilter( FILTER_ENTRY_T& nextFilterEntry ) { OSL_ASSERT( m_bIterInitialized ); - sal_Bool bRet = ( m_iter != m_vFilters.end( ) ); + bool bRet = ( m_iter != m_vFilters.end( ) ); if ( bRet ) nextFilterEntry = *m_iter++; else - m_bIterInitialized = sal_False; + m_bIterInitialized = false; return bRet; } @@ -197,7 +197,7 @@ OUString SAL_CALL CFilterContainer::getCurrentFilter() const // length of the name + '\0' + length of the filter string + // a trailing '\0' -static sal_uInt32 _getLengthFilter( CFilterContainer::FILTER_ENTRY_T aFilterEntry ) +static sal_uInt32 getLengthFilter( CFilterContainer::FILTER_ENTRY_T aFilterEntry ) { return ( aFilterEntry.first.getLength( ) + 1 + @@ -206,7 +206,7 @@ static sal_uInt32 _getLengthFilter( CFilterContainer::FILTER_ENTRY_T aFilterEntr // calculates the length of all filters currently in the container -static sal_uInt32 _getTotalFilterLength( CFilterContainer& aFilterContainer ) +static sal_uInt32 getTotalFilterLength( CFilterContainer& aFilterContainer ) { CFilterContainer::FILTER_ENTRY_T nextFilter; @@ -214,13 +214,13 @@ static sal_uInt32 _getTotalFilterLength( CFilterContainer& aFilterContainer ) sal_uInt32 totalLength = 0; while( aFilterContainer.getNextFilter( nextFilter ) ) - totalLength += _getLengthFilter( nextFilter ); + totalLength += getLengthFilter( nextFilter ); return ( totalLength > 0 ) ? totalLength + 1 : totalLength; } inline -void _wcsmemcpy( sal_Unicode* pDest, const sal_Unicode* pSrc, sal_uInt32 nLength ) +void wcsmemcpy( sal_Unicode* pDest, const sal_Unicode* pSrc, sal_uInt32 nLength ) { memcpy( pDest, pSrc, nLength * sizeof( sal_Unicode ) ); } @@ -232,7 +232,7 @@ void _wcsmemcpy( sal_Unicode* pDest, const sal_Unicode* pSrc, sal_uInt32 nLength OUString SAL_CALL makeWinFilterBuffer( CFilterContainer& aFilterContainer ) { // calculate the required buffer size - sal_uInt32 reqBuffSize = _getTotalFilterLength( aFilterContainer ); + sal_uInt32 reqBuffSize = getTotalFilterLength( aFilterContainer ); // return if there are no filters if ( !reqBuffSize ) @@ -251,14 +251,14 @@ OUString SAL_CALL makeWinFilterBuffer( CFilterContainer& aFilterContainer ) while( aFilterContainer.getNextFilter( nextFilter ) ) { - _wcsmemcpy( + wcsmemcpy( pBuff + memPos, nextFilter.first.getStr( ), nextFilter.first.getLength( ) ); memPos += nextFilter.first.getLength( ) + 1; - _wcsmemcpy( + wcsmemcpy( pBuff + memPos, nextFilter.second.getStr( ), nextFilter.second.getLength( ) ); diff --git a/fpicker/source/win32/filepicker/FilterContainer.hxx b/fpicker/source/win32/filepicker/FilterContainer.hxx index 26e755d6efbe..18edcf5df25e 100644 --- a/fpicker/source/win32/filepicker/FilterContainer.hxx +++ b/fpicker/source/win32/filepicker/FilterContainer.hxx @@ -43,14 +43,14 @@ public: // 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( + bool SAL_CALL addFilter( const OUString& aName, const OUString& aFilter, - sal_Bool bAllowDuplicates = sal_False ); + bool bAllowDuplicates = false ); // delete the specified filter returns true on // success and false if the filter was not found - sal_Bool SAL_CALL delFilter( const OUString& aName ); + bool SAL_CALL delFilter( const OUString& aName ); // the number of filter already added sal_Int32 SAL_CALL numFilter( ); @@ -61,8 +61,8 @@ public: // 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 OUString& aName, OUString& theFilter ) const; - sal_Bool SAL_CALL getFilter( sal_Int32 aIndex, OUString& theFilter ) const; + bool SAL_CALL getFilter( const OUString& aName, OUString& theFilter ) const; + bool SAL_CALL getFilter( sal_Int32 aIndex, OUString& theFilter ) const; // returns the position of the specified filter or -1 // if the filter was not found @@ -72,7 +72,7 @@ public: void SAL_CALL beginEnumFilter( ); // returns true if another filter has been retrieved - sal_Bool SAL_CALL getNextFilter( FILTER_ENTRY_T& nextFilterEntry ); + bool SAL_CALL getNextFilter( FILTER_ENTRY_T& nextFilterEntry ); // cache current filter void SAL_CALL setCurrentFilter( const OUString& aName ); @@ -93,7 +93,7 @@ private: private: FILTER_VECTOR_T m_vFilters; FILTER_VECTOR_T::const_iterator m_iter; - sal_Bool m_bIterInitialized; + bool m_bIterInitialized; OUString m_sCurrentFilter; }; diff --git a/fpicker/source/win32/filepicker/VistaFilePicker.cxx b/fpicker/source/win32/filepicker/VistaFilePicker.cxx index 5ac4647b52e0..2a8c2477b0fd 100644 --- a/fpicker/source/win32/filepicker/VistaFilePicker.cxx +++ b/fpicker/source/win32/filepicker/VistaFilePicker.cxx @@ -269,7 +269,7 @@ css::uno::Sequence< OUString > SAL_CALL VistaFilePicker::getSelectedFiles() // if we want to show a modal window, the calling thread needs to process messages m_aAsyncExecute.triggerRequestThreadAware(rRequest, AsyncRequests::PROCESS_MESSAGES); - const sal_Bool bOK = rRequest->getArgumentOrDefault(PROP_DIALOG_SHOW_RESULT, (sal_Bool)sal_False ); + const bool bOK = rRequest->getArgumentOrDefault(PROP_DIALOG_SHOW_RESULT, false ); m_lLastFiles = rRequest->getArgumentOrDefault(PROP_SELECTED_FILES , css::uno::Sequence< OUString >()); ::sal_Int16 nResult = css::ui::dialogs::ExecutableDialogResults::CANCEL; @@ -378,13 +378,13 @@ void SAL_CALL VistaFilePicker::setImage( sal_Int16 /*nImageFormat*/, sal_Bool SAL_CALL VistaFilePicker::setShowState(sal_Bool /*bShowState*/) throw (css::uno::RuntimeException) { - return sal_False; + return false; } sal_Bool SAL_CALL VistaFilePicker::getShowState() throw (css::uno::RuntimeException) { - return sal_False; + return false; } void SAL_CALL VistaFilePicker::initialize(const css::uno::Sequence< css::uno::Any >& lArguments) @@ -400,26 +400,26 @@ void SAL_CALL VistaFilePicker::initialize(const css::uno::Sequence< css::uno::An sal_Int32 nTemplate = -1; lArguments[0] >>= nTemplate; - sal_Bool bFileOpenDialog = sal_True; + bool bFileOpenDialog = true; ::sal_Int32 nFeatures = 0; switch(nTemplate) { case css::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE : { - bFileOpenDialog = sal_True; + bFileOpenDialog = true; } break; case css::ui::dialogs::TemplateDescription::FILESAVE_SIMPLE : { - bFileOpenDialog = sal_False; + bFileOpenDialog = false; } break; case css::ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION_PASSWORD : { - bFileOpenDialog = sal_False; + bFileOpenDialog = false; nFeatures |= FEATURE_AUTOEXTENSION; nFeatures |= FEATURE_PASSWORD; } @@ -427,7 +427,7 @@ void SAL_CALL VistaFilePicker::initialize(const css::uno::Sequence< css::uno::An case css::ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION_PASSWORD_FILTEROPTIONS : { - bFileOpenDialog = sal_False; + bFileOpenDialog = false; nFeatures |= FEATURE_AUTOEXTENSION; nFeatures |= FEATURE_PASSWORD; nFeatures |= FEATURE_FILTEROPTIONS; @@ -436,7 +436,7 @@ void SAL_CALL VistaFilePicker::initialize(const css::uno::Sequence< css::uno::An case css::ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION_SELECTION : { - bFileOpenDialog = sal_False; + bFileOpenDialog = false; nFeatures |= FEATURE_AUTOEXTENSION; nFeatures |= FEATURE_SELECTION; } @@ -444,7 +444,7 @@ void SAL_CALL VistaFilePicker::initialize(const css::uno::Sequence< css::uno::An case css::ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION_TEMPLATE : { - bFileOpenDialog = sal_False; + bFileOpenDialog = false; nFeatures |= FEATURE_AUTOEXTENSION; nFeatures |= FEATURE_TEMPLATE; } @@ -452,7 +452,7 @@ void SAL_CALL VistaFilePicker::initialize(const css::uno::Sequence< css::uno::An case css::ui::dialogs::TemplateDescription::FILEOPEN_LINK_PREVIEW_IMAGE_TEMPLATE : { - bFileOpenDialog = sal_True; + bFileOpenDialog = true; nFeatures |= FEATURE_LINK; nFeatures |= FEATURE_PREVIEW; nFeatures |= FEATURE_IMAGETEMPLATE; @@ -461,14 +461,14 @@ void SAL_CALL VistaFilePicker::initialize(const css::uno::Sequence< css::uno::An case css::ui::dialogs::TemplateDescription::FILEOPEN_PLAY : { - bFileOpenDialog = sal_True; + bFileOpenDialog = true; nFeatures |= FEATURE_PLAY; } break; case css::ui::dialogs::TemplateDescription::FILEOPEN_LINK_PLAY : { - bFileOpenDialog = sal_True; + bFileOpenDialog = true; nFeatures |= FEATURE_LINK; nFeatures |= FEATURE_PLAY; } @@ -476,7 +476,7 @@ void SAL_CALL VistaFilePicker::initialize(const css::uno::Sequence< css::uno::An case css::ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION : { - bFileOpenDialog = sal_True; + bFileOpenDialog = true; nFeatures |= FEATURE_READONLY; nFeatures |= FEATURE_VERSION; } @@ -484,7 +484,7 @@ void SAL_CALL VistaFilePicker::initialize(const css::uno::Sequence< css::uno::An case css::ui::dialogs::TemplateDescription::FILEOPEN_LINK_PREVIEW : { - bFileOpenDialog = sal_True; + bFileOpenDialog = true; nFeatures |= FEATURE_LINK; nFeatures |= FEATURE_PREVIEW; } @@ -492,14 +492,14 @@ void SAL_CALL VistaFilePicker::initialize(const css::uno::Sequence< css::uno::An case css::ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION : { - bFileOpenDialog = sal_False; + bFileOpenDialog = false; nFeatures |= FEATURE_AUTOEXTENSION; } break; case css::ui::dialogs::TemplateDescription::FILEOPEN_PREVIEW : { - bFileOpenDialog = sal_True; + bFileOpenDialog = true; nFeatures |= FEATURE_PREVIEW; } break; diff --git a/fpicker/source/win32/filepicker/VistaFilePicker.hxx b/fpicker/source/win32/filepicker/VistaFilePicker.hxx index b14eb124dc69..deb15ef6ee3e 100644 --- a/fpicker/source/win32/filepicker/VistaFilePicker.hxx +++ b/fpicker/source/win32/filepicker/VistaFilePicker.hxx @@ -68,51 +68,51 @@ public: explicit VistaFilePicker( const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR ); - virtual ~VistaFilePicker(); + virtual ~VistaFilePicker() override; // XFilePickerNotifier virtual void SAL_CALL addFilePickerListener( const css::uno::Reference< css::ui::dialogs::XFilePickerListener >& xListener ) - throw( css::uno::RuntimeException ); + throw( css::uno::RuntimeException ) override; virtual void SAL_CALL removeFilePickerListener( const css::uno::Reference< css::ui::dialogs::XFilePickerListener >& xListener ) - throw( css::uno::RuntimeException ); + throw( css::uno::RuntimeException ) override; // XExecutableDialog functions virtual void SAL_CALL setTitle( const OUString& sTitle ) - throw( css::uno::RuntimeException ); + throw( css::uno::RuntimeException ) override; virtual sal_Int16 SAL_CALL execute( ) - throw( css::uno::RuntimeException ); + throw( css::uno::RuntimeException ) override; // XFilePicker functions virtual void SAL_CALL setMultiSelectionMode( sal_Bool bMode ) - throw( css::uno::RuntimeException ); + throw( css::uno::RuntimeException ) override; virtual void SAL_CALL setDefaultName( const OUString& sName ) - throw( css::uno::RuntimeException ); + throw( css::uno::RuntimeException ) override; virtual void SAL_CALL setDisplayDirectory( const OUString& sDirectory ) throw (css::lang::IllegalArgumentException, - css::uno::RuntimeException ); + css::uno::RuntimeException ) override; virtual OUString SAL_CALL getDisplayDirectory( ) - throw( css::uno::RuntimeException ); + throw( css::uno::RuntimeException ) override; virtual css::uno::Sequence< OUString > SAL_CALL getFiles( ) - throw( css::uno::RuntimeException ); + throw( css::uno::RuntimeException ) override; // XFilePicker2 functions virtual css::uno::Sequence< OUString > SAL_CALL getSelectedFiles( ) - throw( css::uno::RuntimeException, std::exception ); + throw( css::uno::RuntimeException, std::exception ) override; // XFilterManager functions @@ -121,14 +121,14 @@ public: virtual void SAL_CALL appendFilter( const OUString& sTitle , const OUString& sFilter ) throw (css::lang::IllegalArgumentException, - css::uno::RuntimeException ); + css::uno::RuntimeException ) override; virtual void SAL_CALL setCurrentFilter( const OUString& sTitle ) throw (css::lang::IllegalArgumentException, - css::uno::RuntimeException ); + css::uno::RuntimeException ) override; virtual OUString SAL_CALL getCurrentFilter( ) - throw( css::uno::RuntimeException ); + throw( css::uno::RuntimeException ) override; // XFilterGroupManager functions @@ -137,7 +137,7 @@ public: virtual void SAL_CALL appendFilterGroup( const OUString& sGroupTitle, const css::uno::Sequence< css::beans::StringPair >& lFilters ) throw (css::lang::IllegalArgumentException, - css::uno::RuntimeException ); + css::uno::RuntimeException ) override; // XFilePickerControlAccess functions @@ -146,48 +146,48 @@ public: virtual void SAL_CALL setValue( sal_Int16 nControlId , sal_Int16 nControlAction, const css::uno::Any& aValue ) - throw (css::uno::RuntimeException); + throw (css::uno::RuntimeException) override; virtual css::uno::Any SAL_CALL getValue( sal_Int16 nControlId , sal_Int16 nControlAction ) - throw (css::uno::RuntimeException); + throw (css::uno::RuntimeException) override; virtual void SAL_CALL enableControl( sal_Int16 nControlId, sal_Bool bEnable ) - throw(css::uno::RuntimeException ); + throw(css::uno::RuntimeException ) override; virtual void SAL_CALL setLabel( sal_Int16 nControlId, const OUString& sLabel ) - throw (css::uno::RuntimeException); + throw (css::uno::RuntimeException) override; virtual OUString SAL_CALL getLabel( sal_Int16 nControlId ) - throw (css::uno::RuntimeException); + throw (css::uno::RuntimeException) override; // XFilePreview virtual css::uno::Sequence< sal_Int16 > SAL_CALL getSupportedImageFormats( ) - throw (css::uno::RuntimeException); + throw (css::uno::RuntimeException) override; virtual sal_Int32 SAL_CALL getTargetColorDepth( ) - throw (css::uno::RuntimeException); + throw (css::uno::RuntimeException) override; virtual sal_Int32 SAL_CALL getAvailableWidth( ) - throw (css::uno::RuntimeException); + throw (css::uno::RuntimeException) override; virtual sal_Int32 SAL_CALL getAvailableHeight( ) - throw (css::uno::RuntimeException); + throw (css::uno::RuntimeException) override; virtual void SAL_CALL setImage( sal_Int16 nImageFormat, const css::uno::Any& aImage ) - throw (css::lang::IllegalArgumentException, css::uno::RuntimeException); + throw (css::lang::IllegalArgumentException, css::uno::RuntimeException) override; virtual sal_Bool SAL_CALL setShowState( sal_Bool bShowState ) - throw (css::uno::RuntimeException); + throw (css::uno::RuntimeException) override; virtual sal_Bool SAL_CALL getShowState( ) - throw (css::uno::RuntimeException); + throw (css::uno::RuntimeException) override; // XInitialization @@ -195,14 +195,14 @@ public: virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& lArguments ) throw(css::uno::Exception , - css::uno::RuntimeException); + css::uno::RuntimeException) override; // XCancellable virtual void SAL_CALL cancel( ) - throw(css::uno::RuntimeException); + throw(css::uno::RuntimeException) override; // XEventListener @@ -216,13 +216,13 @@ public: virtual OUString SAL_CALL getImplementationName( ) - throw(css::uno::RuntimeException); + throw(css::uno::RuntimeException) override; virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) - throw(css::uno::RuntimeException); + throw(css::uno::RuntimeException) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) - throw(css::uno::RuntimeException); + throw(css::uno::RuntimeException) override; /* diff --git a/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx b/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx index dffa6a3838c9..cb559a5a91f5 100644 --- a/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx +++ b/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx @@ -64,20 +64,20 @@ VistaFilePickerEventHandler::~VistaFilePickerEventHandler() HRESULT STDMETHODCALLTYPE VistaFilePickerEventHandler::QueryInterface(REFIID rIID , void** ppObject) { - *ppObject=NULL; + *ppObject=nullptr; if ( rIID == IID_IUnknown ) - *ppObject = (IUnknown*)(IFileDialogEvents*)this; + *ppObject = static_cast(static_cast(this)); if ( rIID == IID_IFileDialogEvents ) - *ppObject = (IFileDialogEvents*)this; + *ppObject = static_cast(this); if ( rIID == IID_IFileDialogControlEvents ) - *ppObject = (IFileDialogControlEvents*)this; + *ppObject = static_cast(this); - if ( *ppObject != NULL ) + if ( *ppObject != nullptr ) { - ((IUnknown*)*ppObject)->AddRef(); + static_cast(*ppObject)->AddRef(); return S_OK; } @@ -248,13 +248,13 @@ public: AsyncPickerEvents() {} - virtual ~AsyncPickerEvents() + virtual ~AsyncPickerEvents() override {} - virtual void before() + virtual void before() override {} - virtual void doRequest(const RequestRef& rRequest) + virtual void doRequest(const RequestRef& rRequest) override { const ::sal_Int32 nEventID = rRequest->getRequest(); const ::sal_Int16 nControlID = rRequest->getArgumentOrDefault(PROP_CONTROL_ID, (::sal_Int16)0); @@ -292,7 +292,7 @@ public: } } - virtual void after() + virtual void after() override {} }; diff --git a/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.hxx b/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.hxx index e07c34e2a84c..1fa0c6909519 100644 --- a/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.hxx +++ b/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.hxx @@ -67,32 +67,32 @@ class VistaFilePickerEventHandler : public ::cppu::BaseMutex // IUnknown virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID rIID , - void** ppObject); - virtual ULONG STDMETHODCALLTYPE AddRef(); - virtual ULONG STDMETHODCALLTYPE Release(); + void** ppObject) override; + virtual ULONG STDMETHODCALLTYPE AddRef() override; + virtual ULONG STDMETHODCALLTYPE Release() override; // IFileDialogEvents - STDMETHODIMP OnFileOk(IFileDialog* pDialog); + STDMETHODIMP OnFileOk(IFileDialog* pDialog) override; STDMETHODIMP OnFolderChanging(IFileDialog* pDialog, - IShellItem* pFolder); + IShellItem* pFolder) override; - STDMETHODIMP OnFolderChange(IFileDialog* pDialog); + STDMETHODIMP OnFolderChange(IFileDialog* pDialog) override; - STDMETHODIMP OnSelectionChange(IFileDialog* pDialog); + STDMETHODIMP OnSelectionChange(IFileDialog* pDialog) override; STDMETHODIMP OnShareViolation(IFileDialog* pDialog , IShellItem* pItem , - FDE_SHAREVIOLATION_RESPONSE* pResponse); + FDE_SHAREVIOLATION_RESPONSE* pResponse) override; - STDMETHODIMP OnTypeChange(IFileDialog* pDialog); + STDMETHODIMP OnTypeChange(IFileDialog* pDialog) override; STDMETHODIMP OnOverwrite(IFileDialog* pDialog , IShellItem* pItem , - FDE_OVERWRITE_RESPONSE* pResponse); + FDE_OVERWRITE_RESPONSE* pResponse) override; // IFileDialogControlEvents @@ -100,17 +100,17 @@ class VistaFilePickerEventHandler : public ::cppu::BaseMutex STDMETHODIMP OnItemSelected(IFileDialogCustomize* pCustomize, DWORD nIDCtl , - DWORD nIDItem ); + DWORD nIDItem ) override; STDMETHODIMP OnButtonClicked(IFileDialogCustomize* pCustomize, - DWORD nIDCtl ); + DWORD nIDCtl ) override; STDMETHODIMP OnCheckButtonToggled(IFileDialogCustomize* pCustomize, DWORD nIDCtl , - BOOL bChecked ); + BOOL bChecked ) override; STDMETHODIMP OnControlActivating(IFileDialogCustomize* pCustomize, - DWORD nIDCtl ); + DWORD nIDCtl ) override; // XFilePickerNotifier diff --git a/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx b/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx index 449519bc22cf..e639beb6d343 100644 --- a/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx +++ b/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx @@ -70,7 +70,7 @@ bool createFolderItem(OUString const & url, ComPtr & folder) { reinterpret_cast(&folder)); #else HRESULT res = SHCreateItemFromParsingName( - path.getStr(), NULL, IID_PPV_ARGS(&folder)); + path.getStr(), nullptr, IID_PPV_ARGS(&folder)); #endif return SUCCEEDED(res); } @@ -101,7 +101,7 @@ static const GUID CLIENTID_FILEOPEN_LINK = {0x39AC4BAE, 0x7D2D, 0x46B OUString lcl_getURLFromShellItem (IShellItem* pItem) { - LPOLESTR pStr = NULL; + LPOLESTR pStr = nullptr; OUString sURL; SIGDN eConversion = SIGDN_FILESYSPATH; @@ -153,8 +153,8 @@ VistaFilePickerImpl::VistaFilePickerImpl() , m_hLastResult () , m_lFilters () , m_iEventHandler(new VistaFilePickerEventHandler(this)) - , m_bInExecute (sal_False) - , m_bWasExecuted (sal_False) + , m_bInExecute (false) + , m_bWasExecuted (false) , m_sDirectory () , m_sFilename () { @@ -179,11 +179,11 @@ void VistaFilePickerImpl::before() // So we make it by try-and-error ... // If first CoInitialize will fail .. we unitialize COM initialize it new .-) - m_hLastResult = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); + m_hLastResult = CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); if ( FAILED(m_hLastResult) ) { CoUninitialize(); - m_hLastResult = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); + m_hLastResult = CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); } } @@ -305,7 +305,7 @@ void VistaFilePickerImpl::impl_sta_addFilePickerListener(const RequestRef& rRequ aLock.clear(); // <- SYNCHRONIZED - VistaFilePickerEventHandler* pHandlerImpl = (VistaFilePickerEventHandler*)iHandler.get(); + VistaFilePickerEventHandler* pHandlerImpl = static_cast(iHandler.get()); if (pHandlerImpl) pHandlerImpl->addFilePickerListener(xListener); } @@ -324,7 +324,7 @@ void VistaFilePickerImpl::impl_sta_removeFilePickerListener(const RequestRef& rR aLock.clear(); // <- SYNCHRONIZED - VistaFilePickerEventHandler* pHandlerImpl = (VistaFilePickerEventHandler*)iHandler.get(); + VistaFilePickerEventHandler* pHandlerImpl = static_cast(iHandler.get()); if (pHandlerImpl) pHandlerImpl->removeFilePickerListener(xListener); } @@ -351,7 +351,7 @@ void VistaFilePickerImpl::impl_sta_appendFilterGroup(const RequestRef& rRequest) ::osl::ResettableMutexGuard aLock(m_aMutex); if ( m_lFilters.numFilter() > 0 && aFilterGroup.getLength() > 0 ) - m_lFilters.addFilter( STRING_SEPARATOR, "", sal_True ); + m_lFilters.addFilter( STRING_SEPARATOR, "", true ); ::sal_Int32 c = aFilterGroup.getLength(); ::sal_Int32 i = 0; @@ -442,7 +442,7 @@ void VistaFilePickerImpl::impl_sta_CreateOpenDialog(const RequestRef& rRequest) ::sal_Int32 nTemplate = rRequest->getArgumentOrDefault(PROP_TEMPLATE_DESCR, (::sal_Int32)0); impl_sta_enableFeatures(nFeatures, nTemplate); - VistaFilePickerEventHandler* pHandlerImpl = (VistaFilePickerEventHandler*)iHandler.get(); + VistaFilePickerEventHandler* pHandlerImpl = static_cast(iHandler.get()); if (pHandlerImpl) pHandlerImpl->startListening(iDialog); } @@ -487,18 +487,18 @@ void VistaFilePickerImpl::impl_sta_CreateSaveDialog(const RequestRef& rRequest) css::uno::Reference xSysDepWin(xWindow,css::uno::UNO_QUERY); if(xSysDepWin.is()) { css::uno::Sequence aProcessIdent(16); - rtl_getGlobalProcessId((sal_uInt8*)aProcessIdent.getArray()); + rtl_getGlobalProcessId(reinterpret_cast(aProcessIdent.getArray())); css::uno::Any aAny = xSysDepWin->getWindowHandle(aProcessIdent,css::lang::SystemDependent::SYSTEM_WIN32); sal_Int64 tmp = 0; aAny >>= tmp; if(tmp != 0) - m_hParentWindow = (HWND) tmp; + m_hParentWindow = reinterpret_cast(tmp); } } impl_sta_enableFeatures(nFeatures, nTemplate); - VistaFilePickerEventHandler* pHandlerImpl = (VistaFilePickerEventHandler*)iHandler.get(); + VistaFilePickerEventHandler* pHandlerImpl = static_cast(iHandler.get()); if (pHandlerImpl) pHandlerImpl->startListening(iDialog); } @@ -649,7 +649,7 @@ void VistaFilePickerImpl::impl_sta_enableFeatures(::sal_Int32 nFeatures, ::sal_I void VistaFilePickerImpl::impl_sta_SetMultiSelectionMode(const RequestRef& rRequest) { - const sal_Bool bMultiSelection = rRequest->getArgumentOrDefault(PROP_MULTISELECTION_MODE, (sal_Bool)sal_True); + const bool bMultiSelection = rRequest->getArgumentOrDefault(PROP_MULTISELECTION_MODE, true); // SYNCHRONIZED-> ::osl::ResettableMutexGuard aLock(m_aMutex); @@ -817,7 +817,7 @@ void VistaFilePickerImpl::impl_sta_getSelectedFiles(const RequestRef& rRequest) TFileOpenDialog iOpen = m_iDialogOpen; TFileSaveDialog iSave = m_iDialogSave; - sal_Bool bInExecute = m_bInExecute; + bool bInExecute = m_bInExecute; aLock.clear(); // <- SYNCHRONIZED @@ -840,8 +840,7 @@ void VistaFilePickerImpl::impl_sta_getSelectedFiles(const RequestRef& rRequest) hResult = iOpen->GetResult(&iItem); } } - else - if (iSave.is()) + else if (iSave.is()) { if (bInExecute) hResult = iSave->GetCurrentSelection(&iItem); @@ -898,9 +897,9 @@ void VistaFilePickerImpl::impl_sta_ShowDialogModal(const RequestRef& rRequest) // it's important to know if we are showing the dialog. // Some dialog interface methods can't be called then or some // tasks must be done differently .-) (e.g. see impl_sta_getSelectedFiles()) - m_bInExecute = sal_True; + m_bInExecute = true; - m_bWasExecuted = sal_True; + m_bWasExecuted = true; aLock.clear(); // <- SYNCHRONIZED @@ -979,7 +978,7 @@ void VistaFilePickerImpl::impl_sta_ShowDialogModal(const RequestRef& rRequest) // SYNCHRONIZED-> aLock.reset(); - m_bInExecute = sal_False; + m_bInExecute = false; aLock.clear(); // <- SYNCHRONIZED @@ -987,7 +986,7 @@ void VistaFilePickerImpl::impl_sta_ShowDialogModal(const RequestRef& rRequest) return; impl_sta_getSelectedFiles(rRequest); - rRequest->setArgument(PROP_DIALOG_SHOW_RESULT, sal_True); + rRequest->setArgument(PROP_DIALOG_SHOW_RESULT, true); } @@ -1028,8 +1027,7 @@ TFileDialogCustomize VistaFilePickerImpl::impl_getCustomizeInterface() #else m_iDialogOpen.query(&iCustom); #endif - else - if (m_iDialogSave.is()) + else if (m_iDialogSave.is()) #ifdef __MINGW32__ m_iDialogSave->QueryInterface(IID_IFileDialogCustomize, (void**)(&iCustom)); #else @@ -1076,7 +1074,7 @@ void VistaFilePickerImpl::impl_sta_SetControlValue(const RequestRef& rRequest) //case css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_PREVIEW : // can be ignored ... preview is supported native now ! case css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_SELECTION : { - sal_Bool bValue = sal_False; + sal_Bool bValue = false; aValue >>= bValue; iCustom->SetCheckButtonState(nId, bValue); } @@ -1141,8 +1139,8 @@ void VistaFilePickerImpl::impl_sta_GetControlValue(const RequestRef& rRequest) css::uno::Any aValue; if( m_bWasExecuted ) - switch (nId) - { + switch (nId) + { case css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_PASSWORD : case css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_READONLY : case css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_FILTEROPTIONS : @@ -1153,10 +1151,10 @@ void VistaFilePickerImpl::impl_sta_GetControlValue(const RequestRef& rRequest) BOOL bValue = FALSE; HRESULT hResult = iCustom->GetCheckButtonState(nId, &bValue); if ( SUCCEEDED(hResult) ) - aValue = css::uno::makeAny((sal_Bool)bValue); + aValue = css::uno::makeAny(bool(bValue)); } break; - } + } if (aValue.hasValue()) rRequest->setArgument(PROP_CONTROL_VALUE, aValue); @@ -1186,7 +1184,7 @@ void VistaFilePickerImpl::impl_sta_GetControlLabel(const RequestRef& /*rRequest* void VistaFilePickerImpl::impl_sta_EnableControl(const RequestRef& rRequest) { ::sal_Int16 nId = rRequest->getArgumentOrDefault(PROP_CONTROL_ID , INVALID_CONTROL_ID ); - sal_Bool bEnabled = rRequest->getArgumentOrDefault(PROP_CONTROL_ENABLE, (sal_Bool)sal_True); + bool bEnabled = rRequest->getArgumentOrDefault(PROP_CONTROL_ENABLE, true); // don't check for right values here ... // most parameters are optional ! @@ -1239,7 +1237,7 @@ void VistaFilePickerImpl::onAutoExtensionChanged (bool bChecked) aLock.clear(); // <- SYNCHRONIZED - PCWSTR pExt = 0; + PCWSTR pExt = nullptr; if ( bChecked ) { pExt = reinterpret_cast(sExt.getStr()); diff --git a/fpicker/source/win32/filepicker/VistaFilePickerImpl.hxx b/fpicker/source/win32/filepicker/VistaFilePickerImpl.hxx index c457e290064d..ee3b7f4d856c 100644 --- a/fpicker/source/win32/filepicker/VistaFilePickerImpl.hxx +++ b/fpicker/source/win32/filepicker/VistaFilePickerImpl.hxx @@ -141,21 +141,21 @@ class VistaFilePickerImpl : private ::cppu::BaseMutex // ctor/dtor - nothing special VistaFilePickerImpl(); - virtual ~VistaFilePickerImpl(); + virtual ~VistaFilePickerImpl() override; // RequestHandler - virtual void before(); - virtual void doRequest(const RequestRef& rRequest); - virtual void after(); + virtual void before() override; + virtual void doRequest(const RequestRef& rRequest) override; + virtual void after() override; // IVistaFilePickerInternalNotify - virtual void onAutoExtensionChanged (bool bChecked); - virtual bool onFileTypeChanged( UINT nTypeIndex ); + virtual void onAutoExtensionChanged (bool bChecked) override; + virtual bool onFileTypeChanged( UINT nTypeIndex ) override; private: @@ -237,7 +237,7 @@ class VistaFilePickerImpl : private ::cppu::BaseMutex /// implementation of request E_GET_CONTROL_LABEL - void impl_sta_GetControlLabel(const RequestRef& rRequest); + static void impl_sta_GetControlLabel(const RequestRef& rRequest); /// implementation of request E_ENABLE_CONTROL @@ -307,9 +307,9 @@ class VistaFilePickerImpl : private ::cppu::BaseMutex /// @todo document me - sal_Bool m_bInExecute; + bool m_bInExecute; - sal_Bool m_bWasExecuted; + bool m_bWasExecuted; // handle to parent window HWND m_hParentWindow; diff --git a/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx b/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx index 479fadb3ce8e..4ec7dd2c2183 100644 --- a/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx +++ b/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx @@ -68,7 +68,7 @@ struct EnumParam CWinFileOpenImpl::CWinFileOpenImpl( CFilePicker* aFilePicker, - sal_Bool bFileOpenDialog, + bool bFileOpenDialog, sal_uInt32 dwFlags, sal_uInt32 dwTemplateId, HINSTANCE hInstance) : @@ -77,7 +77,7 @@ CWinFileOpenImpl::CWinFileOpenImpl( m_Preview(new CPreviewAdapter(hInstance)), m_CustomControls(CCustomControlFactory::CreateCustomControlContainer()), m_FilePicker(aFilePicker), - m_bInitialSelChanged(sal_True), + m_bInitialSelChanged(true), m_HelpPopupWindow(hInstance, m_hwndFileOpenDlg), m_ExecuteFilePickerState(new CExecuteFilePickerState()), m_NonExecuteFilePickerState(new CNonExecuteFilePickerState()) @@ -176,7 +176,7 @@ sal_Int16 SAL_CALL CWinFileOpenImpl::execute( ) throw(uno::RuntimeException) void SAL_CALL CWinFileOpenImpl::appendFilter(const OUString& aTitle, const OUString& aFilter) throw(IllegalArgumentException, uno::RuntimeException) { - sal_Bool bRet = m_filterContainer->addFilter(aTitle, aFilter); + bool bRet = m_filterContainer->addFilter(aTitle, aFilter); if (!bRet) throw IllegalArgumentException( @@ -294,7 +294,7 @@ uno::Any SAL_CALL CWinFileOpenImpl::getValue(sal_Int16 aControlId, sal_Int16 aCo // enables a custom template element -void SAL_CALL CWinFileOpenImpl::enableControl(sal_Int16 ControlID, sal_Bool bEnable) +void SAL_CALL CWinFileOpenImpl::enableControl(sal_Int16 ControlID, bool bEnable) throw(uno::RuntimeException) { OSL_ASSERT(m_FilePickerState); @@ -323,7 +323,7 @@ OUString SAL_CALL CWinFileOpenImpl::getLabel( sal_Int16 aControlId ) uno::Sequence SAL_CALL CWinFileOpenImpl::getSupportedImageFormats() throw (uno::RuntimeException) { - return m_Preview->getSupportedImageFormats(); + return CPreviewAdapter::getSupportedImageFormats(); } sal_Int32 SAL_CALL CWinFileOpenImpl::getTargetColorDepth() @@ -350,13 +350,13 @@ void SAL_CALL CWinFileOpenImpl::setImage(sal_Int16 aImageFormat, const uno::Any& m_Preview->setImage(aImageFormat,aImage); } -sal_Bool SAL_CALL CWinFileOpenImpl::setShowState(sal_Bool bShowState) +bool SAL_CALL CWinFileOpenImpl::setShowState(bool bShowState) throw (uno::RuntimeException) { return m_Preview->setShowState(bShowState); } -sal_Bool SAL_CALL CWinFileOpenImpl::getShowState() +bool SAL_CALL CWinFileOpenImpl::getShowState() throw (uno::RuntimeException) { return m_Preview->getShowState(); @@ -372,7 +372,7 @@ void SAL_CALL CWinFileOpenImpl::cancel() m_hwndFileOpenDlg, WM_COMMAND, MAKEWPARAM(IDCANCEL,BN_CLICKED), - (LPARAM)GetDlgItem(m_hwndFileOpenDlg, IDCANCEL)); + reinterpret_cast(GetDlgItem(m_hwndFileOpenDlg, IDCANCEL))); SAL_WARN_IF(0 == ret, "fpicker", "ERROR: PostMessage() failed!"); } } @@ -392,7 +392,7 @@ sal_Int16 SAL_CALL CWinFileOpenImpl::getFocused() return sal::static_int_cast< sal_Int16 >(nID); } -inline sal_Bool SAL_CALL CWinFileOpenImpl::IsCustomControlHelpRequested(LPHELPINFO lphi) const +inline bool SAL_CALL CWinFileOpenImpl::IsCustomControlHelpRequested(LPHELPINFO lphi) { return ((lphi->iCtrlId != IDOK) && (lphi->iCtrlId != IDCANCEL) && (lphi->iCtrlId < ctlFirst)); } @@ -414,7 +414,7 @@ LRESULT CALLBACK CWinFileOpenImpl::SubClassFunc( { LPHELPINFO lphi = reinterpret_cast(lParam); - if (pImpl->IsCustomControlHelpRequested(lphi)) + if (CWinFileOpenImpl::IsCustomControlHelpRequested(lphi)) pImpl->onCustomControlHelpRequest(lphi); else lResult = CallWindowProc( @@ -444,7 +444,7 @@ LRESULT CALLBACK CWinFileOpenImpl::SubClassFunc( reinterpret_cast(pImpl->m_pfnOldDlgProc), hWnd,wMessage,wParam,lParam); - pImpl->onWMShow((sal_Bool)wParam); + pImpl->onWMShow(bool(wParam)); break; case WM_NCDESTROY: @@ -506,12 +506,12 @@ void SAL_CALL CWinFileOpenImpl::CacheControlState(HWND hWnd) BOOL CALLBACK CWinFileOpenImpl::EnumChildWndProc(HWND hWnd, LPARAM lParam) { - EnumParam* enumParam = (EnumParam*)lParam; + EnumParam* enumParam = reinterpret_cast(lParam); CWinFileOpenImpl* pImpl = enumParam->m_instance; OSL_ASSERT(pImpl); - sal_Bool bRet = sal_True; + bool bRet = true; switch(enumParam->m_action) { @@ -526,7 +526,7 @@ BOOL CALLBACK CWinFileOpenImpl::EnumChildWndProc(HWND hWnd, LPARAM lParam) default: // should not end here - OSL_ASSERT(sal_False); + OSL_ASSERT(false); } return bRet; @@ -541,7 +541,7 @@ sal_uInt32 SAL_CALL CWinFileOpenImpl::onFileOk() EnumChildWindows( m_hwndFileOpenDlgChild, CWinFileOpenImpl::EnumChildWndProc, - (LPARAM)&enumParam); + reinterpret_cast(&enumParam)); return 0; } @@ -597,14 +597,14 @@ void CWinFileOpenImpl::EnlargeStdControlLabels() const int gap = rcOkButton.left - rcFileNameBox.right; gap = (gap > MAX_GAP) ? gap - MAX_GAP : gap; - ScreenToClient(m_hwndFileOpenDlg, (LPPOINT)&rcFileNameBox); + ScreenToClient(m_hwndFileOpenDlg, reinterpret_cast(&rcFileNameBox)); MoveWindow(hFileNameBox, rcFileNameBox.left + gap + OFFSET, rcFileNameBox.top, w - OFFSET, h, true); RECT rcFilterBox; GetWindowRect(hFilterBox, &rcFilterBox); w = rcFilterBox.right - rcFilterBox.left; h = rcFilterBox.bottom - rcFilterBox.top; - ScreenToClient(m_hwndFileOpenDlg, (LPPOINT)&rcFilterBox); + ScreenToClient(m_hwndFileOpenDlg, reinterpret_cast(&rcFilterBox)); MoveWindow(hFilterBox, rcFilterBox.left + gap + OFFSET, rcFilterBox.top, w - OFFSET, h, true); // get the new window rect @@ -616,14 +616,14 @@ void CWinFileOpenImpl::EnlargeStdControlLabels() const w = rcFilterBoxLabel.right - rcFilterBoxLabel.left + offset; h = rcFilterBoxLabel.bottom - rcFilterBoxLabel.top; - ScreenToClient(m_hwndFileOpenDlg, (LPPOINT)&rcFilterBoxLabel); + ScreenToClient(m_hwndFileOpenDlg, reinterpret_cast(&rcFilterBoxLabel)); MoveWindow(hFilterBoxLabel, rcFilterBoxLabel.left, rcFilterBoxLabel.top, w, h, true); RECT rcFileNameBoxLabel; GetWindowRect(hFileNameBoxLabel, &rcFileNameBoxLabel); w = rcFileNameBoxLabel.right - rcFileNameBoxLabel.left + offset; h = rcFileNameBoxLabel.bottom - rcFileNameBoxLabel.top; - ScreenToClient(m_hwndFileOpenDlg, (LPPOINT)&rcFileNameBoxLabel); + ScreenToClient(m_hwndFileOpenDlg, reinterpret_cast(&rcFileNameBoxLabel)); MoveWindow(hFileNameBoxLabel, rcFileNameBoxLabel.left, rcFileNameBoxLabel.top, w, h, true); } @@ -651,7 +651,7 @@ void SAL_CALL CWinFileOpenImpl::onInitDone() EnumChildWindows( m_hwndFileOpenDlgChild, CWinFileOpenImpl::EnumChildWndProc, - (LPARAM)&enumParam); + reinterpret_cast(&enumParam)); m_ExecuteFilePickerState->initFilePickerControls( m_NonExecuteFilePickerState->getControlCommand()); @@ -719,7 +719,7 @@ void CWinFileOpenImpl::onWMSize() m_FilePicker->dialogSizeChanged(); } -void CWinFileOpenImpl::onWMShow(sal_Bool bShow) +void CWinFileOpenImpl::onWMShow(bool bShow) { m_Preview->notifyParentShow(bShow); } @@ -785,7 +785,7 @@ void SAL_CALL CWinFileOpenImpl::SetDefaultExtension() if (hwndChkSaveWithExt) { uno::Any aAny = CheckboxGetState(hwndChkSaveWithExt); - sal_Bool bChecked = *reinterpret_cast(aAny.getValue()); + bool bChecked = *static_cast(aAny.getValue()); if (bChecked) { @@ -842,7 +842,7 @@ void SAL_CALL CWinFileOpenImpl::InitialSetDefaultName() SetWindowTextW(hFileNameBox, reinterpret_cast(m_defaultName.getStr())); } - m_bInitialSelChanged = sal_False; + m_bInitialSelChanged = 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 10eef106c6c3..b6e78f50c850 100644 --- a/fpicker/source/win32/filepicker/WinFileOpenImpl.hxx +++ b/fpicker/source/win32/filepicker/WinFileOpenImpl.hxx @@ -46,12 +46,12 @@ class CWinFileOpenImpl : public CFileOpenDialog public: CWinFileOpenImpl( CFilePicker* aFilePicker, - sal_Bool bFileOpenDialog = sal_True, + bool bFileOpenDialog = true, sal_uInt32 dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, sal_uInt32 dwTemplateId = 0, - HINSTANCE hInstance = 0 ); + HINSTANCE hInstance = nullptr ); - virtual ~CWinFileOpenImpl( ); + virtual ~CWinFileOpenImpl( ) override; // XExecutableDialog @@ -60,13 +60,13 @@ public: // XFilePicker virtual void SAL_CALL setDefaultName( const OUString& aName ) - throw( css::lang::IllegalArgumentException, css::uno::RuntimeException ); + throw( css::lang::IllegalArgumentException, css::uno::RuntimeException ) override; virtual css::uno::Sequence< OUString > SAL_CALL getFiles( ) throw(css::uno::RuntimeException ); virtual void SAL_CALL setDisplayDirectory( const OUString& aDirectory ) - throw( css::lang::IllegalArgumentException, css::uno::RuntimeException ); + throw( css::lang::IllegalArgumentException, css::uno::RuntimeException ) override; virtual OUString SAL_CALL getDisplayDirectory( ) throw ( css::uno::RuntimeException ); @@ -94,7 +94,7 @@ public: virtual css::uno::Any SAL_CALL getValue( sal_Int16 aControlId, sal_Int16 aControlAction ) throw( css::uno::RuntimeException ); - virtual void SAL_CALL enableControl( sal_Int16 aControlId, sal_Bool bEnable ) + virtual void SAL_CALL enableControl( sal_Int16 aControlId, bool bEnable ) throw( css::uno::RuntimeException ); virtual void SAL_CALL setLabel( sal_Int16 aControlId, const OUString& aLabel ) @@ -120,10 +120,10 @@ public: virtual void SAL_CALL setImage( sal_Int16 aImageFormat, const css::uno::Any& aImage ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException); - virtual sal_Bool SAL_CALL setShowState( sal_Bool bShowState ) + virtual bool SAL_CALL setShowState( bool bShowState ) throw (css::uno::RuntimeException); - virtual sal_Bool SAL_CALL getShowState( ) + virtual bool SAL_CALL getShowState( ) throw (css::uno::RuntimeException); // XCancelable @@ -133,33 +133,33 @@ public: // Implementation details protected: - sal_Int16 SAL_CALL getFocused( ); + static sal_Int16 SAL_CALL getFocused( ); - virtual bool SAL_CALL preModal( ); - virtual void SAL_CALL postModal( sal_Int16 nDialogResult ); + virtual bool SAL_CALL preModal( ) override; + virtual void SAL_CALL postModal( sal_Int16 nDialogResult ) override; - virtual sal_uInt32 SAL_CALL onFileOk(); - virtual void SAL_CALL onSelChanged( HWND hwndListBox ); + virtual sal_uInt32 SAL_CALL onFileOk() override; + virtual void SAL_CALL onSelChanged( HWND hwndListBox ) override; // only called back if OFN_EXPLORER is set - virtual void SAL_CALL onInitDone(); - virtual void SAL_CALL onFolderChanged(); - virtual void SAL_CALL onTypeChanged( sal_uInt32 nFilterIndex ); + virtual void SAL_CALL onInitDone() override; + virtual void SAL_CALL onFolderChanged() override; + virtual void SAL_CALL onTypeChanged( sal_uInt32 nFilterIndex ) override; // call base class method first when overriding - virtual void SAL_CALL onInitDialog( HWND hwndDlg ); + virtual void SAL_CALL onInitDialog( HWND hwndDlg ) override; - virtual sal_uInt32 SAL_CALL onCtrlCommand( HWND hwndDlg, sal_uInt16 ctrlId, sal_uInt16 notifyCode ); + virtual sal_uInt32 SAL_CALL onCtrlCommand( HWND hwndDlg, sal_uInt16 ctrlId, sal_uInt16 notifyCode ) override; void onWMSize(); - void onWMShow(sal_Bool bShow); + void onWMShow(bool bShow); void onWMWindowPosChanged(); void onCustomControlHelpRequest(LPHELPINFO lphi); private: inline void SAL_CALL appendFilterGroupSeparator( ); - inline sal_Bool SAL_CALL IsCustomControlHelpRequested(LPHELPINFO lphi) const; + static inline bool SAL_CALL IsCustomControlHelpRequested(LPHELPINFO lphi); void EnlargeStdControlLabels() const; @@ -184,7 +184,7 @@ private: CFilePicker* m_FilePicker; WNDPROC m_pfnOldDlgProc; OUString m_defaultName; - sal_Bool m_bInitialSelChanged; + bool m_bInitialSelChanged; CHelpPopupWindow m_HelpPopupWindow; CFilePickerState* m_FilePickerState; CExecuteFilePickerState* m_ExecuteFilePickerState; diff --git a/fpicker/source/win32/filepicker/asynceventnotifier.cxx b/fpicker/source/win32/filepicker/asynceventnotifier.cxx index 854a6b85a5a7..92799c711ff4 100644 --- a/fpicker/source/win32/filepicker/asynceventnotifier.cxx +++ b/fpicker/source/win32/filepicker/asynceventnotifier.cxx @@ -31,7 +31,7 @@ using ::com::sun::star::ui::dialogs::XFilePickerListener; CAsyncEventNotifier::CAsyncEventNotifier(cppu::OBroadcastHelper& rBroadcastHelper) : - m_hThread(0), + m_hThread(nullptr), m_bRun(false), m_ThreadId(0), m_rBroadcastHelper(rBroadcastHelper), @@ -39,22 +39,22 @@ CAsyncEventNotifier::CAsyncEventNotifier(cppu::OBroadcastHelper& rBroadcastHelpe m_ResumeNotifying(m_hEvents[1]) { // m_NotifyEvent - m_hEvents[0] = CreateEvent(0, /* no security */ + m_hEvents[0] = CreateEvent(nullptr, /* no security */ true, /* manual reset */ false, /* initial state not signaled */ - 0); /* automatic name */ + nullptr); /* automatic name */ // m_ResumeNotifying - m_hEvents[1] = CreateEvent(0, /* no security */ + m_hEvents[1] = CreateEvent(nullptr, /* no security */ true, /* manual reset */ false, /* initial state not signaled */ - 0); /* automatic name */ + nullptr); /* automatic name */ } CAsyncEventNotifier::~CAsyncEventNotifier() { - OSL_ENSURE(0 == m_hThread,"Thread not stopped, destroying this instance leads to desaster"); + OSL_ENSURE(nullptr == m_hThread,"Thread not stopped, destroying this instance leads to desaster"); CloseHandle(m_hEvents[0]); CloseHandle(m_hEvents[1]); @@ -98,10 +98,10 @@ bool SAL_CALL CAsyncEventNotifier::startup(bool bCreateSuspended) if (!bCreateSuspended) SetEvent(m_ResumeNotifying); - m_hThread = (HANDLE)_beginthreadex( - NULL, 0, CAsyncEventNotifier::ThreadProc, this, 0, &m_ThreadId); + m_hThread = reinterpret_cast(_beginthreadex( + nullptr, 0, CAsyncEventNotifier::ThreadProc, this, 0, &m_ThreadId)); - OSL_ASSERT(0 != m_hThread); + OSL_ASSERT(nullptr != m_hThread); if (m_hThread) m_bRun = true; @@ -144,7 +144,7 @@ void SAL_CALL CAsyncEventNotifier::shutdown() aGuard.reset(); CloseHandle(m_hThread); - m_hThread = 0; + m_hThread = nullptr; } @@ -250,7 +250,7 @@ unsigned int WINAPI CAsyncEventNotifier::ThreadProc(LPVOID pParam) { osl_setThreadName("fpicker CAsyncEventNotifier::run()"); - CAsyncEventNotifier* pInst = reinterpret_cast< CAsyncEventNotifier* >(pParam); + CAsyncEventNotifier* pInst = static_cast< CAsyncEventNotifier* >(pParam); OSL_ASSERT(pInst); pInst->run(); diff --git a/fpicker/source/win32/filepicker/asyncrequests.cxx b/fpicker/source/win32/filepicker/asyncrequests.cxx index 089beca54d4a..e3e97a0e090b 100644 --- a/fpicker/source/win32/filepicker/asyncrequests.cxx +++ b/fpicker/source/win32/filepicker/asyncrequests.cxx @@ -29,7 +29,7 @@ static void lcl_sleep( ::osl::Condition& aCondition, ::sal_Int32 nMilliSeconds ) { if (nMilliSeconds < 1) - aCondition.wait(0); + aCondition.wait(); else { TimeValue aTime; @@ -61,7 +61,7 @@ void Request::notify() AsyncRequests::AsyncRequests(const RequestHandlerRef& rHandler) : ::cppu::BaseMutex( ) , ::osl::Thread ( ) - , m_bFinish (sal_False) + , m_bFinish (false) , m_rHandler (rHandler ) , m_lRequests ( ) { @@ -71,7 +71,7 @@ AsyncRequests::~AsyncRequests() { // SYNCHRONIZED -> ::osl::ResettableMutexGuard aLock(m_aMutex); - m_bFinish = sal_True; + m_bFinish = true; aLock.clear(); // <- SYNCHRONIZED @@ -107,7 +107,7 @@ void AsyncRequests::triggerRequestBlocked(const RequestRef& rRequest) triggerJobExecution(); - rRequest->wait(Request::WAIT_INFINITE); + rRequest->wait(); } void AsyncRequests::triggerRequestNonBlocked(const RequestRef& rRequest) @@ -129,7 +129,7 @@ void AsyncRequests::triggerRequestDirectly(const RequestRef& rRequest) aLock.clear(); // <- SYNCHRONIZED - if (rHandler != NULL) + if (rHandler != nullptr) rHandler->doRequest(rRequest); } @@ -157,11 +157,11 @@ void SAL_CALL AsyncRequests::run() // SYNCHRONIZED -> ::osl::ResettableMutexGuard aLock(m_aMutex); RequestHandlerRef rHandler = m_rHandler; - sal_Bool bFinished = m_bFinish; + bool bFinished = m_bFinish; aLock.clear(); // <- SYNCHRONIZED - if (rHandler != NULL) + if (rHandler != nullptr) rHandler->before(); while ( ! bFinished) @@ -180,21 +180,21 @@ void SAL_CALL AsyncRequests::run() aLock.clear(); // <- SYNCHRONIZED - if (rRequest == NULL) + if (rRequest == nullptr) { lcl_sleep(maWait, TIME_TO_WAIT_FOR_NEW_REQUESTS); maWait.reset(); continue; } - if (rHandler != NULL) + if (rHandler != nullptr) { rHandler->doRequest(rRequest); rRequest->notify(); } } - if (rHandler != NULL) + if (rHandler != nullptr) rHandler->after(); } diff --git a/fpicker/source/win32/filepicker/asyncrequests.hxx b/fpicker/source/win32/filepicker/asyncrequests.hxx index 2d4a3cf33d43..50f0a56b4286 100644 --- a/fpicker/source/win32/filepicker/asyncrequests.hxx +++ b/fpicker/source/win32/filepicker/asyncrequests.hxx @@ -155,7 +155,7 @@ class AsyncRequests : private ::cppu::BaseMutex /** does nothing special / excepting to make sure our class won't be inline .-) */ - virtual ~AsyncRequests(); + virtual ~AsyncRequests() override; /** @todo document me @@ -191,11 +191,11 @@ class AsyncRequests : private ::cppu::BaseMutex * waiting for requests. Every request will be executed synchronously * in blocked mode. */ - virtual void SAL_CALL run(); + virtual void SAL_CALL run() override; private: - sal_Bool m_bFinish; + bool m_bFinish; RequestHandlerRef m_rHandler; RequestQueue m_lRequests; osl::Condition maWait; diff --git a/fpicker/source/win32/filepicker/comptr.hxx b/fpicker/source/win32/filepicker/comptr.hxx index 289179ea0254..5cc4f4d3f907 100644 --- a/fpicker/source/win32/filepicker/comptr.hxx +++ b/fpicker/source/win32/filepicker/comptr.hxx @@ -36,7 +36,7 @@ class ComPtr */ ComPtr() { - m_pInterface = NULL; + m_pInterface = nullptr; } @@ -81,7 +81,7 @@ class ComPtr HRESULT create() { - return CoCreateInstance(P_CLSID, NULL, CLSCTX_ALL, P_IID, (void**)&m_pInterface); + return CoCreateInstance(P_CLSID, nullptr, CLSCTX_ALL, P_IID, reinterpret_cast(&m_pInterface)); } @@ -170,7 +170,7 @@ class ComPtr if (m_pInterface) { m_pInterface->Release(); - m_pInterface = NULL; + m_pInterface = nullptr; } } @@ -179,12 +179,12 @@ class ComPtr template< class T_QUERYINTERFACE > HRESULT query(T_QUERYINTERFACE** pQuery) { - return m_pInterface->QueryInterface(__uuidof(T_QUERYINTERFACE), (void**)pQuery); + return m_pInterface->QueryInterface(__uuidof(T_QUERYINTERFACE), reinterpret_cast(pQuery)); } #endif - sal_Bool equals(IUnknown* pCheck) + bool equals(IUnknown* pCheck) { if ( ( ! m_pInterface ) && @@ -202,9 +202,9 @@ class ComPtr } - sal_Bool is() + bool is() { - return (m_pInterface != 0); + return (m_pInterface != nullptr); } private: diff --git a/fpicker/source/win32/filepicker/controlaccess.cxx b/fpicker/source/win32/filepicker/controlaccess.cxx index 451c6caad3bd..e867a4a3b396 100644 --- a/fpicker/source/win32/filepicker/controlaccess.cxx +++ b/fpicker/source/win32/filepicker/controlaccess.cxx @@ -47,7 +47,7 @@ namespace CTRL_SETVALUE_FUNCTION_T ListboxSetValueFunctionTable[] = { - NULL, + nullptr, ListboxAddItem, ListboxAddItems, ListboxDeleteItem, @@ -59,12 +59,12 @@ namespace CTRL_GETVALUE_FUNCTION_T ListboxGetValueFunctionTable[] = { - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, ListboxGetItems, ListboxGetSelectedItem, ListboxGetSelectedItemIndex @@ -72,28 +72,28 @@ namespace const size_t SIZE_LISTBOX_GETVALUE_ACTION_TABLE = SAL_N_ELEMENTS( ListboxGetValueFunctionTable ); - struct _ENTRY + struct ENTRY { LPVOID lpFunctionTable; size_t TableSize; }; // an array of function tables, one for each control class - _ENTRY CtrlClassSetValueFunctionTable[] = + ENTRY CtrlClassSetValueFunctionTable[] = { - { NULL, 0 }, + { nullptr, 0 }, { CheckboxSetValueFunctionTable, SIZE_CHECKBOX_SETVALUE_FUNCTION_TABLE }, { ListboxSetValueFunctionTable, SIZE_LISTBOX_SETVALUE_FUNCTION_TABLE }, - { NULL, 0 } + { nullptr, 0 } }; // an array of function tables, one for each control class - _ENTRY CtrlClassGetValueFunctionTable[] = + ENTRY CtrlClassGetValueFunctionTable[] = { - { NULL, 0 }, + { nullptr, 0 }, { CheckboxGetValueFunctionTable, SIZE_CHECKBOX_GETVALUE_FUNCTION_TABLE }, { ListboxGetValueFunctionTable, SIZE_LISTBOX_GETVALUE_ACTION_TABLE }, - { NULL, 0 } + { nullptr, 0 } }; CTRL_SETVALUE_FUNCTION_T SAL_CALL GetCtrlSetValueFunction( @@ -102,7 +102,7 @@ namespace if ( !aCtrlSetValueFunctionTable || aCtrlAction < 0 || sal::static_int_cast< sal_uInt16 >(aCtrlAction) >= aTableSize ) - return NULL; + return nullptr; return aCtrlSetValueFunctionTable[aCtrlAction]; } @@ -113,19 +113,19 @@ namespace if ( !aCtrlGetValueFunctionTable || aCtrlAction < 0 || sal::static_int_cast< sal_uInt16 >(aCtrlAction) >= aTableSize ) - return NULL; + return nullptr; return aCtrlGetValueFunctionTable[aCtrlAction]; } inline - _ENTRY SAL_CALL GetCtrlClassSetValueFunctionTable( CTRL_CLASS aCtrlClass ) + ENTRY SAL_CALL GetCtrlClassSetValueFunctionTable( CTRL_CLASS aCtrlClass ) { return CtrlClassSetValueFunctionTable[aCtrlClass]; } inline - _ENTRY SAL_CALL GetCtrlClassGetValueFunctionTable( CTRL_CLASS aCtrlClass ) + ENTRY SAL_CALL GetCtrlClassGetValueFunctionTable( CTRL_CLASS aCtrlClass ) { return CtrlClassGetValueFunctionTable[aCtrlClass]; } @@ -147,22 +147,22 @@ namespace CTRL_SETVALUE_FUNCTION_T SAL_CALL GetCtrlSetValueFunction( CTRL_CLASS aCtrlClass, sal_Int16 aCtrlAction ) { - _ENTRY aEntry = + ENTRY aEntry = GetCtrlClassSetValueFunctionTable( aCtrlClass ); return GetCtrlSetValueFunction( - reinterpret_cast< CTRL_SETVALUE_FUNCTION_T* >( aEntry.lpFunctionTable ), + static_cast< CTRL_SETVALUE_FUNCTION_T* >( aEntry.lpFunctionTable ), aEntry.TableSize, aCtrlAction ); } CTRL_GETVALUE_FUNCTION_T SAL_CALL GetCtrlGetValueFunction( CTRL_CLASS aCtrlClass, sal_Int16 aCtrlAction ) { - _ENTRY aEntry = + ENTRY aEntry = GetCtrlClassGetValueFunctionTable( aCtrlClass ); return GetCtrlGetValueFunction( - reinterpret_cast< CTRL_GETVALUE_FUNCTION_T* >( aEntry.lpFunctionTable ), + static_cast< CTRL_GETVALUE_FUNCTION_T* >( aEntry.lpFunctionTable ), aEntry.TableSize, aCtrlAction ); } diff --git a/fpicker/source/win32/filepicker/controlcommand.cxx b/fpicker/source/win32/filepicker/controlcommand.cxx index 4dc0e5aa8bea..5296e487a521 100644 --- a/fpicker/source/win32/filepicker/controlcommand.cxx +++ b/fpicker/source/win32/filepicker/controlcommand.cxx @@ -26,7 +26,7 @@ CControlCommand::CControlCommand( sal_Int16 aControlId ) : - m_NextCommand( NULL ), + m_NextCommand( nullptr ), m_aControlId( aControlId ) { } @@ -114,7 +114,7 @@ CControlCommandResult* SAL_CALL CValueControlCommand::handleRequest( CControlCom (value_request->getControlId( ) == getControlId( )) && (value_request->getControlAction( ) == m_aControlAction) ) { - result = new CValueCommandResult( sal_True, m_aValue ); + result = new CValueCommandResult( true, m_aValue ); } else { @@ -175,7 +175,7 @@ CControlCommandResult* SAL_CALL CLabelControlCommand::handleRequest( CControlCom if ( !value_request && (aRequest->getControlId( ) == getControlId( )) ) { - result = new CLabelCommandResult( sal_True, m_aLabel ); + result = new CLabelCommandResult( true, m_aLabel ); } else { @@ -202,7 +202,7 @@ OUString SAL_CALL CLabelControlCommand::getLabel( ) const CEnableControlCommand::CEnableControlCommand( sal_Int16 aControlId, - sal_Bool bEnable ) : + bool bEnable ) : CControlCommand( aControlId ), m_bEnable( bEnable ) { diff --git a/fpicker/source/win32/filepicker/controlcommand.hxx b/fpicker/source/win32/filepicker/controlcommand.hxx index 30a4e0314d72..4c9fe690417c 100644 --- a/fpicker/source/win32/filepicker/controlcommand.hxx +++ b/fpicker/source/win32/filepicker/controlcommand.hxx @@ -67,9 +67,9 @@ public: sal_Int16 aControlAction, const css::uno::Any& aValue ); - virtual void SAL_CALL exec( CFilePickerState* aFilePickerState ); + virtual void SAL_CALL exec( CFilePickerState* aFilePickerState ) override; - virtual CControlCommandResult* SAL_CALL handleRequest( CControlCommandRequest* aRequest ); + virtual CControlCommandResult* SAL_CALL handleRequest( CControlCommandRequest* aRequest ) override; sal_Int16 SAL_CALL getControlAction( ) const; @@ -88,9 +88,9 @@ public: sal_Int16 aControlId, const OUString& aLabel ); - virtual void SAL_CALL exec( CFilePickerState* aFilePickerState ); + virtual void SAL_CALL exec( CFilePickerState* aFilePickerState ) override; - virtual CControlCommandResult* SAL_CALL handleRequest( CControlCommandRequest* aRequest ); + virtual CControlCommandResult* SAL_CALL handleRequest( CControlCommandRequest* aRequest ) override; OUString SAL_CALL getLabel( ) const; @@ -104,12 +104,12 @@ class CEnableControlCommand : public CControlCommand public: CEnableControlCommand( sal_Int16 controlId, - sal_Bool bEnable ); + bool bEnable ); - virtual void SAL_CALL exec( CFilePickerState* aFilePickerState ); + virtual void SAL_CALL exec( CFilePickerState* aFilePickerState ) override; private: - sal_Bool m_bEnable; + bool m_bEnable; }; #endif diff --git a/fpicker/source/win32/filepicker/controlcommandresult.hxx b/fpicker/source/win32/filepicker/controlcommandresult.hxx index 94fa8d6cb4b9..998e5f1c13d3 100644 --- a/fpicker/source/win32/filepicker/controlcommandresult.hxx +++ b/fpicker/source/win32/filepicker/controlcommandresult.hxx @@ -31,7 +31,7 @@ class CControlCommandResult { public: - explicit CControlCommandResult( sal_Bool bResult = sal_False ) : + explicit CControlCommandResult( bool bResult = false ) : m_bResult( bResult ) { } @@ -40,20 +40,20 @@ public: { } - sal_Bool SAL_CALL hasResult( ) const + bool SAL_CALL hasResult( ) const { return m_bResult; } private: - sal_Bool m_bResult; + bool m_bResult; }; class CValueCommandResult : public CControlCommandResult { public: - CValueCommandResult( sal_Bool bResult, const css::uno::Any& aValue ) : + CValueCommandResult( bool bResult, const css::uno::Any& aValue ) : CControlCommandResult( bResult ), m_aValue( aValue ) { @@ -72,7 +72,7 @@ private: class CLabelCommandResult : public CControlCommandResult { public: - CLabelCommandResult( sal_Bool bResult, const OUString& aLabel ) : + CLabelCommandResult( bool bResult, const OUString& aLabel ) : CControlCommandResult( bResult ), m_aLabel( aLabel ) { diff --git a/fpicker/source/win32/filepicker/customcontrolcontainer.hxx b/fpicker/source/win32/filepicker/customcontrolcontainer.hxx index 6b61253168a9..da7d0b50bc44 100644 --- a/fpicker/source/win32/filepicker/customcontrolcontainer.hxx +++ b/fpicker/source/win32/filepicker/customcontrolcontainer.hxx @@ -34,14 +34,14 @@ class CCustomControlContainer : public CCustomControl { public: - virtual ~CCustomControlContainer(); + virtual ~CCustomControlContainer() override; - virtual void SAL_CALL Align(); - virtual void SAL_CALL SetFont(HFONT hFont); + virtual void SAL_CALL Align() override; + virtual void SAL_CALL SetFont(HFONT hFont) override; - virtual void SAL_CALL AddControl(CCustomControl* aCustomControl); - virtual void SAL_CALL RemoveControl(CCustomControl* aCustomControl); - virtual void SAL_CALL RemoveAllControls(); + virtual void SAL_CALL AddControl(CCustomControl* aCustomControl) override; + virtual void SAL_CALL RemoveControl(CCustomControl* aCustomControl) override; + virtual void SAL_CALL RemoveAllControls() override; private: typedef std::list ControlContainer_t; diff --git a/fpicker/source/win32/filepicker/dialogcustomcontrols.cxx b/fpicker/source/win32/filepicker/dialogcustomcontrols.cxx index 7ffdcb931fba..e91854b0b8fb 100644 --- a/fpicker/source/win32/filepicker/dialogcustomcontrols.cxx +++ b/fpicker/source/win32/filepicker/dialogcustomcontrols.cxx @@ -33,8 +33,8 @@ void SAL_CALL CDialogCustomControlBase::SetFont(HFONT hFont) SendMessageW( m_CustomControlHandle, WM_SETFONT, - (WPARAM)hFont, - (LPARAM)sal_True); + reinterpret_cast(hFont), + (LPARAM)true); } diff --git a/fpicker/source/win32/filepicker/dialogcustomcontrols.hxx b/fpicker/source/win32/filepicker/dialogcustomcontrols.hxx index e6dcb732c184..b06a773b83f2 100644 --- a/fpicker/source/win32/filepicker/dialogcustomcontrols.hxx +++ b/fpicker/source/win32/filepicker/dialogcustomcontrols.hxx @@ -36,8 +36,8 @@ class CDummyCustomControl : public CCustomControl public: CDummyCustomControl(HWND aControlHandle, HWND aParentHandle); - virtual void SAL_CALL Align(); - virtual void SAL_CALL SetFont(HFONT hFont); + virtual void SAL_CALL Align() override; + virtual void SAL_CALL SetFont(HFONT hFont) override; }; @@ -46,7 +46,7 @@ class CDialogCustomControlBase : public CCustomControl protected: CDialogCustomControlBase(HWND aControlHandle, HWND aParentHandle); - virtual void SAL_CALL SetFont(HFONT hFont); + virtual void SAL_CALL SetFont(HFONT hFont) override; // aligns the specific control class to a reference // buddy @@ -64,7 +64,7 @@ class CStaticCustomControl : public CDialogCustomControlBase public: CStaticCustomControl(HWND aControlHandle, HWND aParentHandle); - virtual void SAL_CALL Align(); + virtual void SAL_CALL Align() override; }; @@ -73,7 +73,7 @@ class CPushButtonCustomControl : public CDialogCustomControlBase public: CPushButtonCustomControl(HWND aControlHandle, HWND aParentHandle); - virtual void SAL_CALL Align(); + virtual void SAL_CALL Align() override; }; @@ -82,7 +82,7 @@ class CComboboxCustomControl : public CDialogCustomControlBase public: CComboboxCustomControl(HWND aControlHandle, HWND aParentHandle); - virtual void SAL_CALL Align(); + virtual void SAL_CALL Align() override; }; @@ -91,7 +91,7 @@ class CCheckboxCustomControl : public CDialogCustomControlBase public: CCheckboxCustomControl(HWND aControlHandle, HWND aParentHandle); - virtual void SAL_CALL Align(); + virtual void SAL_CALL Align() override; }; #endif diff --git a/fpicker/source/win32/filepicker/dibpreview.cxx b/fpicker/source/win32/filepicker/dibpreview.cxx index 6a8e6ad63abe..86201a438fb6 100644 --- a/fpicker/source/win32/filepicker/dibpreview.cxx +++ b/fpicker/source/win32/filepicker/dibpreview.cxx @@ -50,7 +50,7 @@ ATOM CDIBPreview::s_ClassAtom = 0; sal_Int32 CDIBPreview::s_RegisterDibPreviewWndCount = 0; -CDIBPreview::CDIBPreview(HINSTANCE instance,HWND parent,sal_Bool bShowWindow) : +CDIBPreview::CDIBPreview(HINSTANCE instance,HWND parent,bool bShowWindow) : m_Instance(instance) { RegisterDibPreviewWindowClass(); @@ -67,10 +67,10 @@ CDIBPreview::CDIBPreview(HINSTANCE instance,HWND parent,sal_Bool bShowWindow) : dwStyle, 0, 0, 0, 0, parent, - (HMENU)0x0, // for child windows this will + nullptr, // for child windows this will // be used as child window identifier m_Instance, - (LPVOID)this // pass a pointer to the current + this // pass a pointer to the current // instance of this class ); @@ -149,22 +149,22 @@ void SAL_CALL CDIBPreview::setImage(sal_Int16 aImageFormat, const Any& aImage) aGuard.clear(); - InvalidateRect(m_Hwnd,NULL,sal_False); + InvalidateRect(m_Hwnd,nullptr,false); UpdateWindow(m_Hwnd); } -sal_Bool SAL_CALL CDIBPreview::setShowState(sal_Bool bShowState) throw (RuntimeException) +bool SAL_CALL CDIBPreview::setShowState(bool bShowState) throw (RuntimeException) { PreviewBase::setShowState(bShowState); ShowWindow(m_Hwnd, m_bShowState ? SW_SHOW : SW_HIDE); - return sal_True; + return true; } -sal_Bool SAL_CALL CDIBPreview::getShowState() throw (RuntimeException) +bool SAL_CALL CDIBPreview::getShowState() throw (RuntimeException) { - return (sal_Bool)IsWindowVisible(m_Hwnd); + return bool(IsWindowVisible(m_Hwnd)); } @@ -186,7 +186,7 @@ void SAL_CALL CDIBPreview::onPaint(HWND hWnd, HDC hDC) (pbmfh->bfType == ('B' | ('M' << 8))) ) { BITMAPINFO * pbmi = reinterpret_cast((pbmfh + 1)); - sal_uInt8 * pBits = reinterpret_cast(((DWORD_PTR)pbmfh) + pbmfh->bfOffBits); + sal_uInt8 * pBits = reinterpret_cast(pbmfh) + pbmfh->bfOffBits; int cxDib = pbmi->bmiHeader.biWidth; int cyDib = abs (pbmi->bmiHeader.biHeight); @@ -216,14 +216,14 @@ void SAL_CALL CDIBPreview::onPaint(HWND hWnd, HDC hDC) rc.top = 0; rc.right = nWidth; rc.bottom = nY; - FillRect(hDC,&rc,(HBRUSH)(COLOR_INACTIVEBORDER + 1)); + FillRect(hDC,&rc,reinterpret_cast(COLOR_INACTIVEBORDER + 1)); // bottom rc.left = 0; rc.top = nHeight - nY - 1; rc.right = nWidth; rc.bottom = nHeight; - FillRect(hDC,&rc,(HBRUSH)(COLOR_INACTIVEBORDER + 1)); + FillRect(hDC,&rc,reinterpret_cast(COLOR_INACTIVEBORDER + 1)); } if (nX > 0) @@ -233,26 +233,26 @@ void SAL_CALL CDIBPreview::onPaint(HWND hWnd, HDC hDC) rc.top = nY; rc.right = nX; rc.bottom = nHeight - nY; - FillRect(hDC,&rc,(HBRUSH)(COLOR_INACTIVEBORDER + 1)); + FillRect(hDC,&rc,reinterpret_cast(COLOR_INACTIVEBORDER + 1)); // right rc.left = nWidth - nX - 1; rc.top = nY; rc.right = nWidth; rc.bottom = nHeight - nY; - FillRect(hDC,&rc,(HBRUSH)(COLOR_INACTIVEBORDER + 1)); + FillRect(hDC,&rc,reinterpret_cast(COLOR_INACTIVEBORDER + 1)); } } else // clear background { RECT rc; GetClientRect(hWnd,&rc); - FillRect(hDC,&rc,(HBRUSH)(COLOR_INACTIVEBORDER + 1)); + FillRect(hDC,&rc,reinterpret_cast(COLOR_INACTIVEBORDER + 1)); } } catch(...) { - OSL_ASSERT(sal_False); + OSL_ASSERT(false); } } @@ -284,8 +284,8 @@ LRESULT CALLBACK CDIBPreview::WndProc( case WM_NCDESTROY: { // RemoveProp returns the saved value on success - if (reinterpret_cast( - RemovePropW(hWnd, CURRENT_INSTANCE)) == NULL) + if (static_cast( + RemovePropW(hWnd, CURRENT_INSTANCE)) == nullptr) { OSL_ASSERT(false); } @@ -294,7 +294,7 @@ LRESULT CALLBACK CDIBPreview::WndProc( case WM_PAINT: { - CDIBPreview* pImpl = reinterpret_cast( + CDIBPreview* pImpl = static_cast( GetPropW(hWnd, CURRENT_INSTANCE)); OSL_ASSERT(pImpl); @@ -336,7 +336,7 @@ ATOM SAL_CALL CDIBPreview::RegisterDibPreviewWindowClass() wndClsEx.style = CS_HREDRAW | CS_VREDRAW; wndClsEx.lpfnWndProc = CDIBPreview::WndProc; wndClsEx.hInstance = m_Instance; - wndClsEx.hbrBackground = (HBRUSH)(COLOR_INACTIVEBORDER + 1); + wndClsEx.hbrBackground = reinterpret_cast(COLOR_INACTIVEBORDER + 1); wndClsEx.lpszClassName = PREVIEWWND_CLASS_NAME; // register the preview window class @@ -380,7 +380,7 @@ void SAL_CALL CDIBPreview::UnregisterDibPreviewWindowClass() if (0 == s_RegisterDibPreviewWndCount) { - UnregisterClassW((PCWSTR)(DWORD_PTR)MAKELONG(s_ClassAtom,0),m_Instance); + UnregisterClassW(reinterpret_cast((DWORD_PTR)MAKELONG(s_ClassAtom,0)),m_Instance); s_ClassAtom = 0; } } diff --git a/fpicker/source/win32/filepicker/dibpreview.hxx b/fpicker/source/win32/filepicker/dibpreview.hxx index 27d14b4ef97a..76f74bbb056c 100644 --- a/fpicker/source/win32/filepicker/dibpreview.hxx +++ b/fpicker/source/win32/filepicker/dibpreview.hxx @@ -47,32 +47,32 @@ class CDIBPreview : public PreviewBase public: // ctor - CDIBPreview(HINSTANCE instance,HWND parent,sal_Bool bShowWindow = sal_False); + CDIBPreview(HINSTANCE instance,HWND parent,bool bShowWindow = false); // dtor - virtual ~CDIBPreview( ); + virtual ~CDIBPreview( ) override; // preview interface implementation virtual sal_Int32 SAL_CALL getTargetColorDepth() - throw (css::uno::RuntimeException); + throw (css::uno::RuntimeException) override; virtual sal_Int32 SAL_CALL getAvailableWidth() - throw (css::uno::RuntimeException); + throw (css::uno::RuntimeException) override; virtual sal_Int32 SAL_CALL getAvailableHeight() - throw (css::uno::RuntimeException); + throw (css::uno::RuntimeException) override; virtual void SAL_CALL setImage(sal_Int16 aImageFormat, const css::uno::Any& aImage) - throw (css::lang::IllegalArgumentException, css::uno::RuntimeException); + throw (css::lang::IllegalArgumentException, css::uno::RuntimeException) override; - virtual sal_Bool SAL_CALL setShowState(sal_Bool bShowState) - throw (css::uno::RuntimeException); + virtual bool SAL_CALL setShowState(bool bShowState) + throw (css::uno::RuntimeException) override; - virtual sal_Bool SAL_CALL getShowState() - throw (css::uno::RuntimeException); + virtual bool SAL_CALL getShowState() + throw (css::uno::RuntimeException) override; - virtual HWND SAL_CALL getWindowHandle() const; + virtual HWND SAL_CALL getWindowHandle() const override; private: virtual void SAL_CALL onPaint( HWND hWnd, HDC hDC ); diff --git a/fpicker/source/win32/filepicker/filepickereventnotification.hxx b/fpicker/source/win32/filepicker/filepickereventnotification.hxx index 132e4e937371..bd42281fee5a 100644 --- a/fpicker/source/win32/filepicker/filepickereventnotification.hxx +++ b/fpicker/source/win32/filepicker/filepickereventnotification.hxx @@ -37,7 +37,7 @@ public: public: explicit CFilePickerEventNotification(EventListenerMethod_t EventListenerMethod); - virtual void SAL_CALL notifyEventListener( css::uno::Reference< css::uno::XInterface > xListener ); + virtual void SAL_CALL notifyEventListener( css::uno::Reference< css::uno::XInterface > xListener ) override; private: EventListenerMethod_t m_EventListenerMethod; @@ -54,7 +54,7 @@ public: explicit CFilePickerParamEventNotification(EventListenerMethod_t EventListenerMethod, const css::ui::dialogs::FilePickerEvent& FilePickerEvent); - virtual void SAL_CALL notifyEventListener( css::uno::Reference< css::uno::XInterface > xListener ); + virtual void SAL_CALL notifyEventListener( css::uno::Reference< css::uno::XInterface > xListener ) override; private: EventListenerMethod_t m_EventListenerMethod; diff --git a/fpicker/source/win32/filepicker/filepickerstate.cxx b/fpicker/source/win32/filepicker/filepickerstate.cxx index 51c4a717ed98..5974b9eb8eae 100644 --- a/fpicker/source/win32/filepicker/filepickerstate.cxx +++ b/fpicker/source/win32/filepicker/filepickerstate.cxx @@ -58,7 +58,7 @@ CFilePickerState::~CFilePickerState( ) CNonExecuteFilePickerState::CNonExecuteFilePickerState( ) : - m_FirstControlCommand( NULL ) + m_FirstControlCommand( nullptr ) { } @@ -118,7 +118,7 @@ Any SAL_CALL CNonExecuteFilePickerState::getValue( sal_Int16 aControlId, sal_Int } -void SAL_CALL CNonExecuteFilePickerState::enableControl( sal_Int16 aControlId, sal_Bool bEnable ) +void SAL_CALL CNonExecuteFilePickerState::enableControl( sal_Int16 aControlId, bool bEnable ) { CEnableControlCommand* enable_command = new CEnableControlCommand( aControlId, bEnable ); @@ -281,7 +281,7 @@ void SAL_CALL CNonExecuteFilePickerState::reset( ) currentCommand = nextCommand; } - m_FirstControlCommand = NULL; + m_FirstControlCommand = nullptr; } @@ -300,7 +300,7 @@ void SAL_CALL CNonExecuteFilePickerState::addControlCommand( CControlCommand* aC { OSL_ASSERT( aControlCommand ); - if ( NULL == m_FirstControlCommand ) + if ( nullptr == m_FirstControlCommand ) { m_FirstControlCommand = aControlCommand; } @@ -308,7 +308,7 @@ void SAL_CALL CNonExecuteFilePickerState::addControlCommand( CControlCommand* aC { CControlCommand* pNextControlCommand = m_FirstControlCommand; - while ( pNextControlCommand->getNextCommand( ) != NULL ) + while ( pNextControlCommand->getNextCommand( ) != nullptr ) pNextControlCommand = pNextControlCommand->getNextCommand( ); pNextControlCommand->setNextCommand( aControlCommand ); @@ -397,7 +397,7 @@ Any SAL_CALL CExecuteFilePickerState::getValue( sal_Int16 aControlId, sal_Int16 } -void SAL_CALL CExecuteFilePickerState::enableControl( sal_Int16 aControlId, sal_Bool bEnable ) +void SAL_CALL CExecuteFilePickerState::enableControl( sal_Int16 aControlId, bool bEnable ) { HWND hwndCtrl = GetHwndDlgItem( aControlId ); @@ -568,7 +568,7 @@ void SAL_CALL CExecuteFilePickerState::setHwnd( HWND hwndDlg ) } -inline sal_Bool SAL_CALL CExecuteFilePickerState::IsListboxControl( HWND hwndControl ) const +inline bool SAL_CALL CExecuteFilePickerState::IsListboxControl( HWND hwndControl ) { OSL_PRECOND( IsWindow( hwndControl ), "invalid parameter" ); @@ -584,7 +584,7 @@ inline sal_Bool SAL_CALL CExecuteFilePickerState::IsListboxControl( HWND hwndCon // is the id of the listbox + 100 -inline sal_Int16 SAL_CALL CExecuteFilePickerState::ListboxIdToListboxLabelId( sal_Int16 aListboxId ) const +inline sal_Int16 SAL_CALL CExecuteFilePickerState::ListboxIdToListboxLabelId( sal_Int16 aListboxId ) { return ( aListboxId + LISTBOX_LABEL_OFFSET ); } @@ -601,7 +601,7 @@ inline HWND SAL_CALL CExecuteFilePickerState::GetListboxLabelItem( sal_Int16 aCo } -HWND SAL_CALL CExecuteFilePickerState::GetHwndDlgItem( sal_Int16 aControlId, sal_Bool bIncludeStdCtrls ) const +HWND SAL_CALL CExecuteFilePickerState::GetHwndDlgItem( sal_Int16 aControlId, bool bIncludeStdCtrls ) const { OSL_ENSURE( IsWindow( m_hwndDlg ), "no valid parent window set before" ); diff --git a/fpicker/source/win32/filepicker/filepickerstate.hxx b/fpicker/source/win32/filepicker/filepickerstate.hxx index 1cfd76ba19a4..c08ceb8a3f61 100644 --- a/fpicker/source/win32/filepicker/filepickerstate.hxx +++ b/fpicker/source/win32/filepicker/filepickerstate.hxx @@ -52,7 +52,7 @@ public: virtual css::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 enableControl( sal_Int16 aControlId, bool bEnable ) = 0; virtual void SAL_CALL setLabel( sal_Int16 aControlId, const OUString& aLabel ) = 0; @@ -72,21 +72,21 @@ class CNonExecuteFilePickerState : public CFilePickerState public: CNonExecuteFilePickerState( ); - virtual ~CNonExecuteFilePickerState( ); + virtual ~CNonExecuteFilePickerState( ) override; - virtual void SAL_CALL setValue( sal_Int16 aControlId, sal_Int16 aControlAction, const css::uno::Any& aValue ); + virtual void SAL_CALL setValue( sal_Int16 aControlId, sal_Int16 aControlAction, const css::uno::Any& aValue ) override; - virtual css::uno::Any SAL_CALL getValue( sal_Int16 aControlId, sal_Int16 aControlAction ); + virtual css::uno::Any SAL_CALL getValue( sal_Int16 aControlId, sal_Int16 aControlAction ) override; - virtual void SAL_CALL enableControl( sal_Int16 aControlId, sal_Bool bEnable ); + virtual void SAL_CALL enableControl( sal_Int16 aControlId, bool bEnable ) override; - virtual void SAL_CALL setLabel( sal_Int16 aControlId, const OUString& aLabel ); + virtual void SAL_CALL setLabel( sal_Int16 aControlId, const OUString& aLabel ) override; - virtual OUString SAL_CALL getLabel( sal_Int16 aControlId ); + virtual OUString SAL_CALL getLabel( sal_Int16 aControlId ) override; - virtual css::uno::Sequence< OUString > SAL_CALL getFiles( CFileOpenDialog* aFileOpenDialog ); + virtual css::uno::Sequence< OUString > SAL_CALL getFiles( CFileOpenDialog* aFileOpenDialog ) override; - virtual OUString SAL_CALL getDisplayDirectory( CFileOpenDialog* aFileOpenDialog ); + virtual OUString SAL_CALL getDisplayDirectory( CFileOpenDialog* aFileOpenDialog ) override; void SAL_CALL reset( ); @@ -106,21 +106,21 @@ private: class CExecuteFilePickerState : public CFilePickerState { public: - explicit CExecuteFilePickerState( HWND hwndDlg = NULL ); + explicit CExecuteFilePickerState( HWND hwndDlg = nullptr ); - virtual void SAL_CALL setValue( sal_Int16 aControlId, sal_Int16 aControlAction, const css::uno::Any& aValue ); + virtual void SAL_CALL setValue( sal_Int16 aControlId, sal_Int16 aControlAction, const css::uno::Any& aValue ) override; - virtual css::uno::Any SAL_CALL getValue( sal_Int16 aControlId, sal_Int16 aControlAction ); + virtual css::uno::Any SAL_CALL getValue( sal_Int16 aControlId, sal_Int16 aControlAction ) override; - virtual void SAL_CALL enableControl( sal_Int16 aControlId, sal_Bool bEnable ); + virtual void SAL_CALL enableControl( sal_Int16 aControlId, bool bEnable ) override; - virtual void SAL_CALL setLabel( sal_Int16 aControlId, const OUString& aLabel ); + virtual void SAL_CALL setLabel( sal_Int16 aControlId, const OUString& aLabel ) override; - virtual OUString SAL_CALL getLabel( sal_Int16 aControlId ); + virtual OUString SAL_CALL getLabel( sal_Int16 aControlId ) override; - virtual css::uno::Sequence< OUString > SAL_CALL getFiles( CFileOpenDialog* aFileOpenDialog ); + virtual css::uno::Sequence< OUString > SAL_CALL getFiles( CFileOpenDialog* aFileOpenDialog ) override; - virtual OUString SAL_CALL getDisplayDirectory( CFileOpenDialog* aFileOpenDialog ); + virtual OUString SAL_CALL getDisplayDirectory( CFileOpenDialog* aFileOpenDialog ) override; void SAL_CALL initFilePickerControls( CControlCommand* firstControlCommand ); @@ -130,9 +130,9 @@ public: private: - inline sal_Bool SAL_CALL IsListboxControl( HWND hwndControl ) const; + static inline bool SAL_CALL IsListboxControl( HWND hwndControl ); - inline sal_Int16 SAL_CALL ListboxIdToListboxLabelId( sal_Int16 aListboxId ) const; + static inline sal_Int16 SAL_CALL ListboxIdToListboxLabelId( sal_Int16 aListboxId ); inline HWND SAL_CALL GetListboxLabelItem( sal_Int16 aControlId ) const; @@ -140,7 +140,7 @@ private: // if bIncludeStdCtrls is false, the standard file dialog // controls like OK button, etc. will not be considered // the function return 0 on failure - HWND SAL_CALL GetHwndDlgItem( sal_Int16 aControlId, sal_Bool bIncludeStdCtrls = sal_True ) const; + HWND SAL_CALL GetHwndDlgItem( sal_Int16 aControlId, bool bIncludeStdCtrls = true ) const; HWND m_hwndDlg; }; diff --git a/fpicker/source/win32/filepicker/getfilenamewrapper.cxx b/fpicker/source/win32/filepicker/getfilenamewrapper.cxx index d7cecfbbab40..16b648da24c4 100644 --- a/fpicker/source/win32/filepicker/getfilenamewrapper.cxx +++ b/fpicker/source/win32/filepicker/getfilenamewrapper.cxx @@ -41,17 +41,17 @@ namespace /* private */ class CurDirGuard { - sal_Bool m_bValid; + bool m_bValid; wchar_t* m_pBuffer; DWORD m_nBufLen; public: CurDirGuard() - : m_bValid( sal_False ) - , m_pBuffer( NULL ) + : m_bValid( false ) + , m_pBuffer( nullptr ) , m_nBufLen( 0 ) { - m_nBufLen = GetCurrentDirectoryW( 0, NULL ); + m_nBufLen = GetCurrentDirectoryW( 0, nullptr ); if ( m_nBufLen ) { m_pBuffer = new wchar_t[m_nBufLen]; @@ -89,7 +89,7 @@ namespace /* private */ } delete [] m_pBuffer; - m_pBuffer = NULL; + m_pBuffer = nullptr; } if ( !bDirSet ) @@ -132,9 +132,9 @@ namespace /* private */ CurDirGuard aGuard; GetFileNameParam* lpgfnp = - reinterpret_cast(pParam); + static_cast(pParam); - HRESULT hr = OleInitialize( NULL ); + HRESULT hr = OleInitialize( nullptr ); if (lpgfnp->m_bOpen) lpgfnp->m_bRet = GetOpenFileName(lpgfnp->m_lpofn); @@ -160,7 +160,7 @@ namespace /* private */ unsigned id; HANDLE hThread = reinterpret_cast( - _beginthreadex(0, 0, ThreadProc, &gfnp, 0, &id)); + _beginthreadex(nullptr, 0, ThreadProc, &gfnp, 0, &id)); SAL_WARN_IF( !hThread, "fpicker", "could not create STA thread"); @@ -180,7 +180,7 @@ namespace /* private */ bool IsMTA() { - HRESULT hr = CoInitialize(NULL); + HRESULT hr = CoInitialize(nullptr); if (RPC_E_CHANGED_MODE == hr) return true; @@ -215,7 +215,7 @@ bool CGetFileNameWrapper::getOpenFileName(LPOPENFILENAME lpofn) { CurDirGuard aGuard; - HRESULT hr = OleInitialize( NULL ); + HRESULT hr = OleInitialize( nullptr ); bRet = GetOpenFileName(lpofn); m_ExtendedDialogError = CommDlgExtendedError(); diff --git a/fpicker/source/win32/filepicker/helppopupwindow.cxx b/fpicker/source/win32/filepicker/helppopupwindow.cxx index 77e933dff183..78395ed745bb 100644 --- a/fpicker/source/win32/filepicker/helppopupwindow.cxx +++ b/fpicker/source/win32/filepicker/helppopupwindow.cxx @@ -63,13 +63,13 @@ CHelpPopupWindow::CHelpPopupWindow( m_vMargins( 0 ), m_avCharWidth( 0 ), m_avCharHeight( 0 ), - m_hwnd( NULL ), + m_hwnd( nullptr ), m_hwndParent( hwndParent ), m_hInstance( hInstance ), - m_hBitmapShadow( NULL ), - m_hBrushShadow( NULL ) + m_hBitmapShadow( nullptr ), + m_hBrushShadow( nullptr ) { - m_bWndClassRegistered = RegisterWindowClass( ) ? sal_True : sal_False; + m_bWndClassRegistered = RegisterWindowClass( ); // create a pattern brush for the window shadow WORD aPattern[] = { 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55 }; @@ -101,7 +101,7 @@ void SAL_CALL CHelpPopupWindow::setText( const OUString& aHelpText ) void SAL_CALL CHelpPopupWindow::show( sal_Int32 x, sal_Int32 y ) { - OSL_ENSURE( NULL == m_hwnd, "method should not be called twice in sequence" ); + OSL_ENSURE( nullptr == m_hwnd, "method should not be called twice in sequence" ); // we create a window with length and height of 0 // first in order to get a device context of this @@ -111,16 +111,16 @@ void SAL_CALL CHelpPopupWindow::show( sal_Int32 x, sal_Int32 y ) m_hwnd = CreateWindowExW( 0, HELPPOPUPWND_CLASS_NAME, - NULL, + nullptr, WS_POPUP, 0, 0, 0, 0, m_hwndParent, - NULL, + nullptr, m_hInstance, - (LPVOID)this ); + this ); OSL_ENSURE( m_hwnd, "creating help popup window failed" ); @@ -204,7 +204,7 @@ void SAL_CALL CHelpPopupWindow::adjustWindowSize( sal_Int32* cx_new, sal_Int32* // adjust the window size SetWindowPos( m_hwnd, - NULL, + nullptr, 0, 0, rect.right, @@ -251,7 +251,7 @@ void SAL_CALL CHelpPopupWindow::adjustWindowPos( SetWindowPos( m_hwnd, - NULL, + nullptr, popX, popY, 0, @@ -335,7 +335,7 @@ void SAL_CALL CHelpPopupWindow::onPaint( HWND hWnd, HDC hdc ) DrawTextW( hdc, - (PWSTR)m_HelpText.getStr( ), + m_HelpText.getStr( ), m_HelpText.getLength( ), &rect, nFormat ); @@ -381,7 +381,7 @@ void SAL_CALL CHelpPopupWindow::onPaint( HWND hWnd, HDC hdc ) void SAL_CALL CHelpPopupWindow::onNcDestroy() { - m_hwnd = NULL; + m_hwnd = nullptr; } @@ -426,7 +426,7 @@ LRESULT CALLBACK CHelpPopupWindow::WndProc( OSL_ASSERT( lpcs->lpCreateParams ); - CHelpPopupWindow* pImpl = reinterpret_cast< CHelpPopupWindow* >( + CHelpPopupWindow* pImpl = static_cast< CHelpPopupWindow* >( lpcs->lpCreateParams ); // connect the instance handle to the window @@ -441,7 +441,7 @@ LRESULT CALLBACK CHelpPopupWindow::WndProc( case WM_PAINT: { - CHelpPopupWindow* pImpl = reinterpret_cast< CHelpPopupWindow* >( + CHelpPopupWindow* pImpl = static_cast< CHelpPopupWindow* >( GetPropW( hWnd, CURRENT_INSTANCE ) ); OSL_ASSERT( pImpl ); @@ -457,7 +457,7 @@ LRESULT CALLBACK CHelpPopupWindow::WndProc( case WM_NCDESTROY: { // RemoveProp returns the saved value on success - CHelpPopupWindow* pImpl = reinterpret_cast< CHelpPopupWindow* >( + CHelpPopupWindow* pImpl = static_cast< CHelpPopupWindow* >( RemovePropW( hWnd, CURRENT_INSTANCE ) ); OSL_ASSERT( pImpl ); @@ -497,8 +497,8 @@ ATOM SAL_CALL CHelpPopupWindow::RegisterWindowClass( ) 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.hCursor = LoadCursor(nullptr, IDC_ARROW); + wndClsEx.hbrBackground = static_cast(GetStockObject( NULL_BRUSH )); wndClsEx.lpszClassName = HELPPOPUPWND_CLASS_NAME; // register the preview window class @@ -539,7 +539,7 @@ void SAL_CALL CHelpPopupWindow::UnregisterWindowClass( ) if ( 0 == s_RegisterWndClassCount ) { if ( !UnregisterClassW( - (PCWSTR)(DWORD_PTR)MAKELONG( s_ClassAtom, 0 ), m_hInstance ) ) + reinterpret_cast((DWORD_PTR)MAKELONG( s_ClassAtom, 0 )), m_hInstance ) ) { OSL_FAIL( "unregister window class failed" ); } diff --git a/fpicker/source/win32/filepicker/helppopupwindow.hxx b/fpicker/source/win32/filepicker/helppopupwindow.hxx index 905bb6785646..44f54e268cdf 100644 --- a/fpicker/source/win32/filepicker/helppopupwindow.hxx +++ b/fpicker/source/win32/filepicker/helppopupwindow.hxx @@ -110,7 +110,7 @@ private: HWND m_hwnd; HWND m_hwndParent; HINSTANCE m_hInstance; - sal_Bool m_bWndClassRegistered; + bool m_bWndClassRegistered; OUString m_HelpText; HBITMAP m_hBitmapShadow; HBRUSH m_hBrushShadow; diff --git a/fpicker/source/win32/filepicker/previewadapter.cxx b/fpicker/source/win32/filepicker/previewadapter.cxx index d90047a11f23..851f68b4c231 100644 --- a/fpicker/source/win32/filepicker/previewadapter.cxx +++ b/fpicker/source/win32/filepicker/previewadapter.cxx @@ -53,9 +53,9 @@ public: virtual void SAL_CALL setImage( sal_Int16 aImageFormat, const Any& aImage ) throw (IllegalArgumentException,RuntimeException); - virtual sal_Bool SAL_CALL setShowState(sal_Bool bShowState); + virtual bool SAL_CALL setShowState(bool bShowState); - virtual sal_Bool SAL_CALL getShowState(); + virtual bool SAL_CALL getShowState(); virtual void SAL_CALL setParent(HWND parent); @@ -65,7 +65,7 @@ public: // parent notification handler - virtual void SAL_CALL notifyParentShow(sal_Bool bShow); + virtual void SAL_CALL notifyParentShow(bool bShow); virtual void SAL_CALL notifyParentSizeChanged(); @@ -89,15 +89,15 @@ protected: //prevent copy/assignment private: - CPreviewAdapterImpl(const CPreviewAdapterImpl&); - CPreviewAdapterImpl& operator=(const CPreviewAdapterImpl&); + CPreviewAdapterImpl(const CPreviewAdapterImpl&) = delete; + CPreviewAdapterImpl& operator=(const CPreviewAdapterImpl&) = delete; }; CPreviewAdapterImpl::CPreviewAdapterImpl(HINSTANCE instance) : m_Instance(instance), m_Preview(new PreviewBase()), // create dummy preview (NULL-Object pattern) - m_FileDialog(0), + m_FileDialog(nullptr), m_RightMargin(0) { } @@ -133,15 +133,15 @@ void SAL_CALL CPreviewAdapterImpl::setImage( sal_Int16 aImageFormat, const Any& } -sal_Bool SAL_CALL CPreviewAdapterImpl::setShowState( sal_Bool bShowState ) +bool SAL_CALL CPreviewAdapterImpl::setShowState( bool bShowState ) { - sal_Bool bRet = m_Preview->setShowState(bShowState); + bool bRet = m_Preview->setShowState(bShowState); rearrangeLayout(); return bRet; } -sal_Bool SAL_CALL CPreviewAdapterImpl::getShowState() +bool SAL_CALL CPreviewAdapterImpl::getShowState() { return m_Preview->getShowState(); } @@ -191,7 +191,7 @@ void SAL_CALL CPreviewAdapterImpl::calcRightMargin() } -void SAL_CALL CPreviewAdapterImpl::notifyParentShow(sal_Bool) +void SAL_CALL CPreviewAdapterImpl::notifyParentShow(bool) { } @@ -259,11 +259,11 @@ void SAL_CALL CPreviewAdapterImpl::rearrangeLayout() // resize the filelistbox to the half of the // available space SetWindowPos(flb_new, - NULL, 0, 0, cx, height, + nullptr, 0, 0, cx, height, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); SetWindowPos(flb_old, - NULL, 0, 0, cx, height, + nullptr, 0, 0, cx, height, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); // get the new dimensions of the filelistbox after @@ -288,12 +288,12 @@ void SAL_CALL CPreviewAdapterImpl::rearrangeLayout() // resize the old filelistbox SetWindowPos(flb_old, - NULL, 0, 0, cx, height, + nullptr, 0, 0, cx, height, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); // resize the new filelistbox SetWindowPos(flb_new, - NULL, 0, 0, cx, height, + nullptr, 0, 0, cx, height, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE ); } } @@ -301,7 +301,7 @@ void SAL_CALL CPreviewAdapterImpl::rearrangeLayout() void SAL_CALL CPreviewAdapterImpl::initializeActivePreview() throw(std::runtime_error) { - sal_Bool bShowState = m_Preview->getImaginaryShowState(); + bool bShowState = m_Preview->getImaginaryShowState(); sal_Int16 aImgFrmt; Any aImg; @@ -344,7 +344,7 @@ class CWin95NTPreviewAdapterImpl : public CPreviewAdapterImpl public: explicit CWin95NTPreviewAdapterImpl(HINSTANCE instance); - virtual void SAL_CALL notifyParentShow(sal_Bool bShow); + virtual void SAL_CALL notifyParentShow(bool bShow) override; }; @@ -354,7 +354,7 @@ CWin95NTPreviewAdapterImpl::CWin95NTPreviewAdapterImpl(HINSTANCE instance) : } -void SAL_CALL CWin95NTPreviewAdapterImpl::notifyParentShow(sal_Bool bShow) +void SAL_CALL CWin95NTPreviewAdapterImpl::notifyParentShow(bool bShow) { try { @@ -417,13 +417,13 @@ void SAL_CALL CPreviewAdapter::setImage( sal_Int16 aImageFormat, const Any& aIma } -sal_Bool SAL_CALL CPreviewAdapter::setShowState( sal_Bool bShowState ) +bool SAL_CALL CPreviewAdapter::setShowState( bool bShowState ) { return m_pImpl->setShowState(bShowState); } -sal_Bool SAL_CALL CPreviewAdapter::getShowState() +bool SAL_CALL CPreviewAdapter::getShowState() { return m_pImpl->getShowState(); } diff --git a/fpicker/source/win32/filepicker/previewadapter.hxx b/fpicker/source/win32/filepicker/previewadapter.hxx index 634b9b7c0494..33f5ef54fa0d 100644 --- a/fpicker/source/win32/filepicker/previewadapter.hxx +++ b/fpicker/source/win32/filepicker/previewadapter.hxx @@ -54,7 +54,7 @@ public: ~CPreviewAdapter(); - css::uno::Sequence SAL_CALL getSupportedImageFormats(); + static css::uno::Sequence SAL_CALL getSupportedImageFormats(); sal_Int32 SAL_CALL getTargetColorDepth(); @@ -65,9 +65,9 @@ public: void SAL_CALL setImage(sal_Int16 aImageFormat, const css::uno::Any& aImage) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException); - sal_Bool SAL_CALL setShowState(sal_Bool bShowState); + bool SAL_CALL setShowState(bool bShowState); - sal_Bool SAL_CALL getShowState(); + bool SAL_CALL getShowState(); void SAL_CALL setParent(HWND parent); diff --git a/fpicker/source/win32/filepicker/previewbase.cxx b/fpicker/source/win32/filepicker/previewbase.cxx index ccae08d223ee..8c158b2df4fa 100644 --- a/fpicker/source/win32/filepicker/previewbase.cxx +++ b/fpicker/source/win32/filepicker/previewbase.cxx @@ -28,7 +28,7 @@ using namespace com::sun::star::lang; PreviewBase::PreviewBase() : m_ImageFormat(css::ui::dialogs::FilePreviewImageFormats::BITMAP), - m_bShowState(sal_False) + m_bShowState(false) { } @@ -61,11 +61,11 @@ void SAL_CALL PreviewBase::setImage( sal_Int16 aImageFormat, const css::uno::Any { if (aImageFormat != css::ui::dialogs::FilePreviewImageFormats::BITMAP) throw IllegalArgumentException( - "unsupported image format", 0, 1); + "unsupported image format", nullptr, 1); if (aImage.hasValue() && (aImage.getValueType() != cppu::UnoType>::get())) throw IllegalArgumentException( - "invalid image data", 0, 2); + "invalid image data", nullptr, 2); // save the new image data and force a redraw m_ImageData = aImage; @@ -80,20 +80,20 @@ void SAL_CALL PreviewBase::getImage(sal_Int16& aImageFormat,css::uno::Any& aImag } -sal_Bool SAL_CALL PreviewBase::setShowState( sal_Bool bShowState ) throw (RuntimeException) +bool SAL_CALL PreviewBase::setShowState( bool bShowState ) throw (RuntimeException) { m_bShowState = bShowState; - return sal_True; + return true; } -sal_Bool SAL_CALL PreviewBase::getShowState() throw (RuntimeException) +bool SAL_CALL PreviewBase::getShowState() throw (RuntimeException) { - return sal_False; + return false; } -sal_Bool SAL_CALL PreviewBase::getImaginaryShowState() const +bool SAL_CALL PreviewBase::getImaginaryShowState() const { return m_bShowState; } @@ -101,7 +101,7 @@ sal_Bool SAL_CALL PreviewBase::getImaginaryShowState() const HWND SAL_CALL PreviewBase::getWindowHandle() const { - return 0; + return nullptr; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/fpicker/source/win32/filepicker/previewbase.hxx b/fpicker/source/win32/filepicker/previewbase.hxx index 054103cb1e58..20d04dc50db2 100644 --- a/fpicker/source/win32/filepicker/previewbase.hxx +++ b/fpicker/source/win32/filepicker/previewbase.hxx @@ -57,22 +57,22 @@ public: virtual void SAL_CALL setImage( sal_Int16 aImageFormat, const css::uno::Any& aImage ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException); - virtual sal_Bool SAL_CALL setShowState( sal_Bool bShowState ) + virtual bool SAL_CALL setShowState( bool bShowState ) throw (css::uno::RuntimeException); - virtual sal_Bool SAL_CALL getShowState() + virtual bool SAL_CALL getShowState() throw (css::uno::RuntimeException); virtual void SAL_CALL getImage(sal_Int16& aImageFormat,css::uno::Any& aImage); - sal_Bool SAL_CALL getImaginaryShowState() const; + bool SAL_CALL getImaginaryShowState() const; virtual HWND SAL_CALL getWindowHandle() const; protected: css::uno::Any m_ImageData; sal_Int16 m_ImageFormat; - sal_Bool m_bShowState; + bool m_bShowState; }; diff --git a/fpicker/source/win32/filepicker/shared.hxx b/fpicker/source/win32/filepicker/shared.hxx index fe4db2871222..be8813f32c68 100644 --- a/fpicker/source/win32/filepicker/shared.hxx +++ b/fpicker/source/win32/filepicker/shared.hxx @@ -25,7 +25,7 @@ const OUString BACKSLASH( "\\" ); const OUString FILTER_SEPARATOR( "------------------------------------------" ); const OUString ALL_FILES_WILDCARD( "*.*" ); -const sal_Bool ALLOW_DUPLICATES = sal_True; +const bool ALLOW_DUPLICATES = true; #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/fpicker/source/win32/folderpicker/FolderPicker.hxx b/fpicker/source/win32/folderpicker/FolderPicker.hxx index 331cfee37e36..8f64c889e5cb 100644 --- a/fpicker/source/win32/folderpicker/FolderPicker.hxx +++ b/fpicker/source/win32/folderpicker/FolderPicker.hxx @@ -50,46 +50,46 @@ public: virtual void SAL_CALL setTitle( const OUString& aTitle ) - throw( css::uno::RuntimeException ); + throw( css::uno::RuntimeException ) override; virtual sal_Int16 SAL_CALL execute( ) - throw( css::uno::RuntimeException ); + throw( css::uno::RuntimeException ) override; // XFolderPicker functions virtual void SAL_CALL setDisplayDirectory( const OUString& aDirectory ) - throw( css::lang::IllegalArgumentException, css::uno::RuntimeException ); + throw( css::lang::IllegalArgumentException, css::uno::RuntimeException ) override; virtual OUString SAL_CALL getDisplayDirectory( ) - throw( css::uno::RuntimeException ); + throw( css::uno::RuntimeException ) override; virtual OUString SAL_CALL getDirectory( ) - throw( css::uno::RuntimeException ); + throw( css::uno::RuntimeException ) override; virtual void SAL_CALL setDescription( const OUString& aDescription ) - throw( css::uno::RuntimeException ); + throw( css::uno::RuntimeException ) override; // XServiceInfo virtual OUString SAL_CALL getImplementationName( ) - throw(css::uno::RuntimeException); + throw(css::uno::RuntimeException) override; virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) - throw(css::uno::RuntimeException); + throw(css::uno::RuntimeException) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) - throw(css::uno::RuntimeException); + throw(css::uno::RuntimeException) override; // XCancellable virtual void SAL_CALL cancel( ) - throw(css::uno::RuntimeException); + throw(css::uno::RuntimeException) override; // overwrite base class method, which is called diff --git a/fpicker/source/win32/folderpicker/MtaFop.cxx b/fpicker/source/win32/folderpicker/MtaFop.cxx index 4c9b9e3744c3..11b084f6e7a5 100644 --- a/fpicker/source/win32/folderpicker/MtaFop.cxx +++ b/fpicker/source/win32/folderpicker/MtaFop.cxx @@ -33,9 +33,9 @@ const sal_uInt32 MSG_SHUTDOWN = WM_USER + 2; const sal_uInt32 MAX_WAITTIME = 2000; // msec -const sal_Bool MANUAL_RESET = sal_True; -const sal_Bool AUTO_RESET = sal_False; -const sal_Bool INIT_NONSIGNALED = sal_False; +const bool MANUAL_RESET = true; +const bool AUTO_RESET = false; +const bool INIT_NONSIGNALED = false; namespace { @@ -43,22 +43,22 @@ namespace const char g_szWndClsName[] = "FopStaReqWnd###"; const char* CURRENT_INSTANCE = "CurrInst"; - typedef struct _RequestContext + struct RequestContext { HANDLE hEvent; - sal_Bool bRet; - } RequestContext; + bool bRet; + }; - inline sal_Bool InitializeRequestContext( RequestContext* aRequestContext ) + inline bool InitializeRequestContext( RequestContext* aRequestContext ) { OSL_ASSERT( aRequestContext ); aRequestContext->hEvent = CreateEventA( - 0, AUTO_RESET, INIT_NONSIGNALED, NULL ); + nullptr, AUTO_RESET, INIT_NONSIGNALED, nullptr ); - aRequestContext->bRet = sal_False; + aRequestContext->bRet = false; - return ( 0 != aRequestContext->hEvent ); + return ( nullptr != aRequestContext->hEvent ); } inline void DeinitializeRequestContext( RequestContext* aRequestContext ) @@ -73,7 +73,7 @@ namespace bool IsMTA() { - HRESULT hr = CoInitialize(NULL); + HRESULT hr = CoInitialize(nullptr); if (RPC_E_CHANGED_MODE == hr) return true; @@ -98,10 +98,10 @@ sal_Int32 CMtaFolderPicker::s_StaRequestWndRegisterCount = 0; CMtaFolderPicker::CMtaFolderPicker( sal_uInt32 Flags ) : - m_hStaThread( NULL ), + m_hStaThread( nullptr ), m_uStaThreadId( 0 ), - m_hEvtThrdReady( NULL ), - m_hwndStaRequestWnd( NULL ) + m_hEvtThrdReady( nullptr ), + m_hwndStaRequestWnd( nullptr ) { m_hInstance = GetModuleHandleA( FOLDERPICKER_SRV_DLL_NAME ); OSL_ENSURE( m_hInstance, "The name of the FolderPicker service dll must have changed" ); @@ -146,21 +146,21 @@ CMtaFolderPicker::CMtaFolderPicker( sal_uInt32 Flags ) : // signals that the thread was successfully set up m_hEvtThrdReady = CreateEventA( - 0, + nullptr, MANUAL_RESET, INIT_NONSIGNALED, - NULL ); + nullptr ); if ( m_hEvtThrdReady ) { // setup the sta thread - m_hStaThread = (HANDLE)_beginthreadex( - NULL, + m_hStaThread = reinterpret_cast(_beginthreadex( + nullptr, 0, CMtaFolderPicker::StaThreadProc, this, 0, - &m_uStaThreadId ); + &m_uStaThreadId )); OSL_ASSERT( m_hStaThread ); } @@ -222,9 +222,9 @@ CMtaFolderPicker::~CMtaFolderPicker( ) } -sal_Bool CMtaFolderPicker::browseForFolder( ) +bool CMtaFolderPicker::browseForFolder( ) { - sal_Bool bRet = sal_False; + bool bRet = false; if (IsMTA()) { @@ -234,15 +234,15 @@ sal_Bool CMtaFolderPicker::browseForFolder( ) if ( WaitForSingleObject( m_hEvtThrdReady, MAX_WAITTIME ) != WAIT_OBJECT_0 ) { OSL_FAIL( "sta thread not ready" ); - return sal_False; + return false; } RequestContext aReqCtx; if ( !InitializeRequestContext( &aReqCtx ) ) { - OSL_ASSERT( sal_False ); - return sal_False; + OSL_ASSERT( false ); + return false; } // marshall request into the sta thread @@ -257,18 +257,18 @@ sal_Bool CMtaFolderPicker::browseForFolder( ) // window messages so that we don't block // our parent window - sal_Bool bContinue = sal_True; + bool bContinue = true; while ( bContinue ) { DWORD dwResult = MsgWaitForMultipleObjects( - 1, &aReqCtx.hEvent, sal_False, INFINITE, QS_ALLEVENTS ); + 1, &aReqCtx.hEvent, false, INFINITE, QS_ALLEVENTS ); switch ( dwResult ) { // the request context event is signaled case WAIT_OBJECT_0: - bContinue = sal_False; + bContinue = false; break; // a window message has arrived @@ -281,14 +281,14 @@ sal_Bool CMtaFolderPicker::browseForFolder( ) // mouse messages are for the FolderPicker which // is in the foreground and should not arrive here MSG msg; - while ( PeekMessageA( &msg, NULL, 0, 0, PM_REMOVE ) ) + while ( PeekMessageA( &msg, nullptr, 0, 0, PM_REMOVE ) ) DispatchMessageA(&msg); } break; // should not happen default: - OSL_ASSERT( sal_False ); + OSL_ASSERT( false ); } } @@ -353,27 +353,27 @@ void SAL_CALL CMtaFolderPicker::cancel( ) m_hwnd, WM_COMMAND, MAKEWPARAM( IDCANCEL, BN_CLICKED ), - (LPARAM)GetDlgItem( m_hwnd, IDCANCEL ) ); + reinterpret_cast(GetDlgItem( m_hwnd, IDCANCEL )) ); SAL_WARN_IF(0 == ret, "fpicker", "ERROR: PostMessage() failed!"); } } -sal_Bool SAL_CALL CMtaFolderPicker::onBrowseForFolder( ) +bool SAL_CALL CMtaFolderPicker::onBrowseForFolder( ) { - sal_Bool bRet; + bool bRet; LPITEMIDLIST lpiid; // pre SHBrowseFroFolder - m_bi.pidlRoot = 0; + m_bi.pidlRoot = nullptr; m_bi.pszDisplayName = reinterpret_cast(m_pathBuff.get()); if ( m_Description.getLength( ) ) m_bi.lpszTitle = reinterpret_cast(m_Description.getStr( )); lpiid = SHBrowseForFolderW( &m_bi ); - bRet = ( NULL != lpiid ); + bRet = ( nullptr != lpiid ); // post SHBrowseForFolder @@ -391,7 +391,7 @@ void SAL_CALL CMtaFolderPicker::releaseItemIdList( LPITEMIDLIST lpItemIdList ) if (pIMalloc.is()) { pIMalloc->Free(lpItemIdList); - lpItemIdList = NULL; + lpItemIdList = nullptr; } } @@ -400,9 +400,9 @@ LPITEMIDLIST SAL_CALL CMtaFolderPicker::getItemIdListFromPath( const OUString& a { // parameter checking if ( !aDirectory.getLength( ) ) - return NULL; + return nullptr; - LPITEMIDLIST lpItemIdList(NULL); + LPITEMIDLIST lpItemIdList(nullptr); sal::systools::COMReference pIShellFolder; SHGetDesktopFolder(&pIShellFolder); @@ -410,12 +410,12 @@ LPITEMIDLIST SAL_CALL CMtaFolderPicker::getItemIdListFromPath( const OUString& a if (pIShellFolder.is()) { pIShellFolder->ParseDisplayName( - NULL, - NULL, + nullptr, + nullptr, reinterpret_cast(const_cast< sal_Unicode* >( aDirectory.getStr( ) )), - NULL, + nullptr, &lpItemIdList, - NULL ); + nullptr ); } return lpItemIdList; @@ -437,7 +437,7 @@ OUString SAL_CALL CMtaFolderPicker::getPathFromItemIdList( LPCITEMIDLIST lpItemI } -void SAL_CALL CMtaFolderPicker::enableOk( sal_Bool bEnable ) +void SAL_CALL CMtaFolderPicker::enableOk( bool bEnable ) { OSL_ASSERT( IsWindow( m_hwnd ) ); @@ -456,7 +456,7 @@ void SAL_CALL CMtaFolderPicker::setSelection( const OUString& aDirectory ) SendMessageW( m_hwnd, BFFM_SETSELECTIONW, - static_cast< WPARAM >( sal_True ), + static_cast< WPARAM >( true ), reinterpret_cast< LPARAM >( aDirectory.getStr( ) ) ); } @@ -482,8 +482,8 @@ void SAL_CALL CMtaFolderPicker::onInitialized( ) SendMessageA( m_hwnd, BFFM_SETSELECTION, - (WPARAM)sal_False, - (LPARAM) lpiidDisplayDir ); + (WPARAM)false, + reinterpret_cast(lpiidDisplayDir) ); releaseItemIdList( lpiidDisplayDir ); } @@ -520,11 +520,11 @@ int CALLBACK CMtaFolderPicker::FolderPickerCallback( HWND hwnd, UINT uMsg, LPARA break; case BFFM_VALIDATEFAILEDW: - nRC = pImpl->onValidateFailed(); + nRC = CMtaFolderPicker::onValidateFailed(); break; default: - OSL_ASSERT( sal_False ); + OSL_ASSERT( false ); } return nRC; @@ -537,7 +537,7 @@ int CALLBACK CMtaFolderPicker::FolderPickerCallback( HWND hwnd, UINT uMsg, LPARA LRESULT CALLBACK CMtaFolderPicker::StaWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ) { LRESULT lResult = 0; - CMtaFolderPicker* pImpl = NULL; + CMtaFolderPicker* pImpl = nullptr; /* we connect to the belonging class instance of this @@ -562,7 +562,7 @@ LRESULT CALLBACK CMtaFolderPicker::StaWndProc( HWND hWnd, UINT uMsg, WPARAM wPar case WM_NCDESTROY: // RemoveProp returns the saved value on success - pImpl = reinterpret_cast< CMtaFolderPicker* >( + pImpl = static_cast< CMtaFolderPicker* >( RemovePropA( hWnd, CURRENT_INSTANCE ) ); OSL_ASSERT( pImpl && !IsBadReadPtr( pImpl, sizeof( CMtaFolderPicker ) ) ); @@ -573,7 +573,7 @@ LRESULT CALLBACK CMtaFolderPicker::StaWndProc( HWND hWnd, UINT uMsg, WPARAM wPar RequestContext* aReqCtx = reinterpret_cast< RequestContext* >( lParam ); OSL_ASSERT( aReqCtx ); - pImpl = reinterpret_cast< CMtaFolderPicker* >( + pImpl = static_cast< CMtaFolderPicker* >( GetPropA( hWnd, CURRENT_INSTANCE ) ); OSL_ASSERT( pImpl && !IsBadReadPtr( pImpl, sizeof( CMtaFolderPicker ) ) ); @@ -584,7 +584,7 @@ LRESULT CALLBACK CMtaFolderPicker::StaWndProc( HWND hWnd, UINT uMsg, WPARAM wPar break; case MSG_SHUTDOWN: - pImpl = reinterpret_cast< CMtaFolderPicker* >( + pImpl = static_cast< CMtaFolderPicker* >( GetPropA( hWnd, CURRENT_INSTANCE ) ); OSL_ASSERT( pImpl && !IsBadReadPtr( pImpl, sizeof( CMtaFolderPicker ) ) ); @@ -605,17 +605,17 @@ LRESULT CALLBACK CMtaFolderPicker::StaWndProc( HWND hWnd, UINT uMsg, WPARAM wPar } -sal_Bool SAL_CALL CMtaFolderPicker::createStaRequestWindow( ) +bool SAL_CALL CMtaFolderPicker::createStaRequestWindow( ) { bool bIsWnd = false; if ( RegisterStaRequestWindowClass( ) ) { m_hwndStaRequestWnd = CreateWindowA( - g_szWndClsName, NULL, + g_szWndClsName, nullptr, 0, 0, 0, 0, 0, - NULL, NULL, m_hInstance, - (LPVOID)this // provide the instance of the class + nullptr, nullptr, m_hInstance, + this // provide the instance of the class ); bIsWnd = IsWindow( m_hwndStaRequestWnd ); @@ -638,7 +638,7 @@ unsigned int CMtaFolderPicker::run( ) OSL_ASSERT( m_hEvtThrdReady ); // setup an sta environment - HRESULT hr = CoInitialize( NULL ); + HRESULT hr = CoInitialize( nullptr ); // if we can't setup an sta environment // we stop here and return @@ -656,7 +656,7 @@ unsigned int CMtaFolderPicker::run( ) // pumping messages MSG msg; - while( GetMessageA( &msg, NULL, 0, 0 ) ) + while( GetMessageA( &msg, nullptr, 0, 0 ) ) DispatchMessageA( &msg ); nRet = 0; @@ -679,11 +679,11 @@ unsigned int WINAPI CMtaFolderPicker::StaThreadProc( LPVOID pParam ) osl_setThreadName("fpicker CMtaFolderPicker::run()"); CMtaFolderPicker* pInst = - reinterpret_cast( pParam ); + static_cast( pParam ); OSL_ASSERT( pInst ); - HRESULT hr = OleInitialize( NULL ); + HRESULT hr = OleInitialize( nullptr ); unsigned int result = pInst->run( ); @@ -710,12 +710,12 @@ ATOM SAL_CALL CMtaFolderPicker::RegisterStaRequestWindowClass( ) wcex.cbClsExtra = 0; wcex.cbWndExtra = 0; wcex.hInstance = m_hInstance; - wcex.hIcon = NULL; - wcex.hCursor = NULL; - wcex.hbrBackground = NULL; - wcex.lpszMenuName = NULL; + wcex.hIcon = nullptr; + wcex.hCursor = nullptr; + wcex.hbrBackground = nullptr; + wcex.lpszMenuName = nullptr; wcex.lpszClassName = g_szWndClsName; - wcex.hIconSm = NULL; + wcex.hIconSm = nullptr; s_ClassAtom = RegisterClassExA( &wcex ); OSL_ASSERT( s_ClassAtom ); @@ -749,7 +749,7 @@ void SAL_CALL CMtaFolderPicker::UnregisterStaRequestWindowClass( ) if ( 0 == s_StaRequestWndRegisterCount ) { UnregisterClassA( - (PCSTR)(DWORD_PTR)MAKELONG( s_ClassAtom, 0 ), m_hInstance ); + reinterpret_cast((DWORD_PTR)MAKELONG( s_ClassAtom, 0 )), m_hInstance ); s_ClassAtom = 0; } diff --git a/fpicker/source/win32/folderpicker/MtaFop.hxx b/fpicker/source/win32/folderpicker/MtaFop.hxx index c85d6b420332..a068faf2e031 100644 --- a/fpicker/source/win32/folderpicker/MtaFop.hxx +++ b/fpicker/source/win32/folderpicker/MtaFop.hxx @@ -100,7 +100,7 @@ public: virtual ~CMtaFolderPicker( ); // shell functions - sal_Bool SAL_CALL browseForFolder( ); + bool SAL_CALL browseForFolder( ); virtual void SAL_CALL setDisplayDirectory( const OUString& aDirectory ); virtual OUString SAL_CALL getDisplayDirectory( ); @@ -118,7 +118,7 @@ public: virtual void SAL_CALL cancel( ); protected: - void SAL_CALL enableOk( sal_Bool bEnable ); + void SAL_CALL enableOk( bool bEnable ); void SAL_CALL setSelection( const OUString& aDirectory ); void SAL_CALL setStatusText( const OUString& aStatusText ); @@ -126,25 +126,25 @@ protected: virtual void SAL_CALL onSelChanged( const OUString& aNewPath ) = 0; private: - sal_uInt32 onValidateFailed(); + static sal_uInt32 onValidateFailed(); // helper functions - LPITEMIDLIST SAL_CALL getItemIdListFromPath( const OUString& aDirectory ); + static LPITEMIDLIST SAL_CALL getItemIdListFromPath( const OUString& aDirectory ); OUString SAL_CALL getPathFromItemIdList( LPCITEMIDLIST lpItemIdList ); - void SAL_CALL releaseItemIdList( LPITEMIDLIST lpItemIdList ); + static void SAL_CALL releaseItemIdList( LPITEMIDLIST lpItemIdList ); unsigned int run( ); // create a hidden windows which serves as an request // target; so we guarantee synchronization - sal_Bool SAL_CALL createStaRequestWindow( ); + bool SAL_CALL createStaRequestWindow( ); // message handler functions; remember these functions are called // from a different thread context! - sal_Bool SAL_CALL onBrowseForFolder( ); + bool SAL_CALL onBrowseForFolder( ); static LRESULT CALLBACK StaWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ); static unsigned int WINAPI StaThreadProc( LPVOID pParam ); diff --git a/fpicker/source/win32/folderpicker/WinFOPImpl.hxx b/fpicker/source/win32/folderpicker/WinFOPImpl.hxx index e5336b3adb85..b6b867865b29 100644 --- a/fpicker/source/win32/folderpicker/WinFOPImpl.hxx +++ b/fpicker/source/win32/folderpicker/WinFOPImpl.hxx @@ -47,16 +47,16 @@ public: virtual void SAL_CALL setDisplayDirectory( const OUString& aDirectory ) - throw( css::lang::IllegalArgumentException, css::uno::RuntimeException ); + throw( css::lang::IllegalArgumentException, css::uno::RuntimeException ) override; virtual OUString SAL_CALL getDisplayDirectory( ) - throw( css::uno::RuntimeException ); + throw( css::uno::RuntimeException ) override; virtual OUString SAL_CALL getDirectory( ) - throw( css::uno::RuntimeException ); + throw( css::uno::RuntimeException ) override; protected: - virtual void SAL_CALL onSelChanged( const OUString& aNewPath ); + virtual void SAL_CALL onSelChanged( const OUString& aNewPath ) override; private: CFolderPicker* m_pFolderPicker; diff --git a/fpicker/source/win32/misc/WinImplHelper.cxx b/fpicker/source/win32/misc/WinImplHelper.cxx index 2f06476b573f..b81750a80173 100644 --- a/fpicker/source/win32/misc/WinImplHelper.cxx +++ b/fpicker/source/win32/misc/WinImplHelper.cxx @@ -58,7 +58,7 @@ bool SAL_CALL IsWindowsVistaOrNewer() { // the Win32 SDK 8.1 deprecates GetVersionEx() #ifdef _WIN32_WINNT_WINBLUE - return IsWindowsVistaOrGreater() ? true : false; + return IsWindowsVistaOrGreater(); #else OSVERSIONINFO osvi; osvi.dwOSVersionInfoSize = sizeof(osvi); @@ -244,7 +244,7 @@ Any SAL_CALL ListboxGetItems( HWND hwnd ) { aItemList.realloc( nItemCount ); - for ( sal_Int32 i = 0; i < nItemCount; i++ ) + for ( LRESULT i = 0; i < nItemCount; i++ ) { aItemList[i] = ListboxGetString( hwnd, i ); } @@ -293,12 +293,12 @@ void SAL_CALL CheckboxSetState( rXInterface, aArgPos ); - sal_Bool bCheckState = *reinterpret_cast< const sal_Bool* >( aState.getValue( ) ); + bool bCheckState = *static_cast< const sal_Bool* >( aState.getValue( ) ); WPARAM wParam = bCheckState ? BST_CHECKED : BST_UNCHECKED; SendMessageW( hwnd, BM_SETCHECK, wParam, 0 ); } -sal_uInt32 SAL_CALL _wcslenex( const sal_Unicode* pStr ) +sal_uInt32 SAL_CALL wcslenex( const sal_Unicode* pStr ) { if ( !pStr ) return 0; diff --git a/fpicker/source/win32/misc/WinImplHelper.hxx b/fpicker/source/win32/misc/WinImplHelper.hxx index b6f2751a2a8b..a5ac793cef95 100644 --- a/fpicker/source/win32/misc/WinImplHelper.hxx +++ b/fpicker/source/win32/misc/WinImplHelper.hxx @@ -73,7 +73,7 @@ void SAL_CALL CheckboxSetState( // ending strings used in some Win32 functions // e.g. Filter\0*.txt\0\0 // the returned length excludes the last '\0' -sal_uInt32 SAL_CALL _wcslenex( const sal_Unicode* pStr ); +sal_uInt32 SAL_CALL wcslenex( const sal_Unicode* pStr ); // converts a soffice label to a windows label diff --git a/fpicker/source/win32/misc/resourceprovider.cxx b/fpicker/source/win32/misc/resourceprovider.cxx index 25778aac84cf..ba47da275959 100644 --- a/fpicker/source/win32/misc/resourceprovider.cxx +++ b/fpicker/source/win32/misc/resourceprovider.cxx @@ -37,13 +37,13 @@ using namespace ::com::sun::star::ui::dialogs::CommonFilePickerElementIds; // we have to translate control ids to resource ids -struct _Entry +struct Entry { sal_Int32 ctrlId; sal_Int16 resId; }; -_Entry CtrlIdToResIdTable[] = { +Entry CtrlIdToResIdTable[] = { { CHECKBOX_AUTOEXTENSION, STR_SVT_FILEPICKER_AUTO_EXTENSION }, { CHECKBOX_PASSWORD, STR_SVT_FILEPICKER_PASSWORD }, { CHECKBOX_FILTEROPTIONS, STR_SVT_FILEPICKER_FILTER_OPTIONS }, -- cgit