summaryrefslogtreecommitdiff
path: root/slideshow
diff options
context:
space:
mode:
authorAndre Fischer <af@openoffice.org>2009-05-06 08:16:59 +0000
committerAndre Fischer <af@openoffice.org>2009-05-06 08:16:59 +0000
commit11a2f378b1111e0d51e294fade2133c7563c359f (patch)
tree063aee5c68ae8fb7296e3727b30cee55f030a02f /slideshow
parent69a4a545a556bd189736b3e510d4b4b07ae8cb6e (diff)
#i48179# Improved/fixed debugging code.
Diffstat (limited to 'slideshow')
-rw-r--r--slideshow/source/engine/debug.cxx13
-rw-r--r--slideshow/source/engine/rehearsetimingsactivity.cxx2
-rw-r--r--slideshow/source/engine/wakeupevent.cxx2
-rw-r--r--slideshow/source/inc/debug.hxx23
-rw-r--r--slideshow/source/inc/delayevent.hxx30
-rw-r--r--slideshow/source/inc/event.hxx4
-rw-r--r--slideshow/source/inc/interruptabledelayevent.hxx2
7 files changed, 26 insertions, 50 deletions
diff --git a/slideshow/source/engine/debug.cxx b/slideshow/source/engine/debug.cxx
index 36bb8c9e106b..75d1c30d5013 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 c17dadc3ac5b..90efe8b5aedd 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 31ea8956c17b..d2e13d188e14 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 e9c501ca58aa..53c031231370 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 458d5f9c0a0e..ba06bffa95ec 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 c609c3e814a5..6e41e5c30123 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 d983d3ba6cff..485c96bc8c2c 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 ),