summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2017-02-08 19:32:14 +0300
committerBartosz Kosiorek <gang65@poczta.onet.pl>2017-02-15 16:01:30 +0000
commitdccb8131161ebf7487c3e7fee41fb30aad37118a (patch)
treed9fe05e71a3c33df39027a5e9a17df9d0eaf6e83
parent854bae75ab891423182f11604aedc42c6bfa334e (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> Reviewed-on: https://gerrit.libreoffice.org/34276 Tested-by: Jenkins <ci@libreoffice.org>
-rw-r--r--sc/source/filter/excel/xetable.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx
index 9f8eec1c4294..b954c7422330 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;
}