[Libreoffice-commits] core.git: 2 commits - sc/source

Eike Rathke erack at redhat.com
Wed Oct 19 21:35:14 UTC 2016


 sc/source/core/data/column3.cxx    |   13 ++++++++-----
 sc/source/core/data/document10.cxx |    3 +++
 2 files changed, 11 insertions(+), 5 deletions(-)

New commits:
commit 19c46727fd6a287cc3ec0417cbab922e611282c1
Author: Eike Rathke <erack at redhat.com>
Date:   Wed Oct 19 23:34:25 2016 +0200

    sc-perf: SetFormulaCells: unnecessary number format check in clipboard/undo
    
    Change-Id: Ica7495e95700db2e6be1dd475ec450d8450364a4

diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 89aa5e0..b804260 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -1922,12 +1922,15 @@ bool ScColumn::SetFormulaCells( SCROW nRow, std::vector<ScFormulaCell*>& rCells
     // Detach all formula cells that will be overwritten.
     DetachFormulaCells(aPos, rCells.size());
 
-    for (size_t i = 0, n = rCells.size(); i < n; ++i)
+    if (!pDocument->IsClipOrUndo())
     {
-        SCROW nThisRow = nRow + i;
-        sal_uInt32 nFmt = GetNumberFormat(nThisRow);
-        if ((nFmt % SV_COUNTRY_LANGUAGE_OFFSET) == 0)
-            rCells[i]->SetNeedNumberFormat(true);
+        for (size_t i = 0, n = rCells.size(); i < n; ++i)
+        {
+            SCROW nThisRow = nRow + i;
+            sal_uInt32 nFmt = GetNumberFormat(nThisRow);
+            if ((nFmt % SV_COUNTRY_LANGUAGE_OFFSET) == 0)
+                rCells[i]->SetNeedNumberFormat(true);
+        }
     }
 
     std::vector<sc::CellTextAttr> aDefaults(rCells.size(), sc::CellTextAttr());
commit 5f01b29876da20299326b466d9596c4121ed2dec
Author: Eike Rathke <erack at redhat.com>
Date:   Wed Oct 19 23:28:21 2016 +0200

    sc-perf: StartAllListeners: bail out early in cliboard or undo document
    
    ... and do not attempt to execute the overhead for all columns in the range
    just to do nothing.
    
    Change-Id: I88d26895cf641e8c71d7ccdf5534de8008070e61

diff --git a/sc/source/core/data/document10.cxx b/sc/source/core/data/document10.cxx
index 4d59838..8964999 100644
--- a/sc/source/core/data/document10.cxx
+++ b/sc/source/core/data/document10.cxx
@@ -469,6 +469,9 @@ void ScDocument::StartNeededListeners( const std::shared_ptr<const sc::ColumnSet
 
 void ScDocument::StartAllListeners( const ScRange& rRange )
 {
+    if (IsClipOrUndo() || GetNoListening())
+        return;
+
     std::shared_ptr<sc::ColumnBlockPositionSet> pPosSet(new sc::ColumnBlockPositionSet(*this));
     sc::StartListeningContext aStartCxt(*this, pPosSet);
     sc::EndListeningContext aEndCxt(*this, pPosSet);


More information about the Libreoffice-commits mailing list