summaryrefslogtreecommitdiff
path: root/sc/source/core/tool/interpr7.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/core/tool/interpr7.cxx')
-rw-r--r--sc/source/core/tool/interpr7.cxx49
1 files changed, 49 insertions, 0 deletions
diff --git a/sc/source/core/tool/interpr7.cxx b/sc/source/core/tool/interpr7.cxx
index bb647c1eb698..aa07090cdd41 100644
--- a/sc/source/core/tool/interpr7.cxx
+++ b/sc/source/core/tool/interpr7.cxx
@@ -9,12 +9,16 @@
#include "interpre.hxx"
#include <rtl/strbuf.hxx>
+#include <formula/errorcodes.hxx>
+#include <svtools/miscopt.hxx>
#include <com/sun/star/ucb/XSimpleFileAccess3.hpp>
#include <com/sun/star/ucb/SimpleFileAccess.hpp>
#include <com/sun/star/io/XInputStream.hpp>
#include "libxml/xpath.h"
+#include <dpobject.hxx>
+#include <document.hxx>
#include <boost/shared_ptr.hpp>
#include <cstring>
@@ -205,4 +209,49 @@ void ScInterpreter::ScWebservice()
}
}
+void ScInterpreter::ScDebugVar()
+{
+ // This is to be used by developers only! Never document this for end
+ // users. This is a convenient way to extract arbitrary internal state to
+ // a cell for easier debugging.
+
+ SvtMiscOptions aMiscOptions;
+ if (!aMiscOptions.IsExperimentalMode())
+ {
+ PushError(ScErrorCodes::errNoName);
+ return;
+ }
+
+ if (!MustHaveParamCount(GetByte(), 1))
+ {
+ PushIllegalParameter();
+ return;
+ }
+
+ rtl_uString* p = GetString().getDataIgnoreCase();
+ if (!p)
+ {
+ PushIllegalParameter();
+ return;
+ }
+
+ OUString aStrUpper(p);
+
+ if (aStrUpper == "PIVOTCOUNT")
+ {
+ // Set the number of pivot tables in the document.
+
+ double fVal = 0.0;
+ if (pDok->HasPivotTable())
+ {
+ const ScDPCollection* pDPs = pDok->GetDPCollection();
+ fVal = pDPs->GetCount();
+ }
+ PushDouble(fVal);
+ return;
+ }
+
+ PushIllegalParameter();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */