[Libreoffice-commits] core.git: chart2/source cui/source dbaccess/source editeng/source extensions/source filter/source include/sfx2 include/svtools include/svx include/tools include/vcl oox/source reportdesign/source sc/inc sc/source sd/source sfx2/source starmath/source svtools/source svx/inc svx/source sw/inc sw/qa sw/source toolkit/source vcl/inc vcl/source xmloff/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Thu Nov 8 11:17:52 UTC 2018
chart2/source/controller/dialogs/res_ErrorBar.cxx | 28 +-
chart2/source/controller/dialogs/tp_SeriesToAxis.cxx | 12 -
chart2/source/controller/main/ConfigurationAccess.cxx | 2
cui/source/dialogs/colorpicker.cxx | 42 ++--
cui/source/dialogs/cuigrfflt.cxx | 28 +-
cui/source/dialogs/zoom.cxx | 14 -
cui/source/tabpages/align.cxx | 6
cui/source/tabpages/autocdlg.cxx | 6
cui/source/tabpages/border.cxx | 138 +++++++-------
cui/source/tabpages/chardlg.cxx | 62 +++---
cui/source/tabpages/connect.cxx | 36 +--
cui/source/tabpages/grfpage.cxx | 60 +++---
cui/source/tabpages/labdlg.cxx | 28 +-
cui/source/tabpages/measure.cxx | 28 +-
cui/source/tabpages/numpages.cxx | 38 +--
cui/source/tabpages/page.cxx | 132 ++++++-------
cui/source/tabpages/paragrph.cxx | 94 ++++-----
cui/source/tabpages/swpossizetabpage.cxx | 72 +++----
cui/source/tabpages/tabstpge.cxx | 6
cui/source/tabpages/textanim.cxx | 42 ++--
cui/source/tabpages/textattr.cxx | 16 -
cui/source/tabpages/tpbitmap.cxx | 72 +++----
cui/source/tabpages/tpcolor.cxx | 24 +-
cui/source/tabpages/tpgradnt.cxx | 80 ++++----
cui/source/tabpages/tphatch.cxx | 24 +-
cui/source/tabpages/tpline.cxx | 58 +++---
cui/source/tabpages/tplnedef.cxx | 20 +-
cui/source/tabpages/tpshadow.cxx | 16 -
cui/source/tabpages/tptrans.cxx | 62 +++---
cui/source/tabpages/transfrm.cxx | 150 +++++++--------
dbaccess/source/ui/dlg/dlgsize.cxx | 8
editeng/source/items/textitem.cxx | 4
editeng/source/xml/xmltxtexp.cxx | 2
extensions/source/propctrlr/propertyhandler.cxx | 10 -
extensions/source/propctrlr/standardcontrol.cxx | 4
extensions/source/propctrlr/usercontrol.cxx | 2
extensions/source/scanner/sanedlg.cxx | 6
filter/source/pdf/impdialog.cxx | 6
include/sfx2/module.hxx | 2
include/svtools/ctrlbox.hxx | 2
include/svtools/ruler.hxx | 18 -
include/svx/svdtrans.hxx | 8
include/svx/sxmuitm.hxx | 2
include/tools/fldunit.hxx | 30 ++-
include/vcl/field.hxx | 8
oox/source/drawingml/textparagraph.cxx | 2
oox/source/export/drawingml.cxx | 2
reportdesign/source/ui/inspection/GeometryHandler.cxx | 2
reportdesign/source/ui/report/ReportController.cxx | 2
reportdesign/source/ui/report/ReportWindow.cxx | 2
reportdesign/source/ui/report/StartMarker.cxx | 2
sc/inc/units.hrc | 18 -
sc/source/core/data/drwlayer.cxx | 4
sc/source/core/tool/appoptio.cxx | 4
sc/source/ui/app/scmod.cxx | 10 -
sc/source/ui/miscdlgs/mtrindlg.cxx | 26 +-
sc/source/ui/optdlg/tpview.cxx | 18 -
sc/source/ui/pagedlg/tptable.cxx | 10 -
sc/source/ui/sidebar/AlignmentPropertyPanel.cxx | 16 -
sc/source/ui/view/colrowba.cxx | 2
sd/source/ui/animations/CustomAnimationDialog.cxx | 90 ++++-----
sd/source/ui/animations/CustomAnimationPane.cxx | 10 -
sd/source/ui/animations/SlideTransitionPane.cxx | 6
sd/source/ui/app/optsitem.cxx | 2
sd/source/ui/app/sdmod1.cxx | 10 -
sd/source/ui/dlg/copydlg.cxx | 48 ++--
sd/source/ui/dlg/diactrl.cxx | 2
sd/source/ui/dlg/dlgsnap.cxx | 28 +-
sd/source/ui/dlg/tpoption.cxx | 26 +-
sd/source/ui/dlg/vectdlg.cxx | 18 -
sfx2/source/appl/module.cxx | 15 +
sfx2/source/dialog/mgetempl.cxx | 20 +-
starmath/source/dialog.cxx | 66 +++---
svtools/source/control/ctrlbox.cxx | 30 +--
svtools/source/control/ruler.cxx | 24 +-
svtools/source/filter/SvFilterOptionsDialog.cxx | 5
svtools/source/filter/exportdialog.cxx | 28 +-
svtools/source/misc/unitconv.cxx | 126 ++++++-------
svx/inc/fieldunit.hrc | 22 +-
svx/source/dialog/compressgraphicdialog.cxx | 4
svx/source/dialog/dlgutil.cxx | 2
svx/source/dialog/fontwork.cxx | 18 -
svx/source/dialog/hdft.cxx | 28 +-
svx/source/dialog/optgrid.cxx | 26 +-
svx/source/dialog/relfld.cxx | 10 -
svx/source/dialog/srchdlg.cxx | 22 +-
svx/source/dialog/strarray.cxx | 2
svx/source/dialog/svxruler.cxx | 12 -
svx/source/sidebar/line/LineWidthPopup.cxx | 2
svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx | 8
svx/source/sidebar/paragraph/ParaPropertyPanel.cxx | 36 +--
svx/source/sidebar/paragraph/ParaSpacingWindow.cxx | 30 +--
svx/source/sidebar/possize/PosSizePropertyPanel.cxx | 40 ++--
svx/source/sidebar/shadow/ShadowPropertyPanel.cxx | 22 +-
svx/source/stbctrls/pszctrl.cxx | 4
svx/source/svdraw/svdattr.cxx | 2
svx/source/svdraw/svdmodel.cxx | 70 +++----
svx/source/svdraw/svdomeas.cxx | 8
svx/source/svdraw/svdtrans.cxx | 50 ++---
svx/source/tbxctrls/extrusioncontrols.cxx | 6
svx/source/tbxctrls/fontworkgallery.cxx | 6
svx/source/tbxctrls/grafctrl.cxx | 2
svx/source/tbxctrls/itemwin.cxx | 2
svx/source/tbxctrls/tbcontrl.cxx | 2
svx/source/unodraw/unoprov.cxx | 48 ++--
svx/source/xml/xmlxtexp.cxx | 2
sw/inc/optload.hrc | 22 +-
sw/qa/extras/htmlexport/htmlexport.cxx | 4
sw/source/filter/html/css1atr.cxx | 36 +--
sw/source/filter/html/wrthtml.cxx | 2
sw/source/filter/ww8/rtfsdrexport.cxx | 4
sw/source/ui/chrdlg/drpcps.cxx | 12 -
sw/source/ui/config/optload.cxx | 20 +-
sw/source/ui/config/optpage.cxx | 42 ++--
sw/source/ui/dbui/mmlayoutpage.cxx | 16 -
sw/source/ui/dialog/uiregionsw.cxx | 16 -
sw/source/ui/envelp/envfmt.cxx | 20 +-
sw/source/ui/envelp/envprt.cxx | 4
sw/source/ui/envelp/labfmt.cxx | 56 ++---
sw/source/ui/frmdlg/column.cxx | 84 ++++----
sw/source/ui/frmdlg/frmpage.cxx | 92 ++++-----
sw/source/ui/frmdlg/wrap.cxx | 40 ++--
sw/source/ui/index/cnttab.cxx | 4
sw/source/ui/misc/linenum.cxx | 6
sw/source/ui/misc/num.cxx | 50 ++---
sw/source/ui/misc/pgfnote.cxx | 62 +++---
sw/source/ui/misc/pggrid.cxx | 52 ++---
sw/source/ui/table/colwd.cxx | 12 -
sw/source/ui/table/rowht.cxx | 8
sw/source/ui/table/tabledlg.cxx | 106 +++++------
sw/source/uibase/app/apphdl.cxx | 10 -
sw/source/uibase/app/swmodul1.cxx | 20 +-
sw/source/uibase/config/usrpref.cxx | 4
sw/source/uibase/dialog/watermarkdialog.cxx | 12 -
sw/source/uibase/inc/envlop.hxx | 8
sw/source/uibase/inc/labimp.hxx | 8
sw/source/uibase/inc/prcntfld.hxx | 14 -
sw/source/uibase/sidebar/PageFormatPanel.cxx | 14 -
sw/source/uibase/sidebar/PageMarginControl.cxx | 20 +-
sw/source/uibase/sidebar/PageSizeControl.cxx | 8
sw/source/uibase/uno/unomod.cxx | 16 -
sw/source/uibase/utlui/prcntfld.cxx | 154 ++++++++--------
sw/source/uibase/utlui/uitool.cxx | 8
toolkit/source/helper/vclunohelper.cxx | 34 +--
vcl/inc/units.hrc | 48 ++--
vcl/source/control/field.cxx | 117 ++++++------
vcl/source/window/builder.cxx | 50 ++---
vcl/source/window/printdlg.cxx | 36 ++-
xmloff/source/core/xmluconv.cxx | 18 -
149 files changed, 2038 insertions(+), 1999 deletions(-)
New commits:
commit 9e0770ea7e0cf094add54ad64bc9ff825d24bbe1
Author: Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Tue Nov 6 14:37:23 2018 +0300
Commit: Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Thu Nov 8 12:15:51 2018 +0100
Convert FieldUnit to scoped enum
Change-Id: Id2df31daa596a18c79af5fc6ea162deb6e24d5af
Reviewed-on: https://gerrit.libreoffice.org/62958
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
diff --git a/chart2/source/controller/dialogs/res_ErrorBar.cxx b/chart2/source/controller/dialogs/res_ErrorBar.cxx
index 9d958a582e86..6262bf63dba6 100644
--- a/chart2/source/controller/dialogs/res_ErrorBar.cxx
+++ b/chart2/source/controller/dialogs/res_ErrorBar.cxx
@@ -110,11 +110,11 @@ ErrorBarResources::ErrorBarResources(weld::Builder* pParent, TabPageParent pPare
, m_xLbFunction(pParent->weld_combo_box("LB_FUNCTION"))
, m_xFlParameters(pParent->weld_frame("framePARAMETERS"))
, m_xBxPositive(pParent->weld_widget("boxPOSITIVE"))
- , m_xMfPositive(pParent->weld_metric_spin_button("MF_POSITIVE", FUNIT_NONE))
+ , m_xMfPositive(pParent->weld_metric_spin_button("MF_POSITIVE", FieldUnit::NONE))
, m_xEdRangePositive(pParent->weld_entry("ED_RANGE_POSITIVE"))
, m_xIbRangePositive(pParent->weld_button("IB_RANGE_POSITIVE"))
, m_xBxNegative(pParent->weld_widget("boxNEGATIVE"))
- , m_xMfNegative(pParent->weld_metric_spin_button("MF_NEGATIVE", FUNIT_NONE))
+ , m_xMfNegative(pParent->weld_metric_spin_button("MF_NEGATIVE", FieldUnit::NONE))
, m_xEdRangeNegative(pParent->weld_entry("ED_RANGE_NEGATIVE"))
, m_xIbRangeNegative(pParent->weld_button("IB_RANGE_NEGATIVE"))
, m_xCbSyncPosNeg(pParent->weld_check_button("CB_SYN_POS_NEG"))
@@ -256,29 +256,29 @@ void ErrorBarResources::UpdateControlStates()
( m_xRbFunction->get_active()) &&
( m_xLbFunction->get_active() == CHART_LB_FUNCTION_ERROR_MARGIN ));
bool bIsPercentage( m_xRbPercent->get_active() || bIsErrorMargin );
- FieldUnit eFieldUnit = FUNIT_NONE;
+ FieldUnit eFieldUnit = FieldUnit::NONE;
if( bIsPercentage )
{
- eFieldUnit = FUNIT_PERCENT;
+ eFieldUnit = FieldUnit::PERCENT;
m_xMfPositive->set_digits( 1 );
- m_xMfPositive->set_increments(10, 100, FUNIT_NONE);
+ m_xMfPositive->set_increments(10, 100, FieldUnit::NONE);
m_xMfNegative->set_digits( 1 );
- m_xMfNegative->set_increments(10, 100, FUNIT_NONE);
+ m_xMfNegative->set_increments(10, 100, FieldUnit::NONE);
}
else
{
m_xMfPositive->set_digits( m_nConstDecimalDigits );
- m_xMfPositive->set_increments(m_nConstSpinSize, m_nConstSpinSize * 10, FUNIT_NONE);
+ m_xMfPositive->set_increments(m_nConstSpinSize, m_nConstSpinSize * 10, FieldUnit::NONE);
m_xMfNegative->set_digits( m_nConstDecimalDigits );
- m_xMfNegative->set_increments(m_nConstSpinSize, m_nConstSpinSize * 10, FUNIT_NONE);
+ m_xMfNegative->set_increments(m_nConstSpinSize, m_nConstSpinSize * 10, FieldUnit::NONE);
}
sal_Int32 nPlusValue = static_cast< sal_Int32 >( m_fPlusValue * pow(10.0,m_xMfPositive->get_digits()) );
sal_Int32 nMinusValue = static_cast< sal_Int32 >( m_fMinusValue * pow(10.0,m_xMfNegative->get_digits()) );
- m_xMfPositive->set_value(nPlusValue, FUNIT_NONE);
- m_xMfNegative->set_value(nMinusValue, FUNIT_NONE);
+ m_xMfPositive->set_value(nPlusValue, FieldUnit::NONE);
+ m_xMfNegative->set_value(nMinusValue, FieldUnit::NONE);
m_xMfPositive->set_unit(eFieldUnit);
m_xMfNegative->set_unit(eFieldUnit);
@@ -392,7 +392,7 @@ IMPL_LINK_NOARG( ErrorBarResources, CategoryChosen, weld::ToggleButton&, void )
else if( m_eErrorKind != SvxChartKindError::Range &&
eOldError == SvxChartKindError::Range )
{
- m_xCbSyncPosNeg->set_active( m_xMfPositive->get_value(FUNIT_NONE) == m_xMfNegative->get_value(FUNIT_NONE));
+ m_xCbSyncPosNeg->set_active( m_xMfPositive->get_value(FieldUnit::NONE) == m_xMfNegative->get_value(FieldUnit::NONE));
}
UpdateControlStates();
@@ -414,7 +414,7 @@ IMPL_LINK_NOARG(ErrorBarResources, PosValueChanged, weld::MetricSpinButton&, voi
m_bRangeNegUnique = m_bRangePosUnique;
}
else
- m_xMfNegative->set_value(m_xMfPositive->get_value(FUNIT_NONE), FUNIT_NONE);
+ m_xMfNegative->set_value(m_xMfPositive->get_value(FieldUnit::NONE), FieldUnit::NONE);
}
}
@@ -628,14 +628,14 @@ void ErrorBarResources::FillItemSet(SfxItemSet& rOutAttrs) const
m_eErrorKind == SvxChartKindError::Percent ||
m_eErrorKind == SvxChartKindError::BigError )
{
- double fPosValue = static_cast< double >( m_xMfPositive->get_value(FUNIT_NONE)) /
+ double fPosValue = static_cast< double >( m_xMfPositive->get_value(FieldUnit::NONE)) /
pow( 10.0, m_xMfPositive->get_digits());
double fNegValue = 0.0;
if( m_xCbSyncPosNeg->get_active())
fNegValue = fPosValue;
else
- fNegValue = static_cast< double >( m_xMfNegative->get_value(FUNIT_NONE)) /
+ fNegValue = static_cast< double >( m_xMfNegative->get_value(FieldUnit::NONE)) /
pow( 10.0, m_xMfNegative->get_digits());
rOutAttrs.Put( SvxDoubleItem( fPosValue, SCHATTR_STAT_CONSTPLUS ));
diff --git a/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx b/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx
index 3821f10e51fe..2cab39c84e8e 100644
--- a/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx
+++ b/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx
@@ -43,8 +43,8 @@ SchOptionTabPage::SchOptionTabPage(TabPageParent pWindow,const SfxItemSet& rInAt
, m_xRbtAxis1(m_xBuilder->weld_radio_button("RBT_OPT_AXIS_1"))
, m_xRbtAxis2(m_xBuilder->weld_radio_button("RBT_OPT_AXIS_2"))
, m_xGrpBar(m_xBuilder->weld_widget("frameSettings"))
- , m_xMTGap(m_xBuilder->weld_metric_spin_button("MT_GAP", FUNIT_PERCENT))
- , m_xMTOverlap(m_xBuilder->weld_metric_spin_button("MT_OVERLAP", FUNIT_PERCENT))
+ , m_xMTGap(m_xBuilder->weld_metric_spin_button("MT_GAP", FieldUnit::PERCENT))
+ , m_xMTOverlap(m_xBuilder->weld_metric_spin_button("MT_OVERLAP", FieldUnit::PERCENT))
, m_xCBConnect(m_xBuilder->weld_check_button("CB_CONNECTOR"))
, m_xCBAxisSideBySide(m_xBuilder->weld_check_button("CB_BARS_SIDE_BY_SIDE"))
, m_xGrpPlotOptions(m_xBuilder->weld_widget("frameFL_PLOT_OPTIONS"))
@@ -85,10 +85,10 @@ bool SchOptionTabPage::FillItemSet(SfxItemSet* rOutAttrs)
rOutAttrs->Put(SfxInt32Item(SCHATTR_AXIS,CHART_AXIS_PRIMARY_Y));
if(m_xMTGap->get_visible())
- rOutAttrs->Put(SfxInt32Item(SCHATTR_BAR_GAPWIDTH,static_cast< sal_Int32 >( m_xMTGap->get_value(FUNIT_PERCENT))));
+ rOutAttrs->Put(SfxInt32Item(SCHATTR_BAR_GAPWIDTH,static_cast< sal_Int32 >( m_xMTGap->get_value(FieldUnit::PERCENT))));
if(m_xMTOverlap->get_visible())
- rOutAttrs->Put(SfxInt32Item(SCHATTR_BAR_OVERLAP,static_cast< sal_Int32 >( m_xMTOverlap->get_value(FUNIT_PERCENT))));
+ rOutAttrs->Put(SfxInt32Item(SCHATTR_BAR_OVERLAP,static_cast< sal_Int32 >( m_xMTOverlap->get_value(FieldUnit::PERCENT))));
if(m_xCBConnect->get_visible())
rOutAttrs->Put(SfxBoolItem(SCHATTR_BAR_CONNECT,m_xCBConnect->get_active()));
@@ -131,13 +131,13 @@ void SchOptionTabPage::Reset(const SfxItemSet* rInAttrs)
if (rInAttrs->GetItemState(SCHATTR_BAR_GAPWIDTH, true, &pPoolItem) == SfxItemState::SET)
{
nTmp = static_cast<long>(static_cast<const SfxInt32Item*>(pPoolItem)->GetValue());
- m_xMTGap->set_value(nTmp, FUNIT_PERCENT);
+ m_xMTGap->set_value(nTmp, FieldUnit::PERCENT);
}
if (rInAttrs->GetItemState(SCHATTR_BAR_OVERLAP, true, &pPoolItem) == SfxItemState::SET)
{
nTmp = static_cast<long>(static_cast<const SfxInt32Item*>(pPoolItem)->GetValue());
- m_xMTOverlap->set_value(nTmp, FUNIT_PERCENT);
+ m_xMTOverlap->set_value(nTmp, FieldUnit::PERCENT);
}
if (rInAttrs->GetItemState(SCHATTR_BAR_CONNECT, true, &pPoolItem) == SfxItemState::SET)
diff --git a/chart2/source/controller/main/ConfigurationAccess.cxx b/chart2/source/controller/main/ConfigurationAccess.cxx
index 0100ec109da3..dc1ba9f657a6 100644
--- a/chart2/source/controller/main/ConfigurationAccess.cxx
+++ b/chart2/source/controller/main/ConfigurationAccess.cxx
@@ -62,7 +62,7 @@ void CalcConfigItem::Notify( const uno::Sequence<OUString>& ) {}
FieldUnit CalcConfigItem::getFieldUnit()
{
- FieldUnit eResult( FUNIT_CM );
+ FieldUnit eResult( FieldUnit::CM );
uno::Sequence< OUString > aNames( 1 );
if( lcl_IsMetric() )
diff --git a/cui/source/dialogs/colorpicker.cxx b/cui/source/dialogs/colorpicker.cxx
index 6375a9a68f91..3e5da04a0818 100644
--- a/cui/source/dialogs/colorpicker.cxx
+++ b/cui/source/dialogs/colorpicker.cxx
@@ -781,13 +781,13 @@ ColorPickerDialog::ColorPickerDialog(weld::Window* pParent, Color nColor, sal_In
, m_xMFGreen(m_xBuilder->weld_spin_button("greenSpinbutton"))
, m_xMFBlue(m_xBuilder->weld_spin_button("blueSpinbutton"))
, m_xEDHex(new weld::HexColorControl(m_xBuilder->weld_entry("hexEntry")))
- , m_xMFHue(m_xBuilder->weld_metric_spin_button("hueSpinbutton", FUNIT_DEGREE))
- , m_xMFSaturation(m_xBuilder->weld_metric_spin_button("satSpinbutton", FUNIT_PERCENT))
- , m_xMFBrightness(m_xBuilder->weld_metric_spin_button("brightSpinbutton", FUNIT_PERCENT))
- , m_xMFCyan(m_xBuilder->weld_metric_spin_button("cyanSpinbutton", FUNIT_PERCENT))
- , m_xMFMagenta(m_xBuilder->weld_metric_spin_button("magSpinbutton", FUNIT_PERCENT))
- , m_xMFYellow(m_xBuilder->weld_metric_spin_button("yellowSpinbutton", FUNIT_PERCENT))
- , m_xMFKey(m_xBuilder->weld_metric_spin_button("keySpinbutton", FUNIT_PERCENT))
+ , m_xMFHue(m_xBuilder->weld_metric_spin_button("hueSpinbutton", FieldUnit::DEGREE))
+ , m_xMFSaturation(m_xBuilder->weld_metric_spin_button("satSpinbutton", FieldUnit::PERCENT))
+ , m_xMFBrightness(m_xBuilder->weld_metric_spin_button("brightSpinbutton", FieldUnit::PERCENT))
+ , m_xMFCyan(m_xBuilder->weld_metric_spin_button("cyanSpinbutton", FieldUnit::PERCENT))
+ , m_xMFMagenta(m_xBuilder->weld_metric_spin_button("magSpinbutton", FieldUnit::PERCENT))
+ , m_xMFYellow(m_xBuilder->weld_metric_spin_button("yellowSpinbutton", FieldUnit::PERCENT))
+ , m_xMFKey(m_xBuilder->weld_metric_spin_button("keySpinbutton", FieldUnit::PERCENT))
, meMode( DefaultMode )
{
m_aColorField.SetModifyHdl( LINK( this, ColorPickerDialog, ColorFieldControlModifydl ) );
@@ -868,17 +868,17 @@ void ColorPickerDialog::update_color( UpdateFlags n )
if (n & UpdateFlags::CMYK) // update CMYK
{
- m_xMFCyan->set_value(toInt(mdCyan, 100.0), FUNIT_PERCENT);
- m_xMFMagenta->set_value(toInt(mdMagenta, 100.0), FUNIT_PERCENT);
- m_xMFYellow->set_value(toInt(mdYellow, 100.0), FUNIT_PERCENT);
- m_xMFKey->set_value(toInt(mdKey, 100.0), FUNIT_PERCENT);
+ m_xMFCyan->set_value(toInt(mdCyan, 100.0), FieldUnit::PERCENT);
+ m_xMFMagenta->set_value(toInt(mdMagenta, 100.0), FieldUnit::PERCENT);
+ m_xMFYellow->set_value(toInt(mdYellow, 100.0), FieldUnit::PERCENT);
+ m_xMFKey->set_value(toInt(mdKey, 100.0), FieldUnit::PERCENT);
}
if (n & UpdateFlags::HSB ) // update HSB
{
- m_xMFHue->set_value(toInt(mdHue, 1.0), FUNIT_DEGREE);
- m_xMFSaturation->set_value(toInt( mdSat, 100.0), FUNIT_PERCENT);
- m_xMFBrightness->set_value(toInt( mdBri, 100.0), FUNIT_PERCENT);
+ m_xMFHue->set_value(toInt(mdHue, 1.0), FieldUnit::DEGREE);
+ m_xMFSaturation->set_value(toInt( mdSat, 100.0), FieldUnit::PERCENT);
+ m_xMFBrightness->set_value(toInt( mdBri, 100.0), FieldUnit::PERCENT);
}
if (n & UpdateFlags::ColorChooser ) // update Color Chooser 1
@@ -1010,37 +1010,37 @@ IMPL_LINK(ColorPickerDialog, ColorModifyMetricHdl, weld::MetricSpinButton&, rEdi
if (&rEdit == m_xMFHue.get())
{
- setColorComponent( ColorComponent::Hue, static_cast<double>(m_xMFHue->get_value(FUNIT_DEGREE)) );
+ setColorComponent( ColorComponent::Hue, static_cast<double>(m_xMFHue->get_value(FieldUnit::DEGREE)) );
n = UpdateFlags::All & ~UpdateFlags::HSB;
}
else if (&rEdit == m_xMFSaturation.get())
{
- setColorComponent( ColorComponent::Saturation, static_cast<double>(m_xMFSaturation->get_value(FUNIT_PERCENT)) / 100.0 );
+ setColorComponent( ColorComponent::Saturation, static_cast<double>(m_xMFSaturation->get_value(FieldUnit::PERCENT)) / 100.0 );
n = UpdateFlags::All & ~UpdateFlags::HSB;
}
else if (&rEdit == m_xMFBrightness.get())
{
- setColorComponent( ColorComponent::Brightness, static_cast<double>(m_xMFBrightness->get_value(FUNIT_PERCENT)) / 100.0 );
+ setColorComponent( ColorComponent::Brightness, static_cast<double>(m_xMFBrightness->get_value(FieldUnit::PERCENT)) / 100.0 );
n = UpdateFlags::All & ~UpdateFlags::HSB;
}
else if (&rEdit == m_xMFCyan.get())
{
- setColorComponent( ColorComponent::Cyan, static_cast<double>(m_xMFCyan->get_value(FUNIT_PERCENT)) / 100.0 );
+ setColorComponent( ColorComponent::Cyan, static_cast<double>(m_xMFCyan->get_value(FieldUnit::PERCENT)) / 100.0 );
n = UpdateFlags::All & ~UpdateFlags::CMYK;
}
else if (&rEdit == m_xMFMagenta.get())
{
- setColorComponent( ColorComponent::Magenta, static_cast<double>(m_xMFMagenta->get_value(FUNIT_PERCENT)) / 100.0 );
+ setColorComponent( ColorComponent::Magenta, static_cast<double>(m_xMFMagenta->get_value(FieldUnit::PERCENT)) / 100.0 );
n = UpdateFlags::All & ~UpdateFlags::CMYK;
}
else if (&rEdit == m_xMFYellow.get())
{
- setColorComponent( ColorComponent::Yellow, static_cast<double>(m_xMFYellow->get_value(FUNIT_PERCENT)) / 100.0 );
+ setColorComponent( ColorComponent::Yellow, static_cast<double>(m_xMFYellow->get_value(FieldUnit::PERCENT)) / 100.0 );
n = UpdateFlags::All & ~UpdateFlags::CMYK;
}
else if (&rEdit == m_xMFKey.get())
{
- setColorComponent( ColorComponent::Key, static_cast<double>(m_xMFKey->get_value(FUNIT_PERCENT)) / 100.0 );
+ setColorComponent( ColorComponent::Key, static_cast<double>(m_xMFKey->get_value(FieldUnit::PERCENT)) / 100.0 );
n = UpdateFlags::All & ~UpdateFlags::CMYK;
}
diff --git a/cui/source/dialogs/cuigrfflt.cxx b/cui/source/dialogs/cuigrfflt.cxx
index 9bc7dcf55cbf..15e8dc084392 100644
--- a/cui/source/dialogs/cuigrfflt.cxx
+++ b/cui/source/dialogs/cuigrfflt.cxx
@@ -159,16 +159,16 @@ IMPL_LINK_NOARG(GraphicFilterDialog, ImplModifyHdl, LinkParamNone*, void)
GraphicFilterMosaic::GraphicFilterMosaic(weld::Window* pParent, const Graphic& rGraphic,
sal_uInt16 nTileWidth, sal_uInt16 nTileHeight, bool bEnhanceEdges)
: GraphicFilterDialog(pParent, "cui/ui/mosaicdialog.ui", "MosaicDialog", rGraphic)
- , mxMtrWidth(m_xBuilder->weld_metric_spin_button("width", FUNIT_PIXEL))
- , mxMtrHeight(m_xBuilder->weld_metric_spin_button("height", FUNIT_PIXEL))
+ , mxMtrWidth(m_xBuilder->weld_metric_spin_button("width", FieldUnit::PIXEL))
+ , mxMtrHeight(m_xBuilder->weld_metric_spin_button("height", FieldUnit::PIXEL))
, mxCbxEdges(m_xBuilder->weld_check_button("edges"))
{
- mxMtrWidth->set_value(nTileWidth, FUNIT_PIXEL);
- mxMtrWidth->set_max(GetGraphicSizePixel().Width(), FUNIT_PIXEL);
+ mxMtrWidth->set_value(nTileWidth, FieldUnit::PIXEL);
+ mxMtrWidth->set_max(GetGraphicSizePixel().Width(), FieldUnit::PIXEL);
mxMtrWidth->connect_value_changed(LINK(this, GraphicFilterMosaic, EditModifyHdl));
- mxMtrHeight->set_value(nTileHeight, FUNIT_PIXEL);
- mxMtrHeight->set_max(GetGraphicSizePixel().Height(), FUNIT_PIXEL);
+ mxMtrHeight->set_value(nTileHeight, FieldUnit::PIXEL);
+ mxMtrHeight->set_max(GetGraphicSizePixel().Height(), FieldUnit::PIXEL);
mxMtrHeight->connect_value_changed(LINK(this, GraphicFilterMosaic, EditModifyHdl));
mxCbxEdges->set_active(bEnhanceEdges);
@@ -191,8 +191,8 @@ Graphic GraphicFilterMosaic::GetFilteredGraphic( const Graphic& rGraphic,
double fScaleX, double fScaleY )
{
Graphic aRet;
- long nTileWidth = static_cast<long>(mxMtrWidth->get_value(FUNIT_PIXEL));
- long nTileHeight = static_cast<long>(mxMtrHeight->get_value(FUNIT_PIXEL));
+ long nTileWidth = static_cast<long>(mxMtrWidth->get_value(FieldUnit::PIXEL));
+ long nTileHeight = static_cast<long>(mxMtrHeight->get_value(FieldUnit::PIXEL));
const Size aSize( std::max( FRound( nTileWidth * fScaleX ), 1L ),
std::max( FRound( nTileHeight * fScaleY ), 1L ) );
@@ -268,10 +268,10 @@ Graphic GraphicFilterSmooth::GetFilteredGraphic( const Graphic& rGraphic, double
GraphicFilterSolarize::GraphicFilterSolarize(weld::Window* pParent, const Graphic& rGraphic,
sal_uInt8 cGreyThreshold, bool bInvert)
: GraphicFilterDialog(pParent, "cui/ui/solarizedialog.ui", "SolarizeDialog", rGraphic)
- , mxMtrThreshold(m_xBuilder->weld_metric_spin_button("value", FUNIT_PERCENT))
+ , mxMtrThreshold(m_xBuilder->weld_metric_spin_button("value", FieldUnit::PERCENT))
, mxCbxInvert(m_xBuilder->weld_check_button("invert"))
{
- mxMtrThreshold->set_value(FRound(cGreyThreshold / 2.55), FUNIT_PERCENT);
+ mxMtrThreshold->set_value(FRound(cGreyThreshold / 2.55), FieldUnit::PERCENT);
mxMtrThreshold->connect_value_changed(LINK(this, GraphicFilterSolarize, EditModifyHdl));
mxCbxInvert->set_active(bInvert);
@@ -291,7 +291,7 @@ IMPL_LINK_NOARG(GraphicFilterSolarize, EditModifyHdl, weld::MetricSpinButton&, v
Graphic GraphicFilterSolarize::GetFilteredGraphic( const Graphic& rGraphic, double, double )
{
Graphic aRet;
- sal_uInt8 nGreyThreshold = static_cast<sal_uInt8>(FRound(mxMtrThreshold->get_value(FUNIT_PERCENT) * 2.55));
+ sal_uInt8 nGreyThreshold = static_cast<sal_uInt8>(FRound(mxMtrThreshold->get_value(FieldUnit::PERCENT) * 2.55));
if( rGraphic.IsAnimated() )
{
@@ -324,9 +324,9 @@ Graphic GraphicFilterSolarize::GetFilteredGraphic( const Graphic& rGraphic, doub
GraphicFilterSepia::GraphicFilterSepia(weld::Window* pParent, const Graphic& rGraphic,
sal_uInt16 nSepiaPercent)
: GraphicFilterDialog(pParent, "cui/ui/agingdialog.ui", "AgingDialog", rGraphic)
- , mxMtrSepia(m_xBuilder->weld_metric_spin_button("value", FUNIT_PERCENT))
+ , mxMtrSepia(m_xBuilder->weld_metric_spin_button("value", FieldUnit::PERCENT))
{
- mxMtrSepia->set_value(nSepiaPercent, FUNIT_PERCENT);
+ mxMtrSepia->set_value(nSepiaPercent, FieldUnit::PERCENT);
mxMtrSepia->connect_value_changed(LINK(this, GraphicFilterSepia, EditModifyHdl));
}
@@ -338,7 +338,7 @@ IMPL_LINK_NOARG(GraphicFilterSepia, EditModifyHdl, weld::MetricSpinButton&, void
Graphic GraphicFilterSepia::GetFilteredGraphic( const Graphic& rGraphic, double, double )
{
Graphic aRet;
- sal_uInt16 nSepiaPct = sal::static_int_cast< sal_uInt16 >(mxMtrSepia->get_value(FUNIT_PERCENT));
+ sal_uInt16 nSepiaPct = sal::static_int_cast< sal_uInt16 >(mxMtrSepia->get_value(FieldUnit::PERCENT));
if( rGraphic.IsAnimated() )
{
diff --git a/cui/source/dialogs/zoom.cxx b/cui/source/dialogs/zoom.cxx
index f02e8b1a79a8..8423823cf113 100644
--- a/cui/source/dialogs/zoom.cxx
+++ b/cui/source/dialogs/zoom.cxx
@@ -39,7 +39,7 @@ sal_uInt16 SvxZoomDialog::GetFactor() const
return 100;
if (m_xUserBtn->get_active())
- return static_cast<sal_uInt16>(m_xUserEdit->get_value(FUNIT_PERCENT));
+ return static_cast<sal_uInt16>(m_xUserEdit->get_value(FieldUnit::PERCENT));
else
return SPECIAL_FACTOR;
}
@@ -59,13 +59,13 @@ void SvxZoomDialog::SetFactor(sal_uInt16 nNewFactor, ZoomButtonId nButtonId)
{
m_xUserBtn->set_active(true);
m_xUserEdit->set_sensitive(true);
- m_xUserEdit->set_value(nNewFactor, FUNIT_PERCENT);
+ m_xUserEdit->set_value(nNewFactor, FieldUnit::PERCENT);
m_xUserEdit->grab_focus();
}
}
else
{
- m_xUserEdit->set_value(nNewFactor, FUNIT_PERCENT);
+ m_xUserEdit->set_value(nNewFactor, FieldUnit::PERCENT);
switch(nButtonId)
{
case ZoomButtonId::OPTIMAL:
@@ -115,7 +115,7 @@ void SvxZoomDialog::HideButton(ZoomButtonId nButtonId)
void SvxZoomDialog::SetLimits(sal_uInt16 nMin, sal_uInt16 nMax)
{
DBG_ASSERT(nMin < nMax, "invalid limits");
- m_xUserEdit->set_range(nMin, nMax, FUNIT_PERCENT);
+ m_xUserEdit->set_range(nMin, nMax, FieldUnit::PERCENT);
}
const SfxItemSet* SvxZoomDialog::GetOutputItemSet() const
@@ -132,7 +132,7 @@ SvxZoomDialog::SvxZoomDialog(weld::Window* pParent, const SfxItemSet& rCoreSet)
, m_xPageWidthBtn(m_xBuilder->weld_radio_button("fitw"))
, m_x100Btn(m_xBuilder->weld_radio_button("100pc"))
, m_xUserBtn(m_xBuilder->weld_radio_button("variable"))
- , m_xUserEdit(m_xBuilder->weld_metric_spin_button("zoomsb", FUNIT_PERCENT))
+ , m_xUserEdit(m_xBuilder->weld_metric_spin_button("zoomsb", FieldUnit::PERCENT))
, m_xViewFrame(m_xBuilder->weld_widget("viewframe"))
, m_xAutomaticBtn(m_xBuilder->weld_radio_button("automatic"))
, m_xSingleBtn(m_xBuilder->weld_radio_button("singlepage"))
@@ -184,7 +184,7 @@ SvxZoomDialog::SvxZoomDialog(weld::Window* pParent, const SfxItemSet& rCoreSet)
nMax = nValue;
SetLimits(nMin, nMax);
- m_xUserEdit->set_value(nValue, FUNIT_PERCENT);
+ m_xUserEdit->set_value(nValue, FieldUnit::PERCENT);
const SfxPoolItem& rItem = m_rSet.Get(m_rSet.GetPool()->GetWhich(SID_ATTR_ZOOM));
@@ -392,7 +392,7 @@ IMPL_LINK_NOARG(SvxZoomDialog, OKHdl, weld::Button&, void)
if (pShell)
{
- sal_uInt16 nZoomValue = static_cast<sal_uInt16>(m_xUserEdit->get_value(FUNIT_PERCENT));
+ sal_uInt16 nZoomValue = static_cast<sal_uInt16>(m_xUserEdit->get_value(FieldUnit::PERCENT));
pShell->PutItem(SfxUInt16Item(SID_ATTR_ZOOM_USER, nZoomValue));
}
m_xDialog->response(RET_OK);
diff --git a/cui/source/tabpages/align.cxx b/cui/source/tabpages/align.cxx
index 821e9abf875a..57e23b0bba46 100644
--- a/cui/source/tabpages/align.cxx
+++ b/cui/source/tabpages/align.cxx
@@ -108,7 +108,7 @@ AlignmentTabPage::AlignmentTabPage(TabPageParent pParent, const SfxItemSet& rCor
// text alignment
, m_xLbHorAlign(m_xBuilder->weld_combo_box("comboboxHorzAlign"))
, m_xFtIndent(m_xBuilder->weld_label("labelIndent"))
- , m_xEdIndent(m_xBuilder->weld_metric_spin_button("spinIndentFrom", FUNIT_POINT))
+ , m_xEdIndent(m_xBuilder->weld_metric_spin_button("spinIndentFrom", FieldUnit::POINT))
, m_xFtVerAlign(m_xBuilder->weld_label("labelVertAlign"))
, m_xLbVerAlign(m_xBuilder->weld_combo_box("comboboxVertAlign"))
//text rotation
@@ -207,7 +207,7 @@ bool AlignmentTabPage::FillItemSet( SfxItemSet* rSet )
if (m_xEdIndent->get_value_changed_from_saved())
{
- rSet->Put(SfxUInt16Item(GetWhich(SID_ATTR_ALIGN_INDENT), m_xEdIndent->get_value(FUNIT_TWIP)));
+ rSet->Put(SfxUInt16Item(GetWhich(SID_ATTR_ALIGN_INDENT), m_xEdIndent->get_value(FieldUnit::TWIP)));
bChanged = true;
}
@@ -419,7 +419,7 @@ void AlignmentTabPage::Reset(const SfxItemSet* pCoreAttrs)
case SfxItemState::SET:
{
const SfxUInt16Item& rIndentItem = static_cast<const SfxUInt16Item&>(pCoreAttrs->Get(nWhich));
- m_xEdIndent->set_value(rIndentItem.GetValue(), FUNIT_TWIP);
+ m_xEdIndent->set_value(rIndentItem.GetValue(), FieldUnit::TWIP);
break;
}
}
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index 1a76003fb216..03aa790d0f9d 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -308,7 +308,7 @@ class OfaAutoFmtPrcntSet : public weld::GenericDialogController
public:
explicit OfaAutoFmtPrcntSet(weld::Window* pParent)
: GenericDialogController(pParent, "cui/ui/percentdialog.ui", "PercentDialog")
- , m_xPrcntMF(m_xBuilder->weld_metric_spin_button("margin", FUNIT_PERCENT))
+ , m_xPrcntMF(m_xBuilder->weld_metric_spin_button("margin", FieldUnit::PERCENT))
{
}
@@ -743,10 +743,10 @@ IMPL_LINK_NOARG(OfaSwAutoFmtOptionsPage, EditHdl, Button*, void)
{
// dialog for per cent settings
OfaAutoFmtPrcntSet aDlg(GetFrameWeld());
- aDlg.GetPrcntFld().set_value(nPercent, FUNIT_PERCENT);
+ aDlg.GetPrcntFld().set_value(nPercent, FieldUnit::PERCENT);
if (aDlg.run() == RET_OK)
{
- nPercent = static_cast<sal_uInt16>(aDlg.GetPrcntFld().get_value(FUNIT_PERCENT));
+ nPercent = static_cast<sal_uInt16>(aDlg.GetPrcntFld().get_value(FieldUnit::PERCENT));
sMargin = " " +
unicode::formatPercent(nPercent, Application::GetSettings().GetUILanguageTag());
}
diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index 7bfaf4889ad1..a9cf96dc1734 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -79,9 +79,9 @@ const sal_uInt16 SvxBorderTabPage::pRanges[] =
static void lcl_SetDecimalDigitsTo1(weld::MetricSpinButton& rField)
{
- auto nMin = rField.denormalize(rField.get_min(FUNIT_TWIP));
+ auto nMin = rField.denormalize(rField.get_min(FieldUnit::TWIP));
rField.set_digits(1);
- rField.set_min(rField.normalize(nMin), FUNIT_TWIP);
+ rField.set_min(rField.normalize(nMin), FieldUnit::TWIP);
}
// number of preset images to show
@@ -128,7 +128,7 @@ SvxShadowItem ShadowControlsWrapper::GetControlValue(const SvxShadowItem& rItem)
// has not changed its value, to avoid round-trip errors (like twip->cm->twip)
// E.g., initial 100 twip will become 0.18 cm, which will return as 102 twip
if (mrMfSize.get_value_changed_from_saved())
- aItem.SetWidth(mrMfSize.denormalize(mrMfSize.get_value(FUNIT_TWIP)));
+ aItem.SetWidth(mrMfSize.denormalize(mrMfSize.get_value(FieldUnit::TWIP)));
if (!mrLbColor.IsNoSelection())
aItem.SetColor(mrLbColor.GetSelectEntryColor());
return aItem;
@@ -157,7 +157,7 @@ void ShadowControlsWrapper::SetControlValue(const SvxShadowItem& rItem)
mrVsPos.SetNoSelection();
break;
}
- mrMfSize.set_value(mrMfSize.normalize(rItem.GetWidth()), FUNIT_TWIP);
+ mrMfSize.set_value(mrMfSize.normalize(rItem.GetWidth()), FieldUnit::TWIP);
mrLbColor.SelectEntry(rItem.GetColor());
}
@@ -181,13 +181,13 @@ SvxMarginItem MarginControlsWrapper::GetControlValue(const SvxMarginItem &rItem)
{
SvxMarginItem aItem(rItem);
if (mrLeftWrp.get_sensitive())
- aItem.SetLeftMargin(mrLeftWrp.denormalize(mrLeftWrp.get_value(FUNIT_TWIP)));
+ aItem.SetLeftMargin(mrLeftWrp.denormalize(mrLeftWrp.get_value(FieldUnit::TWIP)));
if (mrRightWrp.get_sensitive())
- aItem.SetRightMargin(mrRightWrp.denormalize(mrRightWrp.get_value(FUNIT_TWIP)));
+ aItem.SetRightMargin(mrRightWrp.denormalize(mrRightWrp.get_value(FieldUnit::TWIP)));
if (mrTopWrp.get_sensitive())
- aItem.SetTopMargin(mrTopWrp.denormalize(mrTopWrp.get_value(FUNIT_TWIP)));
+ aItem.SetTopMargin(mrTopWrp.denormalize(mrTopWrp.get_value(FieldUnit::TWIP)));
if (mrBottomWrp.get_sensitive())
- aItem.SetBottomMargin(mrBottomWrp.denormalize(mrBottomWrp.get_value(FUNIT_TWIP)));
+ aItem.SetBottomMargin(mrBottomWrp.denormalize(mrBottomWrp.get_value(FieldUnit::TWIP)));
return aItem;
}
@@ -201,10 +201,10 @@ bool MarginControlsWrapper::get_value_changed_from_saved() const
void MarginControlsWrapper::SetControlValue(const SvxMarginItem& rItem)
{
- mrLeftWrp.set_value(mrLeftWrp.normalize(rItem.GetLeftMargin()), FUNIT_TWIP);
- mrRightWrp.set_value(mrRightWrp.normalize(rItem.GetRightMargin()), FUNIT_TWIP);
- mrTopWrp.set_value(mrTopWrp.normalize(rItem.GetTopMargin()), FUNIT_TWIP);
- mrBottomWrp.set_value(mrBottomWrp.normalize(rItem.GetBottomMargin()), FUNIT_TWIP);
+ mrLeftWrp.set_value(mrLeftWrp.normalize(rItem.GetLeftMargin()), FieldUnit::TWIP);
+ mrRightWrp.set_value(mrRightWrp.normalize(rItem.GetRightMargin()), FieldUnit::TWIP);
+ mrTopWrp.set_value(mrTopWrp.normalize(rItem.GetTopMargin()), FieldUnit::TWIP);
+ mrBottomWrp.set_value(mrBottomWrp.normalize(rItem.GetBottomMargin()), FieldUnit::TWIP);
mrLeftWrp.save_value();
mrRightWrp.save_value();
mrTopWrp.save_value();
@@ -245,22 +245,22 @@ SvxBorderTabPage::SvxBorderTabPage(TabPageParent pParent, const SfxItemSet& rCor
, m_xFrameSelWin(new weld::CustomWeld(*m_xBuilder, "framesel", m_aFrameSel))
, m_xLbLineStyle(new SvtLineListBox(m_xBuilder->weld_menu_button("linestylelb")))
, m_xLbLineColor(new ColorListBox(m_xBuilder->weld_menu_button("linecolorlb"), pParent.GetFrameWeld()))
- , m_xLineWidthMF(m_xBuilder->weld_metric_spin_button("linewidthmf", FUNIT_POINT))
+ , m_xLineWidthMF(m_xBuilder->weld_metric_spin_button("linewidthmf", FieldUnit::POINT))
, m_xSpacingFrame(m_xBuilder->weld_container("spacing"))
, m_xLeftFT(m_xBuilder->weld_label("leftft"))
- , m_xLeftMF(m_xBuilder->weld_metric_spin_button("leftmf", FUNIT_MM))
+ , m_xLeftMF(m_xBuilder->weld_metric_spin_button("leftmf", FieldUnit::MM))
, m_xRightFT(m_xBuilder->weld_label("rightft"))
- , m_xRightMF(m_xBuilder->weld_metric_spin_button("rightmf", FUNIT_MM))
+ , m_xRightMF(m_xBuilder->weld_metric_spin_button("rightmf", FieldUnit::MM))
, m_xTopFT(m_xBuilder->weld_label("topft"))
- , m_xTopMF(m_xBuilder->weld_metric_spin_button("topmf", FUNIT_MM))
+ , m_xTopMF(m_xBuilder->weld_metric_spin_button("topmf", FieldUnit::MM))
, m_xBottomFT(m_xBuilder->weld_label("bottomft"))
- , m_xBottomMF(m_xBuilder->weld_metric_spin_button("bottommf", FUNIT_MM))
+ , m_xBottomMF(m_xBuilder->weld_metric_spin_button("bottommf", FieldUnit::MM))
, m_xSynchronizeCB(m_xBuilder->weld_check_button("sync"))
, m_xShadowFrame(m_xBuilder->weld_container("shadow"))
, m_xWndShadows(new SvtValueSet(m_xBuilder->weld_scrolled_window("shadowswin")))
, m_xWndShadowsWin(new weld::CustomWeld(*m_xBuilder, "shadows", *m_xWndShadows))
, m_xFtShadowSize(m_xBuilder->weld_label("distanceft"))
- , m_xEdShadowSize(m_xBuilder->weld_metric_spin_button("distancemf", FUNIT_MM))
+ , m_xEdShadowSize(m_xBuilder->weld_metric_spin_button("distancemf", FieldUnit::MM))
, m_xFtShadowColor(m_xBuilder->weld_label("shadowcolorft"))
, m_xLbShadowColor(new ColorListBox(m_xBuilder->weld_menu_button("shadowcolorlb"), pParent.GetFrameWeld()))
, m_xPropertiesFrame(m_xBuilder->weld_container("properties"))
@@ -340,7 +340,7 @@ SvxBorderTabPage::SvxBorderTabPage(TabPageParent pParent, const SfxItemSet& rCor
{
// The caller specifies default line width. Honor it.
const SfxInt64Item* p = static_cast<const SfxInt64Item*>(pItem);
- m_xLineWidthMF->set_value(p->GetValue(), FUNIT_POINT);
+ m_xLineWidthMF->set_value(p->GetValue(), FieldUnit::POINT);
}
// set metric
@@ -353,17 +353,17 @@ SvxBorderTabPage::SvxBorderTabPage(TabPageParent pParent, const SfxItemSet& rCor
{
// #103396# the default value (1pt) can't be accurately represented in
// inches or pica with two decimals, so point is used instead.
- case FUNIT_PICA:
- case FUNIT_INCH:
- case FUNIT_FOOT:
- case FUNIT_MILE:
- eFUnit = FUNIT_POINT;
+ case FieldUnit::PICA:
+ case FieldUnit::INCH:
+ case FieldUnit::FOOT:
+ case FieldUnit::MILE:
+ eFUnit = FieldUnit::POINT;
break;
- case FUNIT_CM:
- case FUNIT_M:
- case FUNIT_KM:
- eFUnit = FUNIT_MM;
+ case FieldUnit::CM:
+ case FieldUnit::M:
+ case FieldUnit::KM:
+ eFUnit = FieldUnit::MM;
break;
default: ;//prevent warning
}
@@ -372,9 +372,9 @@ SvxBorderTabPage::SvxBorderTabPage(TabPageParent pParent, const SfxItemSet& rCor
{
switch ( eFUnit )
{
- case FUNIT_M:
- case FUNIT_KM:
- eFUnit = FUNIT_MM;
+ case FieldUnit::M:
+ case FieldUnit::KM:
+ eFUnit = FieldUnit::MM;
break;
default: ; //prevent warning
}
@@ -414,7 +414,7 @@ SvxBorderTabPage::SvxBorderTabPage(TabPageParent pParent, const SfxItemSet& rCor
}
bIsDontCare = !pBoxInfo->IsValid( SvxBoxInfoItemValidFlags::DISABLE );
}
- if(!mbUseMarginItem && eFUnit == FUNIT_MM && MapUnit::MapTwip == rCoreAttrs.GetPool()->GetMetric( GetWhich( SID_ATTR_BORDER_INNER ) ))
+ if(!mbUseMarginItem && eFUnit == FieldUnit::MM && MapUnit::MapTwip == rCoreAttrs.GetPool()->GetMetric( GetWhich( SID_ATTR_BORDER_INNER ) ))
{
//#i91548# changing the number of decimal digits changes the minimum values, too
lcl_SetDecimalDigitsTo1(*m_xLeftMF);
@@ -628,7 +628,7 @@ void SvxBorderTabPage::Reset( const SfxItemSet* rSet )
SetMetricValue(*m_xTopMF, pBoxInfoItem->GetDefDist(), eCoreUnit);
SetMetricValue(*m_xBottomMF, pBoxInfoItem->GetDefDist(), eCoreUnit);
- nMinValue = m_xLeftMF->get_value(FUNIT_NONE);
+ nMinValue = m_xLeftMF->get_value(FieldUnit::NONE);
if ( pBoxInfoItem->IsDist() )
{
@@ -637,10 +637,10 @@ void SvxBorderTabPage::Reset( const SfxItemSet* rSet )
bool bIsAnyBorderVisible = m_aFrameSel.IsAnyBorderVisible();
if( !bIsAnyBorderVisible || !pBoxInfoItem->IsMinDist() )
{
- m_xLeftMF->set_min(0, FUNIT_NONE);
- m_xRightMF->set_min(0, FUNIT_NONE);
- m_xTopMF->set_min(0, FUNIT_NONE);
- m_xBottomMF->set_min(0, FUNIT_NONE);
+ m_xLeftMF->set_min(0, FieldUnit::NONE);
+ m_xRightMF->set_min(0, FieldUnit::NONE);
+ m_xTopMF->set_min(0, FieldUnit::NONE);
+ m_xBottomMF->set_min(0, FieldUnit::NONE);
}
long nLeftDist = pBoxItem->GetDistance( SvxBoxItemLine::LEFT);
SetMetricValue(*m_xLeftMF, nLeftDist, eCoreUnit);
@@ -704,8 +704,8 @@ void SvxBorderTabPage::Reset( const SfxItemSet* rSet )
// Determine the width first as some styles can be missing depending on it
sal_Int64 nWidthPt = static_cast<sal_Int64>(MetricField::ConvertDoubleValue(
sal_Int64( nWidth ), m_xLineWidthMF->get_digits(),
- MapUnit::MapTwip, FUNIT_POINT ));
- m_xLineWidthMF->set_value(nWidthPt, FUNIT_POINT);
+ MapUnit::MapTwip, FieldUnit::POINT ));
+ m_xLineWidthMF->set_value(nWidthPt, FieldUnit::POINT);
m_xLbLineStyle->SetWidth(nWidth);
// then set the style
@@ -772,9 +772,9 @@ void SvxBorderTabPage::Reset( const SfxItemSet* rSet )
}
LinesChanged_Impl( nullptr );
- if (m_xLeftMF->get_value(FUNIT_NONE) == m_xRightMF->get_value(FUNIT_NONE) &&
- m_xTopMF->get_value(FUNIT_NONE) == m_xBottomMF->get_value(FUNIT_NONE) &&
- m_xTopMF->get_value(FUNIT_NONE) == m_xLeftMF->get_value(FUNIT_NONE))
+ if (m_xLeftMF->get_value(FieldUnit::NONE) == m_xRightMF->get_value(FieldUnit::NONE) &&
+ m_xTopMF->get_value(FieldUnit::NONE) == m_xBottomMF->get_value(FieldUnit::NONE) &&
+ m_xTopMF->get_value(FieldUnit::NONE) == m_xLeftMF->get_value(FieldUnit::NONE))
{
mbSync = true;
}
@@ -945,10 +945,10 @@ bool SvxBorderTabPage::FillItemSet( SfxItemSet* rCoreAttrs )
m_xRightMF->get_value_changed_from_saved() ||
m_xTopMF->get_value_changed_from_saved() ||
m_xBottomMF->get_value_changed_from_saved() ||
- nMinValue == m_xLeftMF->get_value(FUNIT_NONE) ||
- nMinValue == m_xRightMF->get_value(FUNIT_NONE) ||
- nMinValue == m_xTopMF->get_value(FUNIT_NONE) ||
- nMinValue == m_xBottomMF->get_value(FUNIT_NONE) ||
+ nMinValue == m_xLeftMF->get_value(FieldUnit::NONE) ||
+ nMinValue == m_xRightMF->get_value(FieldUnit::NONE) ||
+ nMinValue == m_xTopMF->get_value(FieldUnit::NONE) ||
+ nMinValue == m_xBottomMF->get_value(FieldUnit::NONE) ||
(pOldBoxInfoItem && !pOldBoxInfoItem->IsValid(SvxBoxInfoItemValidFlags::DISTANCE))
)
{
@@ -1139,11 +1139,11 @@ IMPL_LINK(SvxBorderTabPage, SelColHdl_Impl, ColorListBox&, rColorBox, void)
IMPL_LINK_NOARG(SvxBorderTabPage, ModifyWidthHdl_Impl, weld::MetricSpinButton&, void)
{
- sal_Int64 nVal = m_xLineWidthMF->get_value(FUNIT_NONE);
+ sal_Int64 nVal = m_xLineWidthMF->get_value(FieldUnit::NONE);
nVal = static_cast<sal_Int64>(MetricField::ConvertDoubleValue(
nVal,
m_xLineWidthMF->get_digits(),
- FUNIT_POINT, MapUnit::MapTwip ));
+ FieldUnit::POINT, MapUnit::MapTwip ));
m_xLbLineStyle->SetWidth( nVal );
m_aFrameSel.SetStyleToSelection( nVal,
@@ -1152,11 +1152,11 @@ IMPL_LINK_NOARG(SvxBorderTabPage, ModifyWidthHdl_Impl, weld::MetricSpinButton&,
IMPL_LINK_NOARG(SvxBorderTabPage, SelStyleHdl_Impl, SvtLineListBox&, void)
{
- sal_Int64 nVal = m_xLineWidthMF->get_value(FUNIT_NONE);
+ sal_Int64 nVal = m_xLineWidthMF->get_value(FieldUnit::NONE);
nVal = static_cast<sal_Int64>(MetricField::ConvertDoubleValue(
nVal,
m_xLineWidthMF->get_digits(),
- FUNIT_POINT, MapUnit::MapTwip ));
+ FieldUnit::POINT, MapUnit::MapTwip ));
m_aFrameSel.SetStyleToSelection ( nVal,
m_xLbLineStyle->GetSelectEntryStyle() );
}
@@ -1321,7 +1321,7 @@ void SvxBorderTabPage::FillLineListBox_Impl()
{ SvxBorderLineStyle::INSET, 10, &SvxBorderLine::darkColor, &SvxBorderLine::lightColor, &sameDistColor }
};
- m_xLbLineStyle->SetSourceUnit( FUNIT_TWIP );
+ m_xLbLineStyle->SetSourceUnit( FieldUnit::TWIP );
for (size_t i = 0; i < SAL_N_ELEMENTS(aLines); ++i)
{
@@ -1333,7 +1333,7 @@ void SvxBorderTabPage::FillLineListBox_Impl()
aLines[i].mnMinWidth, aLines[i].mpColor1Fn, aLines[i].mpColor2Fn, aLines[i].mpColorDistFn);
}
- sal_Int64 nVal = m_xLineWidthMF->get_value(FUNIT_NONE);
+ sal_Int64 nVal = m_xLineWidthMF->get_value(FieldUnit::NONE);
nVal = static_cast<sal_Int64>(MetricField::ConvertDoubleValue(nVal, m_xLineWidthMF->get_digits(),
m_xLineWidthMF->get_unit(), MapUnit::MapTwip));
m_xLbLineStyle->SetWidth( nVal );
@@ -1354,24 +1354,24 @@ IMPL_LINK_NOARG(SvxBorderTabPage, LinesChanged_Impl, LinkParamNone*, void)
{
if(!bSpaceModified)
{
- m_xLeftMF->set_value(nMinValue, FUNIT_NONE);
- m_xRightMF->set_value(nMinValue, FUNIT_NONE);
- m_xTopMF->set_value(nMinValue, FUNIT_NONE);
- m_xBottomMF->set_value(nMinValue, FUNIT_NONE);
+ m_xLeftMF->set_value(nMinValue, FieldUnit::NONE);
+ m_xRightMF->set_value(nMinValue, FieldUnit::NONE);
+ m_xTopMF->set_value(nMinValue, FieldUnit::NONE);
+ m_xBottomMF->set_value(nMinValue, FieldUnit::NONE);
}
}
else
{
- m_xLeftMF->set_min(0, FUNIT_NONE);
- m_xRightMF->set_min(0, FUNIT_NONE);
- m_xTopMF->set_min(0, FUNIT_NONE);
- m_xBottomMF->set_min(0, FUNIT_NONE);
+ m_xLeftMF->set_min(0, FieldUnit::NONE);
+ m_xRightMF->set_min(0, FieldUnit::NONE);
+ m_xTopMF->set_min(0, FieldUnit::NONE);
+ m_xBottomMF->set_min(0, FieldUnit::NONE);
if(!bSpaceModified && !mbAllowPaddingWithoutBorders)
{
- m_xLeftMF->set_value(0, FUNIT_NONE);
- m_xRightMF->set_value(0, FUNIT_NONE);
- m_xTopMF->set_value(0, FUNIT_NONE);
- m_xBottomMF->set_value(0, FUNIT_NONE);
+ m_xLeftMF->set_value(0, FieldUnit::NONE);
+ m_xRightMF->set_value(0, FieldUnit::NONE);
+ m_xTopMF->set_value(0, FieldUnit::NONE);
+ m_xBottomMF->set_value(0, FieldUnit::NONE);
}
}
// for tables everything is allowed
@@ -1418,15 +1418,15 @@ IMPL_LINK( SvxBorderTabPage, ModifyDistanceHdl_Impl, weld::MetricSpinButton&, rF
if (mbSync)
{
- const auto nVal = rField.get_value(FUNIT_NONE);
+ const auto nVal = rField.get_value(FieldUnit::NONE);
if (&rField != m_xLeftMF.get())
- m_xLeftMF->set_value(nVal, FUNIT_NONE);
+ m_xLeftMF->set_value(nVal, FieldUnit::NONE);
if (&rField != m_xRightMF.get())
- m_xRightMF->set_value(nVal, FUNIT_NONE);
+ m_xRightMF->set_value(nVal, FieldUnit::NONE);
if (&rField != m_xTopMF.get())
- m_xTopMF->set_value(nVal, FUNIT_NONE);
+ m_xTopMF->set_value(nVal, FieldUnit::NONE);
if (&rField != m_xBottomMF.get())
- m_xBottomMF->set_value(nVal, FUNIT_NONE);
+ m_xBottomMF->set_value(nVal, FieldUnit::NONE);
}
}
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index acb3bfb8e9c3..c24db30aa290 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -460,7 +460,7 @@ namespace
// conversion twips for the example-window
aSize.setHeight(
- ItemToControl( nHeight, _pPage->GetItemSet().GetPool()->GetMetric( _nFontHeightWhich ), FUNIT_TWIP ) );
+ ItemToControl( nHeight, _pPage->GetItemSet().GetPool()->GetMetric( _nFontHeightWhich ), FieldUnit::TWIP ) );
}
else if ( !_pFontSizeLB->get_active_text().isEmpty() )
aSize.setHeight( PointToTwips( static_cast<long>(_pFontSizeLB->get_value() / 10) ) );
@@ -2457,10 +2457,10 @@ SvxCharPositionPage::SvxCharPositionPage(TabPageParent pParent, const SfxItemSet
, m_xNormalPosBtn(m_xBuilder->weld_radio_button("normal"))
, m_xLowPosBtn(m_xBuilder->weld_radio_button("subscript"))
, m_xHighLowFT(m_xBuilder->weld_label("raiselower"))
- , m_xHighLowMF(m_xBuilder->weld_metric_spin_button("raiselowersb", FUNIT_PERCENT))
+ , m_xHighLowMF(m_xBuilder->weld_metric_spin_button("raiselowersb", FieldUnit::PERCENT))
, m_xHighLowRB(m_xBuilder->weld_check_button("automatic"))
, m_xFontSizeFT(m_xBuilder->weld_label("relativefontsize"))
- , m_xFontSizeMF(m_xBuilder->weld_metric_spin_button("fontsizesb", FUNIT_PERCENT))
+ , m_xFontSizeMF(m_xBuilder->weld_metric_spin_button("fontsizesb", FieldUnit::PERCENT))
, m_xRotationContainer(m_xBuilder->weld_widget("rotationcontainer"))
, m_xScalingFT(m_xBuilder->weld_label("scale"))
, m_xScalingAndRotationFT(m_xBuilder->weld_label("rotateandscale"))
@@ -2468,8 +2468,8 @@ SvxCharPositionPage::SvxCharPositionPage(TabPageParent pParent, const SfxItemSet
, m_x90degRB(m_xBuilder->weld_radio_button("90deg"))
, m_x270degRB(m_xBuilder->weld_radio_button("270deg"))
, m_xFitToLineCB(m_xBuilder->weld_check_button("fittoline"))
- , m_xScaleWidthMF(m_xBuilder->weld_metric_spin_button("scalewidthsb", FUNIT_PERCENT))
- , m_xKerningMF(m_xBuilder->weld_metric_spin_button("kerningsb", FUNIT_POINT))
+ , m_xScaleWidthMF(m_xBuilder->weld_metric_spin_button("scalewidthsb", FieldUnit::PERCENT))
+ , m_xKerningMF(m_xBuilder->weld_metric_spin_button("kerningsb", FieldUnit::POINT))
, m_xPairKerningBtn(m_xBuilder->weld_check_button("pairkerning"))
{
m_xPreviewWin.reset(new weld::CustomWeld(*m_xBuilder, "preview", m_aPreviewWin));
@@ -2536,8 +2536,8 @@ void SvxCharPositionPage::SetEscapement_Impl( SvxEscapement nEsc )
short nFac = aEscItm.GetEsc() < 0 ? -1 : 1;
- m_xHighLowMF->set_value(aEscItm.GetEsc() * nFac, FUNIT_PERCENT);
- m_xFontSizeMF->set_value(aEscItm.GetProportionalHeight(), FUNIT_PERCENT);
+ m_xHighLowMF->set_value(aEscItm.GetEsc() * nFac, FieldUnit::PERCENT);
+ m_xFontSizeMF->set_value(aEscItm.GetProportionalHeight(), FieldUnit::PERCENT);
if ( SvxEscapement::Off == nEsc )
{
@@ -2590,8 +2590,8 @@ IMPL_LINK_NOARG(SvxCharPositionPage, RotationHdl_Impl, weld::ToggleButton&, void
void SvxCharPositionPage::FontModifyHdl_Impl()
{
- sal_uInt8 nEscProp = static_cast<sal_uInt8>(m_xFontSizeMF->get_value(FUNIT_PERCENT));
- short nEsc = static_cast<short>(m_xHighLowMF->get_value(FUNIT_PERCENT));
+ sal_uInt8 nEscProp = static_cast<sal_uInt8>(m_xFontSizeMF->get_value(FieldUnit::PERCENT));
+ short nEsc = static_cast<short>(m_xHighLowMF->get_value(FieldUnit::PERCENT));
nEsc *= m_xLowPosBtn->get_active() ? -1 : 1;
UpdatePreview_Impl( 100, nEscProp, nEsc );
}
@@ -2614,13 +2614,13 @@ IMPL_LINK_NOARG(SvxCharPositionPage, FitToLineHdl_Impl, weld::ToggleButton&, voi
sal_uInt16 nVal = m_nScaleWidthInitialVal;
if (m_xFitToLineCB->get_active())
nVal = m_nScaleWidthItemSetVal;
- m_xScaleWidthMF->set_value(nVal, FUNIT_PERCENT);
+ m_xScaleWidthMF->set_value(nVal, FieldUnit::PERCENT);
m_aPreviewWin.SetFontWidthScale( nVal );
}
IMPL_LINK_NOARG(SvxCharPositionPage, KerningModifyHdl_Impl, weld::MetricSpinButton&, void)
{
- long nVal = static_cast<long>(m_xKerningMF->get_value(FUNIT_POINT));
+ long nVal = static_cast<long>(m_xKerningMF->get_value(FieldUnit::POINT));
nVal = LogicToLogic( nVal, MapUnit::MapPoint, MapUnit::MapTwip );
long nKern = static_cast<short>(m_xKerningMF->denormalize(nVal));
@@ -2643,16 +2643,16 @@ IMPL_LINK(SvxCharPositionPage, ValueChangedHdl_Impl, weld::MetricSpinButton&, rF
if (m_xHighLowMF.get() == &rField)
{
if ( bLow )
- m_nSubEsc = static_cast<short>(m_xHighLowMF->get_value(FUNIT_PERCENT)) * -1;
+ m_nSubEsc = static_cast<short>(m_xHighLowMF->get_value(FieldUnit::PERCENT)) * -1;
else
- m_nSuperEsc = static_cast<short>(m_xHighLowMF->get_value(FUNIT_PERCENT));
+ m_nSuperEsc = static_cast<short>(m_xHighLowMF->get_value(FieldUnit::PERCENT));
}
else if (m_xFontSizeMF.get() == &rField)
{
if ( bLow )
- m_nSubProp = static_cast<sal_uInt8>(m_xFontSizeMF->get_value(FUNIT_PERCENT));
+ m_nSubProp = static_cast<sal_uInt8>(m_xFontSizeMF->get_value(FieldUnit::PERCENT));
else
- m_nSuperProp = static_cast<sal_uInt8>(m_xFontSizeMF->get_value(FUNIT_PERCENT));
+ m_nSuperProp = static_cast<sal_uInt8>(m_xFontSizeMF->get_value(FieldUnit::PERCENT));
}
FontModifyHdl_Impl();
@@ -2660,7 +2660,7 @@ IMPL_LINK(SvxCharPositionPage, ValueChangedHdl_Impl, weld::MetricSpinButton&, rF
IMPL_LINK_NOARG(SvxCharPositionPage, ScaleWidthModifyHdl_Impl, weld::MetricSpinButton&, void)
{
- m_aPreviewWin.SetFontWidthScale(sal_uInt16(m_xScaleWidthMF->get_value(FUNIT_PERCENT)));
+ m_aPreviewWin.SetFontWidthScale(sal_uInt16(m_xScaleWidthMF->get_value(FieldUnit::PERCENT)));
}
DeactivateRC SvxCharPositionPage::DeactivatePage( SfxItemSet* _pSet )
@@ -2689,13 +2689,13 @@ void SvxCharPositionPage::Reset( const SfxItemSet* rSet )
//fdo#75307 validate all the entries and discard all of them if any are
//out of range
bool bValid = true;
- if (m_nSuperEsc < m_xHighLowMF->get_min(FUNIT_PERCENT) || m_nSuperEsc > m_xHighLowMF->get_max(FUNIT_PERCENT))
+ if (m_nSuperEsc < m_xHighLowMF->get_min(FieldUnit::PERCENT) || m_nSuperEsc > m_xHighLowMF->get_max(FieldUnit::PERCENT))
bValid = false;
- if (m_nSubEsc*-1 < m_xHighLowMF->get_min(FUNIT_PERCENT) || m_nSubEsc*-1 > m_xHighLowMF->get_max(FUNIT_PERCENT))
+ if (m_nSubEsc*-1 < m_xHighLowMF->get_min(FieldUnit::PERCENT) || m_nSubEsc*-1 > m_xHighLowMF->get_max(FieldUnit::PERCENT))
bValid = false;
- if (m_nSuperProp < m_xFontSizeMF->get_min(FUNIT_PERCENT) || m_nSuperProp > m_xFontSizeMF->get_max(FUNIT_PERCENT))
+ if (m_nSuperProp < m_xFontSizeMF->get_min(FieldUnit::PERCENT) || m_nSuperProp > m_xFontSizeMF->get_max(FieldUnit::PERCENT))
bValid = false;
- if (m_nSubProp < m_xFontSizeMF->get_min(FUNIT_PERCENT) || m_nSubProp > m_xFontSizeMF->get_max(FUNIT_PERCENT))
+ if (m_nSubProp < m_xFontSizeMF->get_min(FieldUnit::PERCENT) || m_nSubProp > m_xFontSizeMF->get_max(FieldUnit::PERCENT))
bValid = false;
if (!bValid)
@@ -2767,7 +2767,7 @@ void SvxCharPositionPage::Reset( const SfxItemSet* rSet )
m_xHighLowFT->set_sensitive(false);
m_xHighLowMF->set_sensitive(false);
}
- m_xHighLowMF->set_value(m_xHighLowMF->normalize(nFac * nEsc), FUNIT_PERCENT);
+ m_xHighLowMF->set_value(m_xHighLowMF->normalize(nFac * nEsc), FieldUnit::PERCENT);
}
else
{
@@ -2776,7 +2776,7 @@ void SvxCharPositionPage::Reset( const SfxItemSet* rSet )
PositionHdl_Impl(*m_xNormalPosBtn);
}
//the height has to be set after the handler is called to keep the value also if the escapement is zero
- m_xFontSizeMF->set_value(m_xFontSizeMF->normalize(nEscProp), FUNIT_PERCENT);
+ m_xFontSizeMF->set_value(m_xFontSizeMF->normalize(nEscProp), FieldUnit::PERCENT);
}
else
{
@@ -2805,10 +2805,10 @@ void SvxCharPositionPage::Reset( const SfxItemSet* rSet )
rCTLFont.SetFixKerning( static_cast<short>(nKern) );
//the attribute value must be displayed also if it's above the maximum allowed value
- long nVal = static_cast<long>(m_xKerningMF->get_max(FUNIT_POINT));
+ long nVal = static_cast<long>(m_xKerningMF->get_max(FieldUnit::POINT));
if(nVal < nKerning)
- m_xKerningMF->set_max(nKerning, FUNIT_POINT);
- m_xKerningMF->set_value(nKerning, FUNIT_POINT);
+ m_xKerningMF->set_max(nKerning, FieldUnit::POINT);
+ m_xKerningMF->set_value(nKerning, FieldUnit::POINT);
}
else
m_xKerningMF->set_text(OUString());
@@ -2830,10 +2830,10 @@ void SvxCharPositionPage::Reset( const SfxItemSet* rSet )
{
const SvxCharScaleWidthItem& rItem = static_cast<const SvxCharScaleWidthItem&>( rSet->Get( nWhich ) );
m_nScaleWidthInitialVal = rItem.GetValue();
- m_xScaleWidthMF->set_value(m_nScaleWidthInitialVal, FUNIT_PERCENT);
+ m_xScaleWidthMF->set_value(m_nScaleWidthInitialVal, FieldUnit::PERCENT);
}
else
- m_xScaleWidthMF->set_value(100, FUNIT_PERCENT);
+ m_xScaleWidthMF->set_value(100, FieldUnit::PERCENT);
nWhich = GetWhich( SID_ATTR_CHAR_WIDTH_FIT_TO_LINE );
if ( rSet->GetItemState( nWhich ) >= SfxItemState::DEFAULT )
@@ -2924,10 +2924,10 @@ bool SvxCharPositionPage::FillItemSet( SfxItemSet* rSet )
nEsc = bHigh ? DFLT_ESC_AUTO_SUPER : DFLT_ESC_AUTO_SUB;
else
{
- nEsc = static_cast<short>(m_xHighLowMF->denormalize(m_xHighLowMF->get_value(FUNIT_PERCENT)));
+ nEsc = static_cast<short>(m_xHighLowMF->denormalize(m_xHighLowMF->get_value(FieldUnit::PERCENT)));
nEsc *= (bHigh ? 1 : -1);
}
- nEscProp = static_cast<sal_uInt8>(m_xFontSizeMF->denormalize(m_xFontSizeMF->get_value(FUNIT_PERCENT)));
+ nEscProp = static_cast<sal_uInt8>(m_xFontSizeMF->denormalize(m_xFontSizeMF->get_value(FieldUnit::PERCENT)));
}
else
{
@@ -2963,7 +2963,7 @@ bool SvxCharPositionPage::FillItemSet( SfxItemSet* rSet )
short nKerning = 0;
MapUnit eUnit = rSet->GetPool()->GetMetric( nWhich );
- long nTmp = static_cast<long>(m_xKerningMF->get_value(FUNIT_POINT));
+ long nTmp = static_cast<long>(m_xKerningMF->get_value(FieldUnit::POINT));
long nVal = LogicToLogic( nTmp, MapUnit::MapPoint, eUnit );
nKerning = static_cast<short>(m_xKerningMF->denormalize( nVal ));
@@ -2998,7 +2998,7 @@ bool SvxCharPositionPage::FillItemSet( SfxItemSet* rSet )
nWhich = GetWhich( SID_ATTR_CHAR_SCALEWIDTH );
if (m_xScaleWidthMF->get_value_changed_from_saved())
{
- rSet->Put(SvxCharScaleWidthItem(static_cast<sal_uInt16>(m_xScaleWidthMF->get_value(FUNIT_PERCENT)), nWhich));
+ rSet->Put(SvxCharScaleWidthItem(static_cast<sal_uInt16>(m_xScaleWidthMF->get_value(FieldUnit::PERCENT)), nWhich));
bModified = true;
}
else if ( SfxItemState::DEFAULT == rOldSet.GetItemState( nWhich, false ) )
diff --git a/cui/source/tabpages/connect.cxx b/cui/source/tabpages/connect.cxx
index d71bc5623972..9586d3d4e539 100644
--- a/cui/source/tabpages/connect.cxx
+++ b/cui/source/tabpages/connect.cxx
@@ -75,15 +75,15 @@ SvxConnectionPage::SvxConnectionPage(TabPageParent pWindow, const SfxItemSet& rI
, pView(nullptr)
, m_xLbType(m_xBuilder->weld_combo_box("LB_TYPE"))
, m_xFtLine1(m_xBuilder->weld_label("FT_LINE_1"))
- , m_xMtrFldLine1(m_xBuilder->weld_metric_spin_button("MTR_FLD_LINE_1", FUNIT_CM))
+ , m_xMtrFldLine1(m_xBuilder->weld_metric_spin_button("MTR_FLD_LINE_1", FieldUnit::CM))
, m_xFtLine2(m_xBuilder->weld_label("FT_LINE_2"))
- , m_xMtrFldLine2(m_xBuilder->weld_metric_spin_button("MTR_FLD_LINE_2", FUNIT_CM))
+ , m_xMtrFldLine2(m_xBuilder->weld_metric_spin_button("MTR_FLD_LINE_2", FieldUnit::CM))
, m_xFtLine3(m_xBuilder->weld_label("FT_LINE_3"))
- , m_xMtrFldLine3(m_xBuilder->weld_metric_spin_button("MTR_FLD_LINE_3", FUNIT_CM))
- , m_xMtrFldHorz1(m_xBuilder->weld_metric_spin_button("MTR_FLD_HORZ_1", FUNIT_MM))
- , m_xMtrFldVert1(m_xBuilder->weld_metric_spin_button("MTR_FLD_VERT_1", FUNIT_MM))
- , m_xMtrFldHorz2(m_xBuilder->weld_metric_spin_button("MTR_FLD_HORZ_2", FUNIT_MM))
- , m_xMtrFldVert2(m_xBuilder->weld_metric_spin_button("MTR_FLD_VERT_2", FUNIT_MM))
+ , m_xMtrFldLine3(m_xBuilder->weld_metric_spin_button("MTR_FLD_LINE_3", FieldUnit::CM))
+ , m_xMtrFldHorz1(m_xBuilder->weld_metric_spin_button("MTR_FLD_HORZ_1", FieldUnit::MM))
+ , m_xMtrFldVert1(m_xBuilder->weld_metric_spin_button("MTR_FLD_VERT_1", FieldUnit::MM))
+ , m_xMtrFldHorz2(m_xBuilder->weld_metric_spin_button("MTR_FLD_HORZ_2", FieldUnit::MM))
+ , m_xMtrFldVert2(m_xBuilder->weld_metric_spin_button("MTR_FLD_VERT_2", FieldUnit::MM))
, m_xCtlPreview(new weld::CustomWeld(*m_xBuilder, "CTL_PREVIEW", m_aCtlPreview))
{
SfxItemPool* pPool = rOutAttrs.GetPool();
@@ -100,15 +100,15 @@ SvxConnectionPage::SvxConnectionPage(TabPageParent pWindow, const SfxItemSet& rI
SetFieldUnit( *m_xMtrFldLine1, eFUnit );
SetFieldUnit( *m_xMtrFldLine2, eFUnit );
SetFieldUnit( *m_xMtrFldLine3, eFUnit );
- if( eFUnit == FUNIT_MM )
+ if( eFUnit == FieldUnit::MM )
{
- m_xMtrFldHorz1->set_increments(50, 500, FUNIT_NONE);
- m_xMtrFldHorz2->set_increments(50, 500, FUNIT_NONE);
- m_xMtrFldVert1->set_increments(50, 500, FUNIT_NONE);
- m_xMtrFldVert2->set_increments(50, 500, FUNIT_NONE);
- m_xMtrFldLine1->set_increments(50, 500, FUNIT_NONE);
- m_xMtrFldLine2->set_increments(50, 500, FUNIT_NONE);
- m_xMtrFldLine3->set_increments(50, 500, FUNIT_NONE);
+ m_xMtrFldHorz1->set_increments(50, 500, FieldUnit::NONE);
+ m_xMtrFldHorz2->set_increments(50, 500, FieldUnit::NONE);
+ m_xMtrFldVert1->set_increments(50, 500, FieldUnit::NONE);
+ m_xMtrFldVert2->set_increments(50, 500, FieldUnit::NONE);
+ m_xMtrFldLine1->set_increments(50, 500, FieldUnit::NONE);
+ m_xMtrFldLine2->set_increments(50, 500, FieldUnit::NONE);
+ m_xMtrFldLine3->set_increments(50, 500, FieldUnit::NONE);
}
Link<weld::MetricSpinButton&,void> aLink(LINK(this, SvxConnectionPage, ChangeAttrEditHdl_Impl));
@@ -337,21 +337,21 @@ IMPL_LINK_NOARG(SvxConnectionPage, ChangeAttrListBoxHdl_Impl, weld::ComboBox&, v
m_xFtLine3->set_sensitive( nCount > 2 );
m_xMtrFldLine3->set_sensitive( nCount > 2 );
if( nCount > 2 )
- m_xMtrFldLine3->set_value(m_xMtrFldLine3->get_value(FUNIT_NONE), FUNIT_NONE);
+ m_xMtrFldLine3->set_value(m_xMtrFldLine3->get_value(FieldUnit::NONE), FieldUnit::NONE);
else
m_xMtrFldLine3->set_text("");
m_xFtLine2->set_sensitive( nCount > 1 );
m_xMtrFldLine2->set_sensitive( nCount > 1 );
if( nCount > 1 )
- m_xMtrFldLine2->set_value(m_xMtrFldLine2->get_value(FUNIT_NONE), FUNIT_NONE);
+ m_xMtrFldLine2->set_value(m_xMtrFldLine2->get_value(FieldUnit::NONE), FieldUnit::NONE);
else
m_xMtrFldLine2->set_text("");
m_xFtLine1->set_sensitive( nCount > 0 );
m_xMtrFldLine1->set_sensitive( nCount > 0 );
if( nCount > 0 )
- m_xMtrFldLine1->set_value(m_xMtrFldLine1->get_value(FUNIT_NONE), FUNIT_NONE);
+ m_xMtrFldLine1->set_value(m_xMtrFldLine1->get_value(FieldUnit::NONE), FieldUnit::NONE);
else
m_xMtrFldLine1->set_text("");
}
diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx
index 22fb67eff376..d42f42a7f045 100644
--- a/cui/source/tabpages/grfpage.cxx
+++ b/cui/source/tabpages/grfpage.cxx
@@ -57,16 +57,16 @@ SvxGrfCropPage::SvxGrfCropPage(TabPageParent pParent, const SfxItemSet &rSet)
, m_xCropFrame(m_xBuilder->weld_widget("cropframe"))
, m_xZoomConstRB(m_xBuilder->weld_radio_button("keepscale"))
, m_xSizeConstRB(m_xBuilder->weld_radio_button("keepsize"))
- , m_xLeftMF(m_xBuilder->weld_metric_spin_button("left", FUNIT_CM))
- , m_xRightMF(m_xBuilder->weld_metric_spin_button("right", FUNIT_CM))
- , m_xTopMF(m_xBuilder->weld_metric_spin_button("top", FUNIT_CM))
- , m_xBottomMF(m_xBuilder->weld_metric_spin_button("bottom", FUNIT_CM))
+ , m_xLeftMF(m_xBuilder->weld_metric_spin_button("left", FieldUnit::CM))
+ , m_xRightMF(m_xBuilder->weld_metric_spin_button("right", FieldUnit::CM))
+ , m_xTopMF(m_xBuilder->weld_metric_spin_button("top", FieldUnit::CM))
+ , m_xBottomMF(m_xBuilder->weld_metric_spin_button("bottom", FieldUnit::CM))
, m_xScaleFrame(m_xBuilder->weld_widget("scaleframe"))
- , m_xWidthZoomMF(m_xBuilder->weld_metric_spin_button("widthzoom", FUNIT_PERCENT))
- , m_xHeightZoomMF(m_xBuilder->weld_metric_spin_button("heightzoom", FUNIT_PERCENT))
+ , m_xWidthZoomMF(m_xBuilder->weld_metric_spin_button("widthzoom", FieldUnit::PERCENT))
+ , m_xHeightZoomMF(m_xBuilder->weld_metric_spin_button("heightzoom", FieldUnit::PERCENT))
, m_xSizeFrame(m_xBuilder->weld_widget("sizeframe"))
- , m_xWidthMF(m_xBuilder->weld_metric_spin_button("width", FUNIT_CM))
- , m_xHeightMF(m_xBuilder->weld_metric_spin_button("height", FUNIT_CM))
+ , m_xWidthMF(m_xBuilder->weld_metric_spin_button("width", FieldUnit::CM))
+ , m_xHeightMF(m_xBuilder->weld_metric_spin_button("height", FieldUnit::CM))
, m_xOrigSizeGrid(m_xBuilder->weld_widget("origsizegrid"))
, m_xOrigSizeFT(m_xBuilder->weld_label("origsizeft"))
, m_xOrigSizePB(m_xBuilder->weld_button("origsize"))
@@ -151,10 +151,10 @@ void SvxGrfCropPage::Reset( const SfxItemSet *rSet )
}
else
{
- m_xLeftMF->set_value(0, FUNIT_NONE);
- m_xRightMF->set_value(0, FUNIT_NONE);
- m_xTopMF->set_value(0, FUNIT_NONE);
- m_xBottomMF->set_value(0, FUNIT_NONE);
+ m_xLeftMF->set_value(0, FieldUnit::NONE);
+ m_xRightMF->set_value(0, FieldUnit::NONE);
+ m_xTopMF->set_value(0, FieldUnit::NONE);
+ m_xBottomMF->set_value(0, FieldUnit::NONE);
}
m_xLeftMF->save_value();
@@ -301,12 +301,12 @@ void SvxGrfCropPage::ActivatePage(const SfxItemSet& rSet)
auto nWidth = m_xWidthMF->normalize(nOldWidth);
auto nHeight = m_xHeightMF->normalize(nOldHeight);
- if (nWidth != m_xWidthMF->get_value(FUNIT_TWIP))
- m_xWidthMF->set_value(nWidth, FUNIT_TWIP);
+ if (nWidth != m_xWidthMF->get_value(FieldUnit::TWIP))
+ m_xWidthMF->set_value(nWidth, FieldUnit::TWIP);
m_xWidthMF->save_value();
- if (nHeight != m_xHeightMF->get_value(FUNIT_TWIP))
- m_xHeightMF->set_value(nHeight, FUNIT_TWIP);
+ if (nHeight != m_xHeightMF->get_value(FieldUnit::TWIP))
+ m_xHeightMF->set_value(nHeight, FieldUnit::TWIP);
m_xHeightMF->save_value();
if( SfxItemState::SET == rSet.GetItemState( SID_ATTR_GRAF_GRAPHIC, false, &pItem ) )
@@ -364,7 +364,7 @@ IMPL_LINK( SvxGrfCropPage, ZoomHdl, weld::MetricSpinButton&, rField, void )
long nLRBorders = lcl_GetValue(*m_xLeftMF, eUnit)
+lcl_GetValue(*m_xRightMF, eUnit);
m_xWidthMF->set_value( m_xWidthMF->normalize(
- ((aOrigSize.Width() - nLRBorders) * rField.get_value(FUNIT_NONE))/100),
+ ((aOrigSize.Width() - nLRBorders) * rField.get_value(FieldUnit::NONE))/100),
eUnit);
}
else
@@ -372,7 +372,7 @@ IMPL_LINK( SvxGrfCropPage, ZoomHdl, weld::MetricSpinButton&, rField, void )
long nULBorders = lcl_GetValue(*m_xTopMF, eUnit)
+lcl_GetValue(*m_xBottomMF, eUnit);
m_xHeightMF->set_value( m_xHeightMF->normalize(
- ((aOrigSize.Height() - nULBorders ) * rField.get_value(FUNIT_NONE))/100) ,
+ ((aOrigSize.Height() - nULBorders ) * rField.get_value(FieldUnit::NONE))/100) ,
eUnit );
}
}
@@ -399,7 +399,7 @@ IMPL_LINK( SvxGrfCropPage, SizeHdl, weld::MetricSpinButton&, rField, void )
if(!nWidth)
nWidth++;
sal_uInt16 nZoom = static_cast<sal_uInt16>( aSize.Width() * 100 / nWidth);
- m_xWidthZoomMF->set_value(nZoom, FUNIT_NONE);
+ m_xWidthZoomMF->set_value(nZoom, FieldUnit::NONE);
}
else
{
@@ -409,7 +409,7 @@ IMPL_LINK( SvxGrfCropPage, SizeHdl, weld::MetricSpinButton&, rField, void )
if(!nHeight)
nHeight++;
sal_uInt16 nZoom = static_cast<sal_uInt16>( aSize.Height() * 100 / nHeight);
- m_xHeightZoomMF->set_value(nZoom, FUNIT_NONE);
+ m_xHeightZoomMF->set_value(nZoom, FieldUnit::NONE);
}
}
@@ -429,7 +429,7 @@ IMPL_LINK( SvxGrfCropPage, CropModifyHdl, weld::MetricSpinButton&, rField, void
{
long nLeft = lcl_GetValue( *m_xLeftMF, eUnit );
long nRight = lcl_GetValue( *m_xRightMF, eUnit );
- long nWidthZoom = static_cast<long>(m_xWidthZoomMF->get_value(FUNIT_NONE));
+ long nWidthZoom = static_cast<long>(m_xWidthZoomMF->get_value(FieldUnit::NONE));
if (bZoom && nWidthZoom != 0 && ( ( ( aOrigSize.Width() - (nLeft + nRight )) * nWidthZoom )
/ 100 >= aPageSize.Width() ) )
{
@@ -466,7 +466,7 @@ IMPL_LINK( SvxGrfCropPage, CropModifyHdl, weld::MetricSpinButton&, rField, void
{
long nTop = lcl_GetValue( *m_xTopMF, eUnit );
long nBottom = lcl_GetValue( *m_xBottomMF, eUnit );
- long nHeightZoom = static_cast<long>(m_xHeightZoomMF->get_value(FUNIT_NONE));
+ long nHeightZoom = static_cast<long>(m_xHeightZoomMF->get_value(FieldUnit::NONE));
if(bZoom && ( ( ( aOrigSize.Height() - (nTop + nBottom )) * nHeightZoom)
/ 100 >= aPageSize.Height()))
{
@@ -517,8 +517,8 @@ IMPL_LINK_NOARG(SvxGrfCropPage, OrigSizeHdl, weld::Button&, void)
lcl_GetValue( *m_xTopMF, eUnit ) -
lcl_GetValue( *m_xBottomMF, eUnit );
m_xHeightMF->set_value( m_xHeightMF->normalize( nHeight ), eUnit );
- m_xWidthZoomMF->set_value(100, FUNIT_NONE);
- m_xHeightZoomMF->set_value(100, FUNIT_NONE);
+ m_xWidthZoomMF->set_value(100, FieldUnit::NONE);
+ m_xHeightZoomMF->set_value(100, FieldUnit::NONE);
bSetOrigSize = true;
}
/*--------------------------------------------------------------------
@@ -542,12 +542,12 @@ void SvxGrfCropPage::CalcZoom()
long nDen;
if( (nDen = aOrigSize.Width() - nLRBorders) > 0)
nZoom = static_cast<sal_uInt16>((( nWidth * 1000 / nDen )+5)/10);
- m_xWidthZoomMF->set_value(nZoom, FUNIT_NONE);
+ m_xWidthZoomMF->set_value(nZoom, FieldUnit::NONE);
if( (nDen = aOrigSize.Height() - nULBorders) > 0)
nZoom = static_cast<sal_uInt16>((( nHeight * 1000 / nDen )+5)/10);
else
nZoom = 0;
- m_xHeightZoomMF->set_value(nZoom, FUNIT_NONE);
+ m_xHeightZoomMF->set_value(nZoom, FieldUnit::NONE);
}
/*--------------------------------------------------------------------
@@ -618,13 +618,13 @@ void SvxGrfCropPage::GraphicHasChanged( bool bFound )
m_aExampleWN.SetBottom(nVal);
}
- m_xLeftMF->set_increments(nSpin, nSpin * 10, FUNIT_NONE);
- m_xRightMF->set_increments(nSpin, nSpin * 10, FUNIT_NONE);
+ m_xLeftMF->set_increments(nSpin, nSpin * 10, FieldUnit::NONE);
+ m_xRightMF->set_increments(nSpin, nSpin * 10, FieldUnit::NONE);
nSpin = m_xTopMF->normalize(aOrigSize.Height()) / 20;
nSpin = MetricField::ConvertValue( nSpin, aOrigSize.Width(), 0,
eUnit, m_xLeftMF->get_unit() );
- m_xTopMF->set_increments(nSpin, nSpin * 10, FUNIT_NONE);
- m_xBottomMF->set_increments(nSpin, nSpin * 10, FUNIT_NONE);
+ m_xTopMF->set_increments(nSpin, nSpin * 10, FieldUnit::NONE);
+ m_xBottomMF->set_increments(nSpin, nSpin * 10, FieldUnit::NONE);
// display original size
const FieldUnit eMetric = GetModuleFieldUnit( GetItemSet() );
diff --git a/cui/source/tabpages/labdlg.cxx b/cui/source/tabpages/labdlg.cxx
index 680b78f41878..778d4b869e5b 100644
--- a/cui/source/tabpages/labdlg.cxx
+++ b/cui/source/tabpages/labdlg.cxx
@@ -81,15 +81,15 @@ SvxCaptionTabPage::SvxCaptionTabPage(TabPageParent pParent, const SfxItemSet& rI
, nExtension(0)
, rOutAttrs(rInAttrs)
, pView(nullptr)
- , m_xMF_SPACING(m_xBuilder->weld_metric_spin_button("spacing", FUNIT_MM))
+ , m_xMF_SPACING(m_xBuilder->weld_metric_spin_button("spacing", FieldUnit::MM))
, m_xLB_EXTENSION(m_xBuilder->weld_combo_box("extension"))
, m_xFT_BYFT(m_xBuilder->weld_label("byft"))
- , m_xMF_BY(m_xBuilder->weld_metric_spin_button("by", FUNIT_MM))
+ , m_xMF_BY(m_xBuilder->weld_metric_spin_button("by", FieldUnit::MM))
, m_xFT_POSITIONFT(m_xBuilder->weld_label("positionft"))
, m_xLB_POSITION(m_xBuilder->weld_combo_box("position"))
, m_xLineTypes(m_xBuilder->weld_combo_box("linetypes"))
, m_xFT_LENGTHFT(m_xBuilder->weld_label("lengthft"))
- , m_xMF_LENGTH(m_xBuilder->weld_metric_spin_button("length", FUNIT_MM))
+ , m_xMF_LENGTH(m_xBuilder->weld_metric_spin_button("length", FieldUnit::MM))
, m_xCB_OPTIMAL(m_xBuilder->weld_check_button("optimal"))
, m_xCT_CAPTTYPE(new SvtValueSet(m_xBuilder->weld_scrolled_window("valuesetwin")))
, m_xCT_CAPTTYPEWin(new weld::CustomWeld(*m_xBuilder, "valueset", *m_xCT_CAPTTYPE))
@@ -232,10 +232,10 @@ void SvxCaptionTabPage::Reset( const SfxItemSet* )
switch ( eFUnit )
{
- case FUNIT_CM:
- case FUNIT_M:
- case FUNIT_KM:
- eFUnit = FUNIT_MM;
+ case FieldUnit::CM:
+ case FieldUnit::M:
+ case FieldUnit::KM:
+ eFUnit = FieldUnit::MM;
break;
default: ;//prevent warning
}
@@ -253,7 +253,7 @@ void SvxCaptionTabPage::Reset( const SfxItemSet* )
eUnit = pPool->GetMetric( nWhich );
nEscAbs = static_cast<const SdrCaptionEscAbsItem&>( rOutAttrs.Get( nWhich ) ).GetValue();
SetMetricValue( *m_xMF_BY, nEscAbs, eUnit );
- nEscAbs = m_xMF_BY->get_value(FUNIT_NONE);
+ nEscAbs = m_xMF_BY->get_value(FieldUnit::NONE);
nWhich = GetWhich( SDRATTR_CAPTIONESCREL );
nEscRel = static_cast<long>(static_cast<const SdrCaptionEscRelItem&>( rOutAttrs.Get( nWhich ) ).GetValue());
@@ -263,14 +263,14 @@ void SvxCaptionTabPage::Reset( const SfxItemSet* )
eUnit = pPool->GetMetric( nWhich );
nLineLen = static_cast<const SdrCaptionLineLenItem&>( rOutAttrs.Get( nWhich ) ).GetValue();
SetMetricValue( *m_xMF_LENGTH, nLineLen, eUnit );
- nLineLen = m_xMF_LENGTH->get_value(FUNIT_NONE);
+ nLineLen = m_xMF_LENGTH->get_value(FieldUnit::NONE);
//------- distance to box ----------
nWhich = GetWhich( SDRATTR_CAPTIONGAP );
eUnit = pPool->GetMetric( nWhich );
nGap = static_cast<const SdrCaptionGapItem&>( rOutAttrs.Get( nWhich ) ).GetValue();
SetMetricValue( *m_xMF_SPACING, nGap, eUnit );
- nGap = m_xMF_SPACING->get_value(FUNIT_NONE);
+ nGap = m_xMF_SPACING->get_value(FieldUnit::NONE);
nCaptionType = static_cast<const SdrCaptionTypeItem&>( rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONTYPE ) ) ).GetValue();
bFitLineLen = static_cast<const SfxBoolItem&>( rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONFITLINELEN ) ) ).GetValue();
@@ -291,7 +291,7 @@ void SvxCaptionTabPage::Reset( const SfxItemSet* )
nPosition = POS_MIDDLE;
nExtension = EXT_OPTIMAL;
- m_xMF_SPACING->set_value(nGap, FUNIT_NONE);
+ m_xMF_SPACING->set_value(nGap, FieldUnit::NONE);
if( nEscDir == SdrCaptionEscDir::Horizontal )
{
@@ -306,7 +306,7 @@ void SvxCaptionTabPage::Reset( const SfxItemSet* )
else
{
nExtension = EXT_FROM_TOP;
- m_xMF_BY->set_value(nEscAbs, FUNIT_NONE);
+ m_xMF_BY->set_value(nEscAbs, FieldUnit::NONE);
}
}
else if( nEscDir == SdrCaptionEscDir::Vertical )
@@ -322,7 +322,7 @@ void SvxCaptionTabPage::Reset( const SfxItemSet* )
else
{
nExtension = EXT_FROM_LEFT;
- m_xMF_BY->set_value(nEscAbs, FUNIT_NONE);
+ m_xMF_BY->set_value(nEscAbs, FieldUnit::NONE);
}
}
else if( nEscDir == SdrCaptionEscDir::BestFit )
@@ -331,7 +331,7 @@ void SvxCaptionTabPage::Reset( const SfxItemSet* )
}
m_xCB_OPTIMAL->set_active(bFitLineLen);
- m_xMF_LENGTH->set_value(nLineLen, FUNIT_NONE);
+ m_xMF_LENGTH->set_value(nLineLen, FieldUnit::NONE);
m_xLB_EXTENSION->set_active(nExtension);
diff --git a/cui/source/tabpages/measure.cxx b/cui/source/tabpages/measure.cxx
index e27e1c8d9970..16585eff9bcd 100644
--- a/cui/source/tabpages/measure.cxx
+++ b/cui/source/tabpages/measure.cxx
@@ -86,11 +86,11 @@ SvxMeasurePage::SvxMeasurePage(TabPageParent pWindow, const SfxItemSet& rInAttrs
, eUnit(MapUnit::Map100thMM)
, bPositionModified(false)
, m_aCtlPosition(this)
- , m_xMtrFldLineDist(m_xBuilder->weld_metric_spin_button("MTR_LINE_DIST", FUNIT_MM))
- , m_xMtrFldHelplineOverhang(m_xBuilder->weld_metric_spin_button("MTR_FLD_HELPLINE_OVERHANG", FUNIT_MM))
- , m_xMtrFldHelplineDist(m_xBuilder->weld_metric_spin_button("MTR_FLD_HELPLINE_DIST", FUNIT_MM))
- , m_xMtrFldHelpline1Len(m_xBuilder->weld_metric_spin_button("MTR_FLD_HELPLINE1_LEN", FUNIT_MM))
- , m_xMtrFldHelpline2Len(m_xBuilder->weld_metric_spin_button("MTR_FLD_HELPLINE2_LEN", FUNIT_MM))
+ , m_xMtrFldLineDist(m_xBuilder->weld_metric_spin_button("MTR_LINE_DIST", FieldUnit::MM))
+ , m_xMtrFldHelplineOverhang(m_xBuilder->weld_metric_spin_button("MTR_FLD_HELPLINE_OVERHANG", FieldUnit::MM))
+ , m_xMtrFldHelplineDist(m_xBuilder->weld_metric_spin_button("MTR_FLD_HELPLINE_DIST", FieldUnit::MM))
+ , m_xMtrFldHelpline1Len(m_xBuilder->weld_metric_spin_button("MTR_FLD_HELPLINE1_LEN", FieldUnit::MM))
+ , m_xMtrFldHelpline2Len(m_xBuilder->weld_metric_spin_button("MTR_FLD_HELPLINE2_LEN", FieldUnit::MM))
, m_xTsbBelowRefEdge(m_xBuilder->weld_check_button("TSB_BELOW_REF_EDGE"))
, m_xMtrFldDecimalPlaces(m_xBuilder->weld_spin_button("MTR_FLD_DECIMALPLACES"))
, m_xTsbAutoPosV(m_xBuilder->weld_check_button("TSB_AUTOPOSV"))
@@ -112,13 +112,13 @@ SvxMeasurePage::SvxMeasurePage(TabPageParent pWindow, const SfxItemSet& rInAttrs
SetFieldUnit( *m_xMtrFldHelplineDist, eFUnit );
SetFieldUnit( *m_xMtrFldHelpline1Len, eFUnit );
SetFieldUnit( *m_xMtrFldHelpline2Len, eFUnit );
- if( eFUnit == FUNIT_MM )
+ if( eFUnit == FieldUnit::MM )
{
- m_xMtrFldLineDist->set_increments(50, 500, FUNIT_NONE);
- m_xMtrFldHelplineOverhang->set_increments(50, 500, FUNIT_NONE);
- m_xMtrFldHelplineDist->set_increments(50, 500, FUNIT_NONE);
- m_xMtrFldHelpline1Len->set_increments(50, 500, FUNIT_NONE);
- m_xMtrFldHelpline2Len->set_increments(50, 500, FUNIT_NONE);
+ m_xMtrFldLineDist->set_increments(50, 500, FieldUnit::NONE);
+ m_xMtrFldHelplineOverhang->set_increments(50, 500, FieldUnit::NONE);
+ m_xMtrFldHelplineDist->set_increments(50, 500, FieldUnit::NONE);
+ m_xMtrFldHelpline1Len->set_increments(50, 500, FieldUnit::NONE);
+ m_xMtrFldHelpline2Len->set_increments(50, 500, FieldUnit::NONE);
}
m_xTsbAutoPosV->connect_toggled(LINK( this, SvxMeasurePage, ClickAutoPosHdl_Impl));
@@ -746,15 +746,15 @@ void SvxMeasurePage::FillUnitLB()
{
// fill ListBox with metrics
- FieldUnit nUnit = FUNIT_NONE;
+ FieldUnit nUnit = FieldUnit::NONE;
OUString aStrMetric(m_xFtAutomatic->get_label());
- m_xLbUnit->append(OUString::number(nUnit), aStrMetric);
+ m_xLbUnit->append(OUString::number(sal_uInt32(nUnit)), aStrMetric);
for( sal_uInt32 i = 0; i < SvxFieldUnitTable::Count(); ++i )
{
aStrMetric = SvxFieldUnitTable::GetString(i);
nUnit = SvxFieldUnitTable::GetValue(i);
- m_xLbUnit->append(OUString::number(nUnit), aStrMetric);
+ m_xLbUnit->append(OUString::number(sal_uInt32(nUnit)), aStrMetric);
}
}
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index 5e1f23cede2a..5904c18affcf 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -1070,7 +1070,7 @@ SvxNumOptionsTabPage::SvxNumOptionsTabPage(TabPageParent pParent,
, m_xBulColorFT(m_xBuilder->weld_label("colorft"))
, m_xBulColLB(new ColorListBox(m_xBuilder->weld_menu_button("color"), pParent.GetFrameWeld()))
, m_xBulRelSizeFT(m_xBuilder->weld_label("relsizeft"))
- , m_xBulRelSizeMF(m_xBuilder->weld_metric_spin_button("relsize", FUNIT_PERCENT))
+ , m_xBulRelSizeMF(m_xBuilder->weld_metric_spin_button("relsize", FieldUnit::PERCENT))
, m_xAllLevelFT(m_xBuilder->weld_label("sublevelsft"))
, m_xAllLevelNF(m_xBuilder->weld_spin_button("sublevels"))
, m_xStartFT(m_xBuilder->weld_label("startatft"))
@@ -1080,9 +1080,9 @@ SvxNumOptionsTabPage::SvxNumOptionsTabPage(TabPageParent pParent,
, m_xBitmapFT(m_xBuilder->weld_label("bitmapft"))
, m_xBitmapMB(m_xBuilder->weld_menu_button("bitmap"))
, m_xWidthFT(m_xBuilder->weld_label("widthft"))
- , m_xWidthMF(m_xBuilder->weld_metric_spin_button("widthmf", FUNIT_CM))
+ , m_xWidthMF(m_xBuilder->weld_metric_spin_button("widthmf", FieldUnit::CM))
, m_xHeightFT(m_xBuilder->weld_label("heightft"))
- , m_xHeightMF(m_xBuilder->weld_metric_spin_button("heightmf", FUNIT_CM))
+ , m_xHeightMF(m_xBuilder->weld_metric_spin_button("heightmf", FieldUnit::CM))
, m_xRatioCB(m_xBuilder->weld_check_button("keepratio"))
, m_xOrientFT(m_xBuilder->weld_label("orientft"))
, m_xOrientLB(m_xBuilder->weld_combo_box("orientlb"))
@@ -1091,8 +1091,8 @@ SvxNumOptionsTabPage::SvxNumOptionsTabPage(TabPageParent pParent,
, m_xPreviewWIN(new weld::CustomWeld(*m_xBuilder, "preview", m_aPreviewWIN))
{
m_xBulColLB->SetSlotId(SID_ATTR_CHAR_COLOR);
- m_xBulRelSizeMF->set_min(SVX_NUM_REL_SIZE_MIN, FUNIT_PERCENT);
- m_xBulRelSizeMF->set_increments(5, 50, FUNIT_PERCENT);
+ m_xBulRelSizeMF->set_min(SVX_NUM_REL_SIZE_MIN, FieldUnit::PERCENT);
+ m_xBulRelSizeMF->set_increments(5, 50, FieldUnit::PERCENT);
SetExchangeSupport();
aActBulletFont = lcl_GetDefaultBulletFont();
@@ -1155,7 +1155,7 @@ void SvxNumOptionsTabPage::dispose()
void SvxNumOptionsTabPage::SetMetric(FieldUnit eMetric)
{
- if(eMetric == FUNIT_MM)
+ if(eMetric == FieldUnit::MM)
{
m_xWidthMF->set_digits(1);
m_xHeightMF->set_digits(1);
@@ -1478,7 +1478,7 @@ void SvxNumOptionsTabPage::InitControls()
if(bBullRelSize)
{
if(bSameBulRelSize)
- m_xBulRelSizeMF->set_value(aNumFmtArr[nLvl]->GetBulletRelSize(), FUNIT_PERCENT);
+ m_xBulRelSizeMF->set_value(aNumFmtArr[nLvl]->GetBulletRelSize(), FieldUnit::PERCENT);
else
m_xBulRelSizeMF->set_text("");
}
@@ -1804,7 +1804,7 @@ IMPL_LINK(SvxNumOptionsTabPage, BulColorHdl_Impl, ColorListBox&, rColorBox, void
IMPL_LINK(SvxNumOptionsTabPage, BulRelSizeHdl_Impl, weld::MetricSpinButton&, rField, void)
{
- sal_uInt16 nRelSize = rField.get_value(FUNIT_PERCENT);
+ sal_uInt16 nRelSize = rField.get_value(FieldUnit::PERCENT);
sal_uInt16 nMask = 1;
for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
@@ -2010,8 +2010,8 @@ IMPL_LINK( SvxNumOptionsTabPage, SizeHdl_Impl, weld::MetricSpinButton&, rField,
bool bWidth = &rField == m_xWidthMF.get();
bLastWidthModified = bWidth;
bool bRatio = m_xRatioCB->get_active();
- long nWidthVal = static_cast<long>(m_xWidthMF->denormalize(m_xWidthMF->get_value(FUNIT_100TH_MM)));
- long nHeightVal = static_cast<long>(m_xHeightMF->denormalize(m_xHeightMF->get_value(FUNIT_100TH_MM)));
+ long nWidthVal = static_cast<long>(m_xWidthMF->denormalize(m_xWidthMF->get_value(FieldUnit::MM_100TH)));
+ long nHeightVal = static_cast<long>(m_xHeightMF->denormalize(m_xHeightMF->get_value(FieldUnit::MM_100TH)));
nWidthVal = OutputDevice::LogicToLogic( nWidthVal ,
MapUnit::Map100thMM, eCoreUnit );
nHeightVal = OutputDevice::LogicToLogic( nHeightVal,
@@ -2044,7 +2044,7 @@ IMPL_LINK( SvxNumOptionsTabPage, SizeHdl_Impl, weld::MetricSpinButton&, rField,
aSize.setHeight( aInitSize[i].Height() + static_cast<long>(static_cast<double>(nDelta) / fSizeRatio) );
m_xHeightMF->set_value(m_xHeightMF->normalize(
OutputDevice::LogicToLogic( aSize.Height(), eCoreUnit, MapUnit::Map100thMM )),
- FUNIT_100TH_MM);
+ FieldUnit::MM_100TH);
}
}
else
@@ -2056,7 +2056,7 @@ IMPL_LINK( SvxNumOptionsTabPage, SizeHdl_Impl, weld::MetricSpinButton&, rField,
aSize.setWidth( aInitSize[i].Width() + static_cast<long>(static_cast<double>(nDelta) * fSizeRatio) );
m_xWidthMF->set_value(m_xWidthMF->normalize(
OutputDevice::LogicToLogic( aSize.Width(), eCoreUnit, MapUnit::Map100thMM )),
- FUNIT_100TH_MM);
+ FieldUnit::MM_100TH);
}
}
const SvxBrushItem* pBrushItem = aNumFmt.GetBrush();
@@ -2489,24 +2489,24 @@ SvxNumPositionTabPage::SvxNumPositionTabPage(TabPageParent pParent, const SfxIte
, bLabelAlignmentPosAndSpaceModeActive(false)
, m_xLevelLB(m_xBuilder->weld_tree_view("levellb"))
, m_xDistBorderFT(m_xBuilder->weld_label("indent"))
- , m_xDistBorderMF(m_xBuilder->weld_metric_spin_button("indentmf", FUNIT_CM))
+ , m_xDistBorderMF(m_xBuilder->weld_metric_spin_button("indentmf", FieldUnit::CM))
, m_xRelativeCB(m_xBuilder->weld_check_button("relative"))
, m_xIndentFT(m_xBuilder->weld_label("numberingwidth"))
- , m_xIndentMF(m_xBuilder->weld_metric_spin_button("numberingwidthmf", FUNIT_CM))
+ , m_xIndentMF(m_xBuilder->weld_metric_spin_button("numberingwidthmf", FieldUnit::CM))
, m_xDistNumFT(m_xBuilder->weld_label("numdist"))
- , m_xDistNumMF(m_xBuilder->weld_metric_spin_button("numdistmf", FUNIT_CM))
+ , m_xDistNumMF(m_xBuilder->weld_metric_spin_button("numdistmf", FieldUnit::CM))
, m_xAlignFT(m_xBuilder->weld_label("numalign"))
, m_xAlignLB(m_xBuilder->weld_combo_box("numalignlb"))
, m_xLabelFollowedByFT(m_xBuilder->weld_label("numfollowedby"))
, m_xLabelFollowedByLB(m_xBuilder->weld_combo_box("numfollowedbylb"))
, m_xListtabFT(m_xBuilder->weld_label("at"))
- , m_xListtabMF(m_xBuilder->weld_metric_spin_button("atmf", FUNIT_CM))
+ , m_xListtabMF(m_xBuilder->weld_metric_spin_button("atmf", FieldUnit::CM))
, m_xAlign2FT(m_xBuilder->weld_label("num2align"))
, m_xAlign2LB(m_xBuilder->weld_combo_box("num2alignlb"))
, m_xAlignedAtFT(m_xBuilder->weld_label("alignedat"))
- , m_xAlignedAtMF(m_xBuilder->weld_metric_spin_button("alignedatmf", FUNIT_CM))
+ , m_xAlignedAtMF(m_xBuilder->weld_metric_spin_button("alignedatmf", FieldUnit::CM))
, m_xIndentAtFT(m_xBuilder->weld_label("indentat"))
- , m_xIndentAtMF(m_xBuilder->weld_metric_spin_button("indentatmf", FUNIT_CM))
+ , m_xIndentAtMF(m_xBuilder->weld_metric_spin_button("indentatmf", FieldUnit::CM))
, m_xStandardPB(m_xBuilder->weld_button("standard"))
, m_xPreviewWIN(new weld::CustomWeld(*m_xBuilder, "preview", m_aPreviewWIN))
{
@@ -2946,7 +2946,7 @@ VclPtr<SfxTabPage> SvxNumPositionTabPage::Create(TabPageParent pParent,
void SvxNumPositionTabPage::SetMetric(FieldUnit eMetric)
{
- if (eMetric == FUNIT_MM)
+ if (eMetric == FieldUnit::MM)
{
m_xDistBorderMF->set_digits(1);
m_xDistNumMF->set_digits(1);
diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx
index a06cf51ef2e7..d45cc342531b 100644
--- a/cui/source/tabpages/page.cxx
+++ b/cui/source/tabpages/page.cxx
@@ -151,8 +151,8 @@ SvxPageDescPage::SvxPageDescPage(TabPageParent pParent, const SfxItemSet& rAttr)
, mbDelPrinter(false)
, mbEnableDrawingLayerFillStyles(false)
, m_xPaperSizeBox(new SvxPaperSizeListBox(m_xBuilder->weld_combo_box("comboPageFormat")))
- , m_xPaperWidthEdit(m_xBuilder->weld_metric_spin_button("spinWidth", FUNIT_CM))
- , m_xPaperHeightEdit(m_xBuilder->weld_metric_spin_button("spinHeight", FUNIT_CM))
+ , m_xPaperWidthEdit(m_xBuilder->weld_metric_spin_button("spinWidth", FieldUnit::CM))
+ , m_xPaperHeightEdit(m_xBuilder->weld_metric_spin_button("spinHeight", FieldUnit::CM))
, m_xOrientationFT(m_xBuilder->weld_label("labelOrientation"))
, m_xPortraitBtn(m_xBuilder->weld_radio_button("radiobuttonPortrait"))
, m_xLandscapeBtn(m_xBuilder->weld_radio_button("radiobuttonLandscape"))
@@ -160,11 +160,11 @@ SvxPageDescPage::SvxPageDescPage(TabPageParent pParent, const SfxItemSet& rAttr)
, m_xTextFlowBox(new svx::FrameDirectionListBox(m_xBuilder->weld_combo_box("comboTextFlowBox")))
, m_xPaperTrayBox(m_xBuilder->weld_combo_box("comboPaperTray"))
, m_xLeftMarginLbl(m_xBuilder->weld_label("labelLeftMargin"))
- , m_xLeftMarginEdit(m_xBuilder->weld_metric_spin_button("spinMargLeft", FUNIT_CM))
+ , m_xLeftMarginEdit(m_xBuilder->weld_metric_spin_button("spinMargLeft", FieldUnit::CM))
, m_xRightMarginLbl(m_xBuilder->weld_label("labelRightMargin"))
- , m_xRightMarginEdit(m_xBuilder->weld_metric_spin_button("spinMargRight", FUNIT_CM))
- , m_xTopMarginEdit(m_xBuilder->weld_metric_spin_button("spinMargTop", FUNIT_CM))
- , m_xBottomMarginEdit(m_xBuilder->weld_metric_spin_button("spinMargBot", FUNIT_CM))
+ , m_xRightMarginEdit(m_xBuilder->weld_metric_spin_button("spinMargRight", FieldUnit::CM))
+ , m_xTopMarginEdit(m_xBuilder->weld_metric_spin_button("spinMargTop", FieldUnit::CM))
+ , m_xBottomMarginEdit(m_xBuilder->weld_metric_spin_button("spinMargBot", FieldUnit::CM))
, m_xPageText(m_xBuilder->weld_label("labelPageLayout"))
, m_xLayoutBox(m_xBuilder->weld_combo_box("comboPageLayout"))
, m_xNumberFormatBox(new SvxPageNumberListBox(m_xBuilder->weld_combo_box("comboLayoutFormat")))
@@ -261,28 +261,28 @@ SvxPageDescPage::SvxPageDescPage(TabPageParent pParent, const SfxItemSet& rAttr)
Point aPrintOffset = mpDefPrinter->GetPageOffset() - mpDefPrinter->PixelToLogic( Point() );
mpDefPrinter->SetMapMode( aOldMode );
- nFirstLeftMargin = m_xLeftMarginEdit->convert_value_from(m_xLeftMarginEdit->normalize(aPrintOffset.X()), FUNIT_TWIP);
- nFirstRightMargin = m_xRightMarginEdit->convert_value_from(m_xRightMarginEdit->normalize(aPaperSize.Width() - aPrintSize.Width() - aPrintOffset.X()), FUNIT_TWIP);
- nFirstTopMargin = m_xTopMarginEdit->convert_value_from(m_xTopMarginEdit->normalize(aPrintOffset.Y() ), FUNIT_TWIP);
- nFirstBottomMargin = m_xBottomMarginEdit->convert_value_from(m_xBottomMarginEdit->normalize(aPaperSize.Height() - aPrintSize.Height() - aPrintOffset.Y()), FUNIT_TWIP );
- nLastLeftMargin = m_xLeftMarginEdit->convert_value_from(m_xLeftMarginEdit->normalize(aPrintOffset.X() + aPrintSize.Width()), FUNIT_TWIP);
- nLastRightMargin = m_xRightMarginEdit->convert_value_from(m_xRightMarginEdit->normalize(aPrintOffset.X() + aPrintSize.Width()), FUNIT_TWIP);
- nLastTopMargin = m_xTopMarginEdit->convert_value_from(m_xTopMarginEdit->normalize(aPrintOffset.Y() + aPrintSize.Height()), FUNIT_TWIP);
- nLastBottomMargin = m_xBottomMarginEdit->convert_value_from(m_xBottomMarginEdit->normalize(aPrintOffset.Y() + aPrintSize.Height()), FUNIT_TWIP);
+ nFirstLeftMargin = m_xLeftMarginEdit->convert_value_from(m_xLeftMarginEdit->normalize(aPrintOffset.X()), FieldUnit::TWIP);
+ nFirstRightMargin = m_xRightMarginEdit->convert_value_from(m_xRightMarginEdit->normalize(aPaperSize.Width() - aPrintSize.Width() - aPrintOffset.X()), FieldUnit::TWIP);
+ nFirstTopMargin = m_xTopMarginEdit->convert_value_from(m_xTopMarginEdit->normalize(aPrintOffset.Y() ), FieldUnit::TWIP);
+ nFirstBottomMargin = m_xBottomMarginEdit->convert_value_from(m_xBottomMarginEdit->normalize(aPaperSize.Height() - aPrintSize.Height() - aPrintOffset.Y()), FieldUnit::TWIP );
+ nLastLeftMargin = m_xLeftMarginEdit->convert_value_from(m_xLeftMarginEdit->normalize(aPrintOffset.X() + aPrintSize.Width()), FieldUnit::TWIP);
+ nLastRightMargin = m_xRightMarginEdit->convert_value_from(m_xRightMarginEdit->normalize(aPrintOffset.X() + aPrintSize.Width()), FieldUnit::TWIP);
+ nLastTopMargin = m_xTopMarginEdit->convert_value_from(m_xTopMarginEdit->normalize(aPrintOffset.Y() + aPrintSize.Height()), FieldUnit::TWIP);
+ nLastBottomMargin = m_xBottomMarginEdit->convert_value_from(m_xBottomMarginEdit->normalize(aPrintOffset.Y() + aPrintSize.Height()), FieldUnit::TWIP);
// #i4219# get DrawingLayer options
const SvtOptionsDrawinglayer aDrawinglayerOpt;
// #i4219# take Maximum now from configuration (1/100th cm)
// was: 11900 -> 119 cm ;new value 3 meters -> 300 cm -> 30000
- m_xPaperWidthEdit->set_max(m_xPaperWidthEdit->normalize(aDrawinglayerOpt.GetMaximumPaperWidth()), FUNIT_CM);
- m_xPaperHeightEdit->set_max(m_xPaperHeightEdit->normalize(aDrawinglayerOpt.GetMaximumPaperHeight()), FUNIT_CM);
+ m_xPaperWidthEdit->set_max(m_xPaperWidthEdit->normalize(aDrawinglayerOpt.GetMaximumPaperWidth()), FieldUnit::CM);
+ m_xPaperHeightEdit->set_max(m_xPaperHeightEdit->normalize(aDrawinglayerOpt.GetMaximumPaperHeight()), FieldUnit::CM);
// #i4219# also for margins (1/100th cm). Was: 9999, keeping.
- m_xLeftMarginEdit->set_max(m_xLeftMarginEdit->normalize(aDrawinglayerOpt.GetMaximumPaperLeftMargin()), FUNIT_MM);
- m_xRightMarginEdit->set_max(m_xRightMarginEdit->normalize(aDrawinglayerOpt.GetMaximumPaperRightMargin()), FUNIT_MM);
- m_xTopMarginEdit->set_max(m_xTopMarginEdit->normalize(aDrawinglayerOpt.GetMaximumPaperTopMargin()), FUNIT_MM);
- m_xBottomMarginEdit->set_max(m_xBottomMarginEdit->normalize(aDrawinglayerOpt.GetMaximumPaperBottomMargin()), FUNIT_MM);
+ m_xLeftMarginEdit->set_max(m_xLeftMarginEdit->normalize(aDrawinglayerOpt.GetMaximumPaperLeftMargin()), FieldUnit::MM);
+ m_xRightMarginEdit->set_max(m_xRightMarginEdit->normalize(aDrawinglayerOpt.GetMaximumPaperRightMargin()), FieldUnit::MM);
+ m_xTopMarginEdit->set_max(m_xTopMarginEdit->normalize(aDrawinglayerOpt.GetMaximumPaperTopMargin()), FieldUnit::MM);
+ m_xBottomMarginEdit->set_max(m_xBottomMarginEdit->normalize(aDrawinglayerOpt.GetMaximumPaperBottomMargin()), FieldUnit::MM);
// Get the i18n framework numberings and add them to the listbox.
SvxNumOptionsTabPageHelper::GetI18nNumbering(m_xNumberFormatBox->get_widget(), std::numeric_limits<sal_uInt16>::max());
@@ -839,12 +839,12 @@ IMPL_LINK_NOARG(SvxPageDescPage, PaperSizeSelect_Impl, weld::ComboBox&, void)
if (m_xLandscapeBtn->get_active())
Swap( aSize );
- if ( aSize.Height() < m_xPaperHeightEdit->get_min( FUNIT_100TH_MM ) )
+ if ( aSize.Height() < m_xPaperHeightEdit->get_min( FieldUnit::MM_100TH ) )
m_xPaperHeightEdit->set_min(
- m_xPaperHeightEdit->normalize( aSize.Height() ), FUNIT_100TH_MM );
- if ( aSize.Width() < m_xPaperWidthEdit->get_min( FUNIT_100TH_MM ) )
+ m_xPaperHeightEdit->normalize( aSize.Height() ), FieldUnit::MM_100TH );
+ if ( aSize.Width() < m_xPaperWidthEdit->get_min( FieldUnit::MM_100TH ) )
m_xPaperWidthEdit->set_min(
- m_xPaperWidthEdit->normalize( aSize.Width() ), FUNIT_100TH_MM );
+ m_xPaperWidthEdit->normalize( aSize.Width() ), FieldUnit::MM_100TH );
SetMetricValue( *m_xPaperHeightEdit, aSize.Height(), MapUnit::Map100thMM );
SetMetricValue( *m_xPaperWidthEdit, aSize.Width(), MapUnit::Map100thMM );
@@ -863,13 +863,13 @@ IMPL_LINK_NOARG(SvxPageDescPage, PaperSizeSelect_Impl, weld::ComboBox&, void)
// no margin if screen
nTmp = 1; // accordingly 1 cm
- if ( bScreen || m_xRightMarginEdit->get_value(FUNIT_NONE) == 0 )
+ if ( bScreen || m_xRightMarginEdit->get_value(FieldUnit::NONE) == 0 )
SetMetricValue( *m_xRightMarginEdit, nTmp, MapUnit::MapCM );
- if ( bScreen || m_xLeftMarginEdit->get_value(FUNIT_NONE) == 0 )
+ if ( bScreen || m_xLeftMarginEdit->get_value(FieldUnit::NONE) == 0 )
SetMetricValue( *m_xLeftMarginEdit, nTmp, MapUnit::MapCM );
- if ( bScreen || m_xBottomMarginEdit->get_value(FUNIT_NONE) == 0 )
+ if ( bScreen || m_xBottomMarginEdit->get_value(FieldUnit::NONE) == 0 )
SetMetricValue( *m_xBottomMarginEdit, nTmp, MapUnit::MapCM );
- if ( bScreen || m_xTopMarginEdit->get_value(FUNIT_NONE) == 0 )
+ if ( bScreen || m_xTopMarginEdit->get_value(FieldUnit::NONE) == 0 )
SetMetricValue( *m_xTopMarginEdit, nTmp, MapUnit::MapCM );
UpdateExample_Impl( true );
}
@@ -951,38 +951,38 @@ void SvxPageDescPage::SwapFirstValues_Impl( bool bSet )
mpDefPrinter->SetOrientation( eOldOri );
sal_Int64 nSetL = m_xLeftMarginEdit->denormalize(
- m_xLeftMarginEdit->get_value( FUNIT_TWIP ) );
+ m_xLeftMarginEdit->get_value( FieldUnit::TWIP ) );
sal_Int64 nSetR = m_xRightMarginEdit->denormalize(
- m_xRightMarginEdit->get_value( FUNIT_TWIP ) );
+ m_xRightMarginEdit->get_value( FieldUnit::TWIP ) );
sal_Int64 nSetT = m_xTopMarginEdit->denormalize(
- m_xTopMarginEdit->get_value( FUNIT_TWIP ) );
+ m_xTopMarginEdit->get_value( FieldUnit::TWIP ) );
sal_Int64 nSetB = m_xBottomMarginEdit->denormalize(
- m_xBottomMarginEdit->get_value( FUNIT_TWIP ) );
+ m_xBottomMarginEdit->get_value( FieldUnit::TWIP ) );
long nNewL = aPrintOffset.X();
long nNewR = aPaperSize.Width() - aPrintSize.Width() - aPrintOffset.X();
long nNewT = aPrintOffset.Y();
long nNewB = aPaperSize.Height() - aPrintSize.Height() - aPrintOffset.Y();
- nFirstLeftMargin = m_xLeftMarginEdit->convert_value_from(m_xLeftMarginEdit->normalize(nNewL), FUNIT_TWIP);
- nFirstRightMargin = m_xRightMarginEdit->convert_value_from(m_xRightMarginEdit->normalize(nNewR), FUNIT_TWIP);
- nFirstTopMargin = m_xTopMarginEdit->convert_value_from(m_xTopMarginEdit->normalize(nNewT), FUNIT_TWIP);
- nFirstBottomMargin = m_xBottomMarginEdit->convert_value_from(m_xBottomMarginEdit->normalize(nNewB), FUNIT_TWIP);
+ nFirstLeftMargin = m_xLeftMarginEdit->convert_value_from(m_xLeftMarginEdit->normalize(nNewL), FieldUnit::TWIP);
+ nFirstRightMargin = m_xRightMarginEdit->convert_value_from(m_xRightMarginEdit->normalize(nNewR), FieldUnit::TWIP);
+ nFirstTopMargin = m_xTopMarginEdit->convert_value_from(m_xTopMarginEdit->normalize(nNewT), FieldUnit::TWIP);
+ nFirstBottomMargin = m_xBottomMarginEdit->convert_value_from(m_xBottomMarginEdit->normalize(nNewB), FieldUnit::TWIP);
if ( bSet )
{
if ( nSetL < nNewL )
m_xLeftMarginEdit->set_value( m_xLeftMarginEdit->normalize( nNewL ),
- FUNIT_TWIP );
+ FieldUnit::TWIP );
if ( nSetR < nNewR )
m_xRightMarginEdit->set_value( m_xRightMarginEdit->normalize( nNewR ),
- FUNIT_TWIP );
+ FieldUnit::TWIP );
if ( nSetT < nNewT )
m_xTopMarginEdit->set_value( m_xTopMarginEdit->normalize( nNewT ),
- FUNIT_TWIP );
+ FieldUnit::TWIP );
if ( nSetB < nNewB )
m_xBottomMarginEdit->set_value( m_xBottomMarginEdit->normalize( nNewB ),
- FUNIT_TWIP );
+ FieldUnit::TWIP );
}
}
@@ -1312,10 +1312,10 @@ void SvxPageDescPage::RangeHdl_Impl()
long nHFRight = std::max(m_aBspWin.GetHdRight(), m_aBspWin.GetFtRight());
// current values for page margins
- long nBT = static_cast<long>(m_xTopMarginEdit->denormalize(m_xTopMarginEdit->get_value(FUNIT_TWIP)));
- long nBB = static_cast<long>(m_xBottomMarginEdit->denormalize(m_xBottomMarginEdit->get_value(FUNIT_TWIP)));
- long nBL = static_cast<long>(m_xLeftMarginEdit->denormalize(m_xLeftMarginEdit->get_value(FUNIT_TWIP)));
- long nBR = static_cast<long>(m_xRightMarginEdit->denormalize(m_xRightMarginEdit->get_value(FUNIT_TWIP)));
+ long nBT = static_cast<long>(m_xTopMarginEdit->denormalize(m_xTopMarginEdit->get_value(FieldUnit::TWIP)));
+ long nBB = static_cast<long>(m_xBottomMarginEdit->denormalize(m_xBottomMarginEdit->get_value(FieldUnit::TWIP)));
+ long nBL = static_cast<long>(m_xLeftMarginEdit->denormalize(m_xLeftMarginEdit->get_value(FieldUnit::TWIP)));
+ long nBR = static_cast<long>(m_xRightMarginEdit->denormalize(m_xRightMarginEdit->get_value(FieldUnit::TWIP)));
// calculate width of page border
const SfxItemSet* _pSet = &GetItemSet();
@@ -1336,33 +1336,33 @@ void SvxPageDescPage::RangeHdl_Impl()
long nMin = nHHeight + nHDist + nFDist + nFHeight + nBT + nBB +
MINBODY + aBorder.Height();
- m_xPaperHeightEdit->set_min(m_xPaperHeightEdit->normalize(nMin), FUNIT_TWIP);
+ m_xPaperHeightEdit->set_min(m_xPaperHeightEdit->normalize(nMin), FieldUnit::TWIP);
nMin = MINBODY + nBL + nBR + aBorder.Width();
- m_xPaperWidthEdit->set_min(m_xPaperWidthEdit->normalize(nMin), FUNIT_TWIP);
+ m_xPaperWidthEdit->set_min(m_xPaperWidthEdit->normalize(nMin), FieldUnit::TWIP);
- long nH = static_cast<long>(m_xPaperHeightEdit->denormalize(m_xPaperHeightEdit->get_value(FUNIT_TWIP)));
- long nW = static_cast<long>(m_xPaperWidthEdit->denormalize(m_xPaperWidthEdit->get_value(FUNIT_TWIP)));
+ long nH = static_cast<long>(m_xPaperHeightEdit->denormalize(m_xPaperHeightEdit->get_value(FieldUnit::TWIP)));
+ long nW = static_cast<long>(m_xPaperWidthEdit->denormalize(m_xPaperWidthEdit->get_value(FieldUnit::TWIP)));
// Top
long nMax = nH - nBB - aBorder.Height() - MINBODY -
nFDist - nFHeight - nHDist - nHHeight;
- m_xTopMarginEdit->set_max(m_xTopMarginEdit->normalize(nMax), FUNIT_TWIP);
+ m_xTopMarginEdit->set_max(m_xTopMarginEdit->normalize(nMax), FieldUnit::TWIP);
// Bottom
nMax = nH - nBT - aBorder.Height() - MINBODY -
nFDist - nFHeight - nHDist - nHHeight;
- m_xBottomMarginEdit->set_max(m_xTopMarginEdit->normalize(nMax), FUNIT_TWIP);
+ m_xBottomMarginEdit->set_max(m_xTopMarginEdit->normalize(nMax), FieldUnit::TWIP);
// Left
nMax = nW - nBR - MINBODY - aBorder.Width() - nHFLeft - nHFRight;
- m_xLeftMarginEdit->set_max(m_xLeftMarginEdit->normalize(nMax), FUNIT_TWIP);
+ m_xLeftMarginEdit->set_max(m_xLeftMarginEdit->normalize(nMax), FieldUnit::TWIP);
// Right
nMax = nW - nBL - MINBODY - aBorder.Width() - nHFLeft - nHFRight;
- m_xRightMarginEdit->set_max(m_xRightMarginEdit->normalize(nMax), FUNIT_TWIP);
+ m_xRightMarginEdit->set_max(m_xRightMarginEdit->normalize(nMax), FieldUnit::TWIP);
}
void SvxPageDescPage::CalcMargin_Impl()
@@ -1465,12 +1465,12 @@ bool SvxPageDescPage::IsPrinterRangeOverflow(
{
bool bRet = false;
bool bCheck = ( ( m_nPos & nPos ) == 0 );
- long nValue = rField.get_value(FUNIT_NONE);
+ long nValue = rField.get_value(FieldUnit::NONE);
if ( bCheck &&
( nValue < nFirstMargin || nValue > nLastMargin ) &&
rField.get_value_changed_from_saved() )
{
- rField.set_value(nValue < nFirstMargin ? nFirstMargin : nLastMargin, FUNIT_NONE);
+ rField.set_value(nValue < nFirstMargin ? nFirstMargin : nLastMargin, FieldUnit::NONE);
bRet = true;
}
@@ -1485,16 +1485,16 @@ void SvxPageDescPage::CheckMarginEdits( bool _bClear )
if ( _bClear )
m_nPos = 0;
- sal_Int64 nValue = m_xLeftMarginEdit->get_value(FUNIT_NONE);
+ sal_Int64 nValue = m_xLeftMarginEdit->get_value(FieldUnit::NONE);
if ( nValue < nFirstLeftMargin || nValue > nLastLeftMargin )
m_nPos |= MARGIN_LEFT;
- nValue = m_xRightMarginEdit->get_value(FUNIT_NONE);
+ nValue = m_xRightMarginEdit->get_value(FieldUnit::NONE);
if ( nValue < nFirstRightMargin || nValue > nLastRightMargin )
m_nPos |= MARGIN_RIGHT;
- nValue = m_xTopMarginEdit->get_value(FUNIT_NONE);
+ nValue = m_xTopMarginEdit->get_value(FieldUnit::NONE);
if ( nValue < nFirstTopMargin || nValue > nLastTopMargin )
m_nPos |= MARGIN_TOP;
- nValue = m_xBottomMarginEdit->get_value(FUNIT_NONE);
+ nValue = m_xBottomMarginEdit->get_value(FieldUnit::NONE);
if ( nValue < nFirstBottomMargin || nValue > nLastBottomMargin )
m_nPos |= MARGIN_BOTTOM;
}
@@ -1503,20 +1503,20 @@ bool SvxPageDescPage::IsMarginOutOfRange()
{
bool bRet = ( ( ( !( m_nPos & MARGIN_LEFT ) &&
m_xLeftMarginEdit->get_value_changed_from_saved() ) &&
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list