summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-07-16 16:44:43 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-07-16 16:44:43 +0200
commitde9c6a7829b08968491c8b57b5bd4f182e5e873e (patch)
tree76b9748b7981af7d60e231b4baf2eb6deef38536
parent7a6d40a99b44f7693d054ca25f2ba2327c64767c (diff)
Revert "fix excel row height export problems ( I hope ) fdo#50304"
This reverts commit 9746c6de3a05fe9284d6d6bb2f636bfe912733cd. Signed-off-by: Kohei Yoshida <kohei.yoshida@gmail.com> Signed-off-by: Eike Rathke <erack@redhat.com>
-rw-r--r--sc/source/filter/excel/xetable.cxx53
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;
}