[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - sc/source
Justin Luth
justin_luth at sil.org
Wed Feb 15 16:01:50 UTC 2017
sc/source/filter/excel/xetable.cxx | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
New commits:
commit dccb8131161ebf7487c3e7fee41fb30aad37118a
Author: Justin Luth <justin_luth at 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_luth at sil.org>
Tested-by: Justin Luth <justin_luth at sil.org>
Reviewed-by: Bartosz Kosiorek <gang65 at poczta.onet.pl>
Reviewed-on: https://gerrit.libreoffice.org/34276
Tested-by: Jenkins <ci at 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;
}
More information about the Libreoffice-commits
mailing list