From 5946cc2f7056fc580fefe1b90795e3921bdb3969 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Fri, 4 Nov 2016 09:46:29 +0000 Subject: tdf#91260 - ReplaceAll should use a columnar direction. MDDS is columnular, so this shrinks the working set very significantly, and should improve performance. Change-Id: I2aff92b31bfc459e85291059d977541aa65155cf Reviewed-on: https://gerrit.libreoffice.org/30562 Reviewed-by: Michael Meeks Tested-by: Michael Meeks --- sc/source/core/data/table6.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx index d983a55889cc..636ca5629592 100644 --- a/sc/source/core/data/table6.cxx +++ b/sc/source/core/data/table6.cxx @@ -571,10 +571,14 @@ bool ScTable::ReplaceAll( else GetLastDataPos(nLastCol, nLastRow); + // tdf#92160 - columnular replace is faster, and more memory efficient. + SvxSearchItem aCopyItem(rSearchItem); + aCopyItem.SetRowDirection(false); + bool bEverFound = false; while (true) { - bool bFound = Search(rSearchItem, nCol, nRow, nLastCol, nLastRow, rMark, rUndoStr, pUndoDoc); + bool bFound = Search(aCopyItem, nCol, nRow, nLastCol, nLastRow, rMark, rUndoStr, pUndoDoc); if (bFound) { -- cgit