[Libreoffice-commits] core.git: 10 commits - include/sal svl/source sw/source
Michael Stahl
mstahl at redhat.com
Mon Nov 24 04:48:32 PST 2014
include/sal/log-areas.dox | 1
svl/source/config/cjkoptions.cxx | 25 +++++-------
svl/source/config/ctloptions.cxx | 34 +++++++---------
svl/source/items/itemiter.cxx | 8 ---
svl/source/items/itemset.cxx | 67 +++++++++++++--------------------
svl/source/notify/lstner.cxx | 17 ++------
svl/source/undo/undo.cxx | 60 ++++++++++++++---------------
sw/source/core/access/acccell.cxx | 19 ++++-----
sw/source/core/access/accframebase.cxx | 24 +++++------
sw/source/core/access/accpara.cxx | 28 +++++--------
sw/source/core/access/acctextframe.cxx | 12 ++---
sw/source/core/inc/drawfont.hxx | 1
12 files changed, 130 insertions(+), 166 deletions(-)
New commits:
commit 8dc475380a19bb707274491788abfe61d491f0e7
Author: Michael Stahl <mstahl at redhat.com>
Date: Mon Nov 24 13:22:16 2014 +0100
sw: remove last include of tools/debug.hxx
Change-Id: Ic8bcb8b6f5f4d46af33ddf4e493ffd21329dcc08
diff --git a/sw/source/core/inc/drawfont.hxx b/sw/source/core/inc/drawfont.hxx
index 948a620..033d490 100644
--- a/sw/source/core/inc/drawfont.hxx
+++ b/sw/source/core/inc/drawfont.hxx
@@ -21,7 +21,6 @@
#define INCLUDED_SW_SOURCE_CORE_INC_DRAWFONT_HXX
#include <tools/solar.h>
-#include <tools/debug.hxx>
#include <osl/diagnose.h>
class SwTxtFrm;
commit 1397e7dd3061c8995c9c042c59c4f2982bdf5e63
Author: Michael Stahl <mstahl at redhat.com>
Date: Mon Nov 24 13:20:35 2014 +0100
sw: convert DBG_ASSERTs in SwAccessibleParagraph
... and fix a copy-paste error and remove some pointlessly defensive
code.
Change-Id: I08e74a6bc843b307d1c8a7157c2a67f471c00522
diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx
index 2a0a67a..5978f87 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -1154,9 +1154,7 @@ uno::Sequence< OUString > getAttributeNames()
pStrings[i++] = UNO_NAME_CHAR_UNDERLINE;
pStrings[i++] = UNO_NAME_CHAR_UNDERLINE_COLOR;
pStrings[i++] = UNO_NAME_CHAR_WEIGHT;
- DBG_ASSERT( i == pSeq->getLength(), "Please adjust length" );
- if( i != pSeq->getLength() )
- pSeq->realloc( i );
+ assert(i == pSeq->getLength());
pNames = pSeq;
}
return *pNames;
@@ -1184,9 +1182,7 @@ uno::Sequence< OUString > getSupplementalAttributeNames()
pStrings[i++] = UNO_NAME_PARA_LINE_SPACING;
pStrings[i++] = UNO_NAME_PARA_RIGHT_MARGIN;
pStrings[i++] = UNO_NAME_TABSTOPS;
- DBG_ASSERT( i == pSeq->getLength(), "Please adjust length" );
- if( i != pSeq->getLength() )
- pSeq->realloc( i );
+ assert(i == pSeq->getLength());
pNames = pSeq;
}
return *pNames;
@@ -3755,8 +3751,7 @@ bool SwAccessibleParagraph::GetSelectionAtIndex(
}
else
{
- DBG_ASSERT( nHere == nStartIndex,
- "miscalculated index" );
+ assert(nHere == nStartIndex);
// selection starts in this node:
// then check whether it's before or inside our part of
@@ -3770,10 +3765,11 @@ bool SwAccessibleParagraph::GetSelectionAtIndex(
else if( nCoreStart <=
GetPortionData().GetLastValidCorePosition() )
{
- DBG_ASSERT(
+ SAL_WARN_IF(
GetPortionData().IsValidCorePosition(
- nCoreStart ),
- "problem determining valid core position" );
+ nCoreStart),
+ "sw.core",
+ "problem determining valid core position");
nLocalStart =
GetPortionData().GetAccessiblePosition(
@@ -3792,8 +3788,7 @@ bool SwAccessibleParagraph::GetSelectionAtIndex(
}
else
{
- DBG_ASSERT( nHere == nStartIndex,
- "miscalculated index" );
+ assert(nHere == nEndIndex);
// selection ends in this node: then select everything
// before our part of the node
@@ -3809,10 +3804,11 @@ bool SwAccessibleParagraph::GetSelectionAtIndex(
GetPortionData().GetFirstValidCorePosition() )
{
// selection is inside our part of this para
- DBG_ASSERT(
+ SAL_WARN_IF(
GetPortionData().IsValidCorePosition(
- nCoreEnd ),
- "problem determining valid core position" );
+ nCoreEnd),
+ "sw.core",
+ "problem determining valid core position");
nLocalEnd = GetPortionData().GetAccessiblePosition(
nCoreEnd );
commit cd7beed5eb70f116824e36f87f7faa0927642c19
Author: Michael Stahl <mstahl at redhat.com>
Date: Mon Nov 24 13:12:49 2014 +0100
sw: convert DBG_ASSERTs in SwAccessibleFrameBase
Change-Id: Iea85af82e9a678ab83f599798693345d9061284d
diff --git a/sw/source/core/access/accframebase.cxx b/sw/source/core/access/accframebase.cxx
index 77df3da..19e769c 100644
--- a/sw/source/core/access/accframebase.cxx
+++ b/sw/source/core/access/accframebase.cxx
@@ -47,9 +47,9 @@ bool SwAccessibleFrameBase::IsSelected()
{
bool bRet = false;
- OSL_ENSURE( GetMap(), "no map?" );
+ assert(GetMap());
const SwViewShell *pVSh = GetMap()->GetShell();
- OSL_ENSURE( pVSh, "no shell?" );
+ assert(pVSh);
if( pVSh->ISA( SwFEShell ) )
{
const SwFEShell *pFESh = static_cast< const SwFEShell * >( pVSh );
@@ -67,7 +67,7 @@ void SwAccessibleFrameBase::GetStates(
SwAccessibleContext::GetStates( rStateSet );
const SwViewShell *pVSh = GetMap()->GetShell();
- OSL_ENSURE( pVSh, "no shell?" );
+ assert(pVSh);
bool bSelectable = pVSh->ISA( SwFEShell );
// SELECTABLE
@@ -82,7 +82,7 @@ void SwAccessibleFrameBase::GetStates(
if( IsSelected() )
{
rStateSet.AddState( AccessibleStateType::SELECTED );
- OSL_ENSURE( bIsSelected, "bSelected out of sync" );
+ assert(bIsSelected && "bSelected out of sync");
::rtl::Reference < SwAccessibleContext > xThis( this );
GetMap()->SetCursorContext( xThis );
@@ -195,7 +195,7 @@ void SwAccessibleFrameBase::_InvalidateFocus()
osl::MutexGuard aGuard( aMutex );
bSelected = bIsSelected;
}
- OSL_ENSURE( bSelected, "focus object should be selected" );
+ assert(bSelected && "focus object should be selected");
FireStateChangedEvent( AccessibleStateType::FOCUSED,
pWin->HasFocus() && bSelected );
@@ -222,17 +222,15 @@ void SwAccessibleFrameBase::Modify( const SfxPoolItem* pOld, const SfxPoolItem *
if( pFlyFrm )
{
const SwFrmFmt *pFrmFmt = pFlyFrm->GetFmt();
- OSL_ENSURE( pFrmFmt == GetRegisteredIn(), "invalid frame" );
+ assert(pFrmFmt == GetRegisteredIn() && "invalid frame");
const OUString sOldName( GetName() );
- OSL_ENSURE( !pOld ||
- static_cast < const SwStringMsgPoolItem * >( pOld )->GetString() == GetName(),
- "invalid old name" );
+ assert( !pOld ||
+ static_cast<const SwStringMsgPoolItem *>(pOld)->GetString() == GetName());
SetName( pFrmFmt->GetName() );
- OSL_ENSURE( !pNew ||
- static_cast < const SwStringMsgPoolItem * >( pNew )->GetString() == GetName(),
- "invalid new name" );
+ assert( !pNew ||
+ static_cast<const SwStringMsgPoolItem *>(pNew)->GetString() == GetName());
if( sOldName != GetName() )
{
@@ -368,7 +366,7 @@ SwFlyFrm* SwAccessibleFrameBase::getFlyFrm() const
SwFlyFrm* pFlyFrm = NULL;
const SwFrm* pFrm = GetFrm();
- DBG_ASSERT( pFrm != NULL, "frame expected" );
+ assert(pFrm);
if( pFrm->IsFlyFrm() )
{
pFlyFrm = static_cast<SwFlyFrm*>( const_cast<SwFrm*>( pFrm ) );
commit ac4fd5c1ad5676b187fd5cc1ff862b25d04b0adf
Author: Michael Stahl <mstahl at redhat.com>
Date: Mon Nov 24 13:08:21 2014 +0100
sw: convert DBG_ASSERTs in SwAccessibleCell
Change-Id: I87f1fdc9c316fde994a4f0fe431827fb841f7b55
diff --git a/sw/source/core/access/acccell.cxx b/sw/source/core/access/acccell.cxx
index abad380..158037b 100644
--- a/sw/source/core/access/acccell.cxx
+++ b/sw/source/core/access/acccell.cxx
@@ -57,9 +57,9 @@ bool SwAccessibleCell::IsSelected()
{
bool bRet = false;
- OSL_ENSURE( GetMap(), "no map?" );
+ assert(GetMap());
const SwViewShell *pVSh = GetMap()->GetShell();
- OSL_ENSURE( pVSh, "no shell?" );
+ assert(pVSh);
if( pVSh->ISA( SwCrsrShell ) )
{
const SwCrsrShell *pCSh = static_cast< const SwCrsrShell * >( pVSh );
@@ -83,7 +83,7 @@ void SwAccessibleCell::GetStates( ::utl::AccessibleStateSetHelper& rStateSet )
// SELECTABLE
const SwViewShell *pVSh = GetMap()->GetShell();
- OSL_ENSURE( pVSh, "no shell?" );
+ assert(pVSh);
if( pVSh->ISA( SwCrsrShell ) )
rStateSet.AddState( AccessibleStateType::SELECTABLE );
//Add resizable state to table cell.
@@ -93,7 +93,7 @@ void SwAccessibleCell::GetStates( ::utl::AccessibleStateSetHelper& rStateSet )
if( IsSelected() )
{
rStateSet.AddState( AccessibleStateType::SELECTED );
- OSL_ENSURE( bIsSelected, "bSelected out of sync" );
+ assert(bIsSelected && "bSelected out of sync");
::rtl::Reference < SwAccessibleContext > xThis( this );
GetMap()->SetCursorContext( xThis );
}
@@ -169,8 +169,7 @@ bool SwAccessibleCell::_InvalidateChildrenCursorPos( const SwFrm *pFrm )
GetMap()->GetContextImpl( pLower, false ) );
if( xAccImpl.is() )
{
- OSL_ENSURE( xAccImpl->GetFrm()->IsCellFrm(),
- "table child is not a cell frame" );
+ assert(xAccImpl->GetFrm()->IsCellFrm());
bChanged = static_cast< SwAccessibleCell *>(
xAccImpl.get() )->_InvalidateMyCursorPos();
}
@@ -210,7 +209,7 @@ void SwAccessibleCell::_InvalidateCursorPos()
}
const SwFrm *pParent = GetParent( SwAccessibleChild(GetFrm()), IsInPagePreview() );
- OSL_ENSURE( pParent->IsTabFrm(), "parent is not a tab frame" );
+ assert(pParent->IsTabFrm());
const SwTabFrm *pTabFrm = static_cast< const SwTabFrm * >( pParent );
if( pTabFrm->IsFollow() )
pTabFrm = pTabFrm->FindMaster();
@@ -340,8 +339,8 @@ uno::Sequence< sal_Int8 > SAL_CALL SwAccessibleCell::getImplementationId()
SwFrmFmt* SwAccessibleCell::GetTblBoxFormat() const
{
- OSL_ENSURE( GetFrm() != NULL, "no frame?" );
- OSL_ENSURE( GetFrm()->IsCellFrm(), "no cell frame?" );
+ assert(GetFrm());
+ assert(GetFrm()->IsCellFrm());
const SwCellFrm* pCellFrm = static_cast<const SwCellFrm*>( GetFrm() );
return pCellFrm->GetTabBox()->GetFrmFmt();
@@ -420,7 +419,7 @@ static OUString ReplaceFourChar(const OUString& oldOUString)
::com::sun::star::uno::Any strRet;
SwFrmFmt *pFrmFmt = GetTblBoxFormat();
- DBG_ASSERT(pFrmFmt,"Must be Valid");
+ assert(pFrmFmt);
const SwTblBoxFormula& tbl_formula = pFrmFmt->GetTblBoxFormula();
commit 4c378386fddfec39c75311a4c02ee4a1b99f020e
Author: Michael Stahl <mstahl at redhat.com>
Date: Mon Nov 24 13:03:02 2014 +0100
sw: convert DBG_ASSERTs in SwAccessibleTextFrame
Change-Id: I7a829a6a113ee7c5baed74b653c7bb362a360aec
diff --git a/sw/source/core/access/acctextframe.cxx b/sw/source/core/access/acctextframe.cxx
index 2c0c1b1..2cea245 100644
--- a/sw/source/core/access/acctextframe.cxx
+++ b/sw/source/core/access/acctextframe.cxx
@@ -172,7 +172,7 @@ void SAL_CALL
void SAL_CALL SwAccessibleTextFrame::selectAccessibleChild( sal_Int32 )
throw ( lang::IndexOutOfBoundsException, uno::RuntimeException, std::exception )
{
- DBG_ASSERT( false, "<SwAccessibleTextFrame::selectAccessibleChild( sal_Int32 )> - missing implementation" );
+ SAL_WARN("sw.core", "<SwAccessibleTextFrame::selectAccessibleChild( sal_Int32 )> - missing implementation" );
}
sal_Bool SAL_CALL SwAccessibleTextFrame::isAccessibleChildSelected( sal_Int32 nChildIndex )
@@ -204,13 +204,13 @@ sal_Bool SAL_CALL SwAccessibleTextFrame::isAccessibleChildSelected( sal_Int32 nC
void SAL_CALL SwAccessibleTextFrame::clearAccessibleSelection( )
throw ( uno::RuntimeException, std::exception )
{
- DBG_ASSERT( false, "<SwAccessibleTextFrame::clearAccessibleSelection( )> - missing implementation" );
+ SAL_WARN("sw.core", "<SwAccessibleTextFrame::clearAccessibleSelection( )> - missing implementation");
}
void SAL_CALL SwAccessibleTextFrame::selectAllAccessibleChildren( )
throw ( uno::RuntimeException, std::exception )
{
- DBG_ASSERT( false, "<SwAccessibleTextFrame::selectAllAccessibleChildren( )> - missing implementation" );
+ SAL_WARN("sw.core", "<SwAccessibleTextFrame::selectAllAccessibleChildren( )> - missing implementation");
}
sal_Int32 SAL_CALL SwAccessibleTextFrame::getSelectedAccessibleChildCount()
@@ -245,7 +245,7 @@ uno::Reference<XAccessible> SAL_CALL SwAccessibleTextFrame::getSelectedAccessibl
void SAL_CALL SwAccessibleTextFrame::deselectAccessibleChild( sal_Int32 )
throw ( lang::IndexOutOfBoundsException, uno::RuntimeException, std::exception )
{
- DBG_ASSERT( false, "<SwAccessibleTextFrame::selectAllAccessibleChildren( sal_Int32 )> - missing implementation" );
+ SAL_WARN("sw.core", "<SwAccessibleTextFrame::selectAllAccessibleChildren( sal_Int32 )> - missing implementation");
}
// #i73249#
@@ -310,7 +310,7 @@ SwFlyFrm* SwAccessibleTextFrame::getFlyFrm() const
SwFlyFrm* pFlyFrm = NULL;
const SwFrm* pFrm = GetFrm();
- OSL_ENSURE( pFrm != NULL, "frame expected" );
+ assert(pFrm);
if( pFrm->IsFlyFrm() )
{
pFlyFrm = static_cast<SwFlyFrm*>( const_cast<SwFrm*>( pFrm ) );
@@ -337,7 +337,7 @@ uno::Reference<XAccessibleRelationSet> SAL_CALL SwAccessibleTextFrame::getAccess
AccessibleRelationSetHelper* pHelper = new AccessibleRelationSetHelper();
SwFlyFrm* pFlyFrm = getFlyFrm();
- OSL_ENSURE( pFlyFrm != NULL, "fly frame expected" );
+ assert(pFlyFrm);
const SwFlyFrm* pPrevFrm = pFlyFrm->GetPrevLink();
if( pPrevFrm != NULL )
commit f07dcd4413c410b247d45d2be3b922fb5d86d6f2
Author: Michael Stahl <mstahl at redhat.com>
Date: Mon Nov 24 12:58:47 2014 +0100
svl: convert DBG_ASSERTs in SvtCTLOptions
Change-Id: Iec07c3f4088e2af9bc5b63f44e9943af215cebf1
diff --git a/svl/source/config/ctloptions.cxx b/svl/source/config/ctloptions.cxx
index 857d3e2..d4a38cc 100644
--- a/svl/source/config/ctloptions.cxx
+++ b/svl/source/config/ctloptions.cxx
@@ -23,11 +23,9 @@
#include <svl/languageoptions.hxx>
#include <i18nlangtag/mslangid.hxx>
#include <unotools/configitem.hxx>
-#include <tools/debug.hxx>
#include <com/sun/star/uno/Any.h>
#include <com/sun/star/uno/Sequence.hxx>
#include <osl/mutex.hxx>
-#include <osl/diagnose.h>
#include <svl/smplhint.hxx>
#include <rtl/instance.hxx>
#include <unotools/syslocale.hxx>
@@ -103,7 +101,7 @@ bool SvtCTLOptions_Impl::IsReadOnly(SvtCTLOptions::EOption eOption) const
case SvtCTLOptions::E_CTLTEXTNUMERALS : bReadOnly = m_bROCTLTextNumerals ; break;
case SvtCTLOptions::E_CTLSEQUENCECHECKINGRESTRICTED: bReadOnly = m_bROCTLRestricted ; break;
case SvtCTLOptions::E_CTLSEQUENCECHECKINGTYPEANDREPLACE: bReadOnly = m_bROCTLTypeAndReplace; break;
- default: OSL_FAIL( "SvtCTLOptions_Impl::IsReadOnly() - invalid option" );
+ default: assert(false);
}
return bReadOnly;
}
@@ -250,8 +248,8 @@ void SvtCTLOptions_Impl::Load()
Sequence< sal_Bool > aROStates = GetReadOnlyStates( rPropertyNames );
const Any* pValues = aValues.getConstArray();
const sal_Bool* pROStates = aROStates.getConstArray();
- DBG_ASSERT( aValues.getLength() == rPropertyNames.getLength(), "GetProperties failed" );
- DBG_ASSERT( aROStates.getLength() == rPropertyNames.getLength(), "GetReadOnlyStates failed" );
+ assert(aValues.getLength() == rPropertyNames.getLength() && "GetProperties failed");
+ assert(aROStates.getLength() == rPropertyNames.getLength() && "GetReadOnlyStates failed");
if ( aValues.getLength() == rPropertyNames.getLength() && aROStates.getLength() == rPropertyNames.getLength() )
{
bool bValue = false;
@@ -413,79 +411,79 @@ SvtCTLOptions::~SvtCTLOptions()
void SvtCTLOptions::SetCTLFontEnabled( bool _bEnabled )
{
- DBG_ASSERT( pCTLOptions->IsLoaded(), "CTL options not loaded" );
+ assert(pCTLOptions->IsLoaded());
pCTLOptions->SetCTLFontEnabled( _bEnabled );
}
bool SvtCTLOptions::IsCTLFontEnabled() const
{
- DBG_ASSERT( pCTLOptions->IsLoaded(), "CTL options not loaded" );
+ assert(pCTLOptions->IsLoaded());
return pCTLOptions->IsCTLFontEnabled();
}
void SvtCTLOptions::SetCTLSequenceChecking( bool _bEnabled )
{
- DBG_ASSERT( pCTLOptions->IsLoaded(), "CTL options not loaded" );
+ assert(pCTLOptions->IsLoaded());
pCTLOptions->SetCTLSequenceChecking(_bEnabled);
}
bool SvtCTLOptions::IsCTLSequenceChecking() const
{
- DBG_ASSERT( pCTLOptions->IsLoaded(), "CTL options not loaded" );
+ assert(pCTLOptions->IsLoaded());
return pCTLOptions->IsCTLSequenceChecking();
}
void SvtCTLOptions::SetCTLSequenceCheckingRestricted( bool _bEnable )
{
- DBG_ASSERT( pCTLOptions->IsLoaded(), "CTL options not loaded" );
+ assert(pCTLOptions->IsLoaded());
pCTLOptions->SetCTLSequenceCheckingRestricted(_bEnable);
}
bool SvtCTLOptions::IsCTLSequenceCheckingRestricted( void ) const
{
- DBG_ASSERT( pCTLOptions->IsLoaded(), "CTL options not loaded" );
+ assert(pCTLOptions->IsLoaded());
return pCTLOptions->IsCTLSequenceCheckingRestricted();
}
void SvtCTLOptions::SetCTLSequenceCheckingTypeAndReplace( bool _bEnable )
{
- DBG_ASSERT( pCTLOptions->IsLoaded(), "CTL options not loaded" );
+ assert(pCTLOptions->IsLoaded());
pCTLOptions->SetCTLSequenceCheckingTypeAndReplace(_bEnable);
}
bool SvtCTLOptions::IsCTLSequenceCheckingTypeAndReplace() const
{
- DBG_ASSERT( pCTLOptions->IsLoaded(), "CTL options not loaded" );
+ assert(pCTLOptions->IsLoaded());
return pCTLOptions->IsCTLSequenceCheckingTypeAndReplace();
}
void SvtCTLOptions::SetCTLCursorMovement( SvtCTLOptions::CursorMovement _eMovement )
{
- DBG_ASSERT( pCTLOptions->IsLoaded(), "CTL options not loaded" );
+ assert(pCTLOptions->IsLoaded());
pCTLOptions->SetCTLCursorMovement( _eMovement );
}
SvtCTLOptions::CursorMovement SvtCTLOptions::GetCTLCursorMovement() const
{
- DBG_ASSERT( pCTLOptions->IsLoaded(), "CTL options not loaded" );
+ assert(pCTLOptions->IsLoaded());
return pCTLOptions->GetCTLCursorMovement();
}
void SvtCTLOptions::SetCTLTextNumerals( SvtCTLOptions::TextNumerals _eNumerals )
{
- DBG_ASSERT( pCTLOptions->IsLoaded(), "CTL options not loaded" );
+ assert(pCTLOptions->IsLoaded());
pCTLOptions->SetCTLTextNumerals( _eNumerals );
}
SvtCTLOptions::TextNumerals SvtCTLOptions::GetCTLTextNumerals() const
{
- DBG_ASSERT( pCTLOptions->IsLoaded(), "CTL options not loaded" );
+ assert(pCTLOptions->IsLoaded());
return pCTLOptions->GetCTLTextNumerals();
}
bool SvtCTLOptions::IsReadOnly(EOption eOption) const
{
- DBG_ASSERT( pCTLOptions->IsLoaded(), "CTL options not loaded" );
+ assert(pCTLOptions->IsLoaded());
return pCTLOptions->IsReadOnly(eOption);
}
commit a1022694d8a116efe6f7835f5b10b3396bf5b40f
Author: Michael Stahl <mstahl at redhat.com>
Date: Mon Nov 24 12:55:38 2014 +0100
svl: convert DBG_ASSERTs in SvtCJKOptions
Change-Id: I3b7222217e1f5d8b2a26f49b359d9c8587793e88
diff --git a/svl/source/config/cjkoptions.cxx b/svl/source/config/cjkoptions.cxx
index 2b9b4b1..90def9a 100644
--- a/svl/source/config/cjkoptions.cxx
+++ b/svl/source/config/cjkoptions.cxx
@@ -22,7 +22,6 @@
#include <svl/languageoptions.hxx>
#include <i18nlangtag/lang.h>
#include <unotools/configitem.hxx>
-#include <tools/debug.hxx>
#include <tools/solar.h>
#include <com/sun/star/uno/Any.h>
#include <com/sun/star/uno/Sequence.hxx>
@@ -171,8 +170,8 @@ void SvtCJKOptions_Impl::Load()
Sequence< sal_Bool > aROStates = GetReadOnlyStates(rPropertyNames);
const Any* pValues = aValues.getConstArray();
const sal_Bool* pROStates = aROStates.getConstArray();
- DBG_ASSERT( aValues.getLength() == rPropertyNames.getLength(), "GetProperties failed" );
- DBG_ASSERT( aROStates.getLength() == rPropertyNames.getLength(), "GetReadOnlyStates failed" );
+ assert(aValues.getLength() == rPropertyNames.getLength() && "GetProperties failed");
+ assert(aROStates.getLength() == rPropertyNames.getLength() && "GetReadOnlyStates failed");
if ( aValues.getLength() == rPropertyNames.getLength() && aROStates.getLength() == rPropertyNames.getLength() )
{
for ( int nProp = 0; nProp < rPropertyNames.getLength(); nProp++ )
@@ -411,61 +410,61 @@ SvtCJKOptions::~SvtCJKOptions()
bool SvtCJKOptions::IsCJKFontEnabled() const
{
- DBG_ASSERT(pCJKOptions->IsLoaded(), "CJK options not loaded");
+ assert(pCJKOptions->IsLoaded());
return pCJKOptions->IsCJKFontEnabled();
}
bool SvtCJKOptions::IsVerticalTextEnabled() const
{
- DBG_ASSERT(pCJKOptions->IsLoaded(), "CJK options not loaded");
+ assert(pCJKOptions->IsLoaded());
return pCJKOptions->IsVerticalTextEnabled();
}
bool SvtCJKOptions::IsAsianTypographyEnabled() const
{
- DBG_ASSERT(pCJKOptions->IsLoaded(), "CJK options not loaded");
+ assert(pCJKOptions->IsLoaded());
return pCJKOptions->IsAsianTypographyEnabled();
}
bool SvtCJKOptions::IsJapaneseFindEnabled() const
{
- DBG_ASSERT(pCJKOptions->IsLoaded(), "CJK options not loaded");
+ assert(pCJKOptions->IsLoaded());
return pCJKOptions->IsJapaneseFindEnabled();
}
bool SvtCJKOptions::IsRubyEnabled() const
{
- DBG_ASSERT(pCJKOptions->IsLoaded(), "CJK options not loaded");
+ assert(pCJKOptions->IsLoaded());
return pCJKOptions->IsRubyEnabled();
}
bool SvtCJKOptions::IsChangeCaseMapEnabled() const
{
- DBG_ASSERT(pCJKOptions->IsLoaded(), "CJK options not loaded");
+ assert(pCJKOptions->IsLoaded());
return pCJKOptions->IsChangeCaseMapEnabled();
}
bool SvtCJKOptions::IsDoubleLinesEnabled() const
{
- DBG_ASSERT(pCJKOptions->IsLoaded(), "CJK options not loaded");
+ assert(pCJKOptions->IsLoaded());
return pCJKOptions->IsDoubleLinesEnabled();
}
void SvtCJKOptions::SetAll(bool bSet)
{
- DBG_ASSERT(pCJKOptions->IsLoaded(), "CJK options not loaded");
+ assert(pCJKOptions->IsLoaded());
pCJKOptions->SetAll(bSet);
}
bool SvtCJKOptions::IsAnyEnabled() const
{
- DBG_ASSERT(pCJKOptions->IsLoaded(), "CJK options not loaded");
+ assert(pCJKOptions->IsLoaded());
return pCJKOptions->IsAnyEnabled();
}
bool SvtCJKOptions::IsReadOnly(EOption eOption) const
{
- DBG_ASSERT(pCJKOptions->IsLoaded(), "CJK options not loaded");
+ assert(pCJKOptions->IsLoaded());
return pCJKOptions->IsReadOnly(eOption);
}
commit bcbbe579f457816c412ebf9e003a172b2f0991af
Author: Michael Stahl <mstahl at redhat.com>
Date: Mon Nov 24 12:46:02 2014 +0100
svl: convert DBG_ASSERTs in SfxItemSet
Change-Id: I37e507226e676ee797e6911a0b3da1d1823e750a
diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox
index e7f762b..ca9482f 100644
--- a/include/sal/log-areas.dox
+++ b/include/sal/log-areas.dox
@@ -292,6 +292,7 @@ certain functionality.
@section svl
@li @c svl
+ at li @c svl.items
@li @c svl.numbers
@section svtools
diff --git a/svl/source/items/itemiter.cxx b/svl/source/items/itemiter.cxx
index 033d74a..960a915 100644
--- a/svl/source/items/itemiter.cxx
+++ b/svl/source/items/itemiter.cxx
@@ -25,8 +25,6 @@
SfxItemIter::SfxItemIter( const SfxItemSet& rItemSet )
: _rSet( rItemSet )
{
- DBG_ASSERTWARNING( _rSet.Count(), "es gibt gar keine Attribute" );
-
if ( !_rSet._nCount )
{
_nStt = 1;
@@ -49,16 +47,10 @@ SfxItemIter::SfxItemIter( const SfxItemSet& rItemSet )
_nAkt = _nStt;
}
-
-
-
SfxItemIter::~SfxItemIter()
{
}
-
-
-
const SfxPoolItem* SfxItemIter::NextItem()
{
SfxItemArray ppFnd = _rSet._aItems;
diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx
index 9dc809f..c397312 100644
--- a/svl/source/items/itemset.cxx
+++ b/svl/source/items/itemset.cxx
@@ -36,10 +36,6 @@
// STATIC DATA
static const sal_uInt16 nInitCount = 10; // Single USHORTs => 5 pairs without '0'
-#if OSL_DEBUG_LEVEL > 1
-static sal_uLong nRangesCopyCount = 0; // How often have ranges been copied?
-#endif
-
#include "nranges.cxx"
#include "poolio.hxx"
@@ -58,18 +54,18 @@ const sal_Char *DbgCheckItemSet( const void* pVoid )
if ( pItem )
{
++nCount;
- DBG_ASSERT( IsInvalidItem(pItem) ||
- pItem->Which() == 0 || pItem->Which() == nWh,
- "SfxItemSet: invalid which-id" );
- DBG_ASSERT( IsInvalidItem(pItem) || !pItem->Which() ||
+ assert((IsInvalidItem(pItem) ||
+ pItem->Which() == 0 || pItem->Which() == nWh
+ ) && "SfxItemSet: invalid which-id" );
+ assert((IsInvalidItem(pItem) || !pItem->Which() ||
!SfxItemPool::IsWhich(pItem->Which()) ||
pSet->GetPool()->IsItemFlag(nWh, SFX_ITEM_NOT_POOLABLE) ||
- SFX_ITEMS_NULL != pSet->GetPool()->GetSurrogate(pItem),
- "SfxItemSet: item in set which is not in pool" );
+ SFX_ITEMS_NULL != pSet->GetPool()->GetSurrogate(pItem)
+ ) && "SfxItemSet: item in set which is not in pool" );
}
}
- DBG_ASSERT( pSet->_nCount == nCount, "wrong SfxItemSet::nCount detected" );
+ assert(pSet->_nCount == nCount);
return 0;
}
@@ -93,7 +89,7 @@ SfxItemSet::SfxItemSet
_pParent( 0 ),
_nCount( 0 )
{
- DBG_ASSERTWARNING( _pPool == _pPool->GetMasterPool(), "no Master Pool" );
+ SAL_WARN_IF(_pPool != _pPool->GetMasterPool(), "svl.items", "no Master Pool");
// DBG_ASSERT( bTotalRanges || abs( &bTotalRanges - this ) < 1000,
// "please use suitable ranges" );
#if defined DBG_UTIL && defined SFX_ITEMSET_NO_DEFAULT_CTOR
@@ -104,7 +100,7 @@ SfxItemSet::SfxItemSet
#endif
_pWhichRanges = (sal_uInt16*) _pPool->GetFrozenIdRanges();
- DBG_ASSERT( _pWhichRanges, "don't create ItemSets with full range before FreezeIdRanges()" );
+ assert( _pWhichRanges && "don't create ItemSets with full range before FreezeIdRanges()" );
if ( !_pWhichRanges )
_pPool->FillItemIdRanges_Impl( _pWhichRanges );
@@ -120,8 +116,8 @@ SfxItemSet::SfxItemSet( SfxItemPool& rPool, sal_uInt16 nWhich1, sal_uInt16 nWhic
_pParent( 0 ),
_nCount( 0 )
{
- DBG_ASSERT( nWhich1 <= nWhich2, "Invalid range" );
- DBG_ASSERTWARNING( _pPool == _pPool->GetMasterPool(), "no Master Pool" );
+ assert(nWhich1 <= nWhich2);
+ SAL_WARN_IF(_pPool != _pPool->GetMasterPool(), "svl.items", "no Master Pool");
InitRanges_Impl(nWhich1, nWhich2);
}
@@ -157,8 +153,8 @@ SfxItemSet::SfxItemSet( SfxItemPool& rPool,
_pWhichRanges( 0 ),
_nCount( 0 )
{
- DBG_ASSERT( nWh1 <= nWh2, "Invalid range" );
- DBG_ASSERTWARNING( _pPool == _pPool->GetMasterPool(), "no Master Pool" );
+ assert(nWh1 <= nWh2);
+ SAL_WARN_IF(_pPool != _pPool->GetMasterPool(), "svl.items", "no Master Pool");
if(!nNull)
InitRanges_Impl(
@@ -179,10 +175,6 @@ SfxItemSet::SfxItemSet( SfxItemPool& rPool,
void SfxItemSet::InitRanges_Impl(const sal_uInt16 *pWhichPairTable)
{
- #if OSL_DEBUG_LEVEL > 1
- OSL_TRACE("SfxItemSet: Ranges-CopyCount==%ul", ++nRangesCopyCount);
- #endif
-
sal_uInt16 nCnt = 0;
const sal_uInt16* pPtr = pWhichPairTable;
while( *pPtr )
@@ -209,7 +201,7 @@ SfxItemSet::SfxItemSet( SfxItemPool& rPool, const sal_uInt16* pWhichPairTable )
, _pWhichRanges(0)
, _nCount(0)
{
- DBG_ASSERTWARNING( _pPool == _pPool->GetMasterPool(), "no Master Pool" );
+ SAL_WARN_IF(_pPool != _pPool->GetMasterPool(), "svl.items", "no Master Pool");
// pWhichPairTable == 0 ist f"ur das SfxAllEnumItemSet
if ( pWhichPairTable )
@@ -221,7 +213,7 @@ SfxItemSet::SfxItemSet( const SfxItemSet& rASet ):
_pParent( rASet._pParent ),
_nCount( rASet._nCount )
{
- DBG_ASSERTWARNING( _pPool == _pPool->GetMasterPool(), "no Master Pool" );
+ SAL_WARN_IF(_pPool != _pPool->GetMasterPool(), "svl.items", "no Master Pool");
// Calculate the attribute count
sal_uInt16 nCnt = 0;
@@ -255,9 +247,6 @@ SfxItemSet::SfxItemSet( const SfxItemSet& rASet ):
*ppDst = &_pPool->Put( **ppSrc );
// Copy the WhichRanges
- #if OSL_DEBUG_LEVEL > 1
- OSL_TRACE("SfxItemSet: Ranges-CopyCount==%ul", ++nRangesCopyCount);
- #endif
std::ptrdiff_t cnt = pPtr - rASet._pWhichRanges+1;
_pWhichRanges = new sal_uInt16[ cnt ];
memcpy( _pWhichRanges, rASet._pWhichRanges, sizeof( sal_uInt16 ) * cnt);
@@ -439,7 +428,7 @@ void SfxItemSet::InvalidateDefaultItems()
void SfxItemSet::InvalidateAllItems()
{
- DBG_ASSERT( !_nCount, "There are still Items set" );
+ assert( !_nCount && "There are still Items set" );
memset( (void*)_aItems, -1, ( _nCount = TotalCount() ) * sizeof( SfxPoolItem*) );
}
@@ -660,7 +649,7 @@ void SfxItemSet::PutExtended
break;
default:
- OSL_FAIL( "invalid Argument for eDontCareAs" );
+ assert(!"invalid Argument for eDontCareAs");
}
}
else
@@ -685,7 +674,7 @@ void SfxItemSet::PutExtended
break;
default:
- OSL_FAIL( "invalid Argument for eDefaultAs" );
+ assert(!"invalid Argument for eDefaultAs");
}
}
pPtr += 2;
@@ -890,7 +879,7 @@ const SfxPoolItem* SfxItemSet::GetItem
return pItem;
// Else report error
- OSL_FAIL( "invalid argument type" );
+ assert(!"invalid argument type");
}
// No Item of wrong type found
@@ -928,7 +917,7 @@ const SfxPoolItem& SfxItemSet::Get( sal_uInt16 nWhich, bool bSrchInParent) const
#ifdef DBG_UTIL
const SfxPoolItem *pItem = *ppFnd;
if ( pItem->ISA(SfxVoidItem) || !pItem->Which() )
- DBG_WARNING( "SFX_WARNING: Getting disabled Item" );
+ SAL_INFO("svl.items", "SFX_WARNING: Getting disabled Item");
#endif
return **ppFnd;
}
@@ -977,7 +966,7 @@ sal_uInt16 SfxItemSet::TotalCount() const
*/
void SfxItemSet::Intersect( const SfxItemSet& rSet )
{
- DBG_ASSERT(_pPool, "Not implemented without Pool");
+ assert(_pPool && "Not implemented without Pool");
if( !Count() ) // None set?
return;
@@ -1269,7 +1258,7 @@ static void MergeItem_Impl( SfxItemPool *_pPool, sal_uInt16 &rCount,
void SfxItemSet::MergeValues( const SfxItemSet& rSet, bool bIgnoreDefaults )
{
// WARNING! When making changes/fixing bugs, always update the table above!!
- DBG_ASSERT( GetPool() == rSet.GetPool(), "MergeValues with different Pools" );
+ assert( GetPool() == rSet.GetPool() && "MergeValues with different Pools" );
// Test if the which Ranges are different
bool bEqual = true;
@@ -1389,7 +1378,7 @@ sal_uInt16 SfxItemSet::GetWhichByPos( sal_uInt16 nPos ) const
nPos = nPos - n;
pPtr += 2;
}
- DBG_ASSERT( false, "We're wrong here" );
+ assert(false);
return 0;
}
@@ -1412,8 +1401,8 @@ SvStream &SfxItemSet::Store
false: Surrogates */
) const
{
- DBG_ASSERT( _pPool, "No Pool" );
- DBG_ASSERTWARNING( _pPool == _pPool->GetMasterPool(), "no Master Pool" );
+ assert(_pPool);
+ SAL_WARN_IF(_pPool != _pPool->GetMasterPool(), "svl.items", "no Master Pool");
// Remember position of the count (to be able to correct it, if need be)
sal_uLong nCountPos = rStream.Tell();
@@ -1432,7 +1421,7 @@ SvStream &SfxItemSet::Store
pItem = aIter.NextItem() )
{
// Let Items (if need be as a Surrogate) be saved via Pool
- DBG_ASSERT( !IsInvalidItem(pItem), "can't store invalid items" );
+ SAL_WARN_IF(IsInvalidItem(pItem), "svl.items", "can't store invalid items");
if ( !IsInvalidItem(pItem) &&
_pPool->StoreItem( rStream, *pItem, bDirect ) )
// Item was streamed in 'rStream'
@@ -1477,8 +1466,8 @@ SvStream &SfxItemSet::Load
(e.g. when inserting documents) */
)
{
- DBG_ASSERT( _pPool, "No Pool");
- DBG_ASSERTWARNING( _pPool == _pPool->GetMasterPool(), "No Master Pool");
+ assert(_pPool);
+ SAL_WARN_IF(_pPool != _pPool->GetMasterPool(), "svl.items", "no Master Pool");
// No RefPool => Resolve Surrogates with ItemSet's Pool
if ( !pRefPool )
commit d4fce35ddc43b586cdb093244f3a5eae4753b772
Author: Michael Stahl <mstahl at redhat.com>
Date: Mon Nov 24 12:45:02 2014 +0100
svl: convert DBG_ASSERTs in SfxListener
Change-Id: I07776484277769acf37cb11b8b2cff02c4234d5e
diff --git a/svl/source/notify/lstner.cxx b/svl/source/notify/lstner.cxx
index f3daa24..bef588a 100644
--- a/svl/source/notify/lstner.cxx
+++ b/svl/source/notify/lstner.cxx
@@ -17,14 +17,13 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-
-#include <tools/debug.hxx>
+#include <svl/lstner.hxx>
#include <svl/hint.hxx>
#include <svl/SfxBroadcaster.hxx>
-#include <svl/lstner.hxx>
#include <algorithm>
+#include <cassert>
TYPEINIT0(SfxListener);
@@ -72,7 +71,7 @@ void SfxListener::StartListening( SfxBroadcaster& rBroadcaster, bool bPreventDup
rBroadcaster.AddListener(*this);
aBCs.push_back( &rBroadcaster );
- DBG_ASSERT( IsListening(rBroadcaster), "StartListening failed" );
+ assert(IsListening(rBroadcaster) && "StartListening failed");
}
}
@@ -117,16 +116,10 @@ bool SfxListener::IsListening( SfxBroadcaster& rBroadcaster ) const
// base implementation of notification handler
-#ifdef DBG_UTIL
void SfxListener::Notify( SfxBroadcaster& rBroadcaster, const SfxHint& )
-#else
-void SfxListener::Notify( SfxBroadcaster&, const SfxHint& )
-#endif
{
- #ifdef DBG_UTIL
- DBG_ASSERT(aBCs.end() != std::find(aBCs.begin(), aBCs.end(), &rBroadcaster),
- "notification from unregistered broadcaster" );
- #endif
+ (void) rBroadcaster;
+ assert(IsListening(rBroadcaster));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 570a8cfd7ff33374791af3adfc2be9e666c2506b
Author: Michael Stahl <mstahl at redhat.com>
Date: Mon Nov 24 12:41:56 2014 +0100
svl: convert DBG_ASSERTs in undo.cxx
Change-Id: Iecf693181bee7c3ce63dea6c389b03655007a3e5
diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx
index 6c1f46e..f3f855c 100644
--- a/svl/source/undo/undo.cxx
+++ b/svl/source/undo/undo.cxx
@@ -17,16 +17,14 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <svl/undo.hxx>
#include <com/sun/star/uno/Exception.hpp>
#include <osl/mutex.hxx>
#include <comphelper/flagguard.hxx>
-#include <tools/debug.hxx>
#include <tools/diagnose_ex.h>
-#include <svl/undo.hxx>
-
#include <vector>
#include <list>
#include <limits>
@@ -99,7 +97,7 @@ OUString SfxUndoAction::GetRepeatComment(SfxRepeatTarget&) const
void SfxUndoAction::Undo()
{
// These are only conceptually pure virtual
- OSL_FAIL( "pure virtual function called: SfxUndoAction::Undo()" );
+ assert(!"pure virtual function called: SfxUndoAction::Undo()");
}
@@ -113,7 +111,7 @@ void SfxUndoAction::UndoWithContext( SfxUndoContext& i_context )
void SfxUndoAction::Redo()
{
// These are only conceptually pure virtual
- OSL_FAIL( "pure virtual function called: SfxUndoAction::Redo()" );
+ assert(!"pure virtual function called: SfxUndoAction::Redo()");
}
@@ -127,7 +125,7 @@ void SfxUndoAction::RedoWithContext( SfxUndoContext& i_context )
void SfxUndoAction::Repeat(SfxRepeatTarget&)
{
// These are only conceptually pure virtual
- OSL_FAIL( "pure virtual function called: SfxUndoAction::Repeat()" );
+ assert(!"pure virtual function called: SfxUndoAction::Repeat()");
}
@@ -221,7 +219,7 @@ namespace svl { namespace undo { namespace impl
void operator()( SfxUndoListener* i_listener ) const
{
- OSL_PRECOND( is(), "NotifyUndoListener: this will crash!" );
+ assert( is() && "NotifyUndoListener: this will crash!" );
if ( m_altNotificationMethod != 0 )
{
( i_listener->*m_altNotificationMethod )( m_sActionComment );
@@ -452,7 +450,8 @@ void SfxUndoManager::Clear()
{
UndoManagerGuard aGuard( *m_pData );
- OSL_ENSURE( !ImplIsInListAction_Lock(), "SfxUndoManager::Clear: suspicious call - do you really wish to clear the current level?" );
+ SAL_WARN_IF( ImplIsInListAction_Lock(), "svl",
+ "SfxUndoManager::Clear: suspicious call - do you really wish to clear the current level?" );
ImplClearCurrentLevel_NoNotify( aGuard );
// notify listeners
@@ -485,7 +484,8 @@ void SfxUndoManager::ImplClearRedo_NoLock( bool const i_currentLevel )
void SfxUndoManager::ClearRedo()
{
- OSL_ENSURE( !IsInListAction(), "SfxUndoManager::ClearRedo: suspicious call - do you really wish to clear the current level?" );
+ SAL_WARN_IF( IsInListAction(), "svl",
+ "SfxUndoManager::ClearRedo: suspicious call - do you really wish to clear the current level?" );
ImplClearRedo_NoLock( CurrentLevel );
}
@@ -584,7 +584,7 @@ bool SfxUndoManager::ImplAddUndoAction_NoNotify( SfxUndoAction *pAction, bool bT
}
else
{
- OSL_ENSURE(false, "CurrentUndoAction going negative (!)");
+ assert(!"CurrentUndoAction going negative (!)");
}
// fdo#66071 invalidate the current empty mark when removing
--m_pData->mnEmptyMark;
@@ -624,7 +624,7 @@ OUString SfxUndoManager::GetUndoActionComment( size_t nNo, bool const i_currentL
OUString sComment;
const SfxUndoArray* pUndoArray = i_currentLevel ? m_pData->pActUndoArray : m_pData->pUndoArray;
- DBG_ASSERT( nNo < pUndoArray->nCurUndoAction, "svl::SfxUndoManager::GetUndoActionComment: illegal index!" );
+ assert(nNo < pUndoArray->nCurUndoAction);
if( nNo < pUndoArray->nCurUndoAction )
sComment = pUndoArray->aUndoActions[ pUndoArray->nCurUndoAction - 1 - nNo ].pAction->GetComment();
return sComment;
@@ -635,7 +635,7 @@ sal_uInt16 SfxUndoManager::GetUndoActionId() const
{
UndoManagerGuard aGuard( *m_pData );
- DBG_ASSERT( m_pData->pActUndoArray->nCurUndoAction > 0, "svl::SfxUndoManager::GetUndoActionId(), illegal id!" );
+ assert(m_pData->pActUndoArray->nCurUndoAction > 0);
if ( m_pData->pActUndoArray->nCurUndoAction == 0 )
return 0;
return m_pData->pActUndoArray->aUndoActions[m_pData->pActUndoArray->nCurUndoAction-1].pAction->GetId();
@@ -646,7 +646,7 @@ SfxUndoAction* SfxUndoManager::GetUndoAction( size_t nNo ) const
{
UndoManagerGuard aGuard( *m_pData );
- DBG_ASSERT( nNo < m_pData->pActUndoArray->nCurUndoAction, "svl::SfxUndoManager::GetUndoAction(), illegal id!" );
+ assert(nNo < m_pData->pActUndoArray->nCurUndoAction);
if( nNo >= m_pData->pActUndoArray->nCurUndoAction )
return NULL;
return m_pData->pActUndoArray->aUndoActions[m_pData->pActUndoArray->nCurUndoAction-1-nNo].pAction;
@@ -696,20 +696,20 @@ bool SfxUndoManager::UndoWithContext( SfxUndoContext& i_context )
bool SfxUndoManager::ImplUndo( SfxUndoContext* i_contextOrNull )
{
UndoManagerGuard aGuard( *m_pData );
- OSL_ENSURE( !IsDoing(), "SfxUndoManager::Undo: *nested* Undo/Redo actions? How this?" );
+ assert( !IsDoing() && "SfxUndoManager::Undo: *nested* Undo/Redo actions? How this?" );
::comphelper::FlagGuard aDoingGuard( m_pData->mbDoing );
LockGuard aLockGuard( *this );
if ( ImplIsInListAction_Lock() )
{
- OSL_ENSURE( false, "SfxUndoManager::Undo: not possible when within a list action!" );
+ assert(!"SfxUndoManager::Undo: not possible when within a list action!");
return false;
}
if ( m_pData->pActUndoArray->nCurUndoAction == 0 )
{
- OSL_ENSURE( false, "SfxUndoManager::Undo: undo stack is empty!" );
+ SAL_WARN("svl", "SfxUndoManager::Undo: undo stack is empty!" );
return false;
}
@@ -743,7 +743,7 @@ bool SfxUndoManager::ImplUndo( SfxUndoContext* i_contextOrNull )
throw;
}
}
- OSL_ENSURE( false, "SfxUndoManager::Undo: can't clear the Undo stack after the failure - some other party was faster ..." );
+ SAL_WARN("svl", "SfxUndoManager::Undo: can't clear the Undo stack after the failure - some other party was faster ..." );
throw;
}
@@ -808,20 +808,20 @@ bool SfxUndoManager::RedoWithContext( SfxUndoContext& i_context )
bool SfxUndoManager::ImplRedo( SfxUndoContext* i_contextOrNull )
{
UndoManagerGuard aGuard( *m_pData );
- OSL_ENSURE( !IsDoing(), "SfxUndoManager::Redo: *nested* Undo/Redo actions? How this?" );
+ assert( !IsDoing() && "SfxUndoManager::Redo: *nested* Undo/Redo actions? How this?" );
::comphelper::FlagGuard aDoingGuard( m_pData->mbDoing );
LockGuard aLockGuard( *this );
if ( ImplIsInListAction_Lock() )
{
- OSL_ENSURE( false, "SfxUndoManager::Redo: not possible when within a list action!" );
+ assert(!"SfxUndoManager::Redo: not possible when within a list action!");
return false;
}
if ( m_pData->pActUndoArray->nCurUndoAction >= m_pData->pActUndoArray->aUndoActions.size() )
{
- OSL_ENSURE( false, "SfxUndoManager::Redo: redo stack is empty!" );
+ SAL_WARN("svl", "SfxUndoManager::Redo: redo stack is empty!");
return false;
}
@@ -856,7 +856,7 @@ bool SfxUndoManager::ImplRedo( SfxUndoContext* i_contextOrNull )
}
++nCurAction;
}
- OSL_ENSURE( false, "SfxUndoManager::Redo: can't clear the Undo stack after the failure - some other party was faster ..." );
+ SAL_WARN("svl", "SfxUndoManager::Redo: can't clear the Undo stack after the failure - some other party was faster ..." );
throw;
}
@@ -1023,11 +1023,11 @@ size_t SfxUndoManager::ImplLeaveListAction( const bool i_merge, UndoManagerGuard
if( !ImplIsInListAction_Lock() )
{
- OSL_TRACE( "svl::SfxUndoManager::ImplLeaveListAction, called without calling EnterListAction()!" );
+ SAL_WARN("svl", "svl::SfxUndoManager::ImplLeaveListAction, called without calling EnterListAction()!" );
return 0;
}
- DBG_ASSERT( m_pData->pActUndoArray->pFatherUndoArray, "SfxUndoManager::ImplLeaveListAction, no father undo array!?" );
+ assert(m_pData->pActUndoArray->pFatherUndoArray);
// the array/level which we're about to leave
SfxUndoArray* pArrayToLeave = m_pData->pActUndoArray;
@@ -1057,7 +1057,7 @@ size_t SfxUndoManager::ImplLeaveListAction( const bool i_merge, UndoManagerGuard
if ( i_merge )
{
// merge the list action with its predecessor on the same level
- OSL_ENSURE( m_pData->pActUndoArray->nCurUndoAction > 1,
+ SAL_WARN_IF( m_pData->pActUndoArray->nCurUndoAction <= 1, "svl",
"SfxUndoManager::ImplLeaveListAction: cannot merge the list action if there's no other action on the same level - check this beforehand!" );
if ( m_pData->pActUndoArray->nCurUndoAction > 1 )
{
@@ -1095,9 +1095,9 @@ UndoStackMark SfxUndoManager::MarkTopUndoAction()
{
UndoManagerGuard aGuard( *m_pData );
- OSL_ENSURE( !IsInListAction(),
+ SAL_WARN_IF( IsInListAction(), "svl",
"SfxUndoManager::MarkTopUndoAction(): suspicious call!" );
- OSL_ENSURE((m_pData->mnMarks + 1) < (m_pData->mnEmptyMark - 1),
+ assert((m_pData->mnMarks + 1) < (m_pData->mnEmptyMark - 1) &&
"SfxUndoManager::MarkTopUndoAction(): mark overflow!");
size_t const nActionPos = m_pData->pUndoArray->nCurUndoAction;
@@ -1141,7 +1141,7 @@ void SfxUndoManager::RemoveMark( UndoStackMark const i_mark )
}
}
}
- OSL_ENSURE( false, "SfxUndoManager::RemoveMark: mark not found!" );
+ SAL_WARN("svl", "SfxUndoManager::RemoveMark: mark not found!");
// TODO: this might be too offensive. There are situations where we implicitly remove marks
// without our clients, in particular the client which created the mark, having a chance to know
// about this.
@@ -1183,7 +1183,7 @@ void SfxUndoManager::RemoveOldestUndoActions( size_t const i_count )
if ( IsInListAction() && ( m_pData->pUndoArray->nCurUndoAction == 1 ) )
{
- OSL_ENSURE( false, "SfxUndoManager::RemoveOldestUndoActions: cannot remove a not-yet-closed list action!" );
+ assert(!"SfxUndoManager::RemoveOldestUndoActions: cannot remove a not-yet-closed list action!");
return;
}
@@ -1371,8 +1371,8 @@ SfxLinkUndoAction::~SfxLinkUndoAction()
void SfxLinkUndoAction::LinkedSfxUndoActionDestructed(const SfxUndoAction& rCandidate)
{
- OSL_ENSURE(0 != pAction, "OOps, we have no linked SfxUndoAction (!)");
- OSL_ENSURE(pAction == &rCandidate, "OOps, the destroyed and linked UndoActions differ (!)");
+ assert(0 != pAction);
+ assert(pAction == &rCandidate && "Oops, the destroyed and linked UndoActions differ (!)");
(void)rCandidate;
pAction = 0;
}
More information about the Libreoffice-commits
mailing list