diff options
author | Noel Power <noel.power@novell.com> | 2012-07-24 19:49:49 +0100 |
---|---|---|
committer | Noel Power <noel.power@novell.com> | 2012-07-25 18:26:07 +0100 |
commit | cad1ab1f12b01aa0b364697aa63ee2fb73b96dd2 (patch) | |
tree | decbfeda1d47505f90215571a945e630a1f20153 | |
parent | ce53472216cab75bfdf04799fb85f375f01af792 (diff) |
Revert "fix excel row height export problems ( I hope ) fdo#50304"
This reverts commit 9746c6de3a05fe9284d6d6bb2f636bfe912733cd.
-rw-r--r-- | sc/source/filter/excel/xetable.cxx | 53 |
1 files changed, 15 insertions, 38 deletions
diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx index 69db2be39527..e3967f2bc561 100644 --- a/sc/source/filter/excel/xetable.cxx +++ b/sc/source/filter/excel/xetable.cxx @@ -2029,41 +2029,22 @@ 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 - bool bSearchExisting = ( maRowMap.size() >= ( GetMaxPos().Row() - maRowMap.size() ) ); - if ( bSearchExisting ) - { - for (itr = itrBeg; itr != itrEnd; ++itr) - { - const RowRef& rRow = itr->second; - if (rRow->IsDefaultable()) - { - XclExpDefaultRowData aDefData( *rRow ); - size_t& rnDefCount = aDefRowMap[ aDefData ]; - ++rnDefCount; - if( rnDefCount > nMaxDefCount ) - { - nMaxDefCount = rnDefCount; - aMaxDefData = aDefData; - } - } - } - } - else + for (itr = itrBeg; itr != itrEnd; ++itr) { - // find a suitable unused row to get the default height from, - // searching backwards from max row - for ( SCROW nRow = GetMaxPos().Row(); nRow >= 0; --nRow ) + const RowRef& rRow = itr->second; + if (rRow->IsDefaultable()) { - if ( maRowMap.find( nRow ) == maRowMap.end() ) + XclExpDefaultRowData aDefData( *rRow ); + size_t& rnDefCount = aDefRowMap[ aDefData ]; + ++rnDefCount; + if( rnDefCount > nMaxDefCount ) { - // use first encountered unused row height as default - // I wonder should we do this always ( and abandon the search - // of exising rows ) - aMaxDefData.mnHeight = GetDoc().GetRowHeight(nRow, GetCurrScTab(), false); - break; + nMaxDefCount = rnDefCount; + aMaxDefData = aDefData; } } } + // return the default row format to caller rDefRowData = aMaxDefData; @@ -2165,17 +2146,13 @@ XclExpDimensions* XclExpRowBuffer::GetDimensions() XclExpRow& XclExpRowBuffer::GetOrCreateRow( sal_uInt32 nXclRow, bool bRowAlwaysEmpty ) { - RowMap::iterator itr = maRowMap.begin(); - for ( size_t nFrom = maRowMap.size(); nFrom <= nXclRow; ++nFrom ) + RowMap::iterator itr = maRowMap.find(nXclRow); + if (itr == maRowMap.end()) { - itr = maRowMap.find(nFrom); - if ( itr == maRowMap.end() ) - { - RowRef p(new XclExpRow(GetRoot(), nFrom, maOutlineBfr, bRowAlwaysEmpty)); - maRowMap.insert(RowMap::value_type(nFrom, p)); - } + RowRef p(new XclExpRow(GetRoot(), nXclRow, maOutlineBfr, bRowAlwaysEmpty)); + ::std::pair<RowMap::iterator, bool> r = maRowMap.insert(RowMap::value_type(nXclRow, p)); + itr = r.first; } - itr = maRowMap.find(nXclRow); return *itr->second; } |