diff options
-rw-r--r-- | svx/source/stbctrls/zoomsliderctrl.cxx | 13 | ||||
-rw-r--r-- | sw/source/uibase/utlui/viewlayoutctrl.cxx | 18 |
2 files changed, 16 insertions, 15 deletions
diff --git a/svx/source/stbctrls/zoomsliderctrl.cxx b/svx/source/stbctrls/zoomsliderctrl.cxx index 8ea241bbdc82..dcb0c556f448 100644 --- a/svx/source/stbctrls/zoomsliderctrl.cxx +++ b/svx/source/stbctrls/zoomsliderctrl.cxx @@ -152,8 +152,8 @@ long SvxZoomSliderControl::Zoom2Offset( sal_uInt16 nCurrentZoom ) const return nRet; } -SvxZoomSliderControl::SvxZoomSliderControl( sal_uInt16 _nSlotId, sal_uInt16 _nId, StatusBar& _rStb ) : - SfxStatusBarControl( _nSlotId, _nId, _rStb ), +SvxZoomSliderControl::SvxZoomSliderControl( sal_uInt16 _nSlotId, sal_uInt16 _nId, StatusBar& rStatusBar ) : + SfxStatusBarControl( _nSlotId, _nId, rStatusBar ), mpImpl( new SvxZoomSliderControl_Impl ) { mpImpl->maSliderButton = Image( SVX_RES( RID_SVXBMP_SLIDERBUTTON ) ); @@ -161,16 +161,17 @@ SvxZoomSliderControl::SvxZoomSliderControl( sal_uInt16 _nSlotId, sal_uInt16 _nI mpImpl->maDecreaseButton = Image( SVX_RES( RID_SVXBMP_SLIDERDECREASE ) ); //#ifndef MACOSX - if ( _rStb.GetDPIScaleFactor() > 1) + sal_Int32 nScaleFactor = rStatusBar.GetDPIScaleFactor(); + if (nScaleFactor != 1) { Image arr[3] = {mpImpl->maSliderButton, mpImpl->maIncreaseButton, mpImpl->maDecreaseButton}; for (int i = 0; i < 3; i++) { - BitmapEx b = arr[i].GetBitmapEx(); + BitmapEx aBitmap = arr[i].GetBitmapEx(); //Use Lanczos scaling for the slider button because it does a better job with circles - b.Scale(_rStb.GetDPIScaleFactor(), _rStb.GetDPIScaleFactor(), i == 0 ? BMP_SCALE_LANCZOS : BMP_SCALE_FAST); - arr[i] = Image(b); + aBitmap.Scale(nScaleFactor, nScaleFactor, i == 0 ? BMP_SCALE_LANCZOS : BMP_SCALE_FAST); + arr[i] = Image(aBitmap); } mpImpl->maSliderButton = arr[0]; mpImpl->maIncreaseButton = arr[1]; diff --git a/sw/source/uibase/utlui/viewlayoutctrl.cxx b/sw/source/uibase/utlui/viewlayoutctrl.cxx index bf1f3a222782..aa45d375c315 100644 --- a/sw/source/uibase/utlui/viewlayoutctrl.cxx +++ b/sw/source/uibase/utlui/viewlayoutctrl.cxx @@ -39,8 +39,8 @@ struct SwViewLayoutControl::SwViewLayoutControl_Impl Image maImageBookMode_Active; }; -SwViewLayoutControl::SwViewLayoutControl( sal_uInt16 _nSlotId, sal_uInt16 _nId, StatusBar& rStb ) : - SfxStatusBarControl( _nSlotId, _nId, rStb ), +SwViewLayoutControl::SwViewLayoutControl( sal_uInt16 _nSlotId, sal_uInt16 _nId, StatusBar& rStatusBar ) : + SfxStatusBarControl( _nSlotId, _nId, rStatusBar ), mpImpl( new SwViewLayoutControl_Impl ) { mpImpl->mnState = 0; @@ -52,7 +52,8 @@ SwViewLayoutControl::SwViewLayoutControl( sal_uInt16 _nSlotId, sal_uInt16 _nId, mpImpl->maImageBookMode = Image( SW_RES(IMG_VIEWLAYOUT_BOOKMODE) ); mpImpl->maImageBookMode_Active = Image( SW_RES(IMG_VIEWLAYOUT_BOOKMODE_ACTIVE) ); - if ( rStb.GetDPIScaleFactor() > 1) + sal_Int32 nScaleFactor = rStatusBar.GetDPIScaleFactor(); + if (nScaleFactor != 1) { Image arr[6] = {mpImpl->maImageSingleColumn, mpImpl->maImageSingleColumn_Active, mpImpl->maImageAutomatic, mpImpl->maImageAutomatic_Active, @@ -60,9 +61,9 @@ SwViewLayoutControl::SwViewLayoutControl( sal_uInt16 _nSlotId, sal_uInt16 _nId, for (int i = 0; i < 6; i++) { - BitmapEx b = arr[i].GetBitmapEx(); - b.Scale(rStb.GetDPIScaleFactor(), rStb.GetDPIScaleFactor(), BMP_SCALE_FAST); - arr[i] = Image(b); + BitmapEx aBitmap = arr[i].GetBitmapEx(); + aBitmap.Scale(nScaleFactor, nScaleFactor, BMP_SCALE_FAST); + arr[i] = Image(aBitmap); } mpImpl->maImageSingleColumn = arr[0]; @@ -74,7 +75,6 @@ SwViewLayoutControl::SwViewLayoutControl( sal_uInt16 _nSlotId, sal_uInt16 _nId, mpImpl->maImageBookMode = arr[4]; mpImpl->maImageBookMode_Active = arr[5]; } - } SwViewLayoutControl::~SwViewLayoutControl() @@ -124,8 +124,8 @@ void SwViewLayoutControl::Paint( const UserDrawEvent& rUsrEvt ) mpImpl->maImageAutomatic.GetSizePixel().Width() + mpImpl->maImageBookMode.GetSizePixel().Width(); - const long nXOffset = (aRect.GetWidth() - nImageWidthSum)/2; - const long nYOffset = (aControlRect.GetHeight() - mpImpl->maImageSingleColumn.GetSizePixel().Height())/2; + const long nXOffset = (aRect.GetWidth() - nImageWidthSum) / 2; + const long nYOffset = (aControlRect.GetHeight() - mpImpl->maImageSingleColumn.GetSizePixel().Height()) / 2; aRect.Left() = aRect.Left() + nXOffset; aRect.Top() = aRect.Top() + nYOffset; |