summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBerk Gureken <berkgureken@gmail.com>2016-02-01 12:07:06 +0200
committerMichael Stahl <mstahl@redhat.com>2016-02-04 12:54:23 +0000
commit9108dc39525fb1d881d5b4a634039a25ef2d2d25 (patch)
tree8e77cba1ae24fa8fb2515b3f620da0e16cb91a02
parent1ee9765beffa7cebcc891227d741eeb0cc74eb55 (diff)
tdf#43157 Cleanup DBG_ASSERT for fpicker and framework
Change-Id: I1b79a39a9d709184cc72a905647f73dbf85eef27 Signed-off-by: Berk Gureken <berkgureken@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/21991 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r--fpicker/source/office/asyncfilepicker.cxx4
-rw-r--r--fpicker/source/office/commonpicker.cxx2
-rw-r--r--fpicker/source/office/fpinteraction.cxx2
-rw-r--r--fpicker/source/office/fpsmartcontent.cxx2
-rw-r--r--fpicker/source/office/iodlg.cxx32
-rw-r--r--fpicker/source/office/iodlgimp.cxx2
-rw-r--r--framework/source/fwi/helper/mischelper.cxx2
-rw-r--r--framework/source/uiconfiguration/windowstateconfiguration.cxx12
-rw-r--r--framework/source/uielement/langselectionstatusbarcontroller.cxx8
-rw-r--r--framework/source/uielement/menubarmanager.cxx2
10 files changed, 34 insertions, 34 deletions
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<SvtContentEntry*>(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]);
}
diff --git a/framework/source/fwi/helper/mischelper.cxx b/framework/source/fwi/helper/mischelper.cxx
index f8a1f753aafc..665b74290fca 100644
--- a/framework/source/fwi/helper/mischelper.cxx
+++ b/framework/source/fwi/helper/mischelper.cxx
@@ -53,7 +53,7 @@ uno::Reference< linguistic2::XLanguageGuessing > LanguageGuessingHelper::GetGues
}
catch (const uno::Exception &)
{
- DBG_ASSERT( false, "failed to get language guessing component" );
+ SAL_WARN( "framework.fwi", "failed to get language guessing component" );
}
}
return m_xLanguageGuesser;
diff --git a/framework/source/uiconfiguration/windowstateconfiguration.cxx b/framework/source/uiconfiguration/windowstateconfiguration.cxx
index 71ddcfa9d427..9412302e06bb 100644
--- a/framework/source/uiconfiguration/windowstateconfiguration.cxx
+++ b/framework/source/uiconfiguration/windowstateconfiguration.cxx
@@ -592,7 +592,7 @@ Any ConfigurationAccess_WindowState::impl_getSequenceFromStruct( const WindowSta
case PROPERTY_DOCKSIZE:
aPropSeq[nIndex].Value = makeAny( rWinStateInfo.aDockSize ); break;
default:
- DBG_ASSERT( false, "Wrong value for ConfigurationAccess_WindowState. Who has forgotten to add this new property!" );
+ assert( false && "Wrong value for ConfigurationAccess_WindowState. Who has forgotten to add this new property!" );
}
}
}
@@ -772,7 +772,7 @@ Any ConfigurationAccess_WindowState::impl_insertCacheAndReturnSequence( const OU
break;
default:
- DBG_ASSERT( false, "Wrong value for ConfigurationAccess_WindowState. Who has forgotten to add this new property!" );
+ assert( false && "Wrong value for ConfigurationAccess_WindowState. Who has forgotten to add this new property!" );
}
if ( bAddToSeq )
@@ -844,7 +844,7 @@ ConfigurationAccess_WindowState::WindowStateInfo& ConfigurationAccess_WindowStat
case PROPERTY_CONTEXTACTIVE:
aWindowStateInfo.bContextActive = bValue; break;
default:
- DBG_ASSERT( false, "Unknown boolean property in WindowState found!" );
+ SAL_WARN( "framework.uiconfiguration", "Unknown boolean property in WindowState found!" );
}
}
}
@@ -956,7 +956,7 @@ ConfigurationAccess_WindowState::WindowStateInfo& ConfigurationAccess_WindowStat
break;
default:
- DBG_ASSERT( false, "Wrong value for ConfigurationAccess_WindowState. Who has forgotten to add this new property!" );
+ assert( false && "Wrong value for ConfigurationAccess_WindowState. Who has forgotten to add this new property!" );
}
}
catch( const css::container::NoSuchElementException& )
@@ -1145,7 +1145,7 @@ void ConfigurationAccess_WindowState::impl_fillStructFromSequence( WindowStateIn
break;
default:
- DBG_ASSERT( false, "Wrong value for ConfigurationAccess_WindowState. Who has forgotten to add this new property!" );
+ assert( false && "Wrong value for ConfigurationAccess_WindowState. Who has forgotten to add this new property!" );
}
break;
@@ -1226,7 +1226,7 @@ void ConfigurationAccess_WindowState::impl_putPropertiesFromStruct( const Window
case PROPERTY_STYLE:
xPropSet->setPropertyValue( m_aPropArray[i], makeAny( sal_Int32( rWinStateInfo.nStyle )) ); break;
default:
- DBG_ASSERT( false, "Wrong value for ConfigurationAccess_WindowState. Who has forgotten to add this new property!" );
+ assert( false && "Wrong value for ConfigurationAccess_WindowState. Who has forgotten to add this new property!" );
}
}
catch( const Exception& )
diff --git a/framework/source/uielement/langselectionstatusbarcontroller.cxx b/framework/source/uielement/langselectionstatusbarcontroller.cxx
index 723aee1e3c8c..5133e4483b84 100644
--- a/framework/source/uielement/langselectionstatusbarcontroller.cxx
+++ b/framework/source/uielement/langselectionstatusbarcontroller.cxx
@@ -158,8 +158,8 @@ throw (css::uno::RuntimeException, std::exception)
rStr != sAsterisk &&
!rStr.isEmpty()) // 'no language found' from language guessing
{
- DBG_ASSERT( MID_LANG_SEL_1 <= nItemId && nItemId <= MID_LANG_SEL_9,
- "nItemId outside of expected range!" );
+ SAL_WARN_IF( MID_LANG_SEL_1 > nItemId || nItemId > MID_LANG_SEL_9,
+ "framework.uielement", "nItemId outside of expected range!" );
xPopupMenu->insertItem( nItemId, rStr, 0, nItemId );
if ( rStr == m_aCurLang )
{
@@ -186,8 +186,8 @@ throw (css::uno::RuntimeException, std::exception)
rStr != sAsterisk &&
!rStr.isEmpty()) // 'no language found' from language guessing
{
- DBG_ASSERT( MID_LANG_PARA_1 <= nItemId && nItemId <= MID_LANG_PARA_9,
- "nItemId outside of expected range!" );
+ SAL_WARN_IF( MID_LANG_PARA_1 > nItemId || nItemId > MID_LANG_PARA_9,
+ "framework.uielement", "nItemId outside of expected range!" );
subPopupMenu->insertItem( nItemId, rStr, 0, nItemId );
aLangMap[nItemId] = rStr;
++nItemId;
diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx
index a1ac05c8111f..cd4492f40fae 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -226,7 +226,7 @@ MenuBarManager::~MenuBarManager()
m_xDeferedItemContainer.clear();
m_aAsyncSettingsTimer.Stop();
- DBG_ASSERT( OWeakObject::m_refCount == 0, "Who wants to delete an object with refcount > 0!" );
+ SAL_WARN_IF( OWeakObject::m_refCount != 0, "framework.uielement", "Who wants to delete an object with refcount > 0!" );
}
void MenuBarManager::Destroy()