[PATCH 1/2] Replace DBG_ stuff with OSL_ equivalents in writer
Jacek Wolszczak
shutdownrunner at gmail.com
Sun Jun 5 01:08:38 PDT 2011
---
starmath/inc/rect.hxx | 2 +-
starmath/inc/utility.hxx | 6 +++---
starmath/source/mathmlimport.cxx | 2 +-
starmath/source/node.cxx | 2 +-
starmath/source/parse.cxx | 4 ++--
starmath/source/symbol.cxx | 2 +-
starmath/source/view.cxx | 4 ++--
starmath/source/visitors.cxx | 2 +-
sw/inc/fldbas.hxx | 3 ---
sw/source/core/fields/fldbas.cxx | 11 -----------
sw/source/core/layout/dbg_lay.cxx | 2 +-
sw/source/ui/uno/unomailmerge.cxx | 4 ----
12 files changed, 13 insertions(+), 31 deletions(-)
diff --git a/starmath/inc/rect.hxx b/starmath/inc/rect.hxx
index 29940f3..85dc824 100644
--- a/starmath/inc/rect.hxx
+++ b/starmath/inc/rect.hxx
@@ -234,7 +234,7 @@ inline void SmRect::CopyMBL(const SmRect &rRect)
inline long SmRect::GetBaseline() const
{
- DBG_ASSERT(HasBaseline(), "Sm: Baseline nicht vorhanden");
+ OSL_ENSURE(HasBaseline(), "Sm: Baseline nicht vorhanden");
return nBaseline;
}
diff --git a/starmath/inc/utility.hxx b/starmath/inc/utility.hxx
index ae374da..f94027c 100644
--- a/starmath/inc/utility.hxx
+++ b/starmath/inc/utility.hxx
@@ -50,7 +50,7 @@ inline long SmPtsTo100th_mm(long nNumPts)
// 72.27 [pt] = 1 [inch] = 2,54 [cm] = 2540 [100th of mm].
// result is being rounded to the nearest integer.
{
- DBG_ASSERT(nNumPts >= 0, "Sm : Ooops...");
+ OSL_ENSURE(nNumPts >= 0, "Sm : Ooops...");
// broken into multiple and fraction of 'nNumPts' to reduce chance
// of overflow
// (7227 / 2) is added in order to round to the nearest integer
@@ -70,7 +70,7 @@ inline Fraction Sm100th_mmToPts(long nNum100th_mm)
// returns the length (in points) that corresponds to the length
// 'nNum100th_mm' (in 100th of mm).
{
- DBG_ASSERT(nNum100th_mm >= 0, "Sm : Ooops...");
+ OSL_ENSURE(nNum100th_mm >= 0, "Sm : Ooops...");
Fraction aTmp (7227L, 254000L);
return aTmp *= Fraction(nNum100th_mm);
}
@@ -78,7 +78,7 @@ inline Fraction Sm100th_mmToPts(long nNum100th_mm)
inline long SmRoundFraction(const Fraction &rFrac)
{
- DBG_ASSERT(rFrac > Fraction(), "Sm : Ooops...");
+ OSL_ENSURE(rFrac > Fraction(), "Sm : Ooops...");
return (rFrac.GetNumerator() + rFrac.GetDenominator() / 2) / rFrac.GetDenominator();
}
diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx
index b2a673d..b84ebce 100644
--- a/starmath/source/mathmlimport.cxx
+++ b/starmath/source/mathmlimport.cxx
@@ -1835,7 +1835,7 @@ SvXMLImportContext *SmXMLOfficeContext_Impl::CreateChildContext(sal_uInt16 nPref
if ( XML_NAMESPACE_OFFICE == nPrefix &&
rLocalName == GetXMLToken(XML_META) )
{
- DBG_WARNING("XML_TOK_DOC_META: should not have come here, maybe document is invalid?");
+ OSL_FAIL("XML_TOK_DOC_META: should not have come here, maybe document is invalid?");
}
else if ( XML_NAMESPACE_OFFICE == nPrefix &&
rLocalName == GetXMLToken(XML_SETTINGS) )
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index 299e420..15cc458 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -646,7 +646,7 @@ void SmNode::DumpAsDot(std::ostream &out, String* label, int number, int& id, in
long SmNode::GetFormulaBaseline() const
{
- DBG_ASSERT( 0, "This dummy implementation should not have been called." );
+ OSL_FAIL( "This dummy implementation should not have been called." );
return 0;
}
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index f2a86b9..2a678d0 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -501,7 +501,7 @@ void SmParser::NextToken()
#if OSL_DEBUG_LEVEL > 1
if (!IsDelimiter( m_aBufferString, static_cast< xub_StrLen >(aRes.EndPos) ))
{
- DBG_WARNING( "identifier really finished? (compatibility!)" );
+ OSL_FAIL( "identifier really finished? (compatibility!)" );
}
#endif
}
@@ -541,7 +541,7 @@ void SmParser::NextToken()
#if OSL_DEBUG_LEVEL > 1
if (!IsDelimiter( m_aBufferString, static_cast< xub_StrLen >(aRes.EndPos) ))
{
- DBG_WARNING( "identifier really finished? (compatibility!)" );
+ OSL_FAIL( "identifier really finished? (compatibility!)" );
}
#endif
}
diff --git a/starmath/source/symbol.cxx b/starmath/source/symbol.cxx
index 0b87b39..ea5d0e9 100644
--- a/starmath/source/symbol.cxx
+++ b/starmath/source/symbol.cxx
@@ -218,7 +218,7 @@ bool SmSymbolManager::AddOrReplaceSymbol( const SmSym &rSymbol, bool bForceChang
OSL_ENSURE( bAdded, "failed to add symbol" );
if (bAdded)
m_bModified = true;
- DBG_ASSERT( bAdded || (pFound && !bSymbolConflict), "AddOrReplaceSymbol: unresolved symbol conflict" );
+ OSL_ENSURE( bAdded || (pFound && !bSymbolConflict), "AddOrReplaceSymbol: unresolved symbol conflict" );
}
return bAdded;
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 3a099c3..ac4f6d9 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -171,7 +171,7 @@ void SmGraphicWindow::MouseButtonDown(const MouseEvent& rMEvt)
// set formula-cursor and selection of edit window according to the
// position clicked at
//
- DBG_ASSERT(rMEvt.GetClicks() > 0, "Sm : 0 clicks");
+ OSL_ENSURE(rMEvt.GetClicks() > 0, "Sm : 0 clicks");
if ( rMEvt.IsLeft() )
{
// get click position relativ to formula
@@ -878,7 +878,7 @@ IMPL_LINK( SmCmdBoxWindow, InitialFocusTimerHdl, Timer *, EMPTYARG /*pTimer*/ )
}
catch (uno::Exception &)
{
- DBG_ASSERT( 0, "failed to properly set initial focus to edit window" );
+ OSL_FAIL( "failed to properly set initial focus to edit window" );
}
return 0;
}
diff --git a/starmath/source/visitors.cxx b/starmath/source/visitors.cxx
index 8a8341f..5e8a574 100644
--- a/starmath/source/visitors.cxx
+++ b/starmath/source/visitors.cxx
@@ -727,7 +727,7 @@ void SmDrawingVisitor::Visit( SmRectangleNode* pNode )
aTmp.Top( ) += nTmpBorderWidth;
aTmp.Bottom( ) -= nTmpBorderWidth;
- DBG_ASSERT( aTmp.GetHeight( ) > 0 && aTmp.GetWidth( ) > 0,
+ OSL_ENSURE( aTmp.GetHeight( ) > 0 && aTmp.GetWidth( ) > 0,
"Sm: leeres Rechteck" );
//! avoid GROWING AND SHRINKING of drawn rectangle when constantly
diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx
index baa1bc0..8267a95 100644
--- a/sw/inc/fldbas.hxx
+++ b/sw/inc/fldbas.hxx
@@ -252,9 +252,6 @@ protected:
public:
-#if OSL_DEBUG_LEVEL > 1
- virtual ~SwFieldType();
-#endif
static const String& GetTypeStr( sal_uInt16 nTypeId );
// Only in derived classes.
diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx
index db7170e..4e482dd 100644
--- a/sw/source/core/fields/fldbas.cxx
+++ b/sw/source/core/fields/fldbas.cxx
@@ -83,7 +83,6 @@ sal_uInt16 lcl_GetLanguageOfFormat( sal_uInt16 nLng, sal_uLong nFmt,
SvStringsDtor* SwFieldType::pFldNames = 0;
-DBG_NAME(SwFieldType)
sal_uInt16 aTypeTab[] = {
/* RES_DBFLD */ TYP_DBFLD,
@@ -152,18 +151,8 @@ SwFieldType::SwFieldType( sal_uInt16 nWhichId )
: SwModify(0),
nWhich( nWhichId )
{
- DBG_CTOR( SwFieldType, 0 );
}
-#if OSL_DEBUG_LEVEL > 1
-
-SwFieldType::~SwFieldType()
-{
- DBG_DTOR( SwFieldType, 0 );
-}
-
-#endif
-
const String& SwFieldType::GetName() const
{
return aEmptyStr;
diff --git a/sw/source/core/layout/dbg_lay.cxx b/sw/source/core/layout/dbg_lay.cxx
index 0005e2e..dfc3dae 100644
--- a/sw/source/core/layout/dbg_lay.cxx
+++ b/sw/source/core/layout/dbg_lay.cxx
@@ -863,6 +863,6 @@ void SwFrmChangesLeave::Leave()
SwProtocol::Record( pFrm, PROT_FRMCHANGES, 0, &aFrm );
}
-#endif // DBG_UTIL
+#endif // OSL_DEBUG_LEVEL > 1
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/uno/unomailmerge.cxx b/sw/source/ui/uno/unomailmerge.cxx
index 6d6f166..8c1048d 100644
--- a/sw/source/ui/uno/unomailmerge.cxx
+++ b/sw/source/ui/uno/unomailmerge.cxx
@@ -240,7 +240,6 @@ namespace
DelayedFileDeletion& operator=( const DelayedFileDeletion& ); // never implemented
};
- DBG_NAME( DelayedFileDeletion )
//------------------------------------------------------
DelayedFileDeletion::DelayedFileDeletion( const Reference< XModel >& _rxModel, const String& _rTemporaryFile )
:
@@ -248,8 +247,6 @@ namespace
,m_sTemporaryFile( _rTemporaryFile )
,m_nPendingDeleteAttempts( 0 )
{
- DBG_CTOR( DelayedFileDeletion, NULL );
-
osl_incrementInterlockedCount( &m_refCount );
try
{
@@ -364,7 +361,6 @@ namespace
//------------------------------------------------------
DelayedFileDeletion::~DelayedFileDeletion( )
{
- DBG_DTOR( DelayedFileDeletion, NULL );
}
}
--
1.7.3.4
--=-i/V99t770hGjvAqSFGIO
Content-Disposition: attachment;
filename="0002-Remove-the-remaining-debug.hxx-includes-in-writer.patch"
Content-Type: text/x-patch;
name="0002-Remove-the-remaining-debug.hxx-includes-in-writer.patch";
charset="UTF-8"
Content-Transfer-Encoding: 7bit
More information about the LibreOffice
mailing list