From 9108dc39525fb1d881d5b4a634039a25ef2d2d25 Mon Sep 17 00:00:00 2001 From: Berk Gureken Date: Mon, 1 Feb 2016 12:07:06 +0200 Subject: tdf#43157 Cleanup DBG_ASSERT for fpicker and framework Change-Id: I1b79a39a9d709184cc72a905647f73dbf85eef27 Signed-off-by: Berk Gureken Reviewed-on: https://gerrit.libreoffice.org/21991 Reviewed-by: Michael Stahl Tested-by: Michael Stahl --- fpicker/source/office/asyncfilepicker.cxx | 4 ++-- fpicker/source/office/commonpicker.cxx | 2 +- fpicker/source/office/fpinteraction.cxx | 2 +- fpicker/source/office/fpsmartcontent.cxx | 2 +- fpicker/source/office/iodlg.cxx | 32 +++++++++++++++---------------- fpicker/source/office/iodlgimp.cxx | 2 +- 6 files changed, 22 insertions(+), 22 deletions(-) (limited to 'fpicker') diff --git a/fpicker/source/office/asyncfilepicker.cxx b/fpicker/source/office/asyncfilepicker.cxx index e1dade722bb2..2f390e621797 100644 --- a/fpicker/source/office/asyncfilepicker.cxx +++ b/fpicker/source/office/asyncfilepicker.cxx @@ -34,8 +34,8 @@ namespace svt ,m_pDialog ( _pDialog ) ,m_bRunning ( false ) { - DBG_ASSERT( m_pDialog, "AsyncPickerAction::AsyncPickerAction: invalid dialog!" ); - DBG_ASSERT( m_pView, "AsyncPickerAction::AsyncPickerAction: invalid view!" ); + assert( m_pDialog && "AsyncPickerAction::AsyncPickerAction: invalid dialog!" ); + assert( m_pView && "AsyncPickerAction::AsyncPickerAction: invalid view!" ); } diff --git a/fpicker/source/office/commonpicker.cxx b/fpicker/source/office/commonpicker.cxx index f47c956e5ba1..c856bda72267 100644 --- a/fpicker/source/office/commonpicker.cxx +++ b/fpicker/source/office/commonpicker.cxx @@ -201,7 +201,7 @@ namespace svt if ( !m_pDlg ) { m_pDlg.reset( implCreateDialog( VCLUnoHelper::GetWindow( m_xDialogParent ) ) ); - DBG_ASSERT( m_pDlg, "OCommonPicker::createPicker: invalid dialog returned!" ); + SAL_WARN_IF( !m_pDlg, "fpicker.office", "OCommonPicker::createPicker: invalid dialog returned!" ); if ( m_pDlg ) { diff --git a/fpicker/source/office/fpinteraction.cxx b/fpicker/source/office/fpinteraction.cxx index a991e3044529..ccf6edec5a55 100644 --- a/fpicker/source/office/fpinteraction.cxx +++ b/fpicker/source/office/fpinteraction.cxx @@ -38,7 +38,7 @@ namespace svt ,m_bUsed( false ) ,m_eInterceptions( OFilePickerInteractionHandler::E_NOINTERCEPTION ) { - DBG_ASSERT( m_xMaster.is(), "OFilePickerInteractionHandler::OFilePickerInteractionHandler: invalid master handler!" ); + SAL_WARN_IF( !m_xMaster.is(), "fpicker.office", "OFilePickerInteractionHandler::OFilePickerInteractionHandler: invalid master handler!" ); } diff --git a/fpicker/source/office/fpsmartcontent.cxx b/fpicker/source/office/fpsmartcontent.cxx index 719dda1a2824..fc5af8d4af06 100644 --- a/fpicker/source/office/fpsmartcontent.cxx +++ b/fpicker/source/office/fpsmartcontent.cxx @@ -193,7 +193,7 @@ namespace svt if ( isInvalid() || !isBound() ) return false; - DBG_ASSERT( m_pContent, "SmartContent::implIs: inconsistence!" ); + assert( m_pContent && "SmartContent::implIs: inconsistence!" ); // if, after an bindTo, we don't have a content, then we should be INVALID, or at least // NOT_BOUND (the latter happens, for example, if somebody tries to ask for an empty URL) diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx index 3365bb28ce51..14bff94687de 100644 --- a/fpicker/source/office/iodlg.cxx +++ b/fpicker/source/office/iodlg.cxx @@ -121,7 +121,7 @@ namespace OUString getMostCurrentFilter( SvtExpFileDlg_Impl* pImpl ) { - DBG_ASSERT( pImpl, "invalid impl pointer" ); + assert( pImpl && "invalid impl pointer" ); const SvtFileDialogFilter_Impl* pFilter = pImpl->_pUserFilter; if ( !pFilter ) @@ -136,8 +136,8 @@ namespace bool restoreCurrentFilter( SvtExpFileDlg_Impl* _pImpl ) { - DBG_ASSERT( _pImpl->GetCurFilter(), "restoreCurrentFilter: no current filter!" ); - DBG_ASSERT( !_pImpl->GetCurFilterDisplayName().isEmpty(), "restoreCurrentFilter: no current filter (no display name)!" ); + SAL_WARN_IF( !_pImpl->GetCurFilter(), "fpicker.office", "restoreCurrentFilter: no current filter!" ); + SAL_WARN_IF( _pImpl->GetCurFilterDisplayName().isEmpty(), "fpicker.office", "restoreCurrentFilter: no current filter (no display name)!" ); _pImpl->SelectFilterListEntry( _pImpl->GetCurFilterDisplayName() ); @@ -253,7 +253,7 @@ namespace comphelper::getProcessComponentContext() )-> queryContentProvider( _rForURL ) ); - DBG_ASSERT( xProvider.is(), "lcl_getHomeDirectory: could not find a (valid) content provider for the current URL!" ); + SAL_WARN_IF( !xProvider.is(), "fpicker.office", "lcl_getHomeDirectory: could not find a (valid) content provider for the current URL!" ); Reference< XPropertySet > xProviderProps( xProvider, UNO_QUERY ); if ( xProviderProps.is() ) { @@ -1474,7 +1474,7 @@ void SvtFileDialog::UpdateControls( const OUString& rURL ) { OUString sText; - DBG_ASSERT( INetProtocol::NotValid != aObj.GetProtocol(), "SvtFileDialog::UpdateControls: Invalid URL!" ); + SAL_WARN_IF( INetProtocol::NotValid == aObj.GetProtocol(), "fpicker.office", "SvtFileDialog::UpdateControls: Invalid URL!" ); if ( aObj.getSegmentCount() ) { @@ -1521,7 +1521,7 @@ void SvtFileDialog::UpdateControls( const OUString& rURL ) IMPL_LINK_TYPED( SvtFileDialog, SelectHdl_Impl, SvTreeListBox*, pBox, void ) { SvTreeListEntry* pEntry = pBox->FirstSelected(); - DBG_ASSERT( pEntry, "SelectHandler without selected entry" ); + assert( pEntry && "SelectHandler without selected entry" ); SvtContentEntry* pUserData = static_cast(pEntry->GetUserData()); if ( pUserData ) @@ -1600,8 +1600,8 @@ IMPL_LINK_TYPED( SvtFileDialog, OpenDoneHdl_Impl, SvtFileView*, pView, void ) { // additional check: the parent folder should not be prohibited INetURLObject aCurrentFolder( sCurrentFolder ); - DBG_ASSERT( INetProtocol::NotValid != aCurrentFolder.GetProtocol(), - "SvtFileDialog::OpenDoneHdl_Impl: invalid current URL!" ); + SAL_WARN_IF( INetProtocol::NotValid == aCurrentFolder.GetProtocol(), + "fpicker.office", "SvtFileDialog::OpenDoneHdl_Impl: invalid current URL!" ); aCurrentFolder.removeSegment(); } @@ -1779,7 +1779,7 @@ short SvtFileDialog::Execute() short nResult = ModalDialog::Execute(); _bIsInExecute = false; - DBG_ASSERT( !m_pCurrentAsyncAction.is(), "SvtFilePicker::Execute: still running an async action!" ); + SAL_WARN_IF( m_pCurrentAsyncAction.is(), "fpicker.office", "SvtFilePicker::Execute: still running an async action!" ); // the dialog should not be cancellable while an async action is running - first, the action // needs to be cancelled @@ -2027,7 +2027,7 @@ short SvtFileDialog::PrepareExecute() } } SvtFileDialogFilter_Impl* pNewCurFilter = _pImp->m_aFilter[ nPos ].get(); - DBG_ASSERT( pNewCurFilter, "SvtFileDialog::Execute: invalid filter pos!" ); + assert( pNewCurFilter && "SvtFileDialog::Execute: invalid filter pos!" ); _pImp->SetCurFilter( pNewCurFilter, pNewCurFilter->GetName() ); } @@ -2104,7 +2104,7 @@ short SvtFileDialog::PrepareExecute() void SvtFileDialog::executeAsync( ::svt::AsyncPickerAction::Action _eAction, const OUString& _rURL, const OUString& _rFilter ) { - DBG_ASSERT( !m_pCurrentAsyncAction.is(), "SvtFileDialog::executeAsync: previous async action not yet finished!" ); + SAL_WARN_IF( m_pCurrentAsyncAction.is(), "fpicker.office", "SvtFileDialog::executeAsync: previous async action not yet finished!" ); m_pCurrentAsyncAction = new AsyncPickerAction( this, _pFileView, _eAction ); @@ -2149,7 +2149,7 @@ void SvtFileDialog::SetStandardDir( const OUString& rStdDir ) { INetURLObject aObj( rStdDir ); - DBG_ASSERT( aObj.GetProtocol() != INetProtocol::NotValid, "Invalid protocol!" ); + SAL_WARN_IF( aObj.GetProtocol() == INetProtocol::NotValid, "fpicker.office", "Invalid protocol!" ); aObj.setFinalSlash(); _pImp->SetStandardDir( aObj.GetMainURL( INetURLObject::NO_DECODE ) ); } @@ -2213,14 +2213,14 @@ SvtFileDialogFilter_Impl* SvtFileDialog::implAddFilter( const OUString& _rFilter void SvtFileDialog::AddFilter( const OUString& _rFilter, const OUString& _rType ) { - DBG_ASSERT( !IsInExecute(), "SvtFileDialog::AddFilter: currently executing!" ); + SAL_WARN_IF( IsInExecute(), "fpicker.office", "SvtFileDialog::AddFilter: currently executing!" ); implAddFilter ( _rFilter, _rType ); } void SvtFileDialog::AddFilterGroup( const OUString& _rFilter, const Sequence< StringPair >& _rFilters ) { - DBG_ASSERT( !IsInExecute(), "SvtFileDialog::AddFilter: currently executing!" ); + SAL_WARN_IF( IsInExecute(), "fpicker.office", "SvtFileDialog::AddFilter: currently executing!" ); implAddFilter( _rFilter, OUString() ); const StringPair* pSubFilters = _rFilters.getConstArray(); @@ -2232,7 +2232,7 @@ void SvtFileDialog::AddFilterGroup( const OUString& _rFilter, const Sequence< St void SvtFileDialog::SetCurFilter( const OUString& rFilter ) { - DBG_ASSERT( !IsInExecute(), "SvtFileDialog::SetCurFilter: currently executing!" ); + SAL_WARN_IF( IsInExecute(), "fpicker.office", "SvtFileDialog::SetCurFilter: currently executing!" ); // look for corresponding filter sal_uInt16 nPos = _pImp->m_aFilter.size(); @@ -2277,7 +2277,7 @@ sal_uInt16 SvtFileDialog::GetFilterCount() const const OUString& SvtFileDialog::GetFilterName( sal_uInt16 nPos ) const { - DBG_ASSERT( nPos < GetFilterCount(), "invalid index" ); + assert( nPos < GetFilterCount() && "invalid index" ); return _pImp->m_aFilter[ nPos ]->GetName(); } diff --git a/fpicker/source/office/iodlgimp.cxx b/fpicker/source/office/iodlgimp.cxx index ae511ecb53a6..3a3b305e5232 100644 --- a/fpicker/source/office/iodlgimp.cxx +++ b/fpicker/source/office/iodlgimp.cxx @@ -190,7 +190,7 @@ void SvtUpButton_Impl::Select() if ( nId ) { --nId; - DBG_ASSERT( nId <= _aURLs.size(), "SvtUpButton_Impl:falscher Index" ); + assert( nId <= _aURLs.size() && "SvtUpButton_Impl:falscher Index" ); GetDialogParent()->OpenURL_Impl(_aURLs[nId]); } -- cgit