diff options
author | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-08-10 23:00:18 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-08-16 21:22:40 -0400 |
commit | 98dc4bb8a1d029ba8b01504b74ed5397e1e7164b (patch) | |
tree | 2ca7ef6a45076e9b4b67ceff9dbe814abda5d4e9 /sc | |
parent | acd31343d1a346f045a8145894c7e4451910cbf8 (diff) |
Extended UNO's script API to allow adding of multiple listeners at once.
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/docshell/docsh.cxx | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 87c0f8f7d62f..6099bb3b2630 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -150,6 +150,48 @@ using ::rtl::OUStringBuffer; using ::boost::shared_ptr; using ::std::vector; +#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)); + } + + void printTime(int line) const + { + double fEndTime = getTime(); + fprintf(stdout, "%s: --(%d) (duration: %g sec)\n", msMsg.c_str(), line, (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; +}; + +} + // STATIC DATA ----------------------------------------------------------- // Stream-Namen im Storage @@ -1014,6 +1056,7 @@ static void lcl_parseHtmlFilterOption(const OUString& rOption, LanguageType& rLa sal_Bool ScDocShell::ConvertFrom( SfxMedium& rMedium ) { + StackPrinter __stack_printer__("ScDocShell::ConvertFrom"); RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "nn93723", "ScDocShell::ConvertFrom" ); LoadMediumGuard aLoadGuard(&aDocument); |