diff options
author | Thomas Arnhold <thomas@arnhold.org> | 2012-01-10 16:00:18 +0100 |
---|---|---|
committer | Thomas Arnhold <thomas@arnhold.org> | 2012-01-10 16:52:33 +0100 |
commit | 2c3d0ff9f83aab89980529da2aa3837390b84ef7 (patch) | |
tree | a7ff1a3e2271c219b29c4ab3a4e54411c22ed20c /svx/source | |
parent | a2dd79d14ee2e76e3b6c13f2880706292ea90c26 (diff) |
Use SAL_N_ELEMENTS
Some more like Thorstens diff 9c59cd15b150638c845bbc275b9b04460afc23bd
Done with some regex magic (and a check if this var is an array):
s/sizeof\(\s*$var\s*\)\s*\/\s*sizeof\(\s*\*$var\s*/SAL_N_ELEMENTS\($var/gs
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/dialog/linkwarn.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdotext.cxx | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/svx/source/dialog/linkwarn.cxx b/svx/source/dialog/linkwarn.cxx index 5beecf0c3172..6bc3a1b21fbd 100644 --- a/svx/source/dialog/linkwarn.cxx +++ b/svx/source/dialog/linkwarn.cxx @@ -114,7 +114,7 @@ void SvxLinkWarningDialog::InitSize() &m_aLinkGraphicBtn, &m_aEmbedGraphicBtn, &m_aOptionLine, &m_aWarningOnBox }; Window** pCurrent = pWins; - for ( sal_uInt32 i = 0; i < sizeof(pWins) / sizeof(*pWins); ++i, ++pCurrent ) + for ( sal_uInt32 i = 0; i < SAL_N_ELEMENTS(pWins); ++i, ++pCurrent ) { Point aNewPos = (*pCurrent)->GetPosPixel(); aNewPos.Y() -= nDelta; diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 620b67736c51..e43b160cc81b 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1281,7 +1281,7 @@ void SdrTextObj::ImpAutoFitText( SdrOutliner& rOutliner, const Size& rTextSize, // loop early-exits if we detect an already attained value sal_uInt16 nMinStretchX=0, nMinStretchY=0; sal_uInt16 aOldStretchXVals[]={0,0,0,0,0,0,0,0,0,0}; - const size_t aStretchArySize=sizeof(aOldStretchXVals)/sizeof(*aOldStretchXVals); + const size_t aStretchArySize=SAL_N_ELEMENTS(aOldStretchXVals); for(unsigned int i=0; i<aStretchArySize; ++i) { const Size aCurrTextSize = rOutliner.CalcTextSizeNTP(); |