Remove core/except (came in with m101)
This commit is contained in:
parent
4997d825c1
commit
1ade0128a0
6 changed files with 0 additions and 398 deletions
|
@ -247,8 +247,6 @@ $(eval $(call gb_Library_add_exception_objects,sw,\
|
|||
sw/source/core/edit/edtox \
|
||||
sw/source/core/edit/edundo \
|
||||
sw/source/core/edit/edws \
|
||||
sw/source/core/except/dbgloop \
|
||||
sw/source/core/except/errhdl \
|
||||
sw/source/core/fields/authfld \
|
||||
sw/source/core/fields/cellfml \
|
||||
sw/source/core/fields/chpfld \
|
||||
|
|
|
@ -62,7 +62,6 @@ $(eval $(call gb_Library_add_linked_libs,swd,\
|
|||
))
|
||||
|
||||
$(eval $(call gb_Library_add_exception_objects,swd,\
|
||||
sw/source/core/except/errhdl \
|
||||
sw/source/filter/basflt/iodetect \
|
||||
sw/source/ui/uno/detreg \
|
||||
sw/source/ui/uno/swdet2 \
|
||||
|
|
|
@ -1,76 +0,0 @@
|
|||
/*************************************************************************
|
||||
*
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
||||
*
|
||||
* OpenOffice.org - a multi-platform office productivity suite
|
||||
*
|
||||
* This file is part of OpenOffice.org.
|
||||
*
|
||||
* OpenOffice.org is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License version 3
|
||||
* only, as published by the Free Software Foundation.
|
||||
*
|
||||
* OpenOffice.org is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License version 3 for more details
|
||||
* (a copy is included in the LICENSE file that accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* version 3 along with OpenOffice.org. If not, see
|
||||
* <http://www.openoffice.org/license.html>
|
||||
* for a copy of the LGPLv3 License.
|
||||
*
|
||||
************************************************************************/
|
||||
#ifndef _ERRHDL_HXX
|
||||
#define _ERRHDL_HXX
|
||||
|
||||
#ifdef DBG_UTIL
|
||||
|
||||
#include <tools/solar.h>
|
||||
#include <sal/types.h>
|
||||
#include "swdllapi.h"
|
||||
|
||||
extern sal_Bool bAssert; // sal_True, wenn eine ASSERT-Box hochkam
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Ausgabe einer Fehlermeldung inkl. Dateiname und Zeilennummer
|
||||
// wo der Fehler auftrat.
|
||||
// Die Funktion darf nicht direkt benutzt werden!
|
||||
// -----------------------------------------------------------------------
|
||||
SW_DLLPUBLIC void AssertFail( const sal_Char*, const sal_Char*, sal_uInt16 );
|
||||
SW_DLLPUBLIC void AssertFail( sal_uInt16, const sal_Char*, sal_uInt16 );
|
||||
|
||||
#define ASSERT( cond, message ) \
|
||||
if( !(cond) ) { \
|
||||
const char *_pErrorText = #message; \
|
||||
const char *_pFileName = __FILE__; \
|
||||
::AssertFail( _pErrorText, _pFileName, __LINE__ ); \
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Prueft ob die angegebene Bedingung wahr ist, wenn nicht wird eine
|
||||
// Fehlermeldung die ueber die ID Identifiziert wird, ausgegeben.
|
||||
// -----------------------------------------------------------------------
|
||||
#define ASSERT_ID( cond, id ) \
|
||||
if( !(cond) ) { \
|
||||
const char *_pFileName = __FILE__; \
|
||||
::AssertFail( (sal_uInt16)id, _pFileName, __LINE__ ); \
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Beim Bilden der Produktversion werden alle Debug-Utilities automatisch
|
||||
// ignoriert
|
||||
// -----------------------------------------------------------------------
|
||||
#else
|
||||
#define ASSERT( cond, message ) ;
|
||||
#define ASSERT_ID( cond, id ) ;
|
||||
#endif // PRODUCT
|
||||
|
||||
|
||||
|
||||
#endif
|
|
@ -1,168 +0,0 @@
|
|||
/*************************************************************************
|
||||
*
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
||||
*
|
||||
* OpenOffice.org - a multi-platform office productivity suite
|
||||
*
|
||||
* This file is part of OpenOffice.org.
|
||||
*
|
||||
* OpenOffice.org is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License version 3
|
||||
* only, as published by the Free Software Foundation.
|
||||
*
|
||||
* OpenOffice.org is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License version 3 for more details
|
||||
* (a copy is included in the LICENSE file that accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* version 3 along with OpenOffice.org. If not, see
|
||||
* <http://www.openoffice.org/license.html>
|
||||
* for a copy of the LGPLv3 License.
|
||||
*
|
||||
************************************************************************/
|
||||
|
||||
// MARKER(update_precomp.py): autogen include statement, do not remove
|
||||
#include "precompiled_sw.hxx"
|
||||
|
||||
#ifdef DBG_UTIL
|
||||
|
||||
#include <tools/stream.hxx>
|
||||
#include "dbgloop.hxx"
|
||||
#include "errhdl.hxx"
|
||||
|
||||
DbgLoopStack DbgLoop::aDbgLoopStack;
|
||||
|
||||
/*************************************************************************
|
||||
* class DbgLoopStack
|
||||
*************************************************************************/
|
||||
|
||||
DbgLoopStack::DbgLoopStack()
|
||||
{
|
||||
Reset();
|
||||
}
|
||||
|
||||
void DbgLoopStack::Reset()
|
||||
{
|
||||
nPtr = 0;
|
||||
pDbg = 0;
|
||||
for( sal_uInt16 i = 0; i < DBG_MAX_STACK; ++i )
|
||||
aCount[i] = 0;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* DbgLoopStack::Push()
|
||||
*************************************************************************/
|
||||
|
||||
void DbgLoopStack::Push( const void *pThis )
|
||||
{
|
||||
// Wir muessen irgendwie mitbekommen, wann die erste Stackposition
|
||||
// resettet werden soll, z.B. wenn wir einen Nullpointer uebergeben
|
||||
if( !nPtr && ( pDbg != pThis || !pThis ) )
|
||||
{
|
||||
aCount[1] = 0;
|
||||
pDbg = pThis;
|
||||
}
|
||||
|
||||
++nPtr;
|
||||
if( DBG_MAX_STACK > nPtr )
|
||||
{
|
||||
// Wenn eine loop entdeckt wird, wird der counter wieder zurueckgesetzt.
|
||||
ASSERT( DBG_MAX_LOOP > aCount[nPtr], "DbgLoopStack::Push: loop detected" );
|
||||
if( DBG_MAX_LOOP > aCount[nPtr] )
|
||||
++(aCount[nPtr]);
|
||||
else
|
||||
aCount[nPtr] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* DbgLoopStack::Pop()
|
||||
*************************************************************************/
|
||||
|
||||
void DbgLoopStack::Pop()
|
||||
{
|
||||
if( DBG_MAX_STACK > nPtr )
|
||||
{
|
||||
ASSERT( nPtr, "DbgLoopStack::Pop: can't pop the stack" );
|
||||
|
||||
ASSERT( aCount[nPtr], "DbgLoopStack::Pop: can't dec the count" );
|
||||
if( DBG_MAX_STACK > nPtr + 1 )
|
||||
aCount[nPtr + 1] = 0;
|
||||
}
|
||||
--nPtr;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* DbgLoopStack::Print()
|
||||
*************************************************************************/
|
||||
|
||||
void DbgLoopStack::Print( SvStream &rOS ) const
|
||||
{
|
||||
rOS << "POS: " << nPtr << '\n';
|
||||
sal_uInt16 i;
|
||||
for( i = 0; i < DBG_MAX_STACK; ++i )
|
||||
rOS << i << " ";
|
||||
rOS << '\n';
|
||||
for( i = 0; i < DBG_MAX_STACK; ++i )
|
||||
rOS << aCount[i] << " ";
|
||||
rOS << '\n';
|
||||
}
|
||||
|
||||
#ifdef STAND_ALONE
|
||||
// compile with: cl /AL /DSTAND_ALONE dbgloop.cxx
|
||||
|
||||
/*************************************************************************
|
||||
* main()
|
||||
*************************************************************************/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
void AssertFail( const char *pErr, const char *pFile, sal_uInt16 nLine )
|
||||
{
|
||||
cout << pErr << '\n';
|
||||
PrintLoopStack( cout );
|
||||
exit(0);
|
||||
}
|
||||
|
||||
class Test
|
||||
{
|
||||
public:
|
||||
void Run() const;
|
||||
};
|
||||
|
||||
void Test::Run() const
|
||||
{
|
||||
cout << "---" << '\n';
|
||||
for( sal_uInt16 i = 0; i < 10; ++i )
|
||||
{
|
||||
cout << "i" << i;
|
||||
DBG_LOOP;
|
||||
PrintLoopStack( cout );
|
||||
for( sal_uInt16 j = 0; j < 10; ++j )
|
||||
{
|
||||
cout << " j" << j;
|
||||
DBG_LOOP;
|
||||
PrintLoopStack( cout );
|
||||
}
|
||||
cout << '\n';
|
||||
}
|
||||
PrintLoopStack( cout );
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
// unterschiedliche Instanzen waehlen wg. pDbg != pThis
|
||||
Test aTest1;
|
||||
aTest1.Run();
|
||||
Test aTest2;
|
||||
aTest2.Run();
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // DBG_UTIL
|
||||
|
|
@ -1,150 +0,0 @@
|
|||
/*************************************************************************
|
||||
*
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
||||
*
|
||||
* OpenOffice.org - a multi-platform office productivity suite
|
||||
*
|
||||
* This file is part of OpenOffice.org.
|
||||
*
|
||||
* OpenOffice.org is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License version 3
|
||||
* only, as published by the Free Software Foundation.
|
||||
*
|
||||
* OpenOffice.org is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License version 3 for more details
|
||||
* (a copy is included in the LICENSE file that accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* version 3 along with OpenOffice.org. If not, see
|
||||
* <http://www.openoffice.org/license.html>
|
||||
* for a copy of the LGPLv3 License.
|
||||
*
|
||||
************************************************************************/
|
||||
|
||||
// MARKER(update_precomp.py): autogen include statement, do not remove
|
||||
#include "precompiled_sw.hxx"
|
||||
|
||||
#ifdef DBG_UTIL
|
||||
|
||||
#define _ERRHDL_CXX
|
||||
|
||||
|
||||
#include "stdlib.h"
|
||||
#include <tools/debug.hxx>
|
||||
#include <vcl/svapp.hxx>
|
||||
#include <vcl/sound.hxx>
|
||||
#include <errhdl.hxx>
|
||||
|
||||
#ifndef CVBREAK
|
||||
#define CVBREAK
|
||||
#endif
|
||||
|
||||
// Error Codes.
|
||||
#define ERR_SWGBASE 25000
|
||||
|
||||
#define ERR_VAR_IDX (ERR_SWGBASE+ 0)
|
||||
#define ERR_OUTOFSCOPE (ERR_SWGBASE+ 1)
|
||||
|
||||
#define ERR_NUMLEVEL (ERR_SWGBASE+ 2)
|
||||
|
||||
// Error Codes for TxtNode.
|
||||
#define ERR_NOHINTS (ERR_SWGBASE+ 3)
|
||||
|
||||
// Strings to be queried are in COREDL.DLL from _START to _END.
|
||||
#define ERR_SWGMSG_START (ERR_VAR_IDX)
|
||||
#define ERR_SWGMSG_END (ERR_NOHINTS)
|
||||
|
||||
sal_Bool bAssertFail = sal_False; // ist gerade eine Assertbox oben ?
|
||||
sal_Bool bAssert = sal_False; // sal_True, wenn mal ein ASSERT kam.
|
||||
|
||||
/*------------------------------------------------------------------------
|
||||
Ausgabe einer Fehlermeldung inkl. Bedingung, Dateiname und Zeilennummer
|
||||
wo der Fehler auftrat.
|
||||
Die Funktion wird durch das ASSERT Makro gerufen!
|
||||
Parameter:
|
||||
char *pError Fehlermeldung
|
||||
char *pFileName Filename in dem der Fehler auftrat
|
||||
sal_uInt16 nLine Zeilennummer in dem der Fehler auftrat
|
||||
------------------------------------------------------------------------*/
|
||||
|
||||
void AssertFail( const sal_Char* pError, const sal_Char* pFileName, sal_uInt16 nLine )
|
||||
{
|
||||
CVBREAK;
|
||||
// NOTE4("ASSERT: %s at %d: %s\n", pFileName, nLine, pError);
|
||||
bAssert = sal_True;
|
||||
|
||||
if( !bAssertFail && GetpApp() && GetpApp()->IsInMain() )
|
||||
{
|
||||
bAssertFail = sal_True;
|
||||
ByteString aErr;
|
||||
aErr = "Assertion failed\n==================\nFILE : ";
|
||||
aErr += pFileName;
|
||||
aErr += " at line ";
|
||||
aErr += ByteString::CreateFromInt32( nLine );
|
||||
aErr += "\nERROR : ";
|
||||
aErr += pError;
|
||||
|
||||
ByteString aTmp( getenv( "SW_NOBEEP" ) );
|
||||
if ( aTmp != "sal_True" )
|
||||
Sound::Beep(SOUND_ERROR);
|
||||
|
||||
#if defined( UNX ) && !defined( DBG_UTIL )
|
||||
DBG_ERROR( aErr.GetBuffer() ); // DbgErr ist in UNIX-nicht Produkt-Versionen nicht definiert
|
||||
#else
|
||||
DbgError( aErr.GetBuffer() );
|
||||
#endif
|
||||
bAssertFail = sal_False;
|
||||
}
|
||||
else
|
||||
{
|
||||
Sound::Beep(SOUND_ERROR);
|
||||
Sound::Beep(SOUND_ERROR);
|
||||
Sound::Beep(SOUND_ERROR);
|
||||
if( !bAssertFail )
|
||||
*(short *)0 = 4711; // UAE ausloesen
|
||||
}
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------
|
||||
Ausgabe einer Fehlermeldung inkl. Bedingung, Dateiname und Zeilennummer
|
||||
wo der Fehler auftrat.
|
||||
Die Funktion wird durch das ASSERT Makro gerufen!
|
||||
Parameter:
|
||||
sal_uInt16 nErrorId Id fuer Fehlermeldung
|
||||
char *pFileName Filename in dem der Fehler auftrat
|
||||
sal_uInt16 nLine Zeilennummer in dem der Fehler auftrat
|
||||
------------------------------------------------------------------------*/
|
||||
|
||||
void AssertFail( sal_uInt16 nErrorId, const sal_Char* pFileName, sal_uInt16 nLine )
|
||||
{
|
||||
// Umsetzung der ErrorId in eine Fehlermeldung
|
||||
static const sal_Char
|
||||
/* Error Fehlermeldungen zugriffe ausserhalb eines Bereiches */
|
||||
sERR_VAR_IDX[] = "Op[]",
|
||||
sERR_OUTOFSCOPE[] = "Zugriff ausserhalb des Bereiches",
|
||||
/* Error Codes fuer Numerierungsregeln */
|
||||
sERR_NUMLEVEL[] = "Falscher Num-Level",
|
||||
/* Error Codes fuer TxtNode */
|
||||
sERR_NOHINTS[] = "Zugriff auf ungueltiges HintsArray",
|
||||
sERR_UNKNOWN[] = "???";
|
||||
|
||||
static const sal_Char* aErrStrTab[ ERR_SWGMSG_END - ERR_SWGMSG_START +1 ] =
|
||||
{
|
||||
sERR_VAR_IDX, sERR_OUTOFSCOPE, sERR_NUMLEVEL, sERR_NOHINTS
|
||||
};
|
||||
|
||||
const sal_Char* pMsg;
|
||||
if( nErrorId >= ERR_SWGMSG_START && nErrorId < ERR_SWGMSG_END )
|
||||
pMsg = aErrStrTab[ nErrorId - ERR_SWGMSG_START ];
|
||||
else
|
||||
pMsg = sERR_UNKNOWN;
|
||||
|
||||
AssertFail( pMsg, pFileName, nLine );
|
||||
}
|
||||
|
||||
#endif // DBG_UTIL
|
||||
|
|
@ -47,7 +47,6 @@
|
|||
#include <shellio.hxx>
|
||||
#include <poolfmt.hxx>
|
||||
#include <SwXMLTextBlocks.hxx>
|
||||
#include <errhdl.hxx>
|
||||
#include <SwXMLBlockImport.hxx>
|
||||
#include <SwXMLBlockExport.hxx>
|
||||
#include <swerror.h>
|
||||
|
|
Loading…
Reference in a new issue