From 8389dc88a48b366ad7f3dd84129467175e18ab40 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 14 Feb 2020 09:38:50 +0000 Subject: split out MetricField value conversion functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I67a33bd2a5cb06dc66e471918b5c378044a2eff2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88679 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- svx/inc/pch/precompiled_svx.hxx | 4 ++-- svx/source/dialog/compressgraphicdialog.cxx | 5 +++-- svx/source/dialog/dlgunit.hxx | 5 +++-- svx/source/sidebar/possize/PosSizePropertyPanel.cxx | 3 ++- svx/source/stbctrls/pszctrl.cxx | 4 ++-- 5 files changed, 12 insertions(+), 9 deletions(-) (limited to 'svx') diff --git a/svx/inc/pch/precompiled_svx.hxx b/svx/inc/pch/precompiled_svx.hxx index 3581e2087a00..f08526683f9f 100644 --- a/svx/inc/pch/precompiled_svx.hxx +++ b/svx/inc/pch/precompiled_svx.hxx @@ -13,7 +13,7 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2020-02-13 20:23:51 using: + Generated on 2020-02-14 10:26:10 using: ./bin/update_pch svx svx --cutoff=3 --exclude:system --exclude:module --include:local If after updating build fails, use the following command to locate conflicting headers: @@ -86,7 +86,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/svx/source/dialog/compressgraphicdialog.cxx b/svx/source/dialog/compressgraphicdialog.cxx index 184934342a0c..14b4c809f04a 100644 --- a/svx/source/dialog/compressgraphicdialog.cxx +++ b/svx/source/dialog/compressgraphicdialog.cxx @@ -18,6 +18,7 @@ */ #include "dlgunit.hxx" +#include #include #include #include @@ -219,12 +220,12 @@ void CompressGraphicsDialog::UpdateResolutionLB() double CompressGraphicsDialog::GetViewWidthInch() const { - return static_cast(MetricField::ConvertValue(m_aViewSize100mm.Width(), 2, MapUnit::Map100thMM, FieldUnit::INCH)) / 100.0; + return static_cast(vcl::ConvertValue(m_aViewSize100mm.Width(), 2, MapUnit::Map100thMM, FieldUnit::INCH)) / 100.0; } double CompressGraphicsDialog::GetViewHeightInch() const { - return static_cast(MetricField::ConvertValue(m_aViewSize100mm.Height(), 2, MapUnit::Map100thMM, FieldUnit::INCH)) / 100.0; + return static_cast(vcl::ConvertValue(m_aViewSize100mm.Height(), 2, MapUnit::Map100thMM, FieldUnit::INCH)) / 100.0; } BmpScaleFlag CompressGraphicsDialog::GetSelectedInterpolationType() const diff --git a/svx/source/dialog/dlgunit.hxx b/svx/source/dialog/dlgunit.hxx index 914e52d54388..108e2b5e3062 100644 --- a/svx/source/dialog/dlgunit.hxx +++ b/svx/source/dialog/dlgunit.hxx @@ -20,13 +20,14 @@ #ifndef INCLUDED_SVX_SOURCE_DIALOG_DLGUNIT_HXX #define INCLUDED_SVX_SOURCE_DIALOG_DLGUNIT_HXX +#include #include -#include +#include inline OUString GetUnitString( long nVal_100, FieldUnit eFieldUnit, sal_Unicode cSep ) { OUStringBuffer aVal = OUString::number( - MetricField::ConvertValue(nVal_100, 2, MapUnit::Map100thMM, eFieldUnit)); + vcl::ConvertValue(nVal_100, 2, MapUnit::Map100thMM, eFieldUnit)); while( aVal.getLength() < 3 ) aVal.insert( 0, "0" ); diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx index eb22debd13e6..7d87dca1c488 100644 --- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx +++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -995,7 +996,7 @@ void PosSizePropertyPanel::SetPosSizeMinMax() fRight -= maRect.getWidth(); fBottom -= maRect.getHeight(); - const double fMaxLong(static_cast(MetricField::ConvertValue( LONG_MAX, 0, MapUnit::Map100thMM, meDlgUnit ) - 1)); + const double fMaxLong(static_cast(vcl::ConvertValue( LONG_MAX, 0, MapUnit::Map100thMM, meDlgUnit ) - 1)); fLeft = std::clamp(fLeft, -fMaxLong, fMaxLong); fRight = std::clamp(fRight, -fMaxLong, fMaxLong); fTop = std::clamp(fTop, - fMaxLong, fMaxLong); diff --git a/svx/source/stbctrls/pszctrl.cxx b/svx/source/stbctrls/pszctrl.cxx index 8d2c4110863d..72e5d3f530be 100644 --- a/svx/source/stbctrls/pszctrl.cxx +++ b/svx/source/stbctrls/pszctrl.cxx @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include @@ -70,7 +70,7 @@ OUString SvxPosSizeStatusBarControl::GetMetricStr_Impl( long nVal ) OUString sMetric; const sal_Unicode cSep = Application::GetSettings().GetLocaleDataWrapper().getNumDecimalSep()[0]; - sal_Int64 nConvVal = MetricField::ConvertValue( nVal * 100, 0, 0, FieldUnit::MM_100TH, eOutUnit ); + sal_Int64 nConvVal = vcl::ConvertValue( nVal * 100, 0, 0, FieldUnit::MM_100TH, eOutUnit ); if ( nConvVal < 0 && ( nConvVal / 100 == 0 ) ) sMetric += "-"; -- cgit