Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


Hi,

This macro is never defined so I delete it.

Bye
From 6281ffb378d83ef0a44e17f7da3de88d8d284c8a Mon Sep 17 00:00:00 2001
From: Xisco Fauli <anistenis@gmail.com>
Date: Fri, 25 Mar 2011 20:44:20 +0100
Subject: [PATCH] Remove DBG_TRACE_BASIC

---
 basic/source/classes/sbxmod.cxx   |    4 -
 basic/source/comp/sbcomp.cxx      |  198 -------------------------------------
 basic/source/inc/sbtrace.hxx      |   44 --------
 basic/source/runtime/methods1.cxx |    7 --
 basic/source/runtime/rtlproto.hxx |    5 -
 basic/source/runtime/stdobj.cxx   |    4 -
 6 files changed, 0 insertions(+), 262 deletions(-)
 delete mode 100755 basic/source/inc/sbtrace.hxx

diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 15c6989..c7c7135 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -1223,10 +1223,6 @@ sal_uInt16 SbModule::Run( SbMethod* pMeth )
                 // VBA always ensures screenupdating is enabled after completing
                 if ( mbVBACompat )
                     VBAUnlockDocuments( PTR_CAST( StarBASIC, GetParent() ) );
-
-#ifdef DBG_TRACE_BASIC
-                dbg_DeInitTrace();
-#endif
             }
         }
         else
diff --git a/basic/source/comp/sbcomp.cxx b/basic/source/comp/sbcomp.cxx
index 729ec83..b433acd 100755
--- a/basic/source/comp/sbcomp.cxx
+++ b/basic/source/comp/sbcomp.cxx
@@ -34,204 +34,6 @@
 #include "image.hxx"
 #include <basic/sbobjmod.hxx>
 
