From 19c46727fd6a287cc3ec0417cbab922e611282c1 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Wed, 19 Oct 2016 23:34:25 +0200 Subject: sc-perf: SetFormulaCells: unnecessary number format check in clipboard/undo Change-Id: Ica7495e95700db2e6be1dd475ec450d8450364a4 --- sc/source/core/data/column3.cxx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index 89aa5e05e6c2..b8042604ad7b 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& 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 aDefaults(rCells.size(), sc::CellTextAttr()); -- cgit