summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-11-05 12:24:35 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-11-06 07:46:11 +0100
commit97ebc98f0e956712d242e13f15531742f844a738 (patch)
treef8f59969604c4cac28a3efba17c4c281752fa62f /sc
parent4b363760b9f196e139ee367d54252c4d6cbe25f3 (diff)
convert some macros to local functions
Change-Id: If2c89f0f53615f6200b6cd1fb6267cc9b47df927 Reviewed-on: https://gerrit.libreoffice.org/62884 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/attarray.cxx51
1 files changed, 26 insertions, 25 deletions
diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx
index 16201a96b22b..7df620731bb1 100644
--- a/sc/source/core/data/attarray.cxx
+++ b/sc/source/core/data/attarray.cxx
@@ -697,19 +697,23 @@ void ScAttrArray::ApplyStyleArea( SCROW nStartRow, SCROW nEndRow, const ScStyleS
}
// const cast, otherwise it will be too inefficient/complicated
-#define SET_LINECOLOR(dest,c) \
- if ((dest)) \
- { \
- const_cast<SvxBorderLine*>(dest)->SetColor((c)); \
+static void SetLineColor(SvxBorderLine const * dest, Color c)
+{
+ if (dest)
+ {
+ const_cast<SvxBorderLine*>(dest)->SetColor(c);
}
+}
-#define SET_LINE(dest,src) \
- if ((dest)) \
- { \
- SvxBorderLine* pCast = const_cast<SvxBorderLine*>(dest); \
- pCast->SetBorderLineStyle( (src)->GetBorderLineStyle() ); \
- pCast->SetWidth( (src)->GetWidth( ) ); \
+static void SetLine(const SvxBorderLine* dest, const SvxBorderLine* src)
+{
+ if (dest)
+ {
+ SvxBorderLine* pCast = const_cast<SvxBorderLine*>(dest);
+ pCast->SetBorderLineStyle( src->GetBorderLineStyle() );
+ pCast->SetWidth( src->GetWidth() );
}
+}
void ScAttrArray::ApplyLineStyleArea( SCROW nStartRow, SCROW nEndRow,
const SvxBorderLine* pLine, bool bColorOnly )
@@ -773,29 +777,29 @@ void ScAttrArray::ApplyLineStyleArea( SCROW nStartRow, SCROW nEndRow,
Color aColor( pLine->GetColor() );
if( pNewBoxItem )
{
- SET_LINECOLOR( pNewBoxItem->GetTop(), aColor );
- SET_LINECOLOR( pNewBoxItem->GetBottom(), aColor );
- SET_LINECOLOR( pNewBoxItem->GetLeft(), aColor );
- SET_LINECOLOR( pNewBoxItem->GetRight(), aColor );
+ SetLineColor( pNewBoxItem->GetTop(), aColor );
+ SetLineColor( pNewBoxItem->GetBottom(), aColor );
+ SetLineColor( pNewBoxItem->GetLeft(), aColor );
+ SetLineColor( pNewBoxItem->GetRight(), aColor );
}
if( pNewTLBRItem )
- SET_LINECOLOR( pNewTLBRItem->GetLine(), aColor );
+ SetLineColor( pNewTLBRItem->GetLine(), aColor );
if( pNewBLTRItem )
- SET_LINECOLOR( pNewBLTRItem->GetLine(), aColor );
+ SetLineColor( pNewBLTRItem->GetLine(), aColor );
}
else
{
if( pNewBoxItem )
{
- SET_LINE( pNewBoxItem->GetTop(), pLine );
- SET_LINE( pNewBoxItem->GetBottom(), pLine );
- SET_LINE( pNewBoxItem->GetLeft(), pLine );
- SET_LINE( pNewBoxItem->GetRight(), pLine );
+ SetLine( pNewBoxItem->GetTop(), pLine );
+ SetLine( pNewBoxItem->GetBottom(), pLine );
+ SetLine( pNewBoxItem->GetLeft(), pLine );
+ SetLine( pNewBoxItem->GetRight(), pLine );
}
if( pNewTLBRItem )
- SET_LINE( pNewTLBRItem->GetLine(), pLine );
+ SetLine( pNewTLBRItem->GetLine(), pLine );
if( pNewBLTRItem )
- SET_LINE( pNewBLTRItem->GetLine(), pLine );
+ SetLine( pNewBLTRItem->GetLine(), pLine );
}
}
if( pNewBoxItem ) rNewSet.Put( *pNewBoxItem );
@@ -834,9 +838,6 @@ void ScAttrArray::ApplyLineStyleArea( SCROW nStartRow, SCROW nEndRow,
}
}
-#undef SET_LINECOLOR
-#undef SET_LINE
-
void ScAttrArray::ApplyCacheArea( SCROW nStartRow, SCROW nEndRow, SfxItemPoolCache* pCache, ScEditDataArray* pDataArray, bool* const pIsChanged )
{
#if DEBUG_SC_TESTATTRARRAY