summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-08-27 01:59:35 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-08-27 02:00:41 +0200
commit1932c3ce0c498afed30d28efc88d820dcb4553a2 (patch)
treec1e97e5406494c6093b7b9b03f67e5849407d759 /sc/source
parent888a4519c30bed7ca9896f367d5d48fae96bae2d (diff)
don't use macro here
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/table1.cxx28
1 files changed, 15 insertions, 13 deletions
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);