summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2016-10-28 23:55:53 +0200
committerTomaž Vajngerl <quikee@gmail.com>2016-10-29 21:48:30 +0000
commitb7c2764145be2c3fc50397f241dbdb0c53f9befd (patch)
treef861b28305b99047f430d0c067447eb615c6641b /vcl
parenta0cf18f58fd060dd3ef4f60ad7b17c8f8dc662dd (diff)
convert usages of DPIScalingFactor from int to float
Change-Id: I049b3d2cde4dcb8c8c0690d75a015a43cb71b0c0 Reviewed-on: https://gerrit.libreoffice.org/30381 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/status.cxx2
-rw-r--r--vcl/source/window/toolbox.cxx28
2 files changed, 17 insertions, 13 deletions
diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx
index 70778b09e7c2..0c727b32b9e9 100644
--- a/vcl/source/window/status.cxx
+++ b/vcl/source/window/status.cxx
@@ -906,7 +906,7 @@ void StatusBar::InsertItem( sal_uInt16 nItemId, sal_uLong nWidth,
nBits |= StatusBarItemBits::Center;
// create item
- if (mbAdjustHiDPI && GetDPIScaleFactor() != 1)
+ if (mbAdjustHiDPI)
{
nWidth *= GetDPIScaleFactor();
}
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 4378e01c6aee..e46d0da88dff 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -1671,8 +1671,9 @@ bool ToolBox::ImplCalcItem()
long nDropDownArrowWidth = TB_DROPDOWNARROWWIDTH;
// set defaults if image or text is needed but empty
- nDefWidth = GetDefaultImageSize().Width() * GetDPIScaleFactor();
- nDefHeight = GetDefaultImageSize().Height() * GetDPIScaleFactor();
+ float fDPIScaleFactor = GetDPIScaleFactor();
+ nDefWidth = GetDefaultImageSize().Width() * fDPIScaleFactor;
+ nDefHeight = GetDefaultImageSize().Height() * fDPIScaleFactor;
mnWinHeight = 0;
// determine minimum size necessary in NWF
@@ -2711,14 +2712,15 @@ static void ImplDrawMoreIndicator(vcl::RenderContext& rRenderContext, const Rect
else
rRenderContext.SetFillColor(Color(COL_BLACK));
}
+ float fScaleFactor = rRenderContext.GetDPIScaleFactor();
- int linewidth = 1 * rRenderContext.GetDPIScaleFactor();
- int space = 4 * rRenderContext.GetDPIScaleFactor();
+ int linewidth = 1 * fScaleFactor;
+ int space = 4 * fScaleFactor;
if( !bRotate )
{
- long width = 8 * rRenderContext.GetDPIScaleFactor();
- long height = 5 * rRenderContext.GetDPIScaleFactor();
+ long width = 8 * fScaleFactor;
+ long height = 5 * fScaleFactor;
//Keep odd b/c drawing code works better
if ( height % 2 == 0 )
@@ -2742,8 +2744,8 @@ static void ImplDrawMoreIndicator(vcl::RenderContext& rRenderContext, const Rect
}
else
{
- long width = 5 * rRenderContext.GetDPIScaleFactor();
- long height = 8 * rRenderContext.GetDPIScaleFactor();
+ long width = 5 * fScaleFactor;
+ long height = 8 * fScaleFactor;
//Keep odd b/c drawing code works better
if (width % 2 == 0)
@@ -2785,10 +2787,12 @@ static void ImplDrawDropdownArrow(vcl::RenderContext& rRenderContext, const Rect
rRenderContext.SetFillColor(Color(COL_BLACK));
}
+ float fScaleFactor = rRenderContext.GetDPIScaleFactor();
+
if( !bRotate )
{
- long width = 5 * rRenderContext.GetDPIScaleFactor();
- long height = 3 * rRenderContext.GetDPIScaleFactor();
+ long width = 5 * fScaleFactor;
+ long height = 3 * fScaleFactor;
long x = rDropDownRect.Left() + (rDropDownRect.getWidth() - width)/2;
long y = rDropDownRect.Top() + (rDropDownRect.getHeight() - height)/2;
@@ -2802,8 +2806,8 @@ static void ImplDrawDropdownArrow(vcl::RenderContext& rRenderContext, const Rect
}
else
{
- long width = 3 * rRenderContext.GetDPIScaleFactor();
- long height = 5 * rRenderContext.GetDPIScaleFactor();
+ long width = 3 * fScaleFactor;
+ long height = 5 * fScaleFactor;
long x = rDropDownRect.Left() + (rDropDownRect.getWidth() - width)/2;
long y = rDropDownRect.Top() + (rDropDownRect.getHeight() - height)/2;