diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2016-03-29 10:25:17 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-03-31 11:30:36 +0200 |
commit | 6439005484bdf6754b910b1ce025b3fb33b6623f (patch) | |
tree | 1a00f48ae11d3da3d928f2d3d68b3e299216328c /sfx2 | |
parent | 1aa4df615fa5599d05e9dd5e925b5852676185fa (diff) |
use SAL_N_ELEMENTS more widely
found using
git grep -n 'sizeof.*/.*sizeof.*[0]'
Change-Id: Icd4a6cc1ca8ec8ebd68e1701a02789c74cf0eb2a
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/dialog/printopt.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sfx2/source/dialog/printopt.cxx b/sfx2/source/dialog/printopt.cxx index e68ab4cd6827..9ae649655c24 100644 --- a/sfx2/source/dialog/printopt.cxx +++ b/sfx2/source/dialog/printopt.cxx @@ -34,7 +34,7 @@ static sal_uInt16 aDPIArray[] = { 72, 96, 150, 200, 300, 600 }; static bool bOutputForPrinter = true; -#define DPI_COUNT (sizeof(aDPIArray)/sizeof(aDPIArray[0 ])) +#define DPI_COUNT SAL_N_ELEMENTS(aDPIArray) SfxCommonPrintOptionsTabPage::SfxCommonPrintOptionsTabPage( vcl::Window* pParent, const SfxItemSet& rSet ) : SfxTabPage(pParent, "OptPrintPage", "sfx/ui/optprintpage.ui", &rSet) @@ -257,8 +257,8 @@ void SfxCommonPrintOptionsTabPage::ImplSaveControls( PrinterOptions* pCurrentOpt pCurrentOptions->SetReduceBitmaps( m_pReduceBitmapsCB->IsChecked() ); pCurrentOptions->SetReducedBitmapMode( m_pReduceBitmapsOptimalRB->IsChecked() ? PRINTER_BITMAP_OPTIMAL : ( m_pReduceBitmapsNormalRB->IsChecked() ? PRINTER_BITMAP_NORMAL : PRINTER_BITMAP_RESOLUTION ) ); - pCurrentOptions->SetReducedBitmapResolution( aDPIArray[ std::min( (sal_uInt16) m_pReduceBitmapsResolutionLB->GetSelectEntryPos(), - (sal_uInt16)( (sizeof (aDPIArray) / sizeof (aDPIArray[0])) - 1 ) ) ] ); + pCurrentOptions->SetReducedBitmapResolution( aDPIArray[ std::min<sal_uInt16>( m_pReduceBitmapsResolutionLB->GetSelectEntryPos(), + SAL_N_ELEMENTS(aDPIArray) - 1 ) ] ); pCurrentOptions->SetReducedBitmapIncludesTransparency( m_pReduceBitmapsTransparencyCB->IsChecked() ); pCurrentOptions->SetConvertToGreyscales( m_pConvertToGreyscalesCB->IsChecked() ); bool bOrigBackEnd = pCurrentOptions->IsPDFAsStandardPrintJobFormat(); |