[Libreoffice-commits] core.git: Branch 'feature/perfwork5' - sc/inc sc/source
Kohei Yoshida
kohei.yoshida at collabora.com
Wed Nov 19 13:32:52 PST 2014
sc/inc/grouparealistener.hxx | 6 ++++++
sc/source/core/data/bcaslot.cxx | 28 ++++++++++++++++++++++------
sc/source/core/tool/grouparealistener.cxx | 13 +++++++++++++
3 files changed, 41 insertions(+), 6 deletions(-)
New commits:
commit 801e8b05fcfcb7cd19654e00290c3b2eb08ea68f
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Wed Nov 19 13:40:09 2014 -0500
Dump formula group listener info.
Change-Id: Idbad1451393c42c272465907312c64c65eba9525
diff --git a/sc/inc/grouparealistener.hxx b/sc/inc/grouparealistener.hxx
index 28e8f43..5abb0e8 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 ee6f17a..d2edf54 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 7a83461..4321e9b 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.
More information about the Libreoffice-commits
mailing list