summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2009-07-07 16:39:28 -0400
committerKohei Yoshida <kyoshida@novell.com>2009-07-07 16:39:28 -0400
commit4a27a9b1c8840cb676cee353bcfff2e8ace3ab03 (patch)
tree427a3dbda2bfbdce4e93a0287d0de4b74a90842f
parent33327ab1eeda4647a4b479f4663fcd81d9421a6e (diff)
Added some debug statements to probe what gets called when the
layout dialog launches.
-rw-r--r--inc/dpsource.hxx2
-rw-r--r--source/dpsource.cxx45
2 files changed, 43 insertions, 4 deletions
diff --git a/inc/dpsource.hxx b/inc/dpsource.hxx
index 18cecb0..b47c20a 100644
--- a/inc/dpsource.hxx
+++ b/inc/dpsource.hxx
@@ -39,7 +39,7 @@ public:
::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Any SAL_CALL
- getPropertyValue(const ::rtl::OUString& PropertyName)
+ getPropertyValue(const ::rtl::OUString& aPropertyName)
throw (::com::sun::star::beans::UnknownPropertyException,
::com::sun::star::lang::WrappedTargetException,
::com::sun::star::uno::RuntimeException);
diff --git a/source/dpsource.cxx b/source/dpsource.cxx
index 4ceaf3e..1623929 100644
--- a/source/dpsource.cxx
+++ b/source/dpsource.cxx
@@ -3,8 +3,6 @@
#include "dpsource.hxx"
#include <cppuhelper/implementationentry.hxx>
-#include <stdio.h>
-
#define SERVICE_NAME "com.sun.star.sheet.DataPilotSource"
#define IMPLEMENTATION_NAME "com.novell.openoffice.DataPilotSourceProvider"
@@ -30,6 +28,43 @@ using ::com::sun::star::lang::XMultiServiceFactory;
using ::com::sun::star::registry::XRegistryKey;
using ::rtl::OUString;
+
+#include <stdio.h>
+#include <string>
+#include <sys/time.h>
+
+namespace {
+
+class StackPrinter
+{
+public:
+ explicit StackPrinter(const char* msg) :
+ msMsg(msg)
+ {
+ fprintf(stdout, "%s: --begin\n", msMsg.c_str());
+ mfStartTime = getTime();
+ }
+
+ ~StackPrinter()
+ {
+ double fEndTime = getTime();
+ fprintf(stdout, "%s: --end (duration: %g sec)\n", msMsg.c_str(), (fEndTime-mfStartTime));
+ }
+
+private:
+ double getTime() const
+ {
+ timeval tv;
+ gettimeofday(&tv, NULL);
+ return tv.tv_sec + tv.tv_usec / 1000000.0;
+ }
+
+ ::std::string msMsg;
+ double mfStartTime;
+};
+
+}
+
namespace dpsource {
static Sequence<OUString> getSupportedServiceNames();
@@ -50,11 +85,14 @@ Reference<XPropertySetInfo> SourceProvider::getPropertySetInfo() throw (RuntimeE
void SourceProvider::setPropertyValue(const OUString& aPropertyName, const Any& aValue)
throw (UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException)
{
+ StackPrinter __stack_printer__("dpsource/SourceProvider::setPropertyValue");
+ fprintf(stdout, "SourceProvider::setPropertyValue: prop name = '%s'\n", rtl::OUStringToOString(aPropertyName, RTL_TEXTENCODING_UTF8).getStr());
}
-Any SourceProvider::getPropertyValue(const OUString& PropertyName)
+Any SourceProvider::getPropertyValue(const OUString& aPropertyName)
throw (UnknownPropertyException, WrappedTargetException, RuntimeException)
{
+ fprintf(stdout, "SourceProvider::getPropertyValue: prop name = '%s'\n", rtl::OUStringToOString(aPropertyName, RTL_TEXTENCODING_UTF8).getStr());
return Any();
}
@@ -112,6 +150,7 @@ Sequence< Sequence<DataResult> > SourceProvider::getResults() throw (RuntimeExce
Reference<XNameAccess> SourceProvider::getDimensions() throw (RuntimeException)
{
+ StackPrinter __stack_printer__("dpsource/SourceProvider::getDimensions");
return Reference<XNameAccess>();
}