Hi, 0001-Replace-DBG_-stuff-with-OSL_-equivalents-in-writer -- removes some last leftovers of DBG -> OSL conversion in writer
0002-Remove-the-remaining-debug.hxx-includes-in-writer has to be applied along with 0001-Replace-DBG_ASSERT-with-OSL_ENSURE-in-svl-inc-svl-sv -- and this way we completely got rid of debug.hxx in writer BTW, does anyone use DBG_PROFSTART and DBG_PROFSTOP or could these be removed altogether? Jacek
>From 90ff21613009fa3e168c0c2e48259362d5bf8963 Mon Sep 17 00:00:00 2001 From: Jacek Wolszczak <shutdownrun...@gmail.com> Date: Sun, 5 Jun 2011 18:52:22 +0200 Subject: [PATCH] Replace DBG_ASSERT with OSL_ENSURE in svl/inc/svl/svarray.hxx --- svl/inc/svl/svarray.hxx | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/svl/inc/svl/svarray.hxx b/svl/inc/svl/svarray.hxx index 30bb89c..229f615 100644 --- a/svl/inc/svl/svarray.hxx +++ b/svl/inc/svl/svarray.hxx @@ -140,12 +140,12 @@ void Insert( const nm *pI, sal_uInt16 nP,\ #define _SVVARARR_IMPL_GET_OP_INLINE( nm, ArrElem )\ ArrElem& nm::operator[](sal_uInt16 nP) const\ {\ - DBG_ASSERT( pData && nP < nA,"Op[]");\ + OSL_ENSURE( pData && nP < nA,"Op[]");\ return *(pData+nP);\ }\ void nm::Insert( const nm *pI, sal_uInt16 nP, sal_uInt16 nStt, sal_uInt16 nE)\ {\ - DBG_ASSERT(nP<=nA,"Ins,Ar[Start.End]");\ + OSL_ENSURE(nP<=nA,"Ins,Ar[Start.End]");\ if( USHRT_MAX == nE ) \ nE = pI->nA; \ if( nStt < nE ) \ @@ -219,7 +219,7 @@ nm::nm( sal_uInt16 nInit, sal_uInt8 )\ if( nInit )\ {\ pData = (AE*)(rtl_allocateMemory(sizeof(AE) * nInit));\ - DBG_ASSERT( pData, "CTOR, allocate");\ + OSL_ENSURE( pData, "CTOR, allocate");\ }\ }\ \ @@ -236,7 +236,7 @@ void nm::_resize (size_t n)\ \ void nm::Insert( const AERef aE, sal_uInt16 nP )\ {\ - DBG_ASSERT(nP <= nA && nA < USHRT_MAX, "Ins 1");\ + OSL_ENSURE(nP <= nA && nA < USHRT_MAX, "Ins 1");\ if (nFree < 1)\ _resize (nA + ((nA > 1) ? nA : 1));\ if( pData && nP < nA )\ @@ -247,7 +247,7 @@ void nm::Insert( const AERef aE, sal_uInt16 nP )\ \ void nm::Insert( const AE* pE, sal_uInt16 nL, sal_uInt16 nP )\ {\ - DBG_ASSERT(nP<=nA && ((long)nA+nL)<USHRT_MAX,"Ins n");\ + OSL_ENSURE(nP<=nA && ((long)nA+nL)<USHRT_MAX,"Ins n");\ if (nFree < nL)\ _resize (nA + ((nA > nL) ? nA : nL));\ if( pData && nP < nA )\ @@ -290,7 +290,7 @@ void nm::Remove( sal_uInt16 nP, sal_uInt16 nL )\ {\ if( !nL )\ return;\ - DBG_ASSERT( nP < nA && nP + nL <= nA,"Del");\ + OSL_ENSURE( nP < nA && nP + nL <= nA,"Del");\ if( pData && nP+1 < nA )\ memmove( pData+nP, pData+nP+nL, (nA-nP-nL) * sizeof( AE ));\ nA = nA - nL; nFree = nFree + nL;\ @@ -441,7 +441,7 @@ SV_DECL_PTRARR_DEL_GEN(nm, AE, IS, GS, SvPtrarr, AE &, VoidPtr &, vis) void nm::DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL )\ { \ if( nL ) {\ - DBG_ASSERT( nP < nA && nP + nL <= nA,"Del");\ + OSL_ENSURE( nP < nA && nP + nL <= nA,"Del");\ for( sal_uInt16 n=nP; n < nP + nL; n++ ) \ delete *((AE*)pData+n); \ Base::Remove( nP, nL ); \ @@ -718,7 +718,7 @@ _SV_DECL_VARARR_SORT(nm, AE, IS, GS, vis) _SV_IMPL_SORTAR_ALG( nm,AE )\ void nm::DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL ) { \ if( nL ) {\ - DBG_ASSERT( nP < nA && nP + nL <= nA, "ERR_VAR_DEL" );\ + OSL_ENSURE( nP < nA && nP + nL <= nA, "ERR_VAR_DEL" );\ for( sal_uInt16 n=nP; n < nP + nL; n++ ) \ delete *((AE*)pData+n); \ SvPtrarr::Remove( nP, nL ); \ @@ -730,7 +730,7 @@ _SV_SEEK_PTR( nm, AE ) _SV_IMPL_SORTAR_ALG( nm,AE )\ void nm::DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL ) { \ if( nL ) {\ - DBG_ASSERT( nP < nA && nP + nL <= nA, "ERR_VAR_DEL" );\ + OSL_ENSURE( nP < nA && nP + nL <= nA, "ERR_VAR_DEL" );\ for( sal_uInt16 n=nP; n < nP + nL; n++ ) \ delete *((AE*)pData+n); \ SvPtrarr::Remove( nP, nL ); \ -- 1.7.3.4
>From 661940f4fde10fc83abc317fbadb3386663d6d1e Mon Sep 17 00:00:00 2001 From: Jacek Wolszczak <shutdownrun...@gmail.com> Date: Sun, 5 Jun 2011 10:08:38 +0200 Subject: [PATCH 1/2] Replace DBG_ stuff with OSL_ equivalents in writer --- 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
>From 0c5fd91af957a1ef9de918da2fe4cb561bf64fad Mon Sep 17 00:00:00 2001 From: Jacek Wolszczak <shutdownrun...@gmail.com> Date: Sun, 5 Jun 2011 18:54:38 +0200 Subject: [PATCH 2/2] Remove the remaining debug.hxx includes in writer --- starmath/inc/rect.hxx | 1 - starmath/inc/symbol.hxx | 1 - starmath/inc/types.hxx | 2 -- sw/source/core/bastyp/swcache.cxx | 1 - sw/source/core/bastyp/swregion.cxx | 4 ---- sw/source/core/doc/sortopt.cxx | 2 -- sw/source/core/text/blink.cxx | 2 -- sw/source/core/unocore/unoevtlstnr.cxx | 1 - 8 files changed, 0 insertions(+), 14 deletions(-) diff --git a/starmath/inc/rect.hxx b/starmath/inc/rect.hxx index 85dc824..77de779 100644 --- a/starmath/inc/rect.hxx +++ b/starmath/inc/rect.hxx @@ -34,7 +34,6 @@ #include <tools/gen.hxx> #include <vcl/outdev.hxx> #include <vcl/metric.hxx> -#include <tools/debug.hxx> #include "format.hxx" diff --git a/starmath/inc/symbol.hxx b/starmath/inc/symbol.hxx index 999fde6..1074f75 100644 --- a/starmath/inc/symbol.hxx +++ b/starmath/inc/symbol.hxx @@ -30,7 +30,6 @@ #define SYMBOL_HXX #include <vcl/font.hxx> -#include <tools/debug.hxx> #include <tools/dynary.hxx> #include <svl/lstner.hxx> #include <svl/svarray.hxx> diff --git a/starmath/inc/types.hxx b/starmath/inc/types.hxx index d72df24..93514f1 100644 --- a/starmath/inc/types.hxx +++ b/starmath/inc/types.hxx @@ -30,8 +30,6 @@ #define TYPES_HXX #include <sal/types.h> -#include <tools/debug.hxx> - #define FONTNAME_MATH "OpenSymbol" ///////////////////////////////////////////////////////////////// diff --git a/sw/source/core/bastyp/swcache.cxx b/sw/source/core/bastyp/swcache.cxx index 84efc95..2c63b26 100644 --- a/sw/source/core/bastyp/swcache.cxx +++ b/sw/source/core/bastyp/swcache.cxx @@ -29,7 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" -#include <tools/debug.hxx> #include <swcache.hxx> SV_IMPL_PTRARR(SwCacheObjArr,SwCacheObj*); diff --git a/sw/source/core/bastyp/swregion.cxx b/sw/source/core/bastyp/swregion.cxx index 1c04921..a00dbe0 100644 --- a/sw/source/core/bastyp/swregion.cxx +++ b/sw/source/core/bastyp/swregion.cxx @@ -29,10 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - - - -#include <tools/debug.hxx> #include "swtypes.hxx" #include "swrect.hxx" #include "swregion.hxx" diff --git a/sw/source/core/doc/sortopt.cxx b/sw/source/core/doc/sortopt.cxx index 4c3ddb8..3f6d62b 100644 --- a/sw/source/core/doc/sortopt.cxx +++ b/sw/source/core/doc/sortopt.cxx @@ -29,8 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - -#include <tools/debug.hxx> #include <i18npool/lang.h> #include <sortopt.hxx> diff --git a/sw/source/core/text/blink.cxx b/sw/source/core/text/blink.cxx index 8b66234..f120e38 100644 --- a/sw/source/core/text/blink.cxx +++ b/sw/source/core/text/blink.cxx @@ -29,8 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - -#include <tools/debug.hxx> #include "viewsh.hxx" #include "rootfrm.hxx" // GetOleShell() #include "txtfrm.hxx" // FindRootFrm() diff --git a/sw/source/core/unocore/unoevtlstnr.cxx b/sw/source/core/unocore/unoevtlstnr.cxx index d87af61..a50d10c 100644 --- a/sw/source/core/unocore/unoevtlstnr.cxx +++ b/sw/source/core/unocore/unoevtlstnr.cxx @@ -31,7 +31,6 @@ #include <unoevtlstnr.hxx> -#include <tools/debug.hxx> #include <com/sun/star/lang/EventObject.hpp> #include <com/sun/star/lang/XEventListener.hpp> -- 1.7.3.4
_______________________________________________ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice