diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-09-05 09:06:10 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-09-05 13:45:36 +0200 |
commit | a740176009411d21e20d7c11097af1d8812d251d (patch) | |
tree | 1391f8d184667e669df9442e02e90fb20d272aa0 /sc/inc | |
parent | 5b8bc6dc6b5b956d2cf3294f78a7ea2d24eaf561 (diff) |
tdf#150749 Find and replace on very large sheet
This requires 2 fixes
(*) First, we are deleting from the front of a block in the mdds
storage, so apply a similar patch to mdds to the previous improvement,
(*) Then, we end up with an O(n^2) situation in ScRangesList::Join.
But we are only displaying this data, and in fact, we only display the
first 1000 ranges anyway, so just clamp the list to 1000 entries, and
pass a flag up to the dialog so that we can report that we stopped
counting.
(*) I had to tweak the testSharedStringPool unit test, since
we are not actually clearing the underlying mdds storage, the
reference counts do not drop until we have removed all the
elements in that block of mdds storage (because then the entire
block is destructed, including the not-yet destructed elements)
Change-Id: I2c998f81dfb46453a48fce1254fd253d299d12b8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139400
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/inc')
-rw-r--r-- | sc/inc/document.hxx | 2 | ||||
-rw-r--r-- | sc/inc/strings.hrc | 1 | ||||
-rw-r--r-- | sc/inc/table.hxx | 4 |
3 files changed, 4 insertions, 3 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 1767f8c4e5f0..810a21e0de6f 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -1934,7 +1934,7 @@ public: bool SearchAndReplace( const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, SCTAB& rTab, const ScMarkData& rMark, ScRangeList& rMatchedRanges, - OUString& rUndoStr, ScDocument* pUndoDoc = nullptr ); + OUString& rUndoStr, ScDocument* pUndoDoc, bool& bMatchedRangesWereClamped ); static bool IsEmptyCellSearch( const SvxSearchItem& rSearchItem ); // determine Col/Row of subsequent calls diff --git a/sc/inc/strings.hrc b/sc/inc/strings.hrc index 9f9dfb454502..1d45fc0d7647 100644 --- a/sc/inc/strings.hrc +++ b/sc/inc/strings.hrc @@ -59,6 +59,7 @@ #define STR_INSERTGRAPHIC NC_("STR_INSERTGRAPHIC", "Insert Image") #define SCSTR_TOTAL NNC_("SCSTR_TOTAL", "One result found", "%1 results found") #define SCSTR_SKIPPED NC_("SCSTR_SKIPPED", "(only %1 are listed)") +#define SCSTR_RESULTS_CLAMPED NC_("SCSTR_RESULTS_CLAMPED", "More than %1 results found (stopped counting)") // Attribute #define SCSTR_PROTECTDOC NC_("SCSTR_PROTECTDOC", "Protect Spreadsheet Structure") #define SCSTR_UNPROTECTDOC NC_("SCSTR_UNPROTECTDOC", "Unprotect Spreadsheet Structure") diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index d8daa1b03f4a..4d4e7a2f7830 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -703,7 +703,7 @@ public: void GetAutoFormatData(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, ScAutoFormatData& rData); bool SearchAndReplace( const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, const ScMarkData& rMark, - ScRangeList& rMatchedRanges, OUString& rUndoStr, ScDocument* pUndoDoc); + ScRangeList& rMatchedRanges, OUString& rUndoStr, ScDocument* pUndoDoc, bool& bMatchedRangesWereClamped); void FindMaxRotCol( RowInfo* pRowInfo, SCSIZE nArrCount, SCCOL nX1, SCCOL nX2 ); @@ -1196,7 +1196,7 @@ private: const ScMarkData& rMark, OUString& rUndoStr, ScDocument* pUndoDoc); bool ReplaceAll( const SvxSearchItem& rSearchItem, const ScMarkData& rMark, ScRangeList& rMatchedRanges, - OUString& rUndoStr, ScDocument* pUndoDoc); + OUString& rUndoStr, ScDocument* pUndoDoc, bool& bMatchedRangesWereClamped); bool SearchStyle(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, const ScMarkData& rMark); |