From 1932c3ce0c498afed30d28efc88d820dcb4553a2 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard <markus.mohrhard@googlemail.com> Date: Sat, 27 Aug 2011 01:59:35 +0200 Subject: don't use macro here --- sc/source/core/data/table1.cxx | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'sc/source') diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index 770ff55d7778..c1bea2091f01 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -1679,6 +1679,19 @@ public: } }; +void setPrintRange(ScRange* pRange1, const ScRange* pRange2) +{ + if (pRange2) + { + if (pRange1) + *pRange1 = *pRange2; + else + pRange1 = new ScRange(*pRange2); + } + else + DELETEZ(pRange1); +} + } void ScTable::CopyPrintRange(const ScTable& rTable) @@ -1716,20 +1729,9 @@ void ScTable::DoColResize( SCCOL nCol1, SCCOL nCol2, SCSIZE nAdd ) aCol[nCol].Resize(aCol[nCol].GetCellCount() + nAdd); } -#define SET_PRINTRANGE( p1, p2 ) \ - if ( (p2) ) \ - { \ - if ( (p1) ) \ - *(p1) = *(p2); \ - else \ - (p1) = new ScRange( *(p2) ); \ - } \ - else \ - DELETEZ( (p1) ) - void ScTable::SetRepeatColRange( const ScRange* pNew ) { - SET_PRINTRANGE( pRepeatColRange, pNew ); + setPrintRange( pRepeatColRange, pNew ); if (IsStreamValid()) SetStreamValid(false); @@ -1739,7 +1741,7 @@ void ScTable::SetRepeatColRange( const ScRange* pNew ) void ScTable::SetRepeatRowRange( const ScRange* pNew ) { - SET_PRINTRANGE( pRepeatRowRange, pNew ); + setPrintRange( pRepeatRowRange, pNew ); if (IsStreamValid()) SetStreamValid(false); -- cgit