From b7c2764145be2c3fc50397f241dbdb0c53f9befd Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Fri, 28 Oct 2016 23:55:53 +0200 Subject: convert usages of DPIScalingFactor from int to float MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I049b3d2cde4dcb8c8c0690d75a015a43cb71b0c0 Reviewed-on: https://gerrit.libreoffice.org/30381 Reviewed-by: Tomaž Vajngerl Tested-by: Tomaž Vajngerl --- svx/source/svdraw/svdcrtv.cxx | 4 ++-- svx/source/svdraw/svdhdl.cxx | 10 +++------- svx/source/table/tablehandles.cxx | 4 ++-- svx/source/tbxctrls/layctrl.cxx | 6 ++++-- 4 files changed, 11 insertions(+), 13 deletions(-) (limited to 'svx') diff --git a/svx/source/svdraw/svdcrtv.cxx b/svx/source/svdraw/svdcrtv.cxx index b6a7d568644a..c2311edb7b30 100644 --- a/svx/source/svdraw/svdcrtv.cxx +++ b/svx/source/svdraw/svdcrtv.cxx @@ -70,8 +70,8 @@ ImplConnectMarkerOverlay::ImplConnectMarkerOverlay(const SdrCreateView& rView, S if(xTargetOverlay.is()) { - sal_Int32 nScalingFactor = xTargetOverlay->getOutputDevice().GetDPIScaleFactor(); - Size aHalfLogicSize(xTargetOverlay->getOutputDevice().PixelToLogic(Size(4 * nScalingFactor, 4 * nScalingFactor))); + float fScalingFactor = xTargetOverlay->getOutputDevice().GetDPIScaleFactor(); + Size aHalfLogicSize(xTargetOverlay->getOutputDevice().PixelToLogic(Size(4 * fScalingFactor, 4 * fScalingFactor))); // object sdr::overlay::OverlayPolyPolygonStripedAndFilled* pNew = new sdr::overlay::OverlayPolyPolygonStripedAndFilled( diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx index 642337d3e733..7115bba0355c 100644 --- a/svx/source/svdraw/svdhdl.cxx +++ b/svx/source/svdraw/svdhdl.cxx @@ -591,8 +591,8 @@ void SdrHdl::CreateB2dIAObject() default: break; } - sal_Int32 nScaleFactor = rOutDev.GetDPIScaleFactor(); - basegfx::B2DSize aB2DSize(fSize * nScaleFactor, fSize * nScaleFactor); + float fScalingFactor = rOutDev.GetDPIScaleFactor(); + basegfx::B2DSize aB2DSize(fSize * fScalingFactor, fSize * fScalingFactor); Color aHandleStrokeColor(COL_BLACK); Color aHandleFillColor(COL_LIGHTGREEN); @@ -681,7 +681,7 @@ BitmapEx SdrHdl::ImpGetBitmapEx( BitmapMarkerKind eKindOfMarker, sal_uInt16 nInd sdr::overlay::OverlayObject* SdrHdl::CreateOverlayObject( const basegfx::B2DPoint& rPos, - BitmapColorIndex eColIndex, BitmapMarkerKind eKindOfMarker, OutputDevice& rOutDev, Point aMoveOutsideOffset) + BitmapColorIndex eColIndex, BitmapMarkerKind eKindOfMarker, OutputDevice& /*rOutDev*/, Point aMoveOutsideOffset) { sdr::overlay::OverlayObject* pRetval = nullptr; @@ -799,10 +799,6 @@ sdr::overlay::OverlayObject* SdrHdl::CreateOverlayObject( aBmpEx.Erase(COL_BLACK); } - // Scale the handle with the DPI scale factor - sal_Int32 nScaleFactor = rOutDev.GetDPIScaleFactor(); - aBmpEx.Scale(nScaleFactor, nScaleFactor); - if(eKindOfMarker == BitmapMarkerKind::Anchor || eKindOfMarker == BitmapMarkerKind::AnchorPressed) { // upper left as reference point inside the handle for AnchorPressed, too diff --git a/svx/source/table/tablehandles.cxx b/svx/source/table/tablehandles.cxx index cae87f76ad05..53647e987910 100644 --- a/svx/source/table/tablehandles.cxx +++ b/svx/source/table/tablehandles.cxx @@ -290,8 +290,8 @@ void TableBorderHdl::CreateB2dIAObject() const bool bAnimate = getAnimate(); OutputDevice& rOutDev = rPageWindow.GetPaintWindow().GetOutputDevice(); - sal_Int32 nScaleFactor = rOutDev.GetDPIScaleFactor(); - double fWidth = nScaleFactor * 6.0; + float fScaleFactor = rOutDev.GetDPIScaleFactor(); + double fWidth = fScaleFactor * 6.0; sdr::overlay::OverlayObject* pOverlayObject = new sdr::overlay::OverlayRectangle(aRange.getMinimum(), aRange.getMaximum(), diff --git a/svx/source/tbxctrls/layctrl.cxx b/svx/source/tbxctrls/layctrl.cxx index 868f834c2cfe..b0e707f58cfe 100644 --- a/svx/source/tbxctrls/layctrl.cxx +++ b/svx/source/tbxctrls/layctrl.cxx @@ -112,8 +112,10 @@ TableWindow::TableWindow( sal_uInt16 nSlotId, const OUString& rCmd, const OUStri , mnTablePosX(2) , mnTablePosY(2) { - mnTableCellWidth = 15 * GetDPIScaleFactor(); - mnTableCellHeight = 15 * GetDPIScaleFactor(); + float fScaleFactor = GetDPIScaleFactor(); + + mnTableCellWidth = 15 * fScaleFactor; + mnTableCellHeight = 15 * fScaleFactor; mnTableWidth = mnTablePosX + TABLE_CELLS_HORIZ*mnTableCellWidth; mnTableHeight = mnTablePosY + TABLE_CELLS_VERT*mnTableCellHeight; -- cgit