diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-02-14 09:38:50 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-02-14 14:31:50 +0100 |
commit | 8389dc88a48b366ad7f3dd84129467175e18ab40 (patch) | |
tree | 2de192eab43601ee8b145215504ed6aa2b9db243 /sw/source/ui | |
parent | f67e5ef9a5c71f3b35b1c67eb72794e44cc15410 (diff) |
split out MetricField value conversion functions
Change-Id: I67a33bd2a5cb06dc66e471918b5c378044a2eff2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88679
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/ui')
-rw-r--r-- | sw/source/ui/frmdlg/column.cxx | 5 | ||||
-rw-r--r-- | sw/source/ui/misc/pgfnote.cxx | 8 |
2 files changed, 7 insertions, 6 deletions
diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx index d9338a058a11..05aa0ab855d7 100644 --- a/sw/source/ui/frmdlg/column.cxx +++ b/sw/source/ui/frmdlg/column.cxx @@ -35,6 +35,7 @@ #include <sfx2/dispatch.hxx> #include <sfx2/viewfrm.hxx> #include <vcl/event.hxx> +#include <vcl/fieldvalues.hxx> #include <vcl/settings.hxx> #include <vcl/svapp.hxx> @@ -489,7 +490,7 @@ SwColumnPage::SwColumnPage(weld::Container* pPage, weld::DialogController* pCont SvxBorderLineStyle::DASHED ); sal_Int64 nLineWidth = m_xLineWidthEdit->get_value(FieldUnit::POINT); - nLineWidth = static_cast<long>(MetricField::ConvertDoubleValue( + nLineWidth = static_cast<long>(vcl::ConvertDoubleValue( nLineWidth, m_xLineWidthEdit->get_digits(), FieldUnit::POINT, MapUnit::MapTwip )); @@ -686,7 +687,7 @@ IMPL_LINK_NOARG( SwColumnPage, UpdateColMgr, weld::MetricSpinButton&, void ) m_xLineColorLbl->set_sensitive(bEnable); sal_Int64 nLineWidth = m_xLineWidthEdit->get_value(FieldUnit::PERCENT); - nLineWidth = static_cast<long>(MetricField::ConvertDoubleValue( + nLineWidth = static_cast<long>(vcl::ConvertDoubleValue( nLineWidth, m_xLineWidthEdit->get_digits(), m_xLineWidthEdit->get_unit(), MapUnit::MapTwip )); diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx index b2398c80d649..a90b15e2a26d 100644 --- a/sw/source/ui/misc/pgfnote.cxx +++ b/sw/source/ui/misc/pgfnote.cxx @@ -21,7 +21,7 @@ #include <fmtfsize.hxx> #include <hintids.hxx> #include <svtools/unitconv.hxx> -#include <vcl/field.hxx> +#include <vcl/fieldvalues.hxx> #include <unotools/localedatawrapper.hxx> #include <unotools/syslocale.hxx> #include <editeng/borderline.hxx> @@ -84,7 +84,7 @@ IMPL_LINK_NOARG(SwFootNotePage, HeightModify, weld::MetricSpinButton&, void) IMPL_LINK_NOARG(SwFootNotePage, LineWidthChanged_Impl, weld::MetricSpinButton&, void) { sal_Int64 nVal = m_xLineWidthEdit->get_value(FieldUnit::NONE); - nVal = static_cast<sal_Int64>(MetricField::ConvertDoubleValue( + nVal = static_cast<sal_Int64>(vcl::ConvertDoubleValue( nVal, m_xLineWidthEdit->get_digits(), m_xLineWidthEdit->get_unit(), MapUnit::MapTwip )); @@ -170,7 +170,7 @@ void SwFootNotePage::Reset(const SfxItemSet *rSet) // Separator width m_xLineWidthEdit->connect_value_changed(LINK(this, SwFootNotePage, LineWidthChanged_Impl)); - sal_Int64 nWidthPt = static_cast<sal_Int64>(MetricField::ConvertDoubleValue( + sal_Int64 nWidthPt = static_cast<sal_Int64>(vcl::ConvertDoubleValue( sal_Int64( pFootnoteInfo->GetLineWidth() ), m_xLineWidthEdit->get_digits(), MapUnit::MapTwip, m_xLineWidthEdit->get_unit( ) )); m_xLineWidthEdit->set_value(nWidthPt, FieldUnit::NONE); @@ -236,7 +236,7 @@ bool SwFootNotePage::FillItemSet(SfxItemSet *rSet) // Separator width sal_Int64 nWidth = m_xLineWidthEdit->get_value(FieldUnit::NONE); - nWidth = static_cast<long>(MetricField::ConvertDoubleValue( + nWidth = static_cast<long>(vcl::ConvertDoubleValue( nWidth, m_xLineWidthEdit->get_digits(), m_xLineWidthEdit->get_unit(), MapUnit::MapTwip )); |