diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-11-19 13:40:09 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-11-21 20:55:49 -0500 |
commit | 5dd60299c668cd36cc5cc5e8bd5b162e1fc9ef13 (patch) | |
tree | f43063bd780a5a07bceb6247f6817c8d9b9b1b6a /sc | |
parent | db93b490a65c7188bfc704948bc3a373cb3066e3 (diff) |
Dump formula group listener info.
Change-Id: Idbad1451393c42c272465907312c64c65eba9525
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/grouparealistener.hxx | 6 | ||||
-rw-r--r-- | sc/source/core/data/bcaslot.cxx | 28 | ||||
-rw-r--r-- | sc/source/core/tool/grouparealistener.cxx | 13 |
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 639219244280..e93d2fc92364 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. |