[Libreoffice-commits] core.git: 17 commits - basic/source include/osl include/svl include/tools sal/Library_sal.mk sal/osl sfx2/source stoc/source svl/source tools/source vcl/source
Stephan Bergmann
sbergman at redhat.com
Tue Mar 25 08:17:44 PDT 2014
basic/source/runtime/sbdiagnose.cxx | 5
basic/source/sbx/sbxobj.cxx | 65 ++++---
basic/source/sbx/sbxvar.cxx | 39 ----
include/osl/diagnose.h | 44 -----
include/svl/filerec.hxx | 21 --
include/tools/debug.hxx | 68 --------
sal/Library_sal.mk | 3
sal/osl/all/compat.cxx | 37 ++++
sal/osl/all/debugbase.cxx | 30 ---
sal/osl/all/trace.cxx | 28 ---
sal/osl/unx/diagnose.cxx | 278 ----------------------------------
sal/osl/w32/diagnose.c | 147 -----------------
sfx2/source/bastyp/progress.cxx | 21 +-
sfx2/source/control/ctrlitem.cxx | 10 -
sfx2/source/inc/sfxtypes.hxx | 10 -
sfx2/source/menu/virtmenu.cxx | 21 +-
stoc/source/javaloader/javaloader.cxx | 5
svl/source/filerec/filerec.cxx | 4
tools/source/debug/debug.cxx | 73 --------
tools/source/memtools/multisel.cxx | 51 ------
vcl/source/app/dbggui.cxx | 42 -----
21 files changed, 127 insertions(+), 875 deletions(-)
New commits:
commit 97354578d7195bce927f0c00c4e2ae9cd7344776
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Mar 25 14:10:05 2014 +0100
Remove the obsolete functionality originally underlying osl/diagnose.h
...before that got rebased onto sal/log.hxx. That functionality is considered
an implementation detail, so it should be safe to remove it from the URE
interface. As usual, aborting stubs are retained for SONAME stability.
Change-Id: If948b9714c26a3871e38dea4d4d5b5466d6ee258
diff --git a/include/osl/diagnose.h b/include/osl/diagnose.h
index 2d8636f..b0f7bad 100644
--- a/include/osl/diagnose.h
+++ b/include/osl/diagnose.h
@@ -87,50 +87,6 @@
#define OSL_DEBUG_LEVEL 0
#endif
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-/*
- Diagnostic support
-*/
-
-SAL_DLLPUBLIC void SAL_CALL osl_breakDebug(void);
-SAL_DLLPUBLIC sal_Bool SAL_CALL osl_assertFailedLine(const sal_Char* pszFileName, sal_Int32 nLine, const sal_Char* pszMessage);
-SAL_DLLPUBLIC void SAL_CALL osl_trace(const sal_Char* pszFormat, ...);
-SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_reportError(sal_uInt32 nType, const sal_Char* pszErrorMessage);
-
-/*
- For message delivery
-*/
-
-/** a message delivery function which receives a pre-formatted message string
-*/
-typedef void (SAL_CALL *pfunc_osl_printDebugMessage)( const sal_Char * pszMessage );
-
-/** a message delivery function which receives detailed information about where the message was triggered
-*/
-typedef void (SAL_CALL *pfunc_osl_printDetailedDebugMessage)( const sal_Char * pszFileName, sal_Int32 nLine, const sal_Char* pszMessage );
-
-/** sets a message delivery function
-
- The function set here is ignored if a function for detailed message information
- (pfunc_osl_printDetailedDebugMessage) has been set.
-
- The given message handler must be able to cope with a null message.
-*/
-SAL_DLLPUBLIC pfunc_osl_printDebugMessage SAL_CALL osl_setDebugMessageFunc( pfunc_osl_printDebugMessage pNewFunc );
-
-/** sets a delivery function for detailed message information.
-
- The given message handler must be able to cope with a null message.
-*/
-SAL_DLLPUBLIC pfunc_osl_printDetailedDebugMessage SAL_CALL osl_setDetailedDebugMessageFunc( pfunc_osl_printDetailedDebugMessage pNewFunc );
-
-#ifdef __cplusplus
-}
-#endif
-
#define OSL_THIS_FILE __FILE__
/* the macro OSL_LOG_PREFIX is intended to be an office internal macro for now
diff --git a/sal/Library_sal.mk b/sal/Library_sal.mk
index bda3dd346..ec8d89b 100644
--- a/sal/Library_sal.mk
+++ b/sal/Library_sal.mk
@@ -88,7 +88,6 @@ $(eval $(call gb_Library_add_exception_objects,sal,\
sal/osl/all/debugbase \
sal/osl/all/loadmodulerelative \
sal/osl/all/log \
- sal/osl/all/trace \
sal/osl/all/utility \
sal/rtl/alloc_arena \
sal/rtl/alloc_cache \
@@ -154,7 +153,6 @@ endif
ifneq ($(OS),WNT)
$(eval $(call gb_Library_add_exception_objects,sal,\
sal/osl/unx/conditn \
- sal/osl/unx/diagnose \
sal/osl/unx/file \
sal/osl/unx/file_error_transl \
sal/osl/unx/file_misc \
@@ -250,7 +248,6 @@ $(eval $(call gb_Library_add_exception_objects,sal,\
))
$(eval $(call gb_Library_add_cobjects,sal,\
sal/osl/w32/conditn \
- sal/osl/w32/diagnose \
sal/osl/w32/dllentry \
sal/osl/w32/file_error \
sal/osl/w32/interlck \
diff --git a/sal/osl/all/compat.cxx b/sal/osl/all/compat.cxx
index efe7877..ef44215 100644
--- a/sal/osl/all/compat.cxx
+++ b/sal/osl/all/compat.cxx
@@ -23,6 +23,16 @@ SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL osl_acquireSemaphore(void *) {
for (;;) { std::abort(); } // avoid "must return a value" warnings
}
+SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL osl_assertFailedLine(
+ char const *, sal_Int32, char const *)
+{
+ for (;;) { std::abort(); } // avoid "must return a value" warnings
+}
+
+SAL_DLLPUBLIC_EXPORT void SAL_CALL osl_breakDebug() {
+ std::abort();
+}
+
SAL_DLLPUBLIC_EXPORT void * SAL_CALL osl_createSemaphore(sal_uInt32) {
for (;;) { std::abort(); } // avoid "must return a value" warnings
}
@@ -39,6 +49,33 @@ SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL osl_releaseSemaphore(void *) {
for (;;) { std::abort(); } // avoid "must return a value" warnings
}
+SAL_DLLPUBLIC_EXPORT sal_Int32 SAL_CALL osl_reportError(
+ sal_uInt32, char const *)
+{
+ for (;;) { std::abort(); } // avoid "must return a value" warnings
+}
+
+namespace {
+typedef void (SAL_CALL * pfunc_osl_printDebugMessage)(char const *);
+}
+SAL_DLLPUBLIC_EXPORT pfunc_osl_printDebugMessage SAL_CALL
+osl_setDebugMessageFunc(pfunc_osl_printDebugMessage) {
+ for (;;) { std::abort(); } // avoid "must return a value" warnings
+}
+
+namespace {
+typedef void (SAL_CALL * pfunc_osl_printDetailedDebugMessage)(
+ char const *, sal_Int32, char const *);
+}
+SAL_DLLPUBLIC_EXPORT pfunc_osl_printDetailedDebugMessage SAL_CALL
+osl_setDetailedDebugMessageFunc(pfunc_osl_printDetailedDebugMessage) {
+ for (;;) { std::abort(); } // avoid "must return a value" warnings
+}
+
+SAL_DLLPUBLIC_EXPORT void SAL_CALL osl_trace(char const *, ...) {
+ std::abort();
+}
+
SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL osl_tryToAcquireSemaphore(void *) {
for (;;) { std::abort(); } // avoid "must return a value" warnings
}
diff --git a/sal/osl/all/trace.cxx b/sal/osl/all/trace.cxx
deleted file mode 100644
index 007f364..0000000
--- a/sal/osl/all/trace.cxx
+++ /dev/null
@@ -1,28 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-#include "sal/config.h"
-
-#include <cstdarg>
-
-#include "osl/diagnose.h"
-#include "sal/detail/log.h"
-#include "sal/log.hxx"
-
-#include "logformat.hxx"
-
-void osl_trace(char const * pszFormat, ...) {
- std::va_list args;
- va_start(args, pszFormat);
- osl::detail::logFormat(
- SAL_DETAIL_LOG_LEVEL_INFO, "legacy.osl", SAL_WHERE, pszFormat, args);
- va_end(args);
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/osl/unx/diagnose.cxx b/sal/osl/unx/diagnose.cxx
deleted file mode 100644
index 188062c..0000000
--- a/sal/osl/unx/diagnose.cxx
+++ /dev/null
@@ -1,278 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "osl/diagnose.h"
-#include "system.h"
-
-#ifndef HAVE_DLFCN_H
-
-#if defined(LINUX) || defined(SOLARIS)
-#define HAVE_DLFCN_H
-#endif /* LINUX || SOLARIS */
-
-#endif /* HAVE_DLFCN_H */
-
-
-#ifdef HAVE_DLFCN_H
-
-#ifndef INCLUDED_DLFCN_H
-#include <dlfcn.h>
-#define INCLUDED_DLFCN_H
-#endif
-
-#endif /* HAVE_DLFCN_H */
-
-#include <pthread.h>
-#include <stddef.h>
-
-/************************************************************************/
-/* Internal data structures and functions */
-/************************************************************************/
-
-static pthread_mutex_t g_mutex = PTHREAD_MUTEX_INITIALIZER;
-
-typedef pfunc_osl_printDebugMessage oslDebugMessageFunc;
-static oslDebugMessageFunc volatile g_pDebugMessageFunc = 0;
-
-typedef pfunc_osl_printDetailedDebugMessage oslDetailedDebugMessageFunc;
-static oslDetailedDebugMessageFunc volatile g_pDetailedDebugMessageFunc = 0;
-
-static void osl_diagnose_backtrace_Impl (
- oslDebugMessageFunc f);
-
-#define OSL_DIAGNOSE_OUTPUTMESSAGE(f, s) \
-((f != 0) ? (*(f))((s)) : (void)fprintf(stderr, "%s", (s)))
-
-#if defined (LINUX) || defined (SOLARIS)
-
-static void osl_diagnose_frame_Impl (
- oslDebugMessageFunc f,
- int depth,
- void * pc)
-{
- const char *fname = 0, *sname = 0;
- void *fbase = 0, *saddr = 0;
- ptrdiff_t offset;
- char szMessage[1024];
-
-#ifdef INCLUDED_DLFCN_H
- Dl_info dli;
- if (dladdr (pc, &dli) != 0)
- {
- fname = dli.dli_fname;
- fbase = dli.dli_fbase;
- sname = dli.dli_sname;
- saddr = dli.dli_saddr;
- }
-#endif /* INCLUDED_DLFCN_H */
-
- if (saddr)
- offset = (ptrdiff_t)(pc) - (ptrdiff_t)(saddr);
- else if (fbase)
- offset = (ptrdiff_t)(pc) - (ptrdiff_t)(fbase);
- else
- offset = (ptrdiff_t)(pc);
-
- snprintf (szMessage, sizeof(szMessage),
- "Backtrace: [%d] %s: %s+0x%" SAL_PRI_PTRDIFFT "x\n",
- depth,
- fname ? fname : "<unknown>",
- sname ? sname : "???",
- offset);
-
- OSL_DIAGNOSE_OUTPUTMESSAGE(f, szMessage);
-}
-#endif
-
-#if defined(LINUX)
-
-#include <execinfo.h>
-
-#define FRAME_COUNT 64
-#define FRAME_OFFSET 1
-
-static void osl_diagnose_backtrace_Impl (oslDebugMessageFunc f)
-{
- void * ppFrames[FRAME_COUNT];
- int i, n;
-
- n = backtrace (ppFrames, FRAME_COUNT);
- for (i = FRAME_OFFSET; i < n; i++)
- {
- osl_diagnose_frame_Impl (f, (i - FRAME_OFFSET), ppFrames[i]);
- }
-}
-
-#elif defined(SOLARIS)
-
-#include <setjmp.h>
-#include <sys/frame.h>
-
-#if defined(SPARC)
-
-#if defined IS_LP64
-
-#define FRAME_PTR_OFFSET 1
-#define FRAME_OFFSET 0
-#define STACK_BIAS 0x7ff
-
-#else
-
-#define FRAME_PTR_OFFSET 1
-#define FRAME_OFFSET 0
-#define STACK_BIAS 0
-
-#endif
-
-#elif defined(INTEL)
-
-#define FRAME_PTR_OFFSET 3
-#define FRAME_OFFSET 0
-#define STACK_BIAS 0
-
-#endif /* (SPARC || INTEL) */
-
-static void osl_diagnose_backtrace_Impl (oslDebugMessageFunc f)
-{
- jmp_buf ctx;
- long fpval;
- struct frame * fp;
- int i;
-
-#if defined(SPARC)
- asm("ta 3");
-#endif /* SPARC */
- setjmp (ctx);
-
- fpval = ((long*)(ctx))[FRAME_PTR_OFFSET];
- fp = (struct frame*)((char*)(fpval) + STACK_BIAS);
-
- for (i = 0; (i < FRAME_OFFSET) && (fp != 0); i++)
- fp = (struct frame*)((char*)(fp->fr_savfp) + STACK_BIAS);
-
- for (i = 0; (fp != 0) && (fp->fr_savpc != 0); i++)
- {
- struct frame * prev = (struct frame*)((char*)(fp->fr_savfp) + STACK_BIAS);
- osl_diagnose_frame_Impl (f, i, (void*)(fp->fr_savpc));
- fp = (prev > fp) ? prev : 0;
- }
-}
-
-#else /* (LINUX || SOLARIS) */
-
-static void osl_diagnose_backtrace_Impl (oslDebugMessageFunc f)
-{
- (void) f;
- /* not yet implemented */
-}
-
-#endif /* (LINUX || SOLARIS) */
-
-namespace {
-
-// getenv is not thread safe, so minimize use of result:
-bool isEnv(char const * name) {
- char * p = getenv(name);
- return p != NULL && *p != '\0';
-}
-
-}
-
-sal_Bool SAL_CALL osl_assertFailedLine (
- const sal_Char* pszFileName,
- sal_Int32 nLine,
- const sal_Char* pszMessage)
-{
- oslDebugMessageFunc f = g_pDebugMessageFunc;
- char szMessage[1024];
-
- // after reporting the assertion, abort if told so by SAL_DIAGNOSE_ABORT, but *not* if
- // assertions are routed to some external instance
- static bool envAbort = isEnv( "SAL_DIAGNOSE_ABORT" );
- static bool envBacktrace = isEnv( "SAL_DIAGNOSE_BACKTRACE" );
- bool const doAbort = envAbort && f == NULL;
-
- /* If there's a callback for detailed messages, use it */
- if ( g_pDetailedDebugMessageFunc != NULL )
- {
- g_pDetailedDebugMessageFunc( pszFileName, nLine, pszMessage );
- return sal_False;
- }
-
- /* format message into buffer */
- if (pszMessage != 0)
- {
- snprintf(szMessage, sizeof(szMessage),
- "Error: File %s, Line %" SAL_PRIdINT32 ": %s\n",
- pszFileName, nLine, pszMessage);
- }
- else
- {
- snprintf(szMessage, sizeof(szMessage),
- "Error: File %s, Line %" SAL_PRIdINT32 "\n",
- pszFileName, nLine);
- }
-
- /* acquire lock to serialize output message(s) */
- pthread_mutex_lock(&g_mutex);
-
- /* output message buffer */
- OSL_DIAGNOSE_OUTPUTMESSAGE(f, szMessage);
-
- /* should we output backtrace? */
- if( envBacktrace )
- osl_diagnose_backtrace_Impl(f);
-
- /* release lock and leave */
- pthread_mutex_unlock(&g_mutex);
-
- return doAbort;
-}
-
-void SAL_CALL osl_breakDebug()
-{
- abort();
-}
-
-sal_Int32 SAL_CALL osl_reportError (
- sal_uInt32 nType,
- const sal_Char* pszMessage)
-{
- (void) nType; /* unused */
- fputs(pszMessage, stderr);
- return 0;
-}
-
-oslDebugMessageFunc SAL_CALL osl_setDebugMessageFunc (
- oslDebugMessageFunc pNewFunc)
-{
- oslDebugMessageFunc pOldFunc = g_pDebugMessageFunc;
- g_pDebugMessageFunc = pNewFunc;
- return pOldFunc;
-}
-
-pfunc_osl_printDetailedDebugMessage SAL_CALL osl_setDetailedDebugMessageFunc (
- pfunc_osl_printDetailedDebugMessage pNewFunc)
-{
- oslDetailedDebugMessageFunc pOldFunc = g_pDetailedDebugMessageFunc;
- g_pDetailedDebugMessageFunc = pNewFunc;
- return pOldFunc;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/osl/w32/diagnose.c b/sal/osl/w32/diagnose.c
deleted file mode 100644
index 4db4e79..0000000
--- a/sal/osl/w32/diagnose.c
+++ /dev/null
@@ -1,147 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "system.h"
-
-#include <stdio.h>
-
-#include <osl/diagnose.h>
-
-static pfunc_osl_printDebugMessage _pPrintDebugMessage = NULL;
-static pfunc_osl_printDetailedDebugMessage _pPrintDetailedDebugMessage = NULL;
-
-pfunc_osl_printDebugMessage SAL_CALL osl_setDebugMessageFunc( pfunc_osl_printDebugMessage pNewFunc )
-{
- pfunc_osl_printDebugMessage pOldFunc = _pPrintDebugMessage;
- _pPrintDebugMessage = pNewFunc;
-
- return pOldFunc;
-}
-
-pfunc_osl_printDetailedDebugMessage SAL_CALL osl_setDetailedDebugMessageFunc( pfunc_osl_printDetailedDebugMessage pNewFunc )
-{
- pfunc_osl_printDetailedDebugMessage pOldFunc = _pPrintDetailedDebugMessage;
- _pPrintDetailedDebugMessage = pNewFunc;
- return pOldFunc;
-}
-
-/*
- Trace output
-*/
-
-void SAL_CALL osl_breakDebug(void)
-{
- if ( IsDebuggerPresent() )
- DebugBreak();
- else
- abort ();
-}
-
-sal_Bool SAL_CALL osl_assertFailedLine(const sal_Char* pszFileName, sal_Int32 nLine, const sal_Char* pszMessage)
-{
- char const * env = getenv( "SAL_DIAGNOSE_ABORT" );
-#if defined(_DEBUG) && !defined(NO_DEBUG_CRT)
- _CrtDbgReport(_CRT_ASSERT, pszFileName, nLine, NULL, pszMessage);
- return ( ( env != NULL ) && ( *env != '\0' ) );
-#else
- HWND hWndParent;
- UINT nFlags;
- int nCode;
-
- /* get app name or NULL if unknown (don't call assert) */
- LPCSTR lpszAppName = "Error";
- sal_Char szMessage[512];
-
- /* format message into buffer */
- szMessage[sizeof(szMessage)-1] = '\0'; /* zero terminate always */
- _snprintf(szMessage, sizeof(szMessage)-1, "%s: File %hs, Line %d\n:%s\n",
- lpszAppName, pszFileName, nLine, pszMessage);
-
- OutputDebugString(szMessage);
-
- if ( _pPrintDetailedDebugMessage )
- _pPrintDetailedDebugMessage( pszFileName, nLine, pszMessage );
- else if ( _pPrintDebugMessage )
- _pPrintDebugMessage( szMessage );
- else
- {
- if ( !getenv( "DISABLE_SAL_DBGBOX" ) )
- {
- TCHAR szBoxMessage[1024];
-
- /* active popup window for the current thread */
- hWndParent = GetActiveWindow();
- if (hWndParent != NULL)
- hWndParent = GetLastActivePopup(hWndParent);
-
- /* set message box flags */
- nFlags = MB_TASKMODAL | MB_ICONWARNING | MB_YESNOCANCEL | MB_DEFBUTTON2 | MB_SETFOREGROUND;
- if (hWndParent == NULL)
- nFlags |= MB_SERVICE_NOTIFICATION;
-
- /* display the assert */
-
- szBoxMessage[sizeof(szBoxMessage)-1] = 0;
- _snprintf(szBoxMessage, sizeof(szBoxMessage)-1, "%s\n( Yes=Abort / No=Ignore / Cancel=Debugger )",
- szMessage);
-
- nCode = MessageBox(hWndParent, szBoxMessage, "Assertion Failed!", nFlags);
-
- if (nCode == IDYES)
- FatalExit(-1);
-
- if (nCode == IDNO)
- return sal_False; /* ignore */
-
- if (nCode == IDCANCEL)
- return sal_True; /* will cause oslDebugBreak */
- }
- else
- {
- fputs(szMessage, stderr); // fall back
- }
- return ( ( env != NULL ) && ( *env != '\0' ) );
- }
-
- return sal_False;
-#endif /* _DEBUG && !NO_DEBUG_CRT */
-}
-
-sal_Int32 SAL_CALL osl_reportError(sal_uInt32 nType, const sal_Char* pszMessage)
-{
- UINT nFlags;
- int nDisposition;
-
- // active popup window for the current thread
- HWND hWndParent = GetActiveWindow();
- if (hWndParent != NULL)
- hWndParent = GetLastActivePopup(hWndParent);
-
- /* set message box flags */
- nFlags = MB_TASKMODAL | MB_ICONERROR | MB_YESNOCANCEL | MB_DEFBUTTON2 | MB_SETFOREGROUND;
- if (hWndParent == NULL)
- nFlags |= MB_SERVICE_NOTIFICATION;
-
- // display the assert
- nDisposition = MessageBox(hWndParent, pszMessage, "Exception!", nFlags);
- (void)nType; //unused, but part of public API/ABI
- return nDisposition;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 86088dda6e893faaecfea19bad6e0e6c1ffa657c
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Mar 25 14:06:47 2014 +0100
osl_setDetailedDebugMessageFunc is effectively doing nothing
...since the osl/diagnose.h macros got rebased onto sal/log.hxx, so remove the
corresponding tools/debug.h functionality.
Change-Id: Ife4b5b1a2608230d0dbfc3fa8852243c89ed292f
diff --git a/basic/source/runtime/sbdiagnose.cxx b/basic/source/runtime/sbdiagnose.cxx
index e29d3db..4598d80 100644
--- a/basic/source/runtime/sbdiagnose.cxx
+++ b/basic/source/runtime/sbdiagnose.cxx
@@ -112,11 +112,6 @@ RTLFUNC(CaptureAssertions)
// set the new channel
DBG_INSTOUTERROR( nAssertionChannelId );
-
- // ensure OSL assertions are captured, too
- DbgData aData( *DbgGetData() );
- aData.bHookOSLAssert = true;
- DbgUpdateOslHook( &aData );
}
xAssertionChannelBasic = pBasic;
diff --git a/include/tools/debug.hxx b/include/tools/debug.hxx
index 4c79c0f..be726bb 100644
--- a/include/tools/debug.hxx
+++ b/include/tools/debug.hxx
@@ -79,7 +79,6 @@ struct DbgData
bool bOverwrite;
sal_uIntPtr nTraceOut;
sal_uIntPtr nErrorOut;
- bool bHookOSLAssert;
sal_Char aDebugName[260];
sal_Char aInclFilter[512];
sal_Char aExclFilter[512];
@@ -108,16 +107,10 @@ struct DbgDataType
#define DBG_FUNC_SETTESTSOLARMUTEX 14
#define DBG_FUNC_TESTSOLARMUTEX 15
#define DBG_FUNC_PRINTFILE 16
-#define DBG_FUNC_UPDATEOSLHOOK 19
#define DBG_FUNC_SET_ABORT 20
TOOLS_DLLPUBLIC void* DbgFunc( sal_uInt16 nAction, void* pData = NULL );
-inline void DbgUpdateOslHook( DbgData* pData )
-{
- DbgFunc( DBG_FUNC_UPDATEOSLHOOK, pData );
-}
-
inline void DbgDebugStart()
{
DbgFunc( DBG_FUNC_DEBUGSTART );
diff --git a/tools/source/debug/debug.cxx b/tools/source/debug/debug.cxx
index 885a5c6..a52f1e4 100644
--- a/tools/source/debug/debug.cxx
+++ b/tools/source/debug/debug.cxx
@@ -117,9 +117,6 @@ struct DebugData
PointerList* pProfList;
PointerList* pXtorList;
DbgTestSolarMutexProc pDbgTestSolarMutex;
- pfunc_osl_printDetailedDebugMessage
- pOldDebugMessageFunc;
- bool bOslIsHooked;
DebugData()
:bInit( false )
@@ -129,8 +126,6 @@ struct DebugData
,pProfList( NULL )
,pXtorList( NULL )
,pDbgTestSolarMutex( NULL )
- ,pOldDebugMessageFunc( NULL )
- ,bOslIsHooked( false )
{
aDbgData.nTestFlags = DBG_TEST_RESOURCE;
aDbgData.bOverwrite = true;
@@ -140,7 +135,6 @@ struct DebugData
#else
aDbgData.nErrorOut = DBG_OUT_MSGBOX;
#endif
- aDbgData.bHookOSLAssert = true;
aDbgData.aDebugName[0] = 0;
aDbgData.aInclFilter[0] = 0;
aDbgData.aExclFilter[0] = 0;
@@ -631,7 +625,6 @@ static DebugData* GetDebugData()
lcl_tryReadConfigString( pLine, nLineLength, "exclude_class", aDebugData.aDbgData.aExclClassFilter, sizeof( aDebugData.aDbgData.aExclClassFilter ) );
lcl_tryReadOutputChannel( pLine, nLineLength, "trace", &aDebugData.aDbgData.nTraceOut );
lcl_tryReadOutputChannel( pLine, nLineLength, "error", &aDebugData.aDbgData.nErrorOut );
- lcl_tryReadConfigBoolean( pLine, nLineLength, "oslhook", &aDebugData.aDbgData.bHookOSLAssert );
}
// elements of the [gui] section
@@ -809,23 +802,10 @@ static bool ImplDbgFilter( const sal_Char* pFilter, const sal_Char* pMsg,
return false;
}
-extern "C"
-void SAL_CALL dbg_printOslDebugMessage( const sal_Char * pszFileName, sal_Int32 nLine, const sal_Char * pszMessage )
-{
- DbgOut( pszMessage ? pszMessage : "assertion failed!", DBG_OUT_ERROR, pszFileName, (sal_uInt16)nLine );
-}
-
static void DebugInit()
{
bDbgImplInMain = true;
ImplDbgInitLock();
-
- DebugData* pData = GetDebugData();
- if( pData->aDbgData.bHookOSLAssert && ! pData->bOslIsHooked )
- {
- pData->pOldDebugMessageFunc = osl_setDetailedDebugMessageFunc( &dbg_printOslDebugMessage );
- pData->bOslIsHooked = true;
- }
}
static void DebugDeInit()
@@ -835,12 +815,6 @@ static void DebugDeInit()
sal_uIntPtr nCount;
sal_uIntPtr nOldOut;
- if( pData->bOslIsHooked )
- {
- osl_setDetailedDebugMessageFunc( pData->pOldDebugMessageFunc );
- pData->bOslIsHooked = false;
- }
-
// Output statistics trace data to file
nOldOut = pData->aDbgData.nTraceOut;
pData->aDbgData.nTraceOut = DBG_OUT_FILE;
@@ -895,7 +869,6 @@ static void DebugDeInit()
pData->aDbgData.nTestFlags &= DBG_TEST_PROFILING;
pData->aDbgPrintUserChannels.clear();
pData->pDbgPrintWindow = NULL;
- pData->pOldDebugMessageFunc = NULL;
ImplDbgDeInitLock();
}
@@ -1056,7 +1029,6 @@ void* DbgFunc( sal_uInt16 nAction, void* pParam )
lcl_writeConfigString( pIniFile, "exclude_class", pData->aExclClassFilter );
lcl_writeConfigOutChannel( pIniFile, "trace", pData->nTraceOut );
lcl_writeConfigOutChannel( pIniFile, "error", pData->nErrorOut );
- lcl_writeConfigBoolean( pIniFile, "oslhook", pData->bHookOSLAssert );
lcl_lineFeed( pIniFile );
lcl_startSection( pIniFile, eGUI );
@@ -1107,22 +1079,6 @@ void* DbgFunc( sal_uInt16 nAction, void* pParam )
case DBG_FUNC_PRINTFILE:
ImplDbgPrintFile( (const sal_Char*)pParam );
break;
- case DBG_FUNC_UPDATEOSLHOOK:
- {
- const DbgData* pData = static_cast< const DbgData* >( pParam );
- pDebugData->aDbgData.bHookOSLAssert = pData->bHookOSLAssert;
- if( pDebugData->bOslIsHooked && ! pData->bHookOSLAssert )
- {
- osl_setDetailedDebugMessageFunc( pDebugData->pOldDebugMessageFunc );
- pDebugData->bOslIsHooked = false;
- }
- else if( ! pDebugData->bOslIsHooked && pData->bHookOSLAssert )
- {
- pDebugData->pOldDebugMessageFunc = osl_setDetailedDebugMessageFunc( &dbg_printOslDebugMessage );
- pDebugData->bOslIsHooked = true;
- }
- }
- break;
}
return NULL;
diff --git a/vcl/source/app/dbggui.cxx b/vcl/source/app/dbggui.cxx
index f8cee63..26010b5 100644
--- a/vcl/source/app/dbggui.cxx
+++ b/vcl/source/app/dbggui.cxx
@@ -390,7 +390,6 @@ private:
ListBox maTraceBox;
FixedText maErrorText;
ListBox maErrorBox;
- CheckBox maHookOSLBox;
GroupBox maBox4;
OKButton maOKButton;
@@ -574,7 +573,6 @@ DbgDialog::DbgDialog() :
maTraceBox( this, WB_DROPDOWN ),
maErrorText( this ),
maErrorBox( this, WB_DROPDOWN ),
- maHookOSLBox( this ),
maBox4( this ),
maOKButton( this, WB_DEFBUTTON ),
maCancelButton( this ),
@@ -699,15 +697,6 @@ DbgDialog::DbgDialog() :
}
{
- maHookOSLBox.Show();
- maHookOSLBox.SetText("Reroute osl debug ~messages");
- if ( pData->bHookOSLAssert )
- maHookOSLBox.Check( true );
- maHookOSLBox.SetPosSizePixel( LogicToPixel( Point( 10, 240 ), aAppMap ),
- LogicToPixel( Size( 100, 12 ), aAppMap ) );
- }
-
- {
maInclClassText.Show();
maInclClassText.SetText("~Include-ObjectTest-Filter");
maInclClassText.SetPosSizePixel( LogicToPixel( Point( 10, 150 ), aAppMap ),
@@ -880,7 +869,6 @@ IMPL_LINK( DbgDialog, ClickHdl, Button*, pButton )
aData.aExclFilter[sizeof( aData.aExclFilter )-1] = '\0';
aData.bOverwrite = maOverwrite.IsChecked() ? true : false;
- aData.bHookOSLAssert = maHookOSLBox.IsChecked() ? true : false;
if ( maXtorThis.IsChecked() )
aData.nTestFlags |= DBG_TEST_XTOR_THIS;
@@ -915,7 +903,6 @@ IMPL_LINK( DbgDialog, ClickHdl, Button*, pButton )
// Umschalten der Laufzeitwerte
DBG_INSTOUTTRACE( aData.nTraceOut );
DBG_INSTOUTERROR( aData.nErrorOut );
- DbgUpdateOslHook( &aData );
DbgData* pData = DbgGetData();
#define IMMEDIATE_FLAGS (DBG_TEST_RESOURCE | DBG_TEST_DIALOG | DBG_TEST_BOLDAPPFONT)
commit 7bb5f9e1a206e1f62df5d72947d564af2aaa09ca
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Mar 25 12:22:05 2014 +0100
Adapt to sal/log.hxx
Change-Id: Ic197b0fc962ff33b0f0a3c7f04d8208ea9123094
diff --git a/stoc/source/javaloader/javaloader.cxx b/stoc/source/javaloader/javaloader.cxx
index 56c0feb..e6d0723 100644
--- a/stoc/source/javaloader/javaloader.cxx
+++ b/stoc/source/javaloader/javaloader.cxx
@@ -398,8 +398,9 @@ css::uno::Reference<XInterface> SAL_CALL JavaComponentLoader_CreateInstance(cons
}
}
catch(const RuntimeException & runtimeException) {
- OString message = OUStringToOString(runtimeException.Message, RTL_TEXTENCODING_ASCII_US);
- osl_trace("javaloader - could not init javaloader cause of %s", message.getStr());
+ SAL_INFO(
+ "stoc",
+ "could not init javaloader due to " << runtimeException.Message);
throw;
}
commit 3c5d30c03b4b2d2c4d38d602afc839e7a922bca3
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Mar 25 12:18:05 2014 +0100
Adapt to sal/log.hxx
Change-Id: I9c59495977e111d94077470f07591c91fa3c1665
diff --git a/sal/osl/all/debugbase.cxx b/sal/osl/all/debugbase.cxx
index 57238ce..75cd846 100644
--- a/sal/osl/all/debugbase.cxx
+++ b/sal/osl/all/debugbase.cxx
@@ -23,18 +23,10 @@
#include "rtl/ustring.hxx"
#include "osl/process.h"
#include "osl/diagnose.hxx"
+#include "sal/log.hxx"
#include "boost/bind.hpp"
#include <vector>
-// define own ones, independent of OSL_DEBUG_LEVEL:
-#define DEBUGBASE_ENSURE_(c, f, l, m) \
- do \
- { \
- if (!(c) && _OSL_GLOBAL osl_assertFailedLine(f, l, m)) \
- _OSL_GLOBAL osl_breakDebug(); \
- } while (false)
-#define DEBUGBASE_ENSURE(c, m) DEBUGBASE_ENSURE_(c, OSL_THIS_FILE, __LINE__, m)
-
namespace {
typedef std::vector<rtl::OString, rtl::Allocator<rtl::OString> > OStringVec;
@@ -118,16 +110,10 @@ bool SAL_CALL osl_detail_ObjectRegistry_checkObjectCount(
nSize = static_cast<std::size_t>(rData.m_nCount);
bool const bRet = (nSize == nExpected);
- if (! bRet) {
- rtl::OStringBuffer buf;
- buf.append( "unexpected number of " );
- buf.append( rData.m_pName );
- buf.append( ": " );
- buf.append( static_cast<sal_Int64>(nSize) );
- buf.append("; Expected: ");
- buf.append( static_cast<sal_Int64>(nExpected) );
- DEBUGBASE_ENSURE( false, buf.makeStringAndClear().getStr() );
- }
+ SAL_WARN_IF(
+ !bRet, "sal.osl",
+ "unexpected number of " << rData.m_pName << ": " << nSize
+ << "; Expected: " << nExpected);
return bRet;
}
@@ -139,8 +125,7 @@ void SAL_CALL osl_detail_ObjectRegistry_registerObject(
osl::MutexGuard const guard( osl_detail_ObjectRegistry_getMutex() );
std::pair<osl::detail::VoidPointerSet::iterator, bool> const insertion(
rData.m_addresses.insert(pObj) );
- DEBUGBASE_ENSURE( insertion.second, "### insertion failed!?" );
- static_cast<void>(insertion);
+ SAL_WARN_IF(!insertion.second, "sal.osl", "insertion failed!?");
}
else {
osl_atomic_increment(&rData.m_nCount);
@@ -154,8 +139,7 @@ void SAL_CALL osl_detail_ObjectRegistry_revokeObject(
if (rData.m_bStoreAddresses) {
osl::MutexGuard const guard( osl_detail_ObjectRegistry_getMutex() );
std::size_t const n = rData.m_addresses.erase(pObj);
- DEBUGBASE_ENSURE( n == 1, "erased more than 1 entry!?" );
- static_cast<void>(n);
+ SAL_WARN_IF(n != 1, "sal.osl", "erased more than 1 entry!?");
}
else {
osl_atomic_decrement(&rData.m_nCount);
commit ff1a592a1f2c8426691bf497a67720a6a91bdaae
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Mar 25 11:51:33 2014 +0100
Remove unused DBG_FUNC_* slots
Change-Id: Ief6661ed4bb57546014deef5b10d20fc3a4894fe
diff --git a/include/tools/debug.hxx b/include/tools/debug.hxx
index 786c2ff..4c79c0f 100644
--- a/include/tools/debug.hxx
+++ b/include/tools/debug.hxx
@@ -102,15 +102,12 @@ struct DbgDataType
#define DBG_FUNC_SAVEDATA 5
#define DBG_FUNC_SETPRINTMSGBOX 6
#define DBG_FUNC_SETPRINTWINDOW 7
-#define DBG_FUNC_SETPRINTTESTTOOL 8
#define DBG_FUNC_XTORINFO 10
#define DBG_FUNC_COREDUMP 12
#define DBG_FUNC_ALLERROROUT 13
#define DBG_FUNC_SETTESTSOLARMUTEX 14
#define DBG_FUNC_TESTSOLARMUTEX 15
#define DBG_FUNC_PRINTFILE 16
-#define DBG_FUNC_GETPRINTMSGBOX 17
-#define DBG_FUNC_FILTERMESSAGE 18 // new for #i38967
#define DBG_FUNC_UPDATEOSLHOOK 19
#define DBG_FUNC_SET_ABORT 20
diff --git a/tools/source/debug/debug.cxx b/tools/source/debug/debug.cxx
index bccd8ab..885a5c6 100644
--- a/tools/source/debug/debug.cxx
+++ b/tools/source/debug/debug.cxx
@@ -111,7 +111,6 @@ struct DebugData
bool bInit;
DbgPrintLine pDbgPrintMsgBox;
DbgPrintLine pDbgPrintWindow;
- DbgPrintLine pDbgPrintTestTool;
DbgPrintLine pDbgAbort;
::std::vector< DbgPrintLine >
aDbgPrintUserChannels;
@@ -126,7 +125,6 @@ struct DebugData
:bInit( false )
,pDbgPrintMsgBox( NULL )
,pDbgPrintWindow( NULL )
- ,pDbgPrintTestTool( NULL )
,pDbgAbort( NULL )
,pProfList( NULL )
,pXtorList( NULL )
@@ -896,7 +894,6 @@ static void DebugDeInit()
pData->aDbgData.nTraceOut = nOldOut;
pData->aDbgData.nTestFlags &= DBG_TEST_PROFILING;
pData->aDbgPrintUserChannels.clear();
- pData->pDbgPrintTestTool = NULL;
pData->pDbgPrintWindow = NULL;
pData->pOldDebugMessageFunc = NULL;
ImplDbgDeInitLock();
@@ -1012,15 +1009,7 @@ void* DbgFunc( sal_uInt16 nAction, void* pParam )
if ( nAction == DBG_FUNC_GETDATA )
return (void*)&(pDebugData->aDbgData);
- else if ( nAction == DBG_FUNC_GETPRINTMSGBOX )
- return (void*)(long)(pDebugData->pDbgPrintMsgBox);
- else if ( nAction == DBG_FUNC_FILTERMESSAGE )
- if ( ImplDbgFilterMessage( (const sal_Char*) pParam ) )
- return (void*) -1;
- else
- return (void*) 0; // aka NULL
else
-
{
switch ( nAction )
{
@@ -1044,10 +1033,6 @@ void* DbgFunc( sal_uInt16 nAction, void* pParam )
pDebugData->pDbgPrintWindow = (DbgPrintLine)(long)pParam;
break;
- case DBG_FUNC_SETPRINTTESTTOOL:
- pDebugData->pDbgPrintTestTool = (DbgPrintLine)(long)pParam;
- break;
-
case DBG_FUNC_SET_ABORT:
pDebugData->pDbgAbort = (DbgPrintLine)(long)pParam;
break;
@@ -1500,10 +1485,7 @@ void DbgOut( const sal_Char* pMsg, sal_uInt16 nDbgOut, const sal_Char* pFile, sa
if ( nOut == DBG_OUT_TESTTOOL )
{
- if ( pData->pDbgPrintTestTool )
- pData->pDbgPrintTestTool( aBufOut );
- else
- nOut = DBG_OUT_MSGBOX;
+ nOut = DBG_OUT_MSGBOX;
}
if ( nOut == DBG_OUT_MSGBOX )
commit 0e36a13a80465854ba510676fa2baa2e21e67d11
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Mar 25 11:39:11 2014 +0100
MI_DEBUG is never defined
Change-Id: I6f5d74e892d9bdca5a39caa76feb4e3d05b95ba9
diff --git a/tools/source/memtools/multisel.cxx b/tools/source/memtools/multisel.cxx
index 9aac9de..916f647 100644
--- a/tools/source/memtools/multisel.cxx
+++ b/tools/source/memtools/multisel.cxx
@@ -17,46 +17,11 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifdef MI_DEBUG
-#define private public
-#include <stdio.h>
-#endif
-
#include <tools/debug.hxx>
#include <tools/multisel.hxx>
#include "rtl/ustrbuf.hxx"
-#ifdef MI_DEBUG
-#define DBG(x) x
-#else
-#define DBG(x)
-#endif
-
-
-#ifdef MI_DEBUG
-static void Print( const MultiSelection* pSel )
-{
- DbgOutf( "TotRange: %4ld-%4ld\n",
- pSel->aTotRange.Min(), pSel->aTotRange.Max() );
- if ( pSel->bCurValid )
- {
- DbgOutf( "CurSubSel: %4ld\n", pSel->nCurSubSel );
- DbgOutf( "CurIndex: %4ld\n", pSel->nCurIndex );
- }
- DbgOutf( "SelCount: %4ld\n", pSel->nSelCount );
- DbgOutf( "SubCount: %4ld\n", pSel->aSels.Count() );
- for ( sal_uIntPtr nPos = 0; nPos < pSel->aSels.Count(); ++nPos )
- {
- DbgOutf( "SubSel #%2ld: %4ld-%4ld\n", nPos,
- pSel->aSels.GetObject(nPos)->Min(),
- pSel->aSels.GetObject(nPos)->Max() );
- }
- DbgOutf( "\n" );
- fclose( pFile );
-}
-#endif
-
void MultiSelection::ImplClear()
{
// no selected indexes
@@ -186,16 +151,12 @@ bool MultiSelection::operator== ( MultiSelection& rWith )
void MultiSelection::SelectAll( bool bSelect )
{
- DBG(DbgOutf( "::SelectAll(%s)\n", bSelect ? "sal_True" : "sal_False" ));
-
ImplClear();
if ( bSelect )
{
aSels.push_back( new Range(aTotRange) );
nSelCount = aTotRange.Len();
}
-
- DBG(Print( this ));
}
bool MultiSelection::Select( long nIndex, bool bSelect )
@@ -256,7 +217,6 @@ bool MultiSelection::Select( long nIndex, bool bSelect )
|| !aSels[ nSubSelPos ]->IsInside( nIndex )
) {
// not selected, nothing to do
- DBG(Print( this ));
return false;
}
@@ -271,7 +231,6 @@ bool MultiSelection::Select( long nIndex, bool bSelect )
::std::advance( it, nSubSelPos );
delete *it;
aSels.erase( it );
- DBG(Print( this ));
return true;
}
@@ -296,8 +255,6 @@ bool MultiSelection::Select( long nIndex, bool bSelect )
}
}
- DBG(Print( this ));
-
return true;
}
@@ -389,8 +346,6 @@ bool MultiSelection::IsSelected( long nIndex ) const
void MultiSelection::Insert( long nIndex, long nCount )
{
- DBG(DbgOutf( "::Insert(%ld, %ld)\n", nIndex, nCount ));
-
// find the virtual target position
size_t nSubSelPos = ImplFindSubSelection( nIndex );
@@ -439,14 +394,10 @@ void MultiSelection::Insert( long nIndex, long nCount )
aTotRange.Max() += nCount;
if ( bSelectNew )
nSelCount += nCount;
-
- DBG(Print( this ));
}
void MultiSelection::Remove( long nIndex )
{
- DBG(DbgOutf( "::Remove(%ld)\n", nIndex ));
-
// find the virtual target position
size_t nSubSelPos = ImplFindSubSelection( nIndex );
@@ -479,8 +430,6 @@ void MultiSelection::Remove( long nIndex )
bCurValid = false;
aTotRange.Max() -= 1;
-
- DBG(Print( this ));
}
long MultiSelection::ImplFwdUnselected()
commit 19d8bae1111a5bb366cb63f640cdebbfb93fb7e1
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Mar 25 11:37:03 2014 +0100
Adapt to sal/log.hxx
Change-Id: Ife7840ec39de743a7dfaacb20c0871fbcd8195e7
diff --git a/include/svl/filerec.hxx b/include/svl/filerec.hxx
index e67bdb8..637dc7c 100644
--- a/include/svl/filerec.hxx
+++ b/include/svl/filerec.hxx
@@ -585,7 +585,7 @@ inline SfxMiniRecordWriter::SfxMiniRecordWriter( SvStream* pStream, sal_uInt8 nT
_nPreTag( nTag )
{
DBG_ASSERT( _nPreTag != 0xFF, "invalid Tag" );
- DBG( DbgOutf( "SfxFileRec: writing record to %ul", pStream->Tell() ) );
+ SAL_INFO("svl", "SfxFileRec: writing record to " << pStream->Tell());
pStream->SeekRel( + SFX_REC_HEADERSIZE_MINI );
}
diff --git a/svl/source/filerec/filerec.cxx b/svl/source/filerec/filerec.cxx
index 5d397ea..6ddb964 100644
--- a/svl/source/filerec/filerec.cxx
+++ b/svl/source/filerec/filerec.cxx
@@ -199,7 +199,7 @@ SfxMiniRecordReader::SfxMiniRecordReader
while(true)
{
// Header lesen
- DBG( DbgOutf( "SfxFileRec: searching record at %ul", pStream->Tell() ) );
+ SAL_INFO("svl", "SfxFileRec: searching record at " << pStream->Tell());
sal_uInt32 nHeader;
pStream->ReadUInt32( nHeader );
@@ -307,7 +307,7 @@ bool SfxSingleRecordReader::FindHeader_Impl
{
// Header lesen
sal_uInt32 nHeader;
- DBG( DbgOutf( "SfxFileRec: searching record at %ul", _pStream->Tell() ) );
+ SAL_INFO("svl", "SfxFileRec: searching record at " << _pStream->Tell());
_pStream->ReadUInt32( nHeader );
if ( !SetHeader_Impl( nHeader ) )
// EOR => Such-Schleife abbreichen
commit 351c4bcf83983d8e08a5bf174e0b274bc2c0085a
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Mar 25 11:33:44 2014 +0100
Adapt to sal/log.hxx
Change-Id: I1af793393a1aceba7a53c85a4943a9b81362a918
diff --git a/sfx2/source/inc/sfxtypes.hxx b/sfx2/source/inc/sfxtypes.hxx
index b2a51e2..bcefe93 100644
--- a/sfx2/source/inc/sfxtypes.hxx
+++ b/sfx2/source/inc/sfxtypes.hxx
@@ -92,11 +92,11 @@ public:
SfxStack( const char *pName )
{
++nLevel;
- DbgOutf( "STACK: enter %3d %s", nLevel, pName );
+ SAL_LOG("sfx", "STACK: enter " << nLevel << " " << pName);
}
~SfxStack()
{
- DbgOutf( "STACK: leave %3d", nLevel );
+ SAL_LOG("sfx", "STACK: leave " << nLevel);
--nLevel;
}
};
commit 5e9e04c9a83f6e7f9c07ed7c10933a97adb335c1
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Mar 25 11:30:47 2014 +0100
Adapt to sal/log.hxx
Change-Id: Ifb0f400136365d85170fbc4c33573ffec6a4bfcd
diff --git a/sfx2/source/inc/sfxtypes.hxx b/sfx2/source/inc/sfxtypes.hxx
index 177bcaf..b2a51e2 100644
--- a/sfx2/source/inc/sfxtypes.hxx
+++ b/sfx2/source/inc/sfxtypes.hxx
@@ -72,16 +72,12 @@ struct _Capper
#endif
-#ifdef DBG_UTIL
#ifndef DBG
+#ifdef DBG_UTIL
#define DBG(statement) statement
-#endif
-#define DBG_OUTF(x) DbgOutf x
#else
-#ifndef DBG
#define DBG(statement)
#endif
-#define DBG_OUTF(x)
#endif
diff --git a/sfx2/source/menu/virtmenu.cxx b/sfx2/source/menu/virtmenu.cxx
index d2a1d81..f855291 100644
--- a/sfx2/source/menu/virtmenu.cxx
+++ b/sfx2/source/menu/virtmenu.cxx
@@ -277,7 +277,7 @@ SfxVirtualMenu::~SfxVirtualMenu()
delete pSVMenu;
}
- DBG_OUTF( ("SfxVirtualMenu %lx destroyed", this) );
+ SAL_INFO("sfx", "SfxVirtualMenu " << this << " destroyed");
DBG_ASSERT( !nLocks, "destroying active menu" );
}
@@ -660,7 +660,7 @@ bool SfxVirtualMenu::Bind_Impl( Menu *pMenu )
pSubMenu = new SfxVirtualMenu( nSID, this,
*pMenu, sal_False, *pBindings, bOLE, bRes, bIsAddonPopupMenu );
- DBG_OUTF( ("New VirtualMenu %lx created", pSubMenu) );
+ SAL_INFO("sfx", "New VirtualMenu " << pSubMenu << " created");
rCtrl.Bind( this, nSID, *pSubMenu, pSVMenu->GetItemText(nSID), *pBindings );
@@ -782,7 +782,10 @@ void SfxVirtualMenu::InsertAddOnsMenuItem( Menu* pMenu )
IMPL_LINK( SfxVirtualMenu, Activate, Menu *, pMenu )
{
- DBG_OUTF( ("SfxVirtualMenu %lx activated %lx, own %lx", this, pMenu, pSVMenu));
+ SAL_INFO(
+ "sfx",
+ "SfxVirtualMenu " << this << " activated " << pMenu << ", own "
+ << pSVMenu);
// MI: for what was it still good for?
// MBA: seemes to be an old QAP-Hack( checked-in in rev.1.41 ! )
@@ -915,7 +918,10 @@ IMPL_LINK( SfxVirtualMenu, Activate, Menu *, pMenu )
IMPL_LINK( SfxVirtualMenu, Deactivate, Menu *, pMenu )
{
- DBG_OUTF( ("SfxVirtualMenu %lx deactivated %lx, own %lx", this, pMenu, pSVMenu) );
+ SAL_INFO(
+ "sfx",
+ "SfxVirtualMenu " << this << " deactivated " << pMenu << ", own "
+ << pSVMenu);
if ( bIsActive && ( 0 == pMenu || pMenu == pSVMenu ) )
{
// All controllers can be unbinded all the way up to the Menubar,
@@ -933,7 +939,10 @@ IMPL_LINK( SfxVirtualMenu, Deactivate, Menu *, pMenu )
IMPL_LINK( SfxVirtualMenu, Select, Menu *, pMenu )
{
sal_uInt16 nSlotId = (sal_uInt16) pMenu->GetCurItemId();
- DBG_OUTF( ("SfxVirtualMenu %lx selected %u from %lx", this, nSlotId, pMenu) );
+ SAL_INFO(
+ "sfx",
+ "SfxVirtualMenu " << this << " selected " << nSlotId << " from "
+ << pMenu);
if ( nSlotId >= START_ITEMID_WINDOWLIST && nSlotId <= END_ITEMID_WINDOWLIST )
{
@@ -1055,7 +1064,7 @@ void SfxVirtualMenu::InitPopup( sal_uInt16 nPos, sal_Bool /*bOLE*/ )
SfxVirtualMenu *pSubMenu =
new SfxVirtualMenu(nSID, this, *pMenu, sal_False, *pBindings, bOLE, bRes);
- DBG_OUTF( ("New VirtualMenu %lx created", pSubMenu) );
+ SAL_INFO("sfx", "New VirtualMenu " << pSubMenu << " created");
rCtrl.Bind( this, nSID, *pSubMenu, pSVMenu->GetItemText(nSID), *pBindings );
}
commit 9759de7a885ffe02d83a9c9aef7678c3e673bd5a
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Mar 25 11:23:38 2014 +0100
Adapt to sal/log.hxx
Change-Id: I7afe7bfe295dfa20206fdb6bc10da8ea31adb47e
diff --git a/sfx2/source/control/ctrlitem.cxx b/sfx2/source/control/ctrlitem.cxx
index dfeb6e8..762724f 100644
--- a/sfx2/source/control/ctrlitem.cxx
+++ b/sfx2/source/control/ctrlitem.cxx
@@ -42,12 +42,10 @@ void SfxControllerItem::CheckConfigure_Impl( sal_uIntPtr nType )
// is the ID configurable at all in 'nType'?
const SfxSlot *pSlot = SFX_SLOTPOOL().GetSlot(nId);
DBG_ASSERTWARNING( pSlot, "SfxControllerItem: binding not existing slot" );
- if ( pSlot && !pSlot->IsMode(nType) )
- {
- DBG_WARNING( "SfxControllerItem: slot without ...Config-flag" );
- DbgOutf( "SfxControllerItem: Config-flag missing at SID %5d",
- pSlot->GetSlotId() );
- }
+ SAL_WARN_IF(
+ pSlot && !pSlot->IsMode(nType), "sfx.control",
+ "SfxControllerItem: slot without ...Config-flag at SID "
+ << pSlot->GetSlotId());
}
#endif
commit dd3a00ffd5e67d74a4dbcdf9a2e8482eab19ce5d
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Mar 25 11:23:34 2014 +0100
Adapt to sal/log.hxx
Change-Id: I9ec4c72d4779f7182478b8d40e1039baf3088449
diff --git a/sfx2/source/bastyp/progress.cxx b/sfx2/source/bastyp/progress.cxx
index 0f5340f..2d0f768 100644
--- a/sfx2/source/bastyp/progress.cxx
+++ b/sfx2/source/bastyp/progress.cxx
@@ -158,8 +158,10 @@ SfxProgress::SfxProgress
pImp->bWaitMode = bWait;
pImp->nCreate = Get10ThSec();
pImp->nNextReschedule = pImp->nCreate;
- DBG( DbgOutf( "SfxProgress: created for '%s' at %luds",
- rText.getStr(), pImp->nCreate ) );
+ SAL_INFO(
+ "sfx.bastyp",
+ "SfxProgress: created for '" << rText << "' at " << pImp->nCreate
+ << "ds");
pImp->bAllDocs = bAll;
pImp->pWorkWin = 0;
pImp->pView = 0;
@@ -209,7 +211,8 @@ void SfxProgress::Stop()
if ( !pImp->bRunning )
return;
pImp->bRunning = false;
- DBG( DbgOutf( "SfxProgress: destroyed at %luds", Get10ThSec() ) );
+ SAL_INFO(
+ "sfx.bastyp", "SfxProgress: destroyed at " << Get10ThSec() << "ds");
Suspend();
if ( pImp->xObjSh.Is() )
@@ -298,8 +301,10 @@ bool SfxProgress::SetState
// new Range?
if ( nNewRange && nNewRange != pImp->nMax )
{
- DBG( DbgOutf( "SfxProgress: range changed from %lu to %lu",
- pImp->nMax, nNewRange ) );
+ SAL_INFO(
+ "sfx.bastyp",
+ "SfxProgress: range changed from " << pImp->nMax << " to "
+ << nNewRange);
pImp->nMax = nNewRange;
}
@@ -371,7 +376,7 @@ void SfxProgress::Resume()
if( pImp->pActiveProgress ) return;
if ( bSuspended )
{
- DBG( DbgOutf( "SfxProgress: resumed" ) );
+ SAL_INFO("sfx.bastyp", "SfxProgress: resumed");
if ( pImp->xStatusInd.is() )
{
pImp->xStatusInd->start( pImp->aText, pImp->nMax );
@@ -417,7 +422,7 @@ void SfxProgress::Suspend()
if( pImp->pActiveProgress ) return;
if ( !bSuspended )
{
- DBG( DbgOutf( "SfxProgress: suspended" ) );
+ SAL_INFO("sfx.bastyp", "SfxProgress: suspended");
bSuspended = true;
if ( pImp->xStatusInd.is() )
@@ -450,7 +455,7 @@ void SfxProgress::UnLock()
if ( !pImp->bLocked )
return;
- DBG( DbgOutf( "SfxProgress: unlocked" ) );
+ SAL_INFO("sfx.bastyp", "SfxProgress: unlocked");
pImp->bLocked = false;
pImp->Enable_Impl(true);
}
commit d940e3519717c71c80ba8d3915bbc48acb59cc93
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Mar 25 11:16:02 2014 +0100
Remove unused SfxMiniRecordWriter ctor
Change-Id: I97fd0bb73fd13af1c3b2a548b1329393cbc10924
diff --git a/include/svl/filerec.hxx b/include/svl/filerec.hxx
index e744873..e67bdb8 100644
--- a/include/svl/filerec.hxx
+++ b/include/svl/filerec.hxx
@@ -196,8 +196,6 @@ protected:
public:
inline SfxMiniRecordWriter( SvStream *pStream, sal_uInt8 nTag );
- inline SfxMiniRecordWriter( SvStream *pStream, sal_uInt8 nTag,
- sal_uInt32 nSize );
inline ~SfxMiniRecordWriter();
inline SvStream& operator*() const;
@@ -592,23 +590,6 @@ inline SfxMiniRecordWriter::SfxMiniRecordWriter( SvStream* pStream, sal_uInt8 nT
pStream->SeekRel( + SFX_REC_HEADERSIZE_MINI );
}
-/** create a mini record with a known content size
- *
- * @param pStream the stream that will contain the record
- * @param nTag a record tag between 0x01 and 0xFE
- * @param nSize data size in Byte
- */
-inline SfxMiniRecordWriter::SfxMiniRecordWriter( SvStream* pStream, sal_uInt8 nTag, sal_uInt32 nSize )
-: _pStream( pStream ),
- _bHeaderOk(true)
-{
- DBG_ASSERT( nTag != 0 && nTag != 0xFF, "invalid Tag" );
- DBG(_nStartPos = pStream->Tell());
- DBG( DbgOutf( "SfxFileRec: writing record to %ul", _nStartPos ) );
-
- pStream->WriteUInt32( ( nTag << 24 ) | nSize );
-}
-
/** The destructor closes the record automatically if not done earlier */
inline SfxMiniRecordWriter::~SfxMiniRecordWriter()
{
commit 6854bd6b9ed13277a11ae495d9ce47eb197ba754
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Mar 25 11:08:08 2014 +0100
These DbgOutf calls do not seem worth keeping
Change-Id: I6da5848ee2d1d23f921e56ac2eae09c6f148ebbd
diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx
index 3b7b0807..4c8f980 100644
--- a/basic/source/sbx/sbxvar.cxx
+++ b/basic/source/sbx/sbxvar.cxx
@@ -34,10 +34,6 @@ using namespace com::sun::star::uno;
TYPEINIT1(SbxVariable,SbxValue)
TYPEINIT1(SbxHint,SfxSimpleHint)
-#ifdef DBG_UTIL
-static sal_uIntPtr nVar = 0;
-#endif
-
///////////////////////////// SbxVariableImpl
class SbxVariableImpl
@@ -68,9 +64,6 @@ SbxVariable::SbxVariable() : SbxValue()
pParent = NULL;
nUserData = 0;
nHash = 0;
-#ifdef DBG_UTIL
- DbgOutf( "SbxVariable::Ctor %lx=%ld", (void*)this, ++nVar );
-#endif
}
void registerComListenerVariableForBasic( SbxVariable* pVar, StarBASIC* pBasic );
@@ -106,13 +99,6 @@ SbxVariable::SbxVariable( const SbxVariable& r )
nUserData = 0;
nHash = 0;
}
-#ifdef DBG_UTIL
- if ( maName.equalsAscii( "Cells"))
- {
- maName = "Cells";
- }
- DbgOutf( "SbxVariable::Ctor %lx=%ld", (void*)this, ++nVar );
-#endif
}
SbxVariable::SbxVariable( SbxDataType t, void* p ) : SbxValue( t, p )
@@ -122,23 +108,12 @@ SbxVariable::SbxVariable( SbxDataType t, void* p ) : SbxValue( t, p )
pParent = NULL;
nUserData = 0;
nHash = 0;
-#ifdef DBG_UTIL
- DbgOutf( "SbxVariable::Ctor %lx=%ld", (void*)this, ++nVar );
-#endif
}
void removeDimAsNewRecoverItem( SbxVariable* pVar );
SbxVariable::~SbxVariable()
{
-#ifdef DBG_UTIL
- OString aBStr(OUStringToOString(maName, RTL_TEXTENCODING_ASCII_US));
- DbgOutf( "SbxVariable::Dtor %lx (%s)", (void*)this, aBStr.getStr() );
- if ( maName.equalsAscii( "Cells"))
- {
- maName = "Cells";
- }
-#endif
#ifndef DISABLE_SCRIPTING
if( IsSet( SBX_DIM_AS_NEW ))
{
commit db3d23ff9eaf57279a515730429cce8684e03c65
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Mar 25 11:06:06 2014 +0100
Adapt to sal/log.hxx
Change-Id: Ibb4549bcca6dd93ae31ef84fbb34f5054d50fe7b
diff --git a/basic/source/sbx/sbxobj.cxx b/basic/source/sbx/sbxobj.cxx
index acd894c..0d80064 100644
--- a/basic/source/sbx/sbxobj.cxx
+++ b/basic/source/sbx/sbxobj.cxx
@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <iomanip>
+
#include <tools/stream.hxx>
#include <basic/sbx.hxx>
#include "sbxres.hxx"
@@ -212,14 +216,15 @@ SbxVariable* SbxObject::FindUserData( sal_uInt32 nData )
SbxVariable* SbxObject::Find( const OUString& rName, SbxClassType t )
{
#ifdef DBG_UTIL
- static sal_uInt16 nLvl = 0;
+ static int nLvl = 1;
static const char* pCls[] = { "DontCare","Array","Value","Variable","Method","Property","Object" };
- OString aNameStr1(OUStringToOString(rName, RTL_TEXTENCODING_ASCII_US));
- OString aNameStr2(OUStringToOString(SbxVariable::GetName(), RTL_TEXTENCODING_ASCII_US));
- DbgOutf( "SBX: Search %.*s %s %s in %s",
- nLvl++, " ",
- ( t >= SbxCLASS_DONTCARE && t <= SbxCLASS_OBJECT )
- ? pCls[ t-1 ] : "Unknown class", aNameStr1.getStr(), aNameStr2.getStr() );
+ SAL_INFO(
+ "basic.sbx",
+ "search" << std::setw(nLvl) << " "
+ << (t >= SbxCLASS_DONTCARE && t <= SbxCLASS_OBJECT
+ ? pCls[t - 1] : "Unknown class")
+ << " " << rName << " in " << SbxVariable::GetName());
+ ++nLvl;
#endif
if( !GetAll( t ) )
@@ -279,14 +284,11 @@ SbxVariable* SbxObject::Find( const OUString& rName, SbxClassType t )
}
}
#ifdef DBG_UTIL
- nLvl--;
- if( pRes )
- {
- OString aNameStr3(OUStringToOString(rName, RTL_TEXTENCODING_ASCII_US));
- OString aNameStr4(OUStringToOString(SbxVariable::GetName(), RTL_TEXTENCODING_ASCII_US));
- DbgOutf( "SBX: Found %.*s %s in %s",
- nLvl, " ", aNameStr3.getStr(), aNameStr4.getStr() );
- }
+ --nLvl;
+ SAL_INFO_IF(
+ pRes, "basic.sbx",
+ "found" << std::setw(nLvl) << " " << rName << " in "
+ << SbxVariable::GetName());
#endif
return pRes;
}
@@ -498,12 +500,13 @@ void SbxObject::Insert( SbxVariable* pVar )
{
aVarName = PTR_CAST(SbxObject,pVar)->GetClassName();
}
- OString aNameStr1(OUStringToOString(aVarName, RTL_TEXTENCODING_ASCII_US));
- OString aNameStr2(OUStringToOString(SbxVariable::GetName(), RTL_TEXTENCODING_ASCII_US));
- DbgOutf( "SBX: Insert %s %s in %s",
- ( pVar->GetClass() >= SbxCLASS_DONTCARE &&
- pVar->GetClass() <= SbxCLASS_OBJECT )
- ? pCls[ pVar->GetClass()-1 ] : "Unknown class", aNameStr1.getStr(), aNameStr2.getStr() );
+ SAL_INFO(
+ "basic.sbx",
+ "insert "
+ << ((pVar->GetClass() >= SbxCLASS_DONTCARE
+ && pVar->GetClass() <= SbxCLASS_OBJECT)
+ ? pCls[pVar->GetClass() - 1] : "Unknown class")
+ << " " << aVarName << " in " << SbxVariable::GetName());
#endif
}
}
@@ -541,12 +544,13 @@ void SbxObject::QuickInsert( SbxVariable* pVar )
{
aVarName = PTR_CAST(SbxObject,pVar)->GetClassName();
}
- OString aNameStr1(OUStringToOString(aVarName, RTL_TEXTENCODING_ASCII_US));
- OString aNameStr2(OUStringToOString(SbxVariable::GetName(), RTL_TEXTENCODING_ASCII_US));
- DbgOutf( "SBX: Insert %s %s in %s",
- ( pVar->GetClass() >= SbxCLASS_DONTCARE &&
- pVar->GetClass() <= SbxCLASS_OBJECT )
- ? pCls[ pVar->GetClass()-1 ] : "Unknown class", aNameStr1.getStr(), aNameStr2.getStr() );
+ SAL_INFO(
+ "basic.sbx",
+ "insert "
+ << ((pVar->GetClass() >= SbxCLASS_DONTCARE
+ && pVar->GetClass() <= SbxCLASS_OBJECT)
+ ? pCls[pVar->GetClass() - 1] : "Unknown class")
+ << " " << aVarName << " in " << SbxVariable::GetName());
#endif
}
}
@@ -568,10 +572,9 @@ void SbxObject::Remove( SbxVariable* pVar )
{
aVarName = PTR_CAST(SbxObject,pVar)->GetClassName();
}
- OString aNameStr1(OUStringToOString(aVarName, RTL_TEXTENCODING_ASCII_US));
- OString aNameStr2(OUStringToOString(SbxVariable::GetName(), RTL_TEXTENCODING_ASCII_US));
- DbgOutf( "SBX: Remove %s in %s",
- aNameStr1.getStr(), aNameStr2.getStr() );
+ SAL_INFO(
+ "basic.sbx",
+ "remove " << aVarName << " in " << SbxVariable::GetName());
#endif
SbxVariableRef pVar_ = pArray->Get( nIdx );
if( pVar_->IsBroadcaster() )
commit 3afc276001625a613af750de755f3baa4fae3d42
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Mar 25 10:36:08 2014 +0100
DBG_OUT_WARNING is unused
...and thus DgbData::nWarningOut is unused, too.
Change-Id: I388d2be7dafbfdc173a731dc7daf1c8b5efcd61d
diff --git a/include/tools/debug.hxx b/include/tools/debug.hxx
index ad58662..786c2ff 100644
--- a/include/tools/debug.hxx
+++ b/include/tools/debug.hxx
@@ -78,7 +78,6 @@ struct DbgData
sal_uIntPtr nTestFlags;
bool bOverwrite;
sal_uIntPtr nTraceOut;
- sal_uIntPtr nWarningOut;
sal_uIntPtr nErrorOut;
bool bHookOSLAssert;
sal_Char aDebugName[260];
@@ -163,8 +162,8 @@ typedef sal_uInt16 DbgChannelId;
@param pProc
the function for emitting the diagnostic messages
@return
- a unique number for this channel, which can be used for ->DbgData::nErrorOut,
- ->DbgData::nWarningOut and ->DbgData::nTraceOut
+ a unique number for this channel, which can be used for ->DbgData::nErrorOut
+ and ->DbgData::nTraceOut
@see DBG_OUT_USER_CHANNEL_0
(In theory, this function could replace the other hard-coded channels. Well, at least
@@ -250,8 +249,7 @@ inline void DbgPrintFile( const sal_Char* pLine )
// Dbg output
#define DBG_OUT_TRACE 1
-#define DBG_OUT_WARNING 2
-#define DBG_OUT_ERROR 3
+#define DBG_OUT_ERROR 2
TOOLS_DLLPUBLIC void DbgOut( const sal_Char* pMsg, sal_uInt16 nOutType = DBG_OUT_TRACE,
const sal_Char* pFile = NULL, sal_uInt16 nLine = 0 );
@@ -384,12 +382,6 @@ do \
DbgGetData()->nTraceOut = nOut; \
} while(false)
-#define DBG_INSTOUTWARNING( nOut ) \
-do \
-{ \
- DbgGetData()->nWarningOut = nOut; \
-} while(false)
-
#define DBG_INSTOUTERROR( nOut ) \
do \
{ \
@@ -434,7 +426,6 @@ typedef const sal_Char* (*DbgUsr)(const void* pThis );
#define DBG_TESTSOLARMUTEX() ((void)0)
#define DBG_INSTOUTTRACE( nOut ) ((void)0)
-#define DBG_INSTOUTWARNING( nOut ) ((void)0)
#define DBG_INSTOUTERROR( nOut ) ((void)0)
#endif
diff --git a/tools/source/debug/debug.cxx b/tools/source/debug/debug.cxx
index 6f7adf8..bccd8ab 100644
--- a/tools/source/debug/debug.cxx
+++ b/tools/source/debug/debug.cxx
@@ -137,7 +137,6 @@ struct DebugData
aDbgData.nTestFlags = DBG_TEST_RESOURCE;
aDbgData.bOverwrite = true;
aDbgData.nTraceOut = DBG_OUT_NULL;
- aDbgData.nWarningOut = DBG_OUT_NULL;
#ifdef UNX
aDbgData.nErrorOut = DBG_OUT_SHELL;
#else
@@ -633,7 +632,6 @@ static DebugData* GetDebugData()
lcl_tryReadConfigString( pLine, nLineLength, "include_class", aDebugData.aDbgData.aInclClassFilter, sizeof( aDebugData.aDbgData.aInclClassFilter ) );
lcl_tryReadConfigString( pLine, nLineLength, "exclude_class", aDebugData.aDbgData.aExclClassFilter, sizeof( aDebugData.aDbgData.aExclClassFilter ) );
lcl_tryReadOutputChannel( pLine, nLineLength, "trace", &aDebugData.aDbgData.nTraceOut );
- lcl_tryReadOutputChannel( pLine, nLineLength, "warning", &aDebugData.aDbgData.nWarningOut );
lcl_tryReadOutputChannel( pLine, nLineLength, "error", &aDebugData.aDbgData.nErrorOut );
lcl_tryReadConfigBoolean( pLine, nLineLength, "oslhook", &aDebugData.aDbgData.bHookOSLAssert );
}
@@ -671,7 +669,6 @@ static DebugData* GetDebugData()
else
{
lcl_matchOutputChannel( getenv( "DBGSV_TRACE_OUT" ), &aDebugData.aDbgData.nTraceOut );
- lcl_matchOutputChannel( getenv( "DBGSV_WARNING_OUT" ), &aDebugData.aDbgData.nWarningOut );
lcl_matchOutputChannel( getenv( "DBGSV_ERROR_OUT" ), &aDebugData.aDbgData.nErrorOut );
}
@@ -1073,7 +1070,6 @@ void* DbgFunc( sal_uInt16 nAction, void* pParam )
lcl_writeConfigString( pIniFile, "include_class", pData->aInclClassFilter );
lcl_writeConfigString( pIniFile, "exclude_class", pData->aExclClassFilter );
lcl_writeConfigOutChannel( pIniFile, "trace", pData->nTraceOut );
- lcl_writeConfigOutChannel( pIniFile, "warning", pData->nWarningOut );
lcl_writeConfigOutChannel( pIniFile, "error", pData->nErrorOut );
lcl_writeConfigBoolean( pIniFile, "oslhook", pData->bHookOSLAssert );
@@ -1415,11 +1411,6 @@ void DbgOut( const sal_Char* pMsg, sal_uInt16 nDbgOut, const sal_Char* pFile, sa
nOut = pData->aDbgData.nErrorOut;
pStr = "Error: ";
}
- else if ( nDbgOut == DBG_OUT_WARNING )
- {
- nOut = pData->aDbgData.nWarningOut;
- pStr = "Warning: ";
- }
else
{
nOut = pData->aDbgData.nTraceOut;
diff --git a/vcl/source/app/dbggui.cxx b/vcl/source/app/dbggui.cxx
index cd1e54e..f8cee63 100644
--- a/vcl/source/app/dbggui.cxx
+++ b/vcl/source/app/dbggui.cxx
@@ -388,8 +388,6 @@ private:
Edit maExclFilter;
FixedText maTraceText;
ListBox maTraceBox;
- FixedText maWarningText;
- ListBox maWarningBox;
FixedText maErrorText;
ListBox maErrorBox;
CheckBox maHookOSLBox;
@@ -574,8 +572,6 @@ DbgDialog::DbgDialog() :
maExclFilter( this ),
maTraceText( this ),
maTraceBox( this, WB_DROPDOWN ),
- maWarningText( this ),
- maWarningBox( this, WB_DROPDOWN ),
maErrorText( this ),
maErrorBox( this, WB_DROPDOWN ),
maHookOSLBox( this ),
@@ -795,29 +791,6 @@ DbgDialog::DbgDialog() :
}
{
- maWarningText.Show();
- maWarningText.SetText("~Warning");
- maWarningText.SetPosSizePixel( LogicToPixel( Point( 115, 210 ), aAppMap ),
- LogicToPixel( Size( 95, 9 ), aAppMap ) );
- }
-
- {
- maWarningBox.InsertEntry(OUString("None"));
- maWarningBox.InsertEntry(OUString("File"));
- maWarningBox.InsertEntry(OUString("Window"));
- maWarningBox.InsertEntry(OUString("Shell"));
- maWarningBox.InsertEntry(OUString("MessageBox"));
- maWarningBox.InsertEntry(OUString("TestTool"));
- maWarningBox.InsertEntry(OUString("Debugger"));
- maWarningBox.InsertEntry(OUString("Abort"));
- ImplAppendUserDefinedChannels( maWarningBox );
- ImplSelectChannel( maWarningBox, pData->nWarningOut, 0 );
- maWarningBox.Show();
- maWarningBox.SetPosSizePixel( LogicToPixel( Point( 115, 220 ), aAppMap ),
- LogicToPixel( Size( 95, 80 ), aAppMap ) );
- }
-
- {
maErrorText.Show();
maErrorText.SetText("~Error");
maErrorText.SetPosSizePixel( LogicToPixel( Point( 220, 210 ), aAppMap ),
@@ -893,7 +866,6 @@ IMPL_LINK( DbgDialog, ClickHdl, Button*, pButton )
aData.nTestFlags = 0;
aData.nTraceOut = ImplGetChannelId( maTraceBox, 0 );
- aData.nWarningOut = ImplGetChannelId( maWarningBox, 0 );
aData.nErrorOut = ImplGetChannelId( maErrorBox, mnErrorOff );
strncpy( aData.aDebugName, OUStringToOString(maDebugName.GetText(), RTL_TEXTENCODING_UTF8).getStr(), sizeof( aData.aDebugName ) );
@@ -942,7 +914,6 @@ IMPL_LINK( DbgDialog, ClickHdl, Button*, pButton )
// Umschalten der Laufzeitwerte
DBG_INSTOUTTRACE( aData.nTraceOut );
- DBG_INSTOUTWARNING( aData.nWarningOut );
DBG_INSTOUTERROR( aData.nErrorOut );
DbgUpdateOslHook( &aData );
commit bb27014e100affb39f34823e110379bc9611e835
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Mar 25 10:19:25 2014 +0100
Remove unused inline functions
Change-Id: I719c0448ae3db291edfb32738404ff375deb3c3b
diff --git a/include/tools/debug.hxx b/include/tools/debug.hxx
index b1b82bd..ad58662 100644
--- a/include/tools/debug.hxx
+++ b/include/tools/debug.hxx
@@ -142,21 +142,11 @@ inline void DbgSetPrintMsgBox( DbgPrintLine pProc )
DbgFunc( DBG_FUNC_SETPRINTMSGBOX, (void*)(long)pProc );
}
-inline DbgPrintLine DbgGetPrintMsgBox()
-{
- return (DbgPrintLine)(long)DbgFunc( DBG_FUNC_GETPRINTMSGBOX );
-}
-
inline void DbgSetPrintWindow( DbgPrintLine pProc )
{
DbgFunc( DBG_FUNC_SETPRINTWINDOW, (void*)(long)pProc );
}
-inline void DbgSetPrintTestTool( DbgPrintLine pProc )
-{
- DbgFunc( DBG_FUNC_SETPRINTTESTTOOL, (void*)(long)pProc );
-}
-
inline void DbgSetAbort( DbgPrintLine pProc )
{
DbgFunc( DBG_FUNC_SET_ABORT, (void*)(long)pProc );
@@ -182,11 +172,6 @@ typedef sal_uInt16 DbgChannelId;
*/
TOOLS_DLLPUBLIC DbgChannelId DbgRegisterUserChannel( DbgPrintLine pProc );
-inline bool DbgFilterMessage( const char* pMsg )
-{
- return (bool)(long) DbgFunc( DBG_FUNC_FILTERMESSAGE, (void*)pMsg );
-}
-
inline bool DbgIsAllErrorOut()
{
return (DbgFunc( DBG_FUNC_ALLERROROUT ) != 0);
@@ -202,24 +187,6 @@ inline void DbgSaveData( const DbgData& rData )
DbgFunc( DBG_FUNC_SAVEDATA, (void*)&rData );
}
-inline bool DbgIsTraceOut()
-{
- DbgData* pData = DbgGetData();
- return pData && pData->nTraceOut != DBG_OUT_NULL;
-}
-
-inline bool DbgIsWarningOut()
-{
- DbgData* pData = DbgGetData();
- return pData && pData->nWarningOut != DBG_OUT_NULL;
-}
-
-inline bool DbgIsErrorOut()
-{
- DbgData* pData = DbgGetData();
- return pData && pData->nErrorOut != DBG_OUT_NULL;
-}
-
inline sal_uIntPtr DbgGetErrorOut() // Testtool: test whether to collect OSL_ASSERTions as well
{
DbgData* pData = DbgGetData();
@@ -229,16 +196,6 @@ inline sal_uIntPtr DbgGetErrorOut() // Testtool: test whether to collect OSL_A
return DBG_OUT_NULL;
}
-inline bool DbgIsAssertWarning()
-{
- return DbgIsWarningOut();
-}
-
-inline bool DbgIsAssert()
-{
- return DbgIsErrorOut();
-}
-
inline sal_uIntPtr DbgIsResource()
{
DbgData* pData = DbgGetData();
commit 6d24c8cf7751edf4809bc5f900d3e03af5251846
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Mar 25 10:06:12 2014 +0100
Adapt to sal/log.hxx
Change-Id: Ie90467573a2e0fb2da227c58ce2e89ab2318eb04
diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx
index 18c219b..3b7b0807 100644
--- a/basic/source/sbx/sbxvar.cxx
+++ b/basic/source/sbx/sbxvar.cxx
@@ -444,16 +444,10 @@ void SbxVariable::SetParent( SbxObject* p )
bFound = ( this == pChildren->Get(nIdx) );
}
}
- if ( !bFound )
- {
- OUString aMsg = "dangling: [";
- aMsg += GetName();
- aMsg += "].SetParent([";
- aMsg += p->GetName();
- aMsg += "])";
- OString aBStr(OUStringToOString(aMsg, RTL_TEXTENCODING_ASCII_US));
- DbgOut( aBStr.getStr(), DBG_OUT_WARNING, __FILE__, __LINE__);
- }
+ SAL_WARN_IF(
+ !bFound, "basic.sbx",
+ "dangling: [" << GetName() << "].SetParent([" << p->GetName()
+ << "])");
}
#endif
More information about the Libreoffice-commits
mailing list