summaryrefslogtreecommitdiff
path: root/sfx2/source/dialog
diff options
context:
space:
mode:
authorKayo Hamid <revol.code@yahoo.com>2010-10-14 21:14:52 +0100
committerMichael Meeks <michael.meeks@novell.com>2010-10-14 21:15:24 +0100
commitb7c82daa28526c566047e158ab2ace522fc442dc (patch)
treec71f33ee622add8de9013a170a7463ed564ad6e8 /sfx2/source/dialog
parent1b0c6da1c3bcc6a9c1412d221d029885f9998fa1 (diff)
Switch to use SAL_N_ELEMENTS macro, everywhere
Diffstat (limited to 'sfx2/source/dialog')
-rw-r--r--sfx2/source/dialog/alienwarn.cxx2
-rw-r--r--sfx2/source/dialog/printopt.cxx6
2 files changed, 3 insertions, 5 deletions
diff --git a/sfx2/source/dialog/alienwarn.cxx b/sfx2/source/dialog/alienwarn.cxx
index 571a056f3070..09aebb25949e 100644
--- a/sfx2/source/dialog/alienwarn.cxx
+++ b/sfx2/source/dialog/alienwarn.cxx
@@ -144,7 +144,7 @@ void SfxAlienWarningDialog::InitSize()
&m_aSaveODFBtn, &m_aKeepCurrentBtn, &m_aMoreInfoBtn, &m_aOptionLine, &m_aWarningOnBox
};
Window** pCurrent = pWins;
- for ( sal_uInt32 i = 0; i < sizeof( pWins ) / sizeof( pWins[ 0 ] ); ++i, ++pCurrent )
+ for ( sal_uInt32 i = 0; i < SAL_N_ELEMENTS( pWins ); ++i, ++pCurrent )
{
Point aNewPos = (*pCurrent)->GetPosPixel();
aNewPos.Y() -= nDelta;
diff --git a/sfx2/source/dialog/printopt.cxx b/sfx2/source/dialog/printopt.cxx
index 45a3aa287ddc..7e3a2e8b02dd 100644
--- a/sfx2/source/dialog/printopt.cxx
+++ b/sfx2/source/dialog/printopt.cxx
@@ -44,8 +44,6 @@
static USHORT aDPIArray[] = { 72, 96, 150, 200, 300, 600 };
static BOOL bOutputForPrinter = TRUE;
-#define DPI_COUNT (sizeof(aDPIArray)/sizeof(aDPIArray[0 ]))
-
SfxCommonPrintOptionsTabPage::SfxCommonPrintOptionsTabPage( Window* pParent, const SfxItemSet& rSet ) :
SfxTabPage( pParent, SfxResId( TP_COMMONPRINTOPTIONS ), rSet ),
@@ -233,7 +231,7 @@ void SfxCommonPrintOptionsTabPage::ImplUpdateControls( const PrinterOptions* pCu
aReduceBitmapsResolutionLB.SelectEntryPos( 0 );
else
{
- for( long i = ( DPI_COUNT - 1 ); i >= 0; i-- )
+ for( long i = ( SAL_N_ELEMENTS(aDPIArray) - 1 ); i >= 0; i-- )
{
if( nDPI >= aDPIArray[ i ] )
{
@@ -362,7 +360,7 @@ void SfxCommonPrintOptionsTabPage::ImplSaveControls( PrinterOptions* pCurrentOpt
pCurrentOptions->SetReducedBitmapMode( aReduceBitmapsOptimalRB.IsChecked() ? PRINTER_BITMAP_OPTIMAL :
( aReduceBitmapsNormalRB.IsChecked() ? PRINTER_BITMAP_NORMAL : PRINTER_BITMAP_RESOLUTION ) );
pCurrentOptions->SetReducedBitmapResolution( aDPIArray[ Min( (USHORT) aReduceBitmapsResolutionLB.GetSelectEntryPos(),
- (USHORT)( sizeof( aDPIArray ) / sizeof( aDPIArray[ 0 ] ) - 1 ) ) ] );
+ (USHORT)( SAL_N_ELEMENTS( aDPIArray ) - 1 ) ) ] );
pCurrentOptions->SetReducedBitmapIncludesTransparency( aReduceBitmapsTransparencyCB.IsChecked() );
pCurrentOptions->SetConvertToGreyscales( aConvertToGreyscalesCB.IsChecked() );
}