diff options
author | Justin Luth <justin_luth@sil.org> | 2017-02-08 19:32:14 +0300 |
---|---|---|
committer | Bartosz Kosiorek <gang65@poczta.onet.pl> | 2017-02-14 01:14:14 +0000 |
commit | 86ff0df3bd71f2e79f85b1facc7737455e732309 (patch) | |
tree | acbf1e092c2c407bf490652b15132a65fa063eca /sc | |
parent | 4f4edde01364881be483eca9449a32a14093250f (diff) |
Optimize Excel GetOrCreateRow: compare to previous map entry
Follow-up patch to 09e9274fc080b471393b806617eb03124db67590 and
related to tdf#105840. Just keeping the non-dependent parts
separate, and building up to a solution for bug 105840.
Change-Id: I129e671f71de6abf876a82d4a6503695add85548
Reviewed-on: https://gerrit.libreoffice.org/34039
Reviewed-by: Justin Luth <justin_luth@sil.org>
Tested-by: Justin Luth <justin_luth@sil.org>
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/excel/xetable.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx index 0c573e973f1e..ee16f1690e08 100644 --- a/sc/source/filter/excel/xetable.cxx +++ b/sc/source/filter/excel/xetable.cxx @@ -2382,9 +2382,11 @@ XclExpRow& XclExpRowBuffer::GetOrCreateRow( sal_uInt32 nXclRow, bool bRowAlwaysE if( !bFound || bFoundHigher ) { size_t nFrom = 0; + RowRef pPrevEntry = nullptr; if( itr != maRowMap.begin() ) { --itr; + pPrevEntry = itr->second; if( bFoundHigher ) nFrom = nXclRow; else @@ -2404,10 +2406,10 @@ XclExpRow& XclExpRowBuffer::GetOrCreateRow( sal_uInt32 nXclRow, bool bRowAlwaysE // not set, to correctly export the heights of rows with wrapped // texts. const sal_uInt16 nHeight = rDoc.GetRowHeight(nFrom, nScTab, false); - if ( !nFrom || ( nFrom == nXclRow ) || bHidden || + if ( !pPrevEntry || ( nFrom == nXclRow ) || bHidden || ( maOutlineBfr.IsCollapsed() ) || ( maOutlineBfr.GetLevel() != 0 ) || - ( nHeight != rDoc.GetRowHeight(nFrom - 1, nScTab, false) ) ) + ( nHeight != pPrevEntry->GetHeight() ) ) { if( maOutlineBfr.GetLevel() > mnHighestOutlineLevel ) { @@ -2415,6 +2417,7 @@ XclExpRow& XclExpRowBuffer::GetOrCreateRow( sal_uInt32 nXclRow, bool bRowAlwaysE } RowRef p(new XclExpRow(GetRoot(), nFrom, maOutlineBfr, bRowAlwaysEmpty, bHidden, nHeight)); maRowMap.insert(RowMap::value_type(nFrom, p)); + pPrevEntry = p; } ++nFrom; } |