diff options
-rw-r--r-- | basic/source/app/brkpnts.cxx | 8 | ||||
-rw-r--r-- | basic/source/app/msgedit.cxx | 37 | ||||
-rw-r--r-- | basic/source/app/msgedit.hxx | 2 |
3 files changed, 43 insertions, 4 deletions
diff --git a/basic/source/app/brkpnts.cxx b/basic/source/app/brkpnts.cxx index 765d10ff0780..cd1e4d6da19c 100644 --- a/basic/source/app/brkpnts.cxx +++ b/basic/source/app/brkpnts.cxx @@ -111,7 +111,7 @@ void BreakpointWindow::SetBPsInModule() { pModule->SetBP( (USHORT)pBrk->nLine ); #if OSL_DEBUG_LEVEL > 1 - DBG_ASSERT( !pModule->IsCompiled() || pModule->IsBP( (USHORT)pBrk->nLine ), "Brechpunkt wurde nicht gesetzt" ) + DBG_ASSERT( !pModule->IsCompiled() || pModule->IsBP( (USHORT)pBrk->nLine ), "Brechpunkt wurde nicht gesetzt" ); #endif pBrk = Next(); } @@ -152,7 +152,7 @@ void BreakpointWindow::InsertBreakpoint( USHORT nLine ) if ( pModule->SetBP( nLine ) ) { #if OSL_DEBUG_LEVEL > 1 - DBG_ASSERT( !pModule->IsCompiled() || pModule->IsBP( nLine ), "Brechpunkt wurde nicht gesetzt" ) + DBG_ASSERT( !pModule->IsCompiled() || pModule->IsBP( nLine ), "Brechpunkt wurde nicht gesetzt" ); #endif if ( StarBASIC::IsRunning() ) { @@ -165,7 +165,7 @@ void BreakpointWindow::InsertBreakpoint( USHORT nLine ) } } #if OSL_DEBUG_LEVEL > 1 - DBG_ASSERT( !pModule->IsCompiled() || pModule->IsBP( nLine ), "Brechpunkt wurde nicht gesetzt" ) + DBG_ASSERT( !pModule->IsCompiled() || pModule->IsBP( nLine ), "Brechpunkt wurde nicht gesetzt" ); #endif } @@ -282,7 +282,7 @@ void BreakpointWindow::Paint( const Rectangle& ) while ( pBrk ) { #if OSL_DEBUG_LEVEL > 1 - DBG_ASSERT( !pModule->IsCompiled() || pModule->IsBP( pBrk->nLine ), "Brechpunkt wurde nicht gesetzt" ) + DBG_ASSERT( !pModule->IsCompiled() || pModule->IsBP( pBrk->nLine ), "Brechpunkt wurde nicht gesetzt" ); #endif ULONG nLine = pBrk->nLine-1; ULONG nY = nLine*nLineHeight - nCurYOffset; diff --git a/basic/source/app/msgedit.cxx b/basic/source/app/msgedit.cxx index 91b3c2e5ea52..8420977820f1 100644 --- a/basic/source/app/msgedit.cxx +++ b/basic/source/app/msgedit.cxx @@ -37,6 +37,7 @@ Version 2 changed order of entries(New Entries at the end) Version 3 Changed Charset from CHARSET_IBMPC to RTL_TEXTENCODING_UTF8 *************************************************************************/ +#include <cstdio> #include <tools/time.hxx> #include <tools/stream.hxx> #ifndef _MSGBOX_HXX //autogen @@ -61,6 +62,8 @@ Version 3 Changed Charset from CHARSET_IBMPC to RTL_TEXTENCODING_UTF8 USHORT MsgEdit::nMaxLogLen = 0; BOOL MsgEdit::bLimitLogLen = FALSE; +BOOL MsgEdit::bPrintLogToStdout = FALSE; +BOOL MsgEdit::bPrintLogToStdoutSet = FALSE; #define WARNING_PREFIX String( SttResId( S_WARNING_PREFIX ) ) #define VERSION_STRING CUniString("File Format Version: ") @@ -85,6 +88,20 @@ MsgEdit::MsgEdit( AppError* pParent, BasicFrame *pBF, const WinBits& aBits ) aEditTree.SetSelectionMode( MULTIPLE_SELECTION ); if ( aEditTree.GetModel()->GetSortMode() != SortNone ) aEditTree.GetModel()->SetSortMode( SortNone ); + + if ( !bPrintLogToStdoutSet ) + { + bPrintLogToStdoutSet = TRUE; + for ( USHORT i = 0 ; i < Application::GetCommandLineParamCount() ; i++ ) + { + if ( Application::GetCommandLineParam( i ).Copy(0,9).CompareIgnoreCaseToAscii("-printlog") == COMPARE_EQUAL + #ifndef UNX + || Application::GetCommandLineParam( i ).Copy(0,9).CompareIgnoreCaseToAscii("/printlog") == COMPARE_EQUAL + #endif + ) + bPrintLogToStdout = TRUE; + } + } } MsgEdit::~MsgEdit() @@ -177,6 +194,7 @@ void MsgEdit::AddAnyMsg( TTLogMsg *LogMsg ) } String aLogMsg = Impl_MakeSaveText( LogMsg->aDebugData ).AppendAscii("\n"); + if( aStrm.IsOpen() ) { aLogMsg.ConvertLineEnd(LINEEND_CRLF); @@ -186,8 +204,27 @@ void MsgEdit::AddAnyMsg( TTLogMsg *LogMsg ) } if ( !bFileWasChanged ) pAppError->UpdateFileInfo( HAS_BEEN_LOADED ); + + + // now write to stdout + if ( bPrintLogToStdout ) + { + String aPrintMsg, aOriginalMsg; + + aOriginalMsg = LogMsg->aDebugData.aMsg; + // converting to human readable string for adding errors to list in testobject + LogMsg->aDebugData.aMsg = pBasicFrame->GenRealString( LogMsg->aDebugData.aMsg ); + + aPrintMsg = Impl_MakeSaveText( LogMsg->aDebugData ).AppendAscii("\n"); + + // restore Original Msg + LogMsg->aDebugData.aMsg = aOriginalMsg; + + printf( ByteString( aPrintMsg, RTL_TEXTENCODING_UTF8 ).GetBuffer() ); + } } } + // converting to human readable string for adding errors to list in testobject LogMsg->aDebugData.aMsg = pBasicFrame->GenRealString( LogMsg->aDebugData.aMsg ); } diff --git a/basic/source/app/msgedit.hxx b/basic/source/app/msgedit.hxx index 0bc86e9d3b9e..bca0eef72929 100644 --- a/basic/source/app/msgedit.hxx +++ b/basic/source/app/msgedit.hxx @@ -94,6 +94,8 @@ class MsgEdit : public DataEdit static USHORT nMaxLogLen; static BOOL bLimitLogLen; + static BOOL bPrintLogToStdout; + static BOOL bPrintLogToStdoutSet; // has it been initialized yet public: MsgEdit( AppError*, BasicFrame *pBF, const WinBits& ); ~MsgEdit(); |