diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-07-17 11:06:15 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-07-24 23:29:26 -0400 |
commit | a4728e2de0d3acc6685b1e0ba0fb4606fdbea3e7 (patch) | |
tree | f1c6353cf6a3d2be3762a51b08250b307241d1b5 /sc/source | |
parent | 932c5679353819b30a1671831d1f591e48df73f0 (diff) |
Add dumping capability for ScTokenArray (for debugging).
Change-Id: Ib3f6a87936a6c00b503f5d72b16b3e4712d7d762
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/core/data/column2.cxx | 7 | ||||
-rw-r--r-- | sc/source/core/tool/token.cxx | 42 |
2 files changed, 42 insertions, 7 deletions
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index 8695581643b8..4d6c3fe65278 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -66,13 +66,6 @@ #include <boost/scoped_ptr.hpp> -#if DEBUG_COLUMN_STORAGE -#include "columniterator.hxx" -#include <iostream> -using std::cout; -using std::endl; -#endif - // ----------------------------------------------------------------------- // factor from font size to optimal cell height (text width) diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index 07da54ed8f9f..3447432c3313 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -527,6 +527,13 @@ bool ScToken::Is3DRef() const return false; } +#if DEBUG_FORMULA_COMPILER +void ScToken::Dump() const +{ + cout << "-- ScToken (base class)" << endl; +} +#endif + FormulaTokenRef ScToken::ExtendRangeReference( FormulaToken & rTok1, FormulaToken & rTok2, const ScAddress & rPos, bool bReuseDoubleRef ) { @@ -746,6 +753,15 @@ bool ScSingleRefToken::operator==( const FormulaToken& r ) const return FormulaToken::operator==( r ) && aSingleRef == static_cast<const ScToken&>(r).GetSingleRef(); } +#if DEBUG_FORMULA_COMPILER +void ScSingleRefToken::Dump() const +{ + cout << "-- ScSingleRefToken" << endl; + cout << " relative column: " << aSingleRef.IsColRel() << " row : " << aSingleRef.IsRowRel() << " sheet: " << aSingleRef.IsTabRel() << endl; + cout << " absolute column: " << aSingleRef.nCol << " row: " << aSingleRef.nRow << " sheet: " << aSingleRef.nTab << endl; + cout << " relative column: " << aSingleRef.nRelCol << " row: " << aSingleRef.nRelRow << " sheet: " << aSingleRef.nRelTab << endl; +} +#endif const ScSingleRefData& ScDoubleRefToken::GetSingleRef() const { return aDoubleRef.Ref1; } ScSingleRefData& ScDoubleRefToken::GetSingleRef() { return aDoubleRef.Ref1; } @@ -760,6 +776,21 @@ bool ScDoubleRefToken::operator==( const FormulaToken& r ) const return FormulaToken::operator==( r ) && aDoubleRef == static_cast<const ScToken&>(r).GetDoubleRef(); } +#if DEBUG_FORMULA_COMPILER +void ScDoubleRefToken::Dump() const +{ + cout << "-- ScDoubleRefToken" << endl; + cout << " ref 1" << endl; + cout << " relative column: " << aDoubleRef.Ref1.IsColRel() << " row: " << aDoubleRef.Ref1.IsRowRel() << " sheet: " << aDoubleRef.Ref1.IsTabRel() << endl; + cout << " absolute column: " << aDoubleRef.Ref1.nCol << " row: " << aDoubleRef.Ref1.nRow << " sheet: " << aDoubleRef.Ref1.nTab << endl; + cout << " relative column: " << aDoubleRef.Ref1.nRelCol << " row: " << aDoubleRef.Ref1.nRelRow << " sheet: " << aDoubleRef.Ref1.nRelTab << endl; + + cout << " ref 2" << endl; + cout << " relative column: " << aDoubleRef.Ref2.IsColRel() << " row: " << aDoubleRef.Ref2.IsRowRel() << " sheet: " << aDoubleRef.Ref2.IsTabRel() << endl; + cout << " absolute column: " << aDoubleRef.Ref2.nCol << " row: " << aDoubleRef.Ref2.nRow << " sheet: " << aDoubleRef.Ref2.nTab << endl; + cout << " relative column: " << aDoubleRef.Ref2.nRelCol << " row: " << aDoubleRef.Ref2.nRelRow << " sheet: " << aDoubleRef.Ref2.nRelTab << endl; +} +#endif const ScRefList* ScRefListToken::GetRefList() const { return &aRefList; } ScRefList* ScRefListToken::GetRefList() { return &aRefList; } @@ -2185,5 +2216,16 @@ void ScTokenArray::AdjustAbsoluteRefs( const ScDocument* pOldDoc, const ScAddres } } +#if DEBUG_FORMULA_COMPILER +void ScTokenArray::Dump() const +{ + for (sal_uInt16 i = 0; i < nLen; ++i) + { + const ScToken* p = static_cast<const ScToken*>(pCode[i]); + p->Dump(); + } +} +#endif + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |