sc/source/filter/excel/xetable.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
New commits: commit dccb8131161ebf7487c3e7fee41fb30aad37118a Author: Justin Luth <justin_l...@sil.org> Date: Wed Feb 8 19:32:14 2017 +0300 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_l...@sil.org> Tested-by: Justin Luth <justin_l...@sil.org> Reviewed-by: Bartosz Kosiorek <gan...@poczta.onet.pl> Reviewed-on: https://gerrit.libreoffice.org/34276 Tested-by: Jenkins <c...@libreoffice.org> diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx index 9f8eec1..b954c74 100644 --- a/sc/source/filter/excel/xetable.cxx +++ b/sc/source/filter/excel/xetable.cxx @@ -2381,9 +2381,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 @@ -2403,10 +2405,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 ) { @@ -2414,6 +2416,7 @@ XclExpRow& XclExpRowBuffer::GetOrCreateRow( sal_uInt32 nXclRow, bool bRowAlwaysE } RowRef p(new XclExpRow(GetRoot(), nFrom, maOutlineBfr, bRowAlwaysEmpty)); maRowMap.insert(RowMap::value_type(nFrom, p)); + pPrevEntry = p; } ++nFrom; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits