diff options
author | Bartosz Kosiorek <gang65@poczta.onet.pl> | 2016-06-17 16:21:06 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-06-22 23:04:47 +0000 |
commit | 228c25fd17727660a3372307e3f73dbcff5e71d2 (patch) | |
tree | 9ba8688e731c96677288236d1d3dacf4ba29aaae /sc/source/filter | |
parent | crashtesting: fix bmp->odg failure... (diff) | |
download | core-228c25fd17727660a3372307e3f73dbcff5e71d2.tar.gz core-228c25fd17727660a3372307e3f73dbcff5e71d2.zip |
tdf#98106 Preserving hidden and empty rows after xlsx export
Change-Id: I1ff2bab766eadac1dd5d483453af0e760634083d
Reviewed-on: https://gerrit.libreoffice.org/26421
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc/source/filter')
-rw-r--r-- | sc/source/filter/excel/xetable.cxx | 16 | ||||
-rw-r--r-- | sc/source/filter/inc/xetable.hxx | 2 |
2 files changed, 10 insertions, 8 deletions
diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx index f539b921d046..2b9d45a48d21 100644 --- a/sc/source/filter/excel/xetable.cxx +++ b/sc/source/filter/excel/xetable.cxx @@ -1993,15 +1993,14 @@ sal_uInt16 XclExpRow::GetFirstFreeXclCol() const bool XclExpRow::IsDefaultable() const { - const sal_uInt16 nAllowedFlags = EXC_ROW_DEFAULTFLAGS | EXC_ROW_HIDDEN | EXC_ROW_UNSYNCED; - return !::get_flag( mnFlags, static_cast< sal_uInt16 >( ~nAllowedFlags ) ) && IsEmpty(); + const sal_uInt16 nFlagsAlwaysMarkedAsDefault = EXC_ROW_DEFAULTFLAGS | EXC_ROW_UNSYNCED; + return !::get_flag( mnFlags, static_cast< sal_uInt16 >( ~nFlagsAlwaysMarkedAsDefault ) ) && IsEmpty(); } void XclExpRow::DisableIfDefault( const XclExpDefaultRowData& rDefRowData ) { mbEnabled = !IsDefaultable() || (mnHeight != rDefRowData.mnHeight) || - (IsHidden() != rDefRowData.IsHidden()) || (IsUnsynced() != rDefRowData.IsUnsynced()); } @@ -2172,6 +2171,7 @@ void XclExpRowBuffer::Finalize( XclExpDefaultRowData& rDefRowData, const ScfUInt XclExpDefaultRowData aMaxDefData; size_t nMaxDefCount = 0; // only look for default format in existing rows, if there are more than unused + // if the row is hidden, then row xml must be created even if it not contain cells XclExpRow* pPrev = nullptr; typedef std::vector< XclExpRow* > XclRepeatedRows; XclRepeatedRows aRepeated; @@ -2179,7 +2179,7 @@ void XclExpRowBuffer::Finalize( XclExpDefaultRowData& rDefRowData, const ScfUInt for (itr = itrBeg; itr != itrEnd; ++itr) { const RowRef& rRow = itr->second; - if (rRow->IsDefaultable()) + if ( rRow->IsDefaultable() ) { XclExpDefaultRowData aDefData( *rRow ); size_t& rnDefCount = aDefRowMap[ aDefData ]; @@ -2192,7 +2192,7 @@ void XclExpRowBuffer::Finalize( XclExpDefaultRowData& rDefRowData, const ScfUInt } if ( pPrev ) { - if ( pPrev->IsDefaultable()) + if ( pPrev->IsDefaultable() ) { // if the previous row we processed is not // defaultable then afaict the rows in between are @@ -2325,8 +2325,10 @@ XclExpRow& XclExpRowBuffer::GetOrCreateRow( sal_uInt32 nXclRow, bool bRowAlwaysE if ( itr == maRowMap.end() ) { // only create RowMap entries for rows that differ from previous, - // or if it is the desired row - if ( !nFrom || ( nFrom == nXclRow ) || ( nFrom && ( rDoc.GetRowHeight(nFrom, nScTab, false) != rDoc.GetRowHeight(nFrom-1, nScTab, false) ) ) ) + // the row is hidden (tdf#98106) or if it is the desired row + if ( !nFrom || ( nFrom == nXclRow ) || + ( rDoc.GetRowHeight(nFrom, nScTab, false) != rDoc.GetRowHeight(nFrom - 1, nScTab, false) ) || + ( rDoc.RowHidden(nFrom, nScTab) ) ) { RowRef p(new XclExpRow(GetRoot(), nFrom, maOutlineBfr, bRowAlwaysEmpty)); maRowMap.insert(RowMap::value_type(nFrom, p)); diff --git a/sc/source/filter/inc/xetable.hxx b/sc/source/filter/inc/xetable.hxx index 140c1526f130..7d8bc50a7af4 100644 --- a/sc/source/filter/inc/xetable.hxx +++ b/sc/source/filter/inc/xetable.hxx @@ -591,7 +591,7 @@ public: protected: /** Constructs the outline buffer. - @param bRows true = Process row ouline array; false = Process column outline array. */ + @param bRows true = Process row outline array; false = Process column outline array. */ explicit XclExpOutlineBuffer( const XclExpRoot& rRoot, bool bRows ); /** Updates the current state by processing the settings at the passed Calc position. */ |