diff options
Diffstat (limited to 'svx/source/gallery2')
-rw-r--r-- | svx/source/gallery2/galbrws2.cxx | 4 | ||||
-rw-r--r-- | svx/source/gallery2/galctrl.cxx | 8 | ||||
-rw-r--r-- | svx/source/gallery2/galmisc.cxx | 2 | ||||
-rw-r--r-- | svx/source/gallery2/galobj.cxx | 20 | ||||
-rw-r--r-- | svx/source/gallery2/galtheme.cxx | 2 |
5 files changed, 18 insertions, 18 deletions
diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx index ed027773324b..d713593d9bff 100644 --- a/svx/source/gallery2/galbrws2.cxx +++ b/svx/source/gallery2/galbrws2.cxx @@ -893,7 +893,7 @@ void GalleryBrowser2::ImplUpdateViews( sal_uInt16 nSelectionId ) for (sal_uInt32 i = 0, nCount = mpCurTheme->GetObjectCount(); i < nCount;) { mpListView->RowInserted( i++ ); - mpIconView->InsertItem( (sal_uInt16) i ); + mpIconView->InsertItem( static_cast<sal_uInt16>(i) ); } ImplSelectItemId( ( nSelectionId > mpCurTheme->GetObjectCount() ) ? mpCurTheme->GetObjectCount() : nSelectionId ); @@ -955,7 +955,7 @@ sal_uInt32 GalleryBrowser2::ImplGetSelectedItemId( const Point* pSelPos, Point& else { nRet = mpListView->FirstSelectedRow() + 1; - rSelPos = mpListView->GetFieldRectPixel( (sal_uInt16) nRet, 1 ).Center(); + rSelPos = mpListView->GetFieldRectPixel( static_cast<sal_uInt16>(nRet), 1 ).Center(); } } diff --git a/svx/source/gallery2/galctrl.cxx b/svx/source/gallery2/galctrl.cxx index dd84637954e7..4a9799c4a087 100644 --- a/svx/source/gallery2/galctrl.cxx +++ b/svx/source/gallery2/galctrl.cxx @@ -102,18 +102,18 @@ bool GalleryPreview::ImplGetGraphicCenterRect( const Graphic& rGraphic, tools::R if( aNewSize.Width() && aNewSize.Height() ) { // scale to fit window - const double fGrfWH = (double) aNewSize.Width() / aNewSize.Height(); - const double fWinWH = (double) aWinSize.Width() / aWinSize.Height(); + const double fGrfWH = static_cast<double>(aNewSize.Width()) / aNewSize.Height(); + const double fWinWH = static_cast<double>(aWinSize.Width()) / aWinSize.Height(); if ( fGrfWH < fWinWH ) { - aNewSize.Width() = (long) ( aWinSize.Height() * fGrfWH ); + aNewSize.Width() = static_cast<long>( aWinSize.Height() * fGrfWH ); aNewSize.Height()= aWinSize.Height(); } else { aNewSize.Width() = aWinSize.Width(); - aNewSize.Height()= (long) ( aWinSize.Width() / fGrfWH); + aNewSize.Height()= static_cast<long>( aWinSize.Width() / fGrfWH); } const Point aNewPos( ( aWinSize.Width() - aNewSize.Width() ) >> 1, diff --git a/svx/source/gallery2/galmisc.cxx b/svx/source/gallery2/galmisc.cxx index 2cd6376557c0..5681b1a7c487 100644 --- a/svx/source/gallery2/galmisc.cxx +++ b/svx/source/gallery2/galmisc.cxx @@ -372,7 +372,7 @@ GalleryProgress::~GalleryProgress() void GalleryProgress::Update( sal_Int32 nVal, sal_Int32 nMaxVal ) { if( mxProgressBar.is() && nMaxVal ) - mxProgressBar->setValue( std::min<sal_Int32>( (double) nVal / nMaxVal * GALLERY_PROGRESS_RANGE, + mxProgressBar->setValue( std::min<sal_Int32>( static_cast<double>(nVal) / nMaxVal * GALLERY_PROGRESS_RANGE, GALLERY_PROGRESS_RANGE ) ); } diff --git a/svx/source/gallery2/galobj.cxx b/svx/source/gallery2/galobj.cxx index 4bf26f7a13de..15810448ba84 100644 --- a/svx/source/gallery2/galobj.cxx +++ b/svx/source/gallery2/galobj.cxx @@ -75,8 +75,8 @@ BitmapEx SgaObject::createPreviewBitmapEx(const Size& rSizePixel) const if(!aRetval.IsEmpty()) { const Size aCurrentSizePixel(aRetval.GetSizePixel()); - const double fScaleX((double)rSizePixel.Width() / (double)aCurrentSizePixel.Width()); - const double fScaleY((double)rSizePixel.Height() / (double)aCurrentSizePixel.Height()); + const double fScaleX(static_cast<double>(rSizePixel.Width()) / static_cast<double>(aCurrentSizePixel.Width())); + const double fScaleY(static_cast<double>(rSizePixel.Height()) / static_cast<double>(aCurrentSizePixel.Height())); const double fScale(std::min(fScaleX, fScaleY)); // only scale when need to decrease, no need to make bigger as original. Also @@ -132,12 +132,12 @@ bool SgaObject::CreateThumb( const Graphic& rGraphic ) } else { - const float fFactor = (float) aBmpSize.Width() / aBmpSize.Height(); - const Size aNewSize( std::max( (long) (fFactor < 1. ? S_THUMB * fFactor : S_THUMB), 8L ), - std::max( (long) (fFactor < 1. ? S_THUMB : S_THUMB / fFactor), 8L ) ); + const float fFactor = static_cast<float>(aBmpSize.Width()) / aBmpSize.Height(); + const Size aNewSize( std::max( static_cast<long>(fFactor < 1. ? S_THUMB * fFactor : S_THUMB), 8L ), + std::max( static_cast<long>(fFactor < 1. ? S_THUMB : S_THUMB / fFactor), 8L ) ); if(aThumbBmp.Scale( - (double) aNewSize.Width() / aBmpSize.Width(), - (double) aNewSize.Height() / aBmpSize.Height(), + static_cast<double>(aNewSize.Width()) / aBmpSize.Width(), + static_cast<double>(aNewSize.Height()) / aBmpSize.Height(), BmpScaleFlag::BestQuality ) ) { aThumbBmp.Convert( BmpConversion::N8BitColors ); @@ -149,12 +149,12 @@ bool SgaObject::CreateThumb( const Graphic& rGraphic ) else if( rGraphic.GetType() == GraphicType::GdiMetafile ) { const Size aPrefSize( rGraphic.GetPrefSize() ); - const double fFactor = (double)aPrefSize.Width() / (double)aPrefSize.Height(); + const double fFactor = static_cast<double>(aPrefSize.Width()) / static_cast<double>(aPrefSize.Height()); Size aSize( S_THUMB, S_THUMB ); if ( fFactor < 1.0 ) - aSize.Width() = (sal_Int32)( S_THUMB * fFactor ); + aSize.Width() = static_cast<sal_Int32>( S_THUMB * fFactor ); else - aSize.Height() = (sal_Int32)( S_THUMB / fFactor ); + aSize.Height() = static_cast<sal_Int32>( S_THUMB / fFactor ); const GraphicConversionParameters aParameters(aSize, false, true, true /*TODO: extra ", true" post-#i121194#*/); aThumbBmp = rGraphic.GetBitmapEx(aParameters); diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx index 6e8b16c4ba1d..9c6cdf8dfbec 100644 --- a/svx/source/gallery2/galtheme.cxx +++ b/svx/source/gallery2/galtheme.cxx @@ -1352,7 +1352,7 @@ SvStream& GalleryTheme::WriteData( SvStream& rOStm ) const pCompat.reset(); // Fill the rest of the buffer. - const long nRest = std::max( 512L - ( (long) rOStm.Tell() - nReservePos ), 0L ); + const long nRest = std::max( 512L - ( static_cast<long>(rOStm.Tell()) - nReservePos ), 0L ); if( nRest ) { |