Kaydet (Commit) 86ff0df3 authored tarafından Justin Luth's avatar Justin Luth Kaydeden (comit) Bartosz Kosiorek

Optimize Excel GetOrCreateRow: compare to previous map entry

Follow-up patch to 09e9274f 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/34039Reviewed-by: 's avatarJustin Luth <justin_luth@sil.org>
Tested-by: 's avatarJustin Luth <justin_luth@sil.org>
Reviewed-by: 's avatarBartosz Kosiorek <gang65@poczta.onet.pl>
üst 4f4edde0
......@@ -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;
}
......
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