summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-03-27 16:05:38 +0200
committerCaolán McNamara <caolanm@redhat.com>2018-03-28 09:21:50 +0200
commit3638dc92ce9b251327302fc903f17d6939fb334e (patch)
treeb8c78cf2168160284d870c0c9c5a577f27721333
parent28632f5c575e1ddc0920041f72686758bf521103 (diff)
tdf#106667 Hang when trying to open a dialog and the whole sheet is selected
regression from commit 8d54796bf152499ecbe61788be64c9035f725dfa (patch) enhance pass-by-ref plugin to detect large arguments which converted this peice of code into an O(n^2) loop Change-Id: I0473a084518c0d10411615e1b3901b9b90144bc9 Reviewed-on: https://gerrit.libreoffice.org/51956 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit f4f1654c07ec58bc36d824e9434ab851b7900e9f) Reviewed-on: https://gerrit.libreoffice.org/51970 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sc/inc/column.hxx2
-rw-r--r--sc/source/core/data/column2.cxx3
-rw-r--r--sc/source/core/data/column3.cxx6
3 files changed, 6 insertions, 5 deletions
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index acd899e7658a..3e8ccee3cee2 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -703,7 +703,7 @@ private:
void AttachNewFormulaCells( const sc::CellStoreType::position_type& aPos, size_t nLength );
void BroadcastNewCell( SCROW nRow );
- bool UpdateScriptType( sc::CellTextAttr& rAttr, SCROW nRow, const sc::CellStoreType::iterator& itr );
+ bool UpdateScriptType( sc::CellTextAttr& rAttr, SCROW nRow, sc::CellStoreType::iterator& itr );
const ScFormulaCell* FetchFormulaCell( SCROW nRow ) const;
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index b0d69b8c4bb8..0434cc9f39a1 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -1978,7 +1978,7 @@ SvtScriptType ScColumn::GetScriptType( SCROW nRow ) const
}
SvtScriptType ScColumn::GetRangeScriptType(
- sc::CellTextAttrStoreType::iterator& itPos, SCROW nRow1, SCROW nRow2, const sc::CellStoreType::iterator& itrCells )
+ sc::CellTextAttrStoreType::iterator& itPos, SCROW nRow1, SCROW nRow2, const sc::CellStoreType::iterator& itrCells_ )
{
if (!ValidRow(nRow1) || !ValidRow(nRow2) || nRow1 > nRow2)
return SvtScriptType::NONE;
@@ -1988,6 +1988,7 @@ SvtScriptType ScColumn::GetRangeScriptType(
maCellTextAttrs.position(itPos, nRow1);
itPos = aRet.first; // Track the position of cell text attribute array.
+ sc::CellStoreType::iterator itrCells = itrCells_;
SvtScriptType nScriptType = SvtScriptType::NONE;
bool bUpdated = false;
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 730003196151..961bf244df60 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -499,7 +499,7 @@ void ScColumn::BroadcastNewCell( SCROW nRow )
Broadcast(nRow);
}
-bool ScColumn::UpdateScriptType( sc::CellTextAttr& rAttr, SCROW nRow, const sc::CellStoreType::iterator& itr )
+bool ScColumn::UpdateScriptType( sc::CellTextAttr& rAttr, SCROW nRow, sc::CellStoreType::iterator& itr )
{
if (rAttr.mnScriptType != SvtScriptType::UNKNOWN)
// Already updated. Nothing to do.
@@ -512,9 +512,9 @@ bool ScColumn::UpdateScriptType( sc::CellTextAttr& rAttr, SCROW nRow, const sc::
return false;
sc::CellStoreType::position_type pos = maCells.position(itr, nRow);
- sc::CellStoreType::iterator itr2 = pos.first;
+ itr = pos.first;
size_t nOffset = pos.second;
- ScRefCellValue aCell = GetCellValue( itr2, nOffset );
+ ScRefCellValue aCell = GetCellValue( itr, nOffset );
ScAddress aPos(nCol, nRow, nTab);
const SfxItemSet* pCondSet = nullptr;