diff options
author | Andre Fischer <af@openoffice.org> | 2009-05-06 08:16:59 +0000 |
---|---|---|
committer | Andre Fischer <af@openoffice.org> | 2009-05-06 08:16:59 +0000 |
commit | 3974ec1ccf6b796be2f84ad891a0f9abffa1ed17 (patch) | |
tree | c1874282c888e06ae53b986e950f944cb445eb88 /slideshow | |
parent | 895d8d860667999e5bb9cc6cee6f26c7e45647f0 (diff) |
#i48179# Improved/fixed debugging code.
Diffstat (limited to 'slideshow')
-rw-r--r-- | slideshow/source/engine/debug.cxx | 13 | ||||
-rw-r--r-- | slideshow/source/engine/rehearsetimingsactivity.cxx | 2 | ||||
-rw-r--r-- | slideshow/source/engine/wakeupevent.cxx | 2 | ||||
-rw-r--r-- | slideshow/source/inc/debug.hxx | 23 | ||||
-rw-r--r-- | slideshow/source/inc/delayevent.hxx | 30 | ||||
-rw-r--r-- | slideshow/source/inc/event.hxx | 4 | ||||
-rw-r--r-- | slideshow/source/inc/interruptabledelayevent.hxx | 2 |
7 files changed, 26 insertions, 50 deletions
diff --git a/slideshow/source/engine/debug.cxx b/slideshow/source/engine/debug.cxx index 1b6a71914..f529828be 100644 --- a/slideshow/source/engine/debug.cxx +++ b/slideshow/source/engine/debug.cxx @@ -31,6 +31,9 @@ #include "precompiled_slideshow.hxx" #include "debug.hxx" + +#if OSL_DEBUG_LEVEL > 1 + #include "animationnodes/basecontainernode.hxx" #include "animationnodes/paralleltimecontainer.hxx" #include "animationnodes/sequentialtimecontainer.hxx" @@ -52,9 +55,8 @@ using ::rtl::OUString; using namespace ::com::sun::star; -namespace slideshow { namespace internal { -#if OSL_DEBUG_LEVEL > 1 +namespace slideshow { namespace internal { namespace { @@ -221,15 +223,11 @@ void Debug_ShowNodeTree (const AnimationNodeSharedPtr& rpNode) DebugShowState(DebugGetTreeRoot(::boost::dynamic_pointer_cast<BaseNode>(rpNode))); } -#endif // OSL_DEBUG_LEVEL > 1 - //----- Tracing --------------------------------------------------------------- -#if OSL_DEBUG_LEVEL > 1 - extern "C" { namespace { @@ -323,6 +321,7 @@ DebugTraceScope::~DebugTraceScope (void) delete [] msMessage; } -#endif // OSL_DEBUG_LEVEL > 1 } } + +#endif // OSL_DEBUG_LEVEL > 1 diff --git a/slideshow/source/engine/rehearsetimingsactivity.cxx b/slideshow/source/engine/rehearsetimingsactivity.cxx index fcdfb3ccb..c885e7ac0 100644 --- a/slideshow/source/engine/rehearsetimingsactivity.cxx +++ b/slideshow/source/engine/rehearsetimingsactivity.cxx @@ -72,7 +72,7 @@ public: WakeupEvent( boost::shared_ptr< ::canvas::tools::ElapsedTime > const& pTimeBase, ActivitySharedPtr const& rActivity, ActivitiesQueue & rActivityQueue ) : -#if OSL_DEBUG_LEVEL > 1 && defined (SLIDESHOW_ADD_DESCRIPTIONS_TO_EVENTS) +#if OSL_DEBUG_LEVEL > 1 Event(::rtl::OUString::createFromAscii("WakeupEvent")), #endif maTimer(pTimeBase), diff --git a/slideshow/source/engine/wakeupevent.cxx b/slideshow/source/engine/wakeupevent.cxx index bbf8cc51b..b36117a7e 100644 --- a/slideshow/source/engine/wakeupevent.cxx +++ b/slideshow/source/engine/wakeupevent.cxx @@ -45,7 +45,7 @@ namespace slideshow WakeupEvent::WakeupEvent( boost::shared_ptr<canvas::tools::ElapsedTime> const & pTimeBase, ActivitiesQueue& rActivityQueue ) : -#if OSL_DEBUG_LEVEL > 1 && defined (SLIDESHOW_ADD_DESCRIPTIONS_TO_EVENTS) +#if OSL_DEBUG_LEVEL > 1 Event(::rtl::OUString::createFromAscii("WakeupEvent")), #endif maTimer(pTimeBase), diff --git a/slideshow/source/inc/debug.hxx b/slideshow/source/inc/debug.hxx index 370ab91b5..d9a6d46fb 100644 --- a/slideshow/source/inc/debug.hxx +++ b/slideshow/source/inc/debug.hxx @@ -31,22 +31,16 @@ #ifndef INCLUDED_SLIDESHOW_DEBUG_HXX #define INCLUDED_SLIDESHOW_DEBUG_HXX -#include "animationnode.hxx" - -namespace slideshow { namespace internal { +#include <osl/diagnose.h> #if OSL_DEBUG_LEVEL > 1 -void Debug_ShowNodeTree (const AnimationNodeSharedPtr& rpNode); -#endif -// Uncomment the following line to define -// SLIDESHOW_ADD_DESCRIPTIONS_TO_EVENTS -// in order to add descriptions to Event objects that help debugging event -// base problems. -#define SLIDESHOW_ADD_DESCRIPTIONS_TO_EVENTS +#include "animationnode.hxx" -#if OSL_DEBUG_LEVEL > 1 +namespace slideshow { namespace internal { + +void Debug_ShowNodeTree (const AnimationNodeSharedPtr& rpNode); // Change this to a valid filename. The file is created anew with every // office start (and execution of at least one TRACE... command.) @@ -66,6 +60,9 @@ void SAL_CALL DebugTraceBegin (const sal_Char* sFormat, ...); void SAL_CALL DebugTraceEnd (const sal_Char* sFormat, ...); void SAL_CALL DebugTraceMessage (const sal_Char* sFormat, ...); +} } // end of namespace ::slideshow::internal + + #define TRACE_BEGIN DebugTraceBegin #define TRACE_END DebugTraceEnd #define TRACE DebugTraceMessage @@ -80,8 +77,4 @@ void SAL_CALL DebugTraceMessage (const sal_Char* sFormat, ...); #endif // OSL_DEBUG_LEVEL > 1 - -} } - - #endif diff --git a/slideshow/source/inc/delayevent.hxx b/slideshow/source/inc/delayevent.hxx index e2db9457b..67f2222e0 100644 --- a/slideshow/source/inc/delayevent.hxx +++ b/slideshow/source/inc/delayevent.hxx @@ -51,7 +51,7 @@ public: template <typename FuncT> Delay( FuncT const& func, double nTimeout -#if OSL_DEBUG_LEVEL > 1 && defined (SLIDESHOW_ADD_DESCRIPTIONS_TO_EVENTS) +#if OSL_DEBUG_LEVEL > 1 , const ::rtl::OUString& rsDescription ) : Event(rsDescription), #else @@ -61,7 +61,7 @@ public: Delay( const boost::function0<void>& func, double nTimeout -#if OSL_DEBUG_LEVEL > 1 && defined (SLIDESHOW_ADD_DESCRIPTIONS_TO_EVENTS) +#if OSL_DEBUG_LEVEL > 1 , const ::rtl::OUString& rsDescription ) : Event(rsDescription), #else @@ -127,12 +127,8 @@ public: template <typename FuncT> Delay_( FuncT const& func, double nTimeout, char const* from_function, char const* from_file, int from_line, - const ::rtl::OUString& rsDescription ) - : Delay(func, nTimeout -#if defined (SLIDESHOW_ADD_DESCRIPTIONS_TO_EVENTS) - , rsDescription -#endif - ), + const ::rtl::OUString& rsDescription) + : Delay(func, nTimeout, rsDescription), FROM_FUNCTION(from_function), FROM_FILE(from_file), FROM_LINE(from_line) {} @@ -145,14 +141,12 @@ template <typename FuncT> inline EventSharedPtr makeDelay_( FuncT const& func, double nTimeout, char const* from_function, char const* from_file, int from_line, - const ::rtl::OUString& rsDescription ) + const ::rtl::OUString& rsDescription) { return EventSharedPtr( new Delay_( func, nTimeout, - from_function, from_file, from_line, rsDescription ) ); + from_function, from_file, from_line, rsDescription) ); } -#if defined (SLIDESHOW_ADD_DESCRIPTIONS_TO_EVENTS) - #define makeDelay(f, t, d) makeDelay_(f, t, \ BOOST_CURRENT_FUNCTION, __FILE__, __LINE__, \ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(d))) @@ -160,17 +154,7 @@ inline EventSharedPtr makeDelay_( BOOST_CURRENT_FUNCTION, __FILE__, __LINE__, \ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(d))) -#else - -#define makeDelay(f, t, d) makeDelay_(f, t, \ - BOOST_CURRENT_FUNCTION, __FILE__, __LINE__) -#define makeEvent(f, d) makeDelay_(f, 0.0, \ - BOOST_CURRENT_FUNCTION, __FILE__, __LINE__) - -#endif - - -#endif // OSL_DEBUG_LEVEL < 1 +#endif // OSL_DEBUG_LEVEL <= 1 } // namespace internal } // namespace presentation diff --git a/slideshow/source/inc/event.hxx b/slideshow/source/inc/event.hxx index f535e9b99..d22017423 100644 --- a/slideshow/source/inc/event.hxx +++ b/slideshow/source/inc/event.hxx @@ -44,7 +44,7 @@ namespace internal { class Event : public Disposable { public: -#if OSL_DEBUG_LEVEL > 1 && defined (SLIDESHOW_ADD_DESCRIPTIONS_TO_EVENTS) +#if OSL_DEBUG_LEVEL > 1 Event (const ::rtl::OUString& rsDescription) : msDescription(rsDescription) {}; #endif @@ -78,7 +78,7 @@ public: */ virtual double getActivationTime( double nCurrentTime ) const = 0; -#if OSL_DEBUG_LEVEL > 1 && defined (SLIDESHOW_ADD_DESCRIPTIONS_TO_EVENTS) +#if OSL_DEBUG_LEVEL > 1 ::rtl::OUString GetDescription (void) const { return msDescription; } private: diff --git a/slideshow/source/inc/interruptabledelayevent.hxx b/slideshow/source/inc/interruptabledelayevent.hxx index 1215bb143..3c73923ae 100644 --- a/slideshow/source/inc/interruptabledelayevent.hxx +++ b/slideshow/source/inc/interruptabledelayevent.hxx @@ -49,7 +49,7 @@ namespace slideshow public: DelayFacade( const EventSharedPtr& rEvent, double nTimeout ) : -#if OSL_DEBUG_LEVEL > 1 && defined (SLIDESHOW_ADD_DESCRIPTIONS_TO_EVENTS) +#if OSL_DEBUG_LEVEL > 1 Event(::rtl::OUString::createFromAscii("DelayFacade")), #endif mpEvent( rEvent ), |