summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-11-19 13:40:09 -0500
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-11-19 13:42:15 -0500
commit801e8b05fcfcb7cd19654e00290c3b2eb08ea68f (patch)
tree3824f4cd21651d3fd3f316e36f6e408d1e8ac6d6 /sc
parentabe96a930dcc267b1468a15b1eb2df2b3d06a509 (diff)
Dump formula group listener info.
Change-Id: Idbad1451393c42c272465907312c64c65eba9525
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/grouparealistener.hxx6
-rw-r--r--sc/source/core/data/bcaslot.cxx28
-rw-r--r--sc/source/core/tool/grouparealistener.cxx13
3 files changed, 41 insertions, 6 deletions
diff --git a/sc/inc/grouparealistener.hxx b/sc/inc/grouparealistener.hxx
index 28e8f4320ad4..5abb0e8ebb92 100644
--- a/sc/inc/grouparealistener.hxx
+++ b/sc/inc/grouparealistener.hxx
@@ -11,6 +11,7 @@
#define INCLUDED_SC_GROUPAREALISTENER_HXX
#include <address.hxx>
+#include <calcmacros.hxx>
#include <svl/listener.hxx>
@@ -51,6 +52,11 @@ public:
*/
void collectFormulaCells( SCTAB nTab, SCCOL nCol, SCROW nRow1, SCROW nRow2, std::vector<ScFormulaCell*>& rCells ) const;
+#if DEBUG_AREA_BROADCASTER
+ ScAddress getTopCellPos() const;
+ SCROW getGroupLength() const;
+#endif
+
private:
void notifyCellChange( const SfxHint& rHint, const ScAddress& rPos );
void notifyBulkChange( const BulkDataHint& rHint );
diff --git a/sc/source/core/data/bcaslot.cxx b/sc/source/core/data/bcaslot.cxx
index ee6f17ae7cfd..d2edf54d2e7c 100644
--- a/sc/source/core/data/bcaslot.cxx
+++ b/sc/source/core/data/bcaslot.cxx
@@ -31,6 +31,7 @@
#if DEBUG_AREA_BROADCASTER
#include <formulacell.hxx>
+#include <grouparealistener.hxx>
#endif
// Number of slots per dimension
@@ -620,20 +621,35 @@ void ScBroadcastAreaSlot::Dump() const
{
const ScBroadcastAreaEntry& rEntry = *it;
const ScBroadcastArea* pArea = rEntry.mpArea;
- cout << " * range: " << rtl::OUStringToOString(pArea->GetRange().Format(SCA_VALID|SCA_TAB_3D, pDoc), RTL_TEXTENCODING_UTF8).getStr() << endl;
const SvtBroadcaster& rBC = pArea->GetBroadcaster();
const SvtBroadcaster::ListenersType& rListeners = rBC.GetAllListeners();
size_t n = rListeners.size();
- cout << " * listener count: " << n << endl;
+
+ cout << " * range: " << rtl::OUStringToOString(pArea->GetRange().Format(SCA_VALID|SCA_TAB_3D, pDoc), RTL_TEXTENCODING_UTF8).getStr()
+ << ", listener count: " << n << endl;
+
for (size_t i = 0; i < n; ++i)
{
const ScFormulaCell* pFC = dynamic_cast<const ScFormulaCell*>(rListeners[i]);
- if (!pFC)
+ if (pFC)
+ {
+ cout << " * listener: formula cell: "
+ << rtl::OUStringToOString(pFC->aPos.Format(SCA_VALID|SCA_TAB_3D, pDoc), RTL_TEXTENCODING_UTF8).getStr()
+ << endl;
+ continue;
+ }
+
+ const sc::FormulaGroupAreaListener* pFGListener = dynamic_cast<const sc::FormulaGroupAreaListener*>(rListeners[i]);
+ if (pFGListener)
+ {
+ cout << " * listener: formula group: (pos: "
+ << rtl::OUStringToOString(pFGListener->getTopCellPos().Format(SCA_VALID | SCA_TAB_3D, pDoc), RTL_TEXTENCODING_UTF8).getStr()
+ << ", length: " << pFGListener->getGroupLength()
+ << ")" << endl;
continue;
+ }
- cout << " * listener: formula cell: "
- << rtl::OUStringToOString(pFC->aPos.Format(SCA_VALID|SCA_TAB_3D, pDoc), RTL_TEXTENCODING_UTF8).getStr()
- << endl;
+ cout << " * listener: unknown" << endl;
}
}
}
diff --git a/sc/source/core/tool/grouparealistener.cxx b/sc/source/core/tool/grouparealistener.cxx
index 7a834614b5e7..4321e9b81649 100644
--- a/sc/source/core/tool/grouparealistener.cxx
+++ b/sc/source/core/tool/grouparealistener.cxx
@@ -219,6 +219,19 @@ void FormulaGroupAreaListener::collectFormulaCells(
}
}
+#if DEBUG_AREA_BROADCASTER
+ScAddress FormulaGroupAreaListener::getTopCellPos() const
+{
+ const ScFormulaCell& rFC = **mppTopCell;
+ return rFC.aPos;
+}
+
+SCROW FormulaGroupAreaListener::getGroupLength() const
+{
+ return mnGroupLen;
+}
+#endif
+
void FormulaGroupAreaListener::notifyCellChange( const SfxHint& rHint, const ScAddress& rPos )
{
// Determine which formula cells within the group need to be notified of this change.