Kaydet (Commit) 1e721077 authored tarafından Seyeong Kim's avatar Seyeong Kim Kaydeden (comit) Caolán McNamara

fdo#83141: optimize slow performance after when using replaceall or searchall

- problem was hang after replaceall or searchall function
- fix slow performance by looping only selected cols.

Change-Id: Ic0178af33bf381e52584bd4366bff9e128891b64
Reviewed-on: https://gerrit.libreoffice.org/11829Tested-by: 's avatarLibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: 's avatarMatthew Francis <mjay.francis@gmail.com>
Tested-by: 's avatarMatthew Francis <mjay.francis@gmail.com>
Reviewed-by: 's avatarKohei Yoshida <libreoffice@kohei.us>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst c3b4c17c
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
#include "refupdatecontext.hxx" #include "refupdatecontext.hxx"
#include "scopetools.hxx" #include "scopetools.hxx"
#include "tabprotection.hxx" #include "tabprotection.hxx"
#include "columnspanset.hxx"
#include <rowheightcontext.hxx> #include <rowheightcontext.hxx>
#include <refhint.hxx> #include <refhint.hxx>
...@@ -2119,10 +2120,17 @@ bool ScTable::HasBlockMatrixFragment( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCR ...@@ -2119,10 +2120,17 @@ bool ScTable::HasBlockMatrixFragment( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCR
bool ScTable::HasSelectionMatrixFragment( const ScMarkData& rMark ) const bool ScTable::HasSelectionMatrixFragment( const ScMarkData& rMark ) const
{ {
bool bFound = false; std::vector<sc::ColRowSpan> aSpans = rMark.GetMarkedColSpans();
for (SCCOL i=0; i<=MAXCOL && !bFound; i++)
bFound |= aCol[i].HasSelectionMatrixFragment(rMark); for ( size_t i=0; i<aSpans.size(); i++ )
return bFound; {
for ( SCCOLROW j=aSpans[i].mnStart; j<aSpans[i].mnEnd; j++ )
{
if ( aCol[j].HasSelectionMatrixFragment(rMark) )
return true;
}
}
return false;
} }
bool ScTable::IsBlockEditable( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, bool ScTable::IsBlockEditable( SCCOL nCol1, SCROW nRow1, SCCOL nCol2,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment