diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2011-01-12 17:21:37 -0500 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2011-01-20 12:31:17 -0500 |
commit | 234214f0a60d0cc8f0b9de319f0495eddf84a485 (patch) | |
tree | f7d18463cb3bdb3815407e1b275f9e631dfb6db3 /sc/source/ui/dbgui/pvlaydlg.cxx | |
parent | 584150cc3c28d9704137da7a475ec50d0463731e (diff) |
Started investigating.
Diffstat (limited to 'sc/source/ui/dbgui/pvlaydlg.cxx')
-rw-r--r-- | sc/source/ui/dbgui/pvlaydlg.cxx | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx index 088891dcde22..16674f3b1dc1 100644 --- a/sc/source/ui/dbgui/pvlaydlg.cxx +++ b/sc/source/ui/dbgui/pvlaydlg.cxx @@ -63,6 +63,48 @@ using ::rtl::OUString; using ::std::vector; using ::std::for_each; +#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; +}; + +} + //---------------------------------------------------------------------------- #define FSTR(index) aFuncNameArr[index-1] @@ -1377,12 +1419,19 @@ bool ScDPLayoutDlg::GetPivotArrays( void ScDPLayoutDlg::UpdateSrcRange() { + StackPrinter __stack_printer__("ScDPLayoutDlg::UpdateSrcRange"); String theCurPosStr = aEdInPos.GetText(); USHORT nResult = ScRange().Parse(theCurPosStr, pDoc, pDoc->GetAddressConvention()); if ( SCA_VALID != (nResult & SCA_VALID) ) + { // invalid source range. + fprintf(stdout, "ScDPLayoutDlg::UpdateSrcRange: invalid source range\n"); + aEdInPos.SetRefValid(false); return; + } + + aEdInPos.SetRefValid(true); ScRefAddress start, end; ConvertDoubleRef(pDoc, theCurPosStr, 1, start, end, pDoc->GetAddressConvention()); |