[Libreoffice-commits] core.git: Branch 'feature/formula-core-rework' - sc/inc sc/source

Kohei Yoshida kohei.yoshida at gmail.com
Mon Jul 15 11:55:12 PDT 2013


 sc/inc/column.hxx               |    1 +
 sc/source/core/data/column3.cxx |   13 ++++++++-----
 sc/source/core/data/table5.cxx  |    5 ++---
 3 files changed, 11 insertions(+), 8 deletions(-)

New commits:
commit f06d913f551ae666a7b4dd905391c388660b0ea1
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Mon Jul 15 14:55:02 2013 -0400

    Try to consolidate broadcast calls originating from column or table.
    
    Change-Id: Ia13f81ab9a2d27e03ced95e18e9f5e6af939f9a0

diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index b223a2d..5676568 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -486,6 +486,7 @@ public:
     void DeleteBroadcasters( sc::ColumnBlockPosition& rBlockPos, SCROW nRow1, SCROW nRow2 );
     bool HasBroadcaster() const;
 
+    void Broadcast( SCROW nRow );
     void BroadcastCells( const std::vector<SCROW>& rRows );
 
     void InterpretDirtyCells( SCROW nRow1, SCROW nRow2 );
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 5288cc5..83592fe 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -67,6 +67,12 @@ using ::com::sun::star::i18n::LocaleDataItem;
 extern const ScFormulaCell* pLastFormulaTreeTop; // in cellform.cxx
 using namespace formula;
 
+void ScColumn::Broadcast( SCROW nRow )
+{
+    ScHint aHint(SC_HINT_DATACHANGED, ScAddress(nCol, nRow, nTab));
+    pDocument->Broadcast(aHint);
+}
+
 void ScColumn::BroadcastCells( const std::vector<SCROW>& rRows )
 {
     if (rRows.empty())
@@ -113,9 +119,7 @@ void ScColumn::Delete( SCROW nRow )
     maCells.set_empty(nRow, nRow);
     maCellTextAttrs.set_empty(nRow, nRow);
 
-    pDocument->Broadcast(
-        ScHint(SC_HINT_DATACHANGED, ScAddress(nCol, nRow, nTab)));
-
+    Broadcast(nRow);
     CellStorageModified();
 }
 
@@ -411,8 +415,7 @@ void ScColumn::BroadcastNewCell( SCROW nRow )
     if (pDocument->IsClipOrUndo() || pDocument->IsInsertingFromOtherDoc() || pDocument->IsCalcingAfterLoad())
         return;
 
-    ScHint aHint(SC_HINT_DATACHANGED, ScAddress(nCol, nRow, nTab));
-    pDocument->Broadcast(aHint);
+    Broadcast(nRow);
 }
 
 bool ScColumn::UpdateScriptType( sc::CellTextAttr& rAttr, SCROW nRow )
diff --git a/sc/source/core/data/table5.cxx b/sc/source/core/data/table5.cxx
index 6d68aaf..7c667e0 100644
--- a/sc/source/core/data/table5.cxx
+++ b/sc/source/core/data/table5.cxx
@@ -1182,7 +1182,7 @@ void ScTable::InvalidateTextWidth( const ScAddress* pAdrFrom, const ScAddress* p
             switch (aCell.meType)
             {
                 case CELLTYPE_VALUE :
-                    pDocument->Broadcast(ScHint(SC_HINT_DATACHANGED, ScAddress(nCol, nRow, nTab)));
+                    rCol.Broadcast(nRow);
                     break;
                 case CELLTYPE_FORMULA :
                     aCell.mpFormula->SetDirty();
@@ -1222,8 +1222,7 @@ void ScTable::InvalidateTextWidth( const ScAddress* pAdrFrom, const ScAddress* p
                 switch (aCell.meType)
                 {
                     case CELLTYPE_VALUE :
-                        pDocument->Broadcast(
-                            ScHint(SC_HINT_DATACHANGED, ScAddress(nCol, nRow, nTab)));
+                        aCol[nCol].Broadcast(nRow);
                         break;
                     case CELLTYPE_FORMULA :
                         aCell.mpFormula->SetDirty();


More information about the Libreoffice-commits mailing list