Kaydet (Commit) 8a421be2 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Dump more info from ScTokenArray (for debugging).

Change-Id: I57897c0b3c7f5974f2b9e510f03c91e23e362096
üst e34afd43
...@@ -3784,14 +3784,55 @@ void ScTokenArray::WrapReference( const ScAddress& rPos, SCCOL nMaxCol, SCROW nM ...@@ -3784,14 +3784,55 @@ void ScTokenArray::WrapReference( const ScAddress& rPos, SCCOL nMaxCol, SCROW nM
} }
#if DEBUG_FORMULA_COMPILER #if DEBUG_FORMULA_COMPILER
namespace {
void dumpFormulaToken( const FormulaToken& rToken )
{
cout << "-- FormulaToken" << endl;
cout << " opcode: " << rToken.GetOpCode() << endl;
cout << " type: " << static_cast<int>(rToken.GetType()) << endl;
switch (rToken.GetType())
{
case svDouble:
cout << " value: " << rToken.GetDouble() << endl;
break;
case svString:
cout << " string: "
<< OUStringToOString(rToken.GetString().getString(), RTL_TEXTENCODING_UTF8).getStr()
<< endl;
break;
default:
;
}
}
}
void ScTokenArray::Dump() const void ScTokenArray::Dump() const
{ {
cout << "+++ Normal Tokens +++" << endl;
for (sal_uInt16 i = 0; i < nLen; ++i) for (sal_uInt16 i = 0; i < nLen; ++i)
{ {
const ScToken* p = dynamic_cast<const ScToken*>(pCode[i]); const FormulaToken* pToken = pCode[i];
const ScToken* p = dynamic_cast<const ScToken*>(pToken);
if (!p)
{
dumpFormulaToken(*pToken);
continue;
}
p->Dump();
}
cout << "+++ RPN Tokens +++" << endl;
for (sal_uInt16 i = 0; i < nRPN; ++i)
{
const FormulaToken* pToken = pRPN[i];
const ScToken* p = dynamic_cast<const ScToken*>(pToken);
if (!p) if (!p)
{ {
cout << "-- (non ScToken)" << endl; dumpFormulaToken(*pToken);
continue; continue;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment