From b7c82daa28526c566047e158ab2ace522fc442dc Mon Sep 17 00:00:00 2001 From: Kayo Hamid Date: Thu, 14 Oct 2010 21:14:52 +0100 Subject: Switch to use SAL_N_ELEMENTS macro, everywhere --- uui/source/masterpasscrtdlg.cxx | 6 +++--- uui/source/passcrtdlg.cxx | 2 +- uui/source/passworddlg.cxx | 2 +- uui/source/secmacrowarnings.cxx | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'uui') diff --git a/uui/source/masterpasscrtdlg.cxx b/uui/source/masterpasscrtdlg.cxx index 9d027f89ffbc..c96e319fb5fe 100644 --- a/uui/source/masterpasscrtdlg.cxx +++ b/uui/source/masterpasscrtdlg.cxx @@ -126,7 +126,7 @@ MasterPasswordCreateDialog::MasterPasswordCreateDialog aFTMasterPasswordWarning.SetPosSizePixel( aFTMasterPasswordWarning.GetPosPixel(), aNewWarningSize ); Window* pControls[] = { &aFL, &aOKBtn, &aCancelBtn, &aHelpBtn }; - const sal_Int32 nCCount = sizeof( pControls ) / sizeof( pControls[0] ); + const sal_Int32 nCCount = SAL_N_ELEMENTS( pControls ); for ( int i = 0; i < nCCount; ++i ) { Point aNewPos =(*pControls[i]).GetPosPixel(); @@ -149,7 +149,7 @@ void MasterPasswordCreateDialog::CalculateTextHeight() &aFTMasterPasswordRepeat, &aEDMasterPasswordRepeat, &aFTCautionText, &aFLCautionText, &aOKBtn, &aCancelBtn, &aHelpBtn }; Window** pWindow = pWins; - const sal_Int32 nCount = sizeof( pWins ) / sizeof( pWins[0] ); + const sal_Int32 nCount = SAL_N_ELEMENTS( pWins ); for ( sal_Int32 i = 0; i < nCount; ++i, ++pWindow ) { Point aNewPos = (*pWindow)->GetPosPixel(); @@ -168,7 +168,7 @@ void MasterPasswordCreateDialog::CalculateTextHeight() nDelta += nTemp; Window* pWins[] = { &aFLCautionText, &aOKBtn, &aCancelBtn, &aHelpBtn }; Window** pWindow = pWins; - const sal_Int32 nCount = sizeof( pWins ) / sizeof( pWins[0] ); + const sal_Int32 nCount = SAL_N_ELEMENTS( pWins ); for ( sal_Int32 i = 0; i < nCount; ++i, ++pWindow ) { Point aNewPos = (*pWindow)->GetPosPixel(); diff --git a/uui/source/passcrtdlg.cxx b/uui/source/passcrtdlg.cxx index 843d3bf15263..77b14f3bf38f 100644 --- a/uui/source/passcrtdlg.cxx +++ b/uui/source/passcrtdlg.cxx @@ -115,7 +115,7 @@ PasswordCreateDialog::PasswordCreateDialog( Window* _pParent, ResMgr * pResMgr, aFTWarning.SetPosSizePixel( aFTWarning.GetPosPixel(), aNewWarningSize ); Window* pControls[] = { &aFixedLine1, &aOKBtn, &aCancelBtn, &aHelpBtn }; - const sal_Int32 nCCount = sizeof( pControls ) / sizeof( pControls[0] ); + const sal_Int32 nCCount = SAL_N_ELEMENTS( pControls ); for ( int i = 0; i < nCCount; ++i ) { Point aNewPos =(*pControls[i]).GetPosPixel(); diff --git a/uui/source/passworddlg.cxx b/uui/source/passworddlg.cxx index 34d886ca2e26..bb81e612e086 100644 --- a/uui/source/passworddlg.cxx +++ b/uui/source/passworddlg.cxx @@ -103,7 +103,7 @@ PasswordDialog::PasswordDialog( aFTPassword.SetPosSizePixel( aFTPassword.GetPosPixel(), aNewLabelSize ); Window* pControls[] = { &aEDPassword, &aFixedLine1, &aOKBtn, &aCancelBtn, &aHelpBtn }; - const sal_Int32 nCCount = sizeof( pControls ) / sizeof( pControls[0] ); + const sal_Int32 nCCount = SAL_N_ELEMENTS( pControls ); for ( int i = 0; i < nCCount; ++i ) { Point aNewPos =(*pControls[i]).GetPosPixel(); diff --git a/uui/source/secmacrowarnings.cxx b/uui/source/secmacrowarnings.cxx index e384dc7dfabc..6447cc20526e 100644 --- a/uui/source/secmacrowarnings.cxx +++ b/uui/source/secmacrowarnings.cxx @@ -225,7 +225,7 @@ void MacroWarning::InitControls() &maBottomSepFL, &maEnableBtn, &maDisableBtn, &maHelpBtn }; 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; @@ -323,7 +323,7 @@ void MacroWarning::FitControls() &maDescr2FI, &maAlwaysTrustCB, &maBottomSepFL, &maEnableBtn, &maDisableBtn, &maHelpBtn }; 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; -- cgit