summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2016-11-04 18:41:59 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2016-11-05 08:07:47 -0400
commit34c49d3f87eafcbb2c57f764e8972178b3804344 (patch)
tree926fe079813ffe8d41ff5f8b72288631588e956d
parentDump the single cell vector reference info to the log. (diff)
downloadcore-34c49d3f87eafcbb2c57f764e8972178b3804344.tar.gz
core-34c49d3f87eafcbb2c57f764e8972178b3804344.zip
Log single cell references.
Change-Id: If711c44a3be7ae02d1354bb36ed7db6b5a86ef6b
-rw-r--r--sc/inc/formulalogger.hxx14
-rw-r--r--sc/source/core/data/grouptokenconverter.cxx1
-rw-r--r--sc/source/core/tool/formulalogger.cxx23
3 files changed, 37 insertions, 1 deletions
diff --git a/sc/inc/formulalogger.hxx b/sc/inc/formulalogger.hxx
index d63cf78b7ef1..83a8e6bb7c02 100644
--- a/sc/inc/formulalogger.hxx
+++ b/sc/inc/formulalogger.hxx
@@ -18,7 +18,12 @@ class ScFormulaCell;
class ScDocument;
class ScAddress;
-namespace formula { struct VectorRefArray; }
+namespace formula {
+
+class FormulaToken;
+struct VectorRefArray;
+
+}
namespace sc {
@@ -83,6 +88,11 @@ public:
void addRefMessage( const ScAddress& rPos, size_t nLen, const formula::VectorRefArray& rArray );
/**
+ * Add to the log a single cell reference information.
+ */
+ void addRefMessage( const ScAddress& rPos, const formula::FormulaToken& rToken );
+
+ /**
* Call this when the group calculation has finished successfullly.
*/
void setCalcComplete();
@@ -117,6 +127,8 @@ public:
void addMessage( const OUString& /*rMsg*/ ) { (void) this; /* loplugin:staticmethods */ }
void addRefMessage( const ScAddress& /*rPos*/, size_t /*nLen*/, const formula::VectorRefArray& /*rArray*/ )
{ (void) this; /* loplugin:staticmethods */ }
+ void addRefMessage( const ScAddress& /*rPos*/, const formula::FormulaToken& /*rToken*/ )
+ { (void) this; /* loplugin:staticmethods */ }
void setCalcComplete() { (void) this; /* loplugin:staticmethods */ }
};
diff --git a/sc/source/core/data/grouptokenconverter.cxx b/sc/source/core/data/grouptokenconverter.cxx
index e866114c2ba3..fd69b4c50d28 100644
--- a/sc/source/core/data/grouptokenconverter.cxx
+++ b/sc/source/core/data/grouptokenconverter.cxx
@@ -160,6 +160,7 @@ bool ScGroupTokenConverter::convert( ScTokenArray& rCode, sc::FormulaLogger::Gro
return false;
mrGroupTokens.AddToken(*pNewToken);
+ rScope.addRefMessage(aRefPos, *pNewToken);
}
}
break;
diff --git a/sc/source/core/tool/formulalogger.cxx b/sc/source/core/tool/formulalogger.cxx
index df7fc734b514..e8f720c611ca 100644
--- a/sc/source/core/tool/formulalogger.cxx
+++ b/sc/source/core/tool/formulalogger.cxx
@@ -157,6 +157,29 @@ void FormulaLogger::GroupScope::addRefMessage(
mpImpl->maMessages.push_back(aBuf.makeStringAndClear());
}
+void FormulaLogger::GroupScope::addRefMessage(
+ const ScAddress& rPos, const formula::FormulaToken& rToken )
+{
+ OUStringBuffer aBuf;
+ OUString aPosStr = rPos.Format(ScRefFlags::VALID, &mpImpl->mrDoc);
+ aBuf.append(aPosStr);
+ aBuf.appendAscii(": ");
+
+ switch (rToken.GetType())
+ {
+ case formula::svDouble:
+ aBuf.appendAscii("numeric value");
+ break;
+ case formula::svString:
+ aBuf.appendAscii("string value");
+ break;
+ default:
+ aBuf.appendAscii("unknown value");
+ }
+
+ mpImpl->maMessages.push_back(aBuf.makeStringAndClear());
+}
+
void FormulaLogger::GroupScope::setCalcComplete()
{
mpImpl->mbCalcComplete = true;