diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2015-02-06 01:31:49 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-02-19 01:06:02 +0100 |
commit | 3488d0a42f6a09723f5fd3fb972b0e778b26f8b3 (patch) | |
tree | 5d62c24d1cf9e9dca8b85521ed511fe2faf20a6c /sc | |
parent | 418b0d39c3a15d642b87dd24c40a91d887426086 (diff) |
make the code easier to read
Change-Id: I8cdfe1cddf57a36054bfe850173ef6130aa608b5
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/oox/sheetdatabuffer.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sc/source/filter/oox/sheetdatabuffer.cxx b/sc/source/filter/oox/sheetdatabuffer.cxx index d27061ce8c97..c6df96f9c329 100644 --- a/sc/source/filter/oox/sheetdatabuffer.cxx +++ b/sc/source/filter/oox/sheetdatabuffer.cxx @@ -333,12 +333,14 @@ void SheetDataBuffer::setStandardNumFmt( const CellAddress& rCellAddr, sal_Int16 } } -void addIfNotInMyMap( StylesBuffer& rStyles, std::map< std::pair< sal_Int32, sal_Int32 >, ApiCellRangeList >& rMap, sal_Int32 nXfId, sal_Int32 nFormatId, const ApiCellRangeList& rRangeList ) +typedef std::pair<sal_Int32, sal_Int32> FormatKeyPair; + +void addIfNotInMyMap( StylesBuffer& rStyles, std::map< FormatKeyPair, ApiCellRangeList >& rMap, sal_Int32 nXfId, sal_Int32 nFormatId, const ApiCellRangeList& rRangeList ) { Xf* pXf1 = rStyles.getCellXf( nXfId ).get(); if ( pXf1 ) { - for ( std::map< std::pair< sal_Int32, sal_Int32 >, ApiCellRangeList >::iterator it = rMap.begin(), it_end = rMap.end(); it != it_end; ++it ) + for ( std::map< FormatKeyPair, ApiCellRangeList >::iterator it = rMap.begin(), it_end = rMap.end(); it != it_end; ++it ) { if ( it->first.second == nFormatId ) { @@ -353,7 +355,7 @@ void addIfNotInMyMap( StylesBuffer& rStyles, std::map< std::pair< sal_Int32, sal } } } - rMap[ std::pair<sal_Int32, sal_Int32>( nXfId, nFormatId ) ] = rRangeList; + rMap[ FormatKeyPair( nXfId, nFormatId ) ] = rRangeList; } } @@ -433,13 +435,13 @@ void SheetDataBuffer::finalizeImport() // write default formatting of remaining row range maXfIdRowRangeList[ maXfIdRowRange.mnXfId ].push_back( maXfIdRowRange.maRowRange ); - std::map< std::pair< sal_Int32, sal_Int32 >, ApiCellRangeList > rangeStyleListMap; + std::map< FormatKeyPair, ApiCellRangeList > rangeStyleListMap; for( XfIdRangeListMap::const_iterator aIt = maXfIdRangeLists.begin(), aEnd = maXfIdRangeLists.end(); aIt != aEnd; ++aIt ) { addIfNotInMyMap( getStyles(), rangeStyleListMap, aIt->first.first, aIt->first.second, aIt->second ); } // gather all ranges that have the same style and apply them in bulk - for ( std::map< std::pair< sal_Int32, sal_Int32 >, ApiCellRangeList >::iterator it = rangeStyleListMap.begin(), it_end = rangeStyleListMap.end(); it != it_end; ++it ) + for ( std::map< FormatKeyPair, ApiCellRangeList >::iterator it = rangeStyleListMap.begin(), it_end = rangeStyleListMap.end(); it != it_end; ++it ) { const ApiCellRangeList& rRanges( it->second ); for ( ::std::vector< CellRangeAddress >::const_iterator it_range = rRanges.begin(), it_rangeend = rRanges.end(); it_range!=it_rangeend; ++it_range ) |