-// To activate tracing enable in sbtrace.hxx
-#ifdef DBG_TRACE_BASIC
-
-// Trace Settings, used if no ini file / not found in ini file
-static char            GpTraceFileNameDefault[] = "d:\\zBasic.Asm\\BasicTrace.txt";
-static char*   GpTraceFileName = GpTraceFileNameDefault;
-
-// GbTraceOn:
-// true = tracing is active, false = tracing is disabled, default = true
-// Set to false initially if you want to activate tracing on demand with
-// TraceCommand( "TraceOn" ), see below
-static bool    GbTraceOn = true;
-
-// GbIncludePCodes:
-// true = PCodes are written to trace, default = false, correspondents
-// with TraceCommand( "PCodeOn" / "PCodeOff" ), see below
-static bool    GbIncludePCodes = false;
-
-static int     GnIndentPerCallLevel = 4;
-static int     GnIndentForPCode = 2;
-
-/*
-    With trace enabled the runtime function TraceCommand
-    can be used to influence the trace functionality
-    from within the running Basic macro.
-
-    Format: TraceCommand( command as String [, param as Variant] )
-
-    Supported commands (command is NOT case sensitive):
-    TraceCommand "TraceOn"                     sets GbTraceOn = true
-    TraceCommand "TraceOff"                    sets GbTraceOn = false
-
-    TraceCommand "PCodeOn"                     sets GbIncludePCodes = true
-    TraceCommand "PCodeOff"                    sets GbIncludePCodes = false
-
-    TraceCommand "Print", aVal         writes aVal into the trace file as
-                                    long as it can be converted to string
-*/
-
-static void lcl_skipWhites( char*& rpc )
-{
-    while( *rpc == ' ' || *rpc == '\t' )
-        ++rpc;
-}
-
-inline void lcl_findNextLine( char*& rpc, char* pe )
-{
-    // Find line end
-    while( rpc < pe && *rpc != 13 && *rpc != 10 )
-        ++rpc;
-
-    // Read all
-    while( rpc < pe && (*rpc == 13 || *rpc == 10) )
-        ++rpc;
-}
-
-inline bool lcl_isAlpha( char c )
-{
-    bool bRet = (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
-    return bRet;
-}
-
-static void lcl_ReadIniFile( const char* pIniFileName )
-{
-    const int BUF_SIZE = 1000;
-    static sal_Char TraceFileNameBuffer[BUF_SIZE];
-    sal_Char Buffer[BUF_SIZE];
-    sal_Char VarNameBuffer[BUF_SIZE];
-    sal_Char ValBuffer[BUF_SIZE];
-
-    FILE* pFile = fopen( pIniFileName ,"rb" );
-    if( pFile == NULL )
-        return;
-
-    size_t nRead = fread( Buffer, 1, BUF_SIZE, pFile );
-
-    // Scan
-    char* pc = Buffer;
-    char* pe = Buffer + nRead;
-    while( pc < pe )
-    {
-        lcl_skipWhites( pc ); if( pc == pe ) break;
-
-        // Read variable
-        char* pVarStart = pc;
-        while( pc < pe && lcl_isAlpha( *pc ) )
-            ++pc;
-        int nVarLen = pc - pVarStart;
-        if( nVarLen == 0 )
-        {
-            lcl_findNextLine( pc, pe );
-            continue;
-        }
-        strncpy( VarNameBuffer, pVarStart, nVarLen );
-        VarNameBuffer[nVarLen] = '\0';
-
-        // Check =
-        lcl_skipWhites( pc ); if( pc == pe ) break;
-        if( *pc != '=' )
-            continue;
-        ++pc;
-        lcl_skipWhites( pc ); if( pc == pe ) break;
-
-        // Read value
-        char* pValStart = pc;
-        while( pc < pe && *pc != 13 && *pc != 10 )
-            ++pc;
-        int nValLen = pc - pValStart;
-        if( nValLen == 0 )
-        {
-            lcl_findNextLine( pc, pe );
-            continue;
-        }
-        strncpy( ValBuffer, pValStart, nValLen );
-        ValBuffer[nValLen] = '\0';
-
-        // Match variables
-        if( strcmp( VarNameBuffer, "GpTraceFileName") == 0 )
-        {
-            strcpy( TraceFileNameBuffer, ValBuffer );
-            GpTraceFileName = TraceFileNameBuffer;
-        }
-        else
-        if( strcmp( VarNameBuffer, "GbTraceOn") == 0 )
-            GbTraceOn = (strcmp( ValBuffer, "true" ) == 0);
-        else
-        if( strcmp( VarNameBuffer, "GbIncludePCodes") == 0 )
-            GbIncludePCodes = (strcmp( ValBuffer, "true" ) == 0);
-        else
-        if( strcmp( VarNameBuffer, "GnIndentPerCallLevel") == 0 )
-            GnIndentPerCallLevel = strtol( ValBuffer, NULL, 10 );
-        else
-        if( strcmp( VarNameBuffer, "GnIndentForPCode") == 0 )
-            GnIndentForPCode = strtol( ValBuffer, NULL, 10 );
-    }
-    fclose( pFile );
-}
-            if( eType & SbxARRAY )
-
-void RTL_Impl_TraceCommand( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite )
-{
-    (void)pBasic;
-    (void)bWrite;
-
-    if ( rPar.Count() < 2 )
-    {
-        StarBASIC::Error( SbERR_BAD_ARGUMENT );
-        return;
-    }
-
-    String aCommand = rPar.Get(1)->GetString();
-
-    if( aCommand.EqualsIgnoreCaseAscii( "TraceOn" ) )
-        GbTraceOn = true;
-    else
-    if( aCommand.EqualsIgnoreCaseAscii( "TraceOff" ) )
-        GbTraceOn = false;
-    else
-    if( aCommand.EqualsIgnoreCaseAscii( "PCodeOn" ) )
-        GbIncludePCodes = true;
-    else
-    if( aCommand.EqualsIgnoreCaseAscii( "PCodeOff" ) )
-        GbIncludePCodes = false;
-    else
-    if( aCommand.EqualsIgnoreCaseAscii( "Print" ) )
-    {
-        if ( rPar.Count() < 3 )
-        {
-            StarBASIC::Error( SbERR_BAD_ARGUMENT );
-            return;
-        }
-
-        SbxError eOld = SbxBase::GetError();
-        if( eOld != SbxERR_OK )
-            SbxBase::ResetError();
-
-        String aValStr = rPar.Get(2)->GetString();
-        SbxError eErr = SbxBase::GetError();
-        if( eErr != SbxERR_OK )
-        {
-            aValStr = String( RTL_CONSTASCII_USTRINGPARAM( "<ERROR converting value to String>" ) 
);
-            SbxBase::ResetError();
-        }
-
-        char Buffer[500];
-        const char* pValStr = OUStringToOString( rtl::OUString( aValStr ), 
RTL_TEXTENCODING_ASCII_US ).getStr();
-
-        sprintf( Buffer, "### TRACE_PRINT: %s ###", pValStr );
-        int nIndent = GnLastCallLvl * GnIndentPerCallLevel;
-        lcl_lineOut( GpTraceFileName, Buffer, lcl_getSpaces( nIndent ) );
-
-        if( eOld != SbxERR_OK )
-            SbxBase::SetError( eOld );
-    }
-}
-
-#endif
-
 // Diese Routine ist hier definiert, damit der Compiler als eigenes Segment
 // geladen werden kann.
 
diff --git a/basic/source/inc/sbtrace.hxx b/basic/source/inc/sbtrace.hxx
deleted file mode 100755
index bf2caf1..0000000
--- a/basic/source/inc/sbtrace.hxx
+++ /dev/null
@@ -1,44 +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 _SBTRACE_HXX
-#define _SBTRACE_HXX
-
-//#define DBG_TRACE_BASIC
-
-#ifdef DBG_TRACE_BASIC
-void dbg_InitTrace( void );
-void dbg_DeInitTrace( void );
-void dbg_traceStep( SbModule* pModule, UINT32 nPC, INT32 nCallLvl );
-void dbg_traceNotifyCall( SbModule* pModule, SbMethod* pMethod, INT32 nCallLvl, bool bLeave = 
false );
-void dbg_traceNotifyError( SbError nTraceErr, const String& aTraceErrMsg, bool bTraceErrHandled, 
INT32 nCallLvl );
-void dbg_RegisterTraceTextForPC( SbModule* pModule, UINT32 nPC,
-    const String& aTraceStr_STMNT, const String& aTraceStr_PCode );
-void RTL_Impl_TraceCommand( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite );
-#endif
-
-#endif
diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx
index 907a301..8462b17 100755
--- a/basic/source/runtime/methods1.cxx
+++ b/basic/source/runtime/methods1.cxx
@@ -1625,13 +1625,6 @@ RTLFUNC(GetDefaultContext)
     RTL_Impl_GetDefaultContext( pBasic, rPar, bWrite );
 }
 
-#ifdef DBG_TRACE_BASIC
-RTLFUNC(TraceCommand)
-{
-    RTL_Impl_TraceCommand( pBasic, rPar, bWrite );
-}
-#endif
-
 RTLFUNC(Join)
 {
     (void)pBasic;
diff --git a/basic/source/runtime/rtlproto.hxx b/basic/source/runtime/rtlproto.hxx
index 7258a7d..c2f1ba5 100755
--- a/basic/source/runtime/rtlproto.hxx
+++ b/basic/source/runtime/rtlproto.hxx
@@ -27,7 +27,6 @@
  ************************************************************************/
 
 #include <basic/sbstar.hxx>
-#include "sbtrace.hxx"
 
 #define        RTLFUNC( name ) void SbRtl_##name( StarBASIC* pBasic, SbxArray& rPar, sal_Bool 
bWrite )
 #define        RTLNAME( name ) &SbRtl_##name
@@ -363,10 +362,6 @@ extern RTLFUNC(CaptureAssertions);
 
 extern RTLFUNC(Partition); // Fong
 
-#ifdef DBG_TRACE_BASIC
-extern RTLFUNC(TraceCommand);
-#endif
-
 extern double Now_Impl();
 extern void Wait_Impl( bool bDurationBased, SbxArray& rPar );
 
diff --git a/basic/source/runtime/stdobj.cxx b/basic/source/runtime/stdobj.cxx
index a15457c..eb6fc36 100755
--- a/basic/source/runtime/stdobj.cxx
+++ b/basic/source/runtime/stdobj.cxx
@@ -630,10 +630,6 @@ static Methods aMethods[] = {
 { "TimeValue",      SbxDATE,      1 | _FUNCTION, RTLNAME(TimeValue),0       },
   { "String",       SbxSTRING, 0,NULL,0 },
 { "TOGGLE",            SbxINTEGER,       _CPROP,    RTLNAME(TOGGLE),0          },
-#ifdef DBG_TRACE_BASIC
-{ "TraceCommand",   SbxNULL,     1 | _FUNCTION, RTLNAME(TraceCommand),0 },
-  { "Command",         SbxSTRING,  0,NULL,0 },
-#endif
 { "Trim",           SbxSTRING,    1 | _FUNCTION, RTLNAME(Trim),0            },
   { "String",       SbxSTRING, 0,NULL,0 },
 { "True",           SbxBOOL,          _CPROP,    RTLNAME(True),0            },
-- 
1.7.1


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.