summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2016-12-08 00:14:13 +0100
committerEike Rathke <erack@redhat.com>2016-12-08 00:34:23 +0100
commitf5bca308c910c4486b2e5c8f67f628ae8e9c2457 (patch)
tree773841cd86daa8a89dcc3502df227f8936768b0a
parentd10f2e5e6d2ae2492d6d80a0cb40455d6d130ea4 (diff)
sc-perf: call RowHidden() only once, tdf#98106 follow-up
Though it was only called twice if no other condition led to the row being added, but at least once anyway, so we can call it beforehand. Change-Id: Iff8dfa926b840d58b92ffec296febe4c2da8e5a9
-rw-r--r--sc/source/filter/excel/xetable.cxx11
-rw-r--r--sc/source/filter/inc/xetable.hxx2
2 files changed, 6 insertions, 7 deletions
diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx
index 37470f52bad0..9cb15b458cd5 100644
--- a/sc/source/filter/excel/xetable.cxx
+++ b/sc/source/filter/excel/xetable.cxx
@@ -1844,7 +1844,7 @@ void XclExpDefrowheight::WriteBody( XclExpStream& rStrm )
}
XclExpRow::XclExpRow( const XclExpRoot& rRoot, sal_uInt32 nXclRow,
- XclExpRowOutlineBuffer& rOutlineBfr, bool bAlwaysEmpty ) :
+ XclExpRowOutlineBuffer& rOutlineBfr, bool bAlwaysEmpty, bool bHidden ) :
XclExpRecord( EXC_ID3_ROW, 16 ),
XclExpRoot( rRoot ),
mnXclRow( nXclRow ),
@@ -1864,7 +1864,6 @@ XclExpRow::XclExpRow( const XclExpRoot& rRoot, sal_uInt32 nXclRow,
CRFlags nRowFlags = GetDoc().GetRowFlags( nScRow, nScTab );
bool bUserHeight( nRowFlags & CRFlags::ManualSize );
- bool bHidden = GetDoc().RowHidden(nScRow, nScTab);
::set_flag( mnFlags, EXC_ROW_UNSYNCED, bUserHeight );
::set_flag( mnFlags, EXC_ROW_HIDDEN, bHidden );
@@ -2394,17 +2393,17 @@ XclExpRow& XclExpRowBuffer::GetOrCreateRow( sal_uInt32 nXclRow, bool bRowAlwaysE
// only create RowMap entries if it is first row in spreadsheet,
// if it is the desired row, for rows that height differ from previous,
// if row is collapsed, has outline level (tdf#100347), or row is hidden (tdf#98106).
- if ( !nFrom || ( nFrom == nXclRow ) ||
+ bool bHidden = rDoc.RowHidden(nFrom, nScTab);
+ if ( !nFrom || ( nFrom == nXclRow ) || bHidden ||
( rDoc.GetRowHeight(nFrom, nScTab, false) != rDoc.GetRowHeight(nFrom - 1, nScTab, false) ) ||
( maOutlineBfr.IsCollapsed() ) ||
- ( maOutlineBfr.GetLevel() != 0 ) ||
- ( rDoc.RowHidden(nFrom, nScTab) ) )
+ ( maOutlineBfr.GetLevel() != 0 ) )
{
if( maOutlineBfr.GetLevel() > mnHighestOutlineLevel )
{
mnHighestOutlineLevel = maOutlineBfr.GetLevel();
}
- RowRef p(new XclExpRow(GetRoot(), nFrom, maOutlineBfr, bRowAlwaysEmpty));
+ RowRef p(new XclExpRow(GetRoot(), nFrom, maOutlineBfr, bRowAlwaysEmpty, bHidden));
maRowMap.insert(RowMap::value_type(nFrom, p));
}
}
diff --git a/sc/source/filter/inc/xetable.hxx b/sc/source/filter/inc/xetable.hxx
index 16894b69f4a1..2324b1124ba1 100644
--- a/sc/source/filter/inc/xetable.hxx
+++ b/sc/source/filter/inc/xetable.hxx
@@ -836,7 +836,7 @@ public:
@param bAlwaysEmpty true = This row will not be filled with blank cells
in the Finalize() function. */
explicit XclExpRow( const XclExpRoot& rRoot, sal_uInt32 nXclRow,
- XclExpRowOutlineBuffer& rOutlineBfr, bool bAlwaysEmpty );
+ XclExpRowOutlineBuffer& rOutlineBfr, bool bAlwaysEmpty, bool bHidden );
/** Returns the excel row index of this ROW record. */
inline sal_uInt32 GetXclRow() const { return mnXclRow; }