diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-11-06 14:37:23 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2018-11-08 12:15:51 +0100 |
commit | 9e0770ea7e0cf094add54ad64bc9ff825d24bbe1 (patch) | |
tree | e897291e44ecb11ca44ba5e5ebefe03ac536862f /cui | |
parent | 841ee6fb052fb35467d74b70f575a86c8c0fe3b7 (diff) |
Convert FieldUnit to scoped enum
Change-Id: Id2df31daa596a18c79af5fc6ea162deb6e24d5af
Reviewed-on: https://gerrit.libreoffice.org/62958
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'cui')
27 files changed, 677 insertions, 677 deletions
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() ) && - ( m_xLeftMarginEdit->get_value(FUNIT_NONE) < nFirstLeftMargin || - m_xLeftMarginEdit->get_value(FUNIT_NONE) > nLastLeftMargin ) ) || + ( m_xLeftMarginEdit->get_value(FieldUnit::NONE) < nFirstLeftMargin || + m_xLeftMarginEdit->get_value(FieldUnit::NONE) > nLastLeftMargin ) ) || ( ( !( m_nPos & MARGIN_RIGHT ) && m_xRightMarginEdit->get_value_changed_from_saved() ) && - ( m_xRightMarginEdit->get_value(FUNIT_NONE) < nFirstRightMargin || - m_xRightMarginEdit->get_value(FUNIT_NONE) > nLastRightMargin ) ) || + ( m_xRightMarginEdit->get_value(FieldUnit::NONE) < nFirstRightMargin || + m_xRightMarginEdit->get_value(FieldUnit::NONE) > nLastRightMargin ) ) || ( ( !( m_nPos & MARGIN_TOP ) && m_xTopMarginEdit->get_value_changed_from_saved() ) && - ( m_xTopMarginEdit->get_value(FUNIT_NONE) < nFirstTopMargin || - m_xTopMarginEdit->get_value(FUNIT_NONE) > nLastTopMargin ) ) || + ( m_xTopMarginEdit->get_value(FieldUnit::NONE) < nFirstTopMargin || + m_xTopMarginEdit->get_value(FieldUnit::NONE) > nLastTopMargin ) ) || ( ( !( m_nPos & MARGIN_BOTTOM ) && m_xBottomMarginEdit->get_value_changed_from_saved() ) && - ( m_xBottomMarginEdit->get_value(FUNIT_NONE) < nFirstBottomMargin || - m_xBottomMarginEdit->get_value(FUNIT_NONE) > nLastBottomMargin ) ) ); + ( m_xBottomMarginEdit->get_value(FieldUnit::NONE) < nFirstBottomMargin || + m_xBottomMarginEdit->get_value(FieldUnit::NONE) > nLastBottomMargin ) ) ); return bRet; } diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx index d93649366dfe..a038007c49fb 100644 --- a/cui/source/tabpages/paragrph.cxx +++ b/cui/source/tabpages/paragrph.cxx @@ -171,8 +171,8 @@ void SvxStdParagraphTabPage::ELRLoseFocus() sal_Int64 nR = m_xRightIndent->denormalize(m_xRightIndent->get_value(eUnit)); OUString aTmp = m_xFLineIndent->get_text(); - if (m_xLeftIndent->get_min(FUNIT_NONE) < 0) - m_xFLineIndent->set_min(-99999, FUNIT_MM); + if (m_xLeftIndent->get_min(FieldUnit::NONE) < 0) + m_xFLineIndent->set_min(-99999, FieldUnit::MM); else m_xFLineIndent->set_min(m_xFLineIndent->normalize(-nL), eUnit); @@ -242,7 +242,7 @@ bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet* rOutSet ) case LLINESPACE_PROP: SetLineSpace_Impl( aSpacing, nPos, static_cast<long>(m_xLineDistAtPercentBox->denormalize( - m_xLineDistAtPercentBox->get_value(FUNIT_NONE) )) ); + m_xLineDistAtPercentBox->get_value(FieldUnit::NONE) )) ); break; case LLINESPACE_MIN: @@ -284,13 +284,13 @@ bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet* rOutSet ) if ( m_xTopDist->IsRelative() ) aMargin.SetUpper( rOldItem.GetUpper(), - static_cast<sal_uInt16>(m_xTopDist->get_value(FUNIT_NONE)) ); + static_cast<sal_uInt16>(m_xTopDist->get_value(FieldUnit::NONE)) ); else aMargin.SetUpper( static_cast<sal_uInt16>(m_xTopDist->GetCoreValue(eUnit)) ); if ( m_xBottomDist->IsRelative() ) aMargin.SetLower( rOldItem.GetLower(), - static_cast<sal_uInt16>(m_xBottomDist->get_value(FUNIT_NONE)) ); + static_cast<sal_uInt16>(m_xBottomDist->get_value(FieldUnit::NONE)) ); else aMargin.SetLower( static_cast<sal_uInt16>(m_xBottomDist->GetCoreValue(eUnit)) ); @@ -331,19 +331,19 @@ bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet* rOutSet ) if (m_xLeftIndent->IsRelative()) aMargin.SetTextLeft( rOldItem.GetTextLeft(), - static_cast<sal_uInt16>(m_xLeftIndent->get_value(FUNIT_NONE)) ); + static_cast<sal_uInt16>(m_xLeftIndent->get_value(FieldUnit::NONE)) ); else aMargin.SetTextLeft(m_xLeftIndent->GetCoreValue(eUnit)); if ( m_xRightIndent->IsRelative() ) aMargin.SetRight( rOldItem.GetRight(), - static_cast<sal_uInt16>(m_xRightIndent->get_value(FUNIT_NONE)) ); + static_cast<sal_uInt16>(m_xRightIndent->get_value(FieldUnit::NONE)) ); else aMargin.SetRight(m_xRightIndent->GetCoreValue(eUnit)); if ( m_xFLineIndent->IsRelative() ) aMargin.SetTextFirstLineOfst( rOldItem.GetTextFirstLineOfst(), - static_cast<sal_uInt16>(m_xFLineIndent->get_value(FUNIT_NONE)) ); + static_cast<sal_uInt16>(m_xFLineIndent->get_value(FieldUnit::NONE)) ); else aMargin.SetTextFirstLineOfst(static_cast<sal_uInt16>(m_xFLineIndent->GetCoreValue(eUnit))); } @@ -422,16 +422,16 @@ void SvxStdParagraphTabPage::Reset( const SfxItemSet* rSet ) SvtCJKOptions aCJKOptions; if(aCJKOptions.IsAsianTypographyEnabled() && bApplyCharUnit ) - eFUnit = FUNIT_CHAR; + eFUnit = FieldUnit::CHAR; m_xLeftIndent->SetFieldUnit(eFUnit); m_xRightIndent->SetFieldUnit(eFUnit); m_xFLineIndent->SetFieldUnit(eFUnit); - if ( eFUnit == FUNIT_CHAR ) + if ( eFUnit == FieldUnit::CHAR ) { - m_xTopDist->SetFieldUnit(FUNIT_LINE); - m_xBottomDist->SetFieldUnit(FUNIT_LINE); - SetFieldUnit(*m_xLineDistAtMetricBox, FUNIT_POINT); + m_xTopDist->SetFieldUnit(FieldUnit::LINE); + m_xBottomDist->SetFieldUnit(FieldUnit::LINE); + SetFieldUnit(*m_xLineDistAtMetricBox, FieldUnit::POINT); } else { @@ -455,7 +455,7 @@ void SvxStdParagraphTabPage::Reset( const SfxItemSet* rSet ) if ( rOldItem.GetPropLeft() != 100 ) { m_xLeftIndent->SetRelative( true ); - m_xLeftIndent->set_value(rOldItem.GetPropLeft(), FUNIT_NONE); + m_xLeftIndent->set_value(rOldItem.GetPropLeft(), FieldUnit::NONE); } else { @@ -467,7 +467,7 @@ void SvxStdParagraphTabPage::Reset( const SfxItemSet* rSet ) if ( rOldItem.GetPropRight() != 100 ) { m_xRightIndent->SetRelative( true ); - m_xRightIndent->set_value(rOldItem.GetPropRight(), FUNIT_NONE); + m_xRightIndent->set_value(rOldItem.GetPropRight(), FieldUnit::NONE); } else { @@ -479,12 +479,12 @@ void SvxStdParagraphTabPage::Reset( const SfxItemSet* rSet ) if ( rOldItem.GetPropTextFirstLineOfst() != 100 ) { m_xFLineIndent->SetRelative(true); - m_xFLineIndent->set_value(rOldItem.GetPropTextFirstLineOfst(), FUNIT_NONE); + m_xFLineIndent->set_value(rOldItem.GetPropTextFirstLineOfst(), FieldUnit::NONE); } else { m_xFLineIndent->SetRelative(false); - m_xFLineIndent->set_min(-9999, FUNIT_NONE); + m_xFLineIndent->set_min(-9999, FieldUnit::NONE); m_xFLineIndent->SetFieldUnit(eFUnit); m_xFLineIndent->SetMetricValue(rOldItem.GetTextFirstLineOfst(), eUnit); } @@ -524,13 +524,13 @@ void SvxStdParagraphTabPage::Reset( const SfxItemSet* rSet ) if ( rOldItem.GetPropUpper() != 100 ) { m_xTopDist->SetRelative( true ); - m_xTopDist->set_value(rOldItem.GetPropUpper(), FUNIT_NONE); + m_xTopDist->set_value(rOldItem.GetPropUpper(), FieldUnit::NONE); } else { m_xTopDist->SetRelative(false); - if (eFUnit == FUNIT_CHAR) - m_xTopDist->SetFieldUnit(FUNIT_LINE); + if (eFUnit == FieldUnit::CHAR) + m_xTopDist->SetFieldUnit(FieldUnit::LINE); else m_xTopDist->SetFieldUnit(eFUnit); m_xTopDist->SetMetricValue(rOldItem.GetUpper(), eUnit); @@ -539,13 +539,13 @@ void SvxStdParagraphTabPage::Reset( const SfxItemSet* rSet ) if ( rOldItem.GetPropLower() != 100 ) { m_xBottomDist->SetRelative( true ); - m_xBottomDist->set_value(rOldItem.GetPropLower(), FUNIT_NONE); + m_xBottomDist->set_value(rOldItem.GetPropLower(), FieldUnit::NONE); } else { m_xBottomDist->SetRelative(false); - if (eFUnit == FUNIT_CHAR) - m_xBottomDist->SetFieldUnit(FUNIT_LINE); + if (eFUnit == FieldUnit::CHAR) + m_xBottomDist->SetFieldUnit(FieldUnit::LINE); else m_xBottomDist->SetFieldUnit(eFUnit); m_xBottomDist->SetMetricValue(rOldItem.GetLower(), eUnit); @@ -674,18 +674,18 @@ SvxStdParagraphTabPage::SvxStdParagraphTabPage(TabPageParent pParent, const Sfx , nWidth(11905 /*567 * 50*/) , nMinFixDist(0) , bRelativeMode(false) - , m_xLeftIndent(new RelativeField(m_xBuilder->weld_metric_spin_button("spinED_LEFTINDENT", FUNIT_CM))) + , m_xLeftIndent(new RelativeField(m_xBuilder->weld_metric_spin_button("spinED_LEFTINDENT", FieldUnit::CM))) , m_xRightLabel(m_xBuilder->weld_label("labelFT_RIGHTINDENT")) - , m_xRightIndent(new RelativeField(m_xBuilder->weld_metric_spin_button("spinED_RIGHTINDENT", FUNIT_CM))) + , m_xRightIndent(new RelativeField(m_xBuilder->weld_metric_spin_button("spinED_RIGHTINDENT", FieldUnit::CM))) , m_xFLineLabel(m_xBuilder->weld_label("labelFT_FLINEINDENT")) - , m_xFLineIndent(new RelativeField(m_xBuilder->weld_metric_spin_button("spinED_FLINEINDENT", FUNIT_CM))) + , m_xFLineIndent(new RelativeField(m_xBuilder->weld_metric_spin_button("spinED_FLINEINDENT", FieldUnit::CM))) , m_xAutoCB(m_xBuilder->weld_check_button("checkCB_AUTO")) - , m_xTopDist(new RelativeField(m_xBuilder->weld_metric_spin_button("spinED_TOPDIST", FUNIT_CM))) - , m_xBottomDist(new RelativeField(m_xBuilder->weld_metric_spin_button("spinED_BOTTOMDIST", FUNIT_CM))) + , m_xTopDist(new RelativeField(m_xBuilder->weld_metric_spin_button("spinED_TOPDIST", FieldUnit::CM))) + , m_xBottomDist(new RelativeField(m_xBuilder->weld_metric_spin_button("spinED_BOTTOMDIST", FieldUnit::CM))) , m_xContextualCB(m_xBuilder->weld_check_button("checkCB_CONTEXTUALSPACING")) , m_xLineDist(m_xBuilder->weld_combo_box("comboLB_LINEDIST")) - , m_xLineDistAtPercentBox(m_xBuilder->weld_metric_spin_button("spinED_LINEDISTPERCENT", FUNIT_PERCENT)) - , m_xLineDistAtMetricBox(m_xBuilder->weld_metric_spin_button("spinED_LINEDISTMETRIC", FUNIT_CM)) + , m_xLineDistAtPercentBox(m_xBuilder->weld_metric_spin_button("spinED_LINEDISTPERCENT", FieldUnit::PERCENT)) + , m_xLineDistAtMetricBox(m_xBuilder->weld_metric_spin_button("spinED_LINEDISTMETRIC", FieldUnit::CM)) , m_xLineDistAtLabel(m_xBuilder->weld_label("labelFT_LINEDIST")) , m_xAbsDist(m_xBuilder->weld_label("labelST_LINEDIST_ABS")) , m_xRegisterFL(m_xBuilder->weld_widget("frameFL_REGISTER")) @@ -700,7 +700,7 @@ SvxStdParagraphTabPage::SvxStdParagraphTabPage(TabPageParent pParent, const Sfx m_xLineDistAtMetricBox->hide(); Init_Impl(); - m_xFLineIndent->set_min(-9999, FUNIT_NONE); // is set to 0 on default + m_xFLineIndent->set_min(-9999, FieldUnit::NONE); // is set to 0 on default } SvxStdParagraphTabPage::~SvxStdParagraphTabPage() @@ -709,8 +709,8 @@ SvxStdParagraphTabPage::~SvxStdParagraphTabPage() void SvxStdParagraphTabPage::EnableNegativeMode() { - m_xLeftIndent->set_min(-9999, FUNIT_NONE); - m_xRightIndent->set_min(-9999, FUNIT_NONE); + m_xLeftIndent->set_min(-9999, FieldUnit::NONE); + m_xRightIndent->set_min(-9999, FieldUnit::NONE); m_xRightIndent->EnableNegativeMode(); m_xLeftIndent->EnableNegativeMode(); } @@ -761,7 +761,7 @@ void SvxStdParagraphTabPage::SetLineSpacing_Impl break; } // the set per cent value - m_xLineDistAtPercentBox->set_value(m_xLineDistAtPercentBox->normalize(rAttr.GetPropLineSpace()), FUNIT_NONE); + m_xLineDistAtPercentBox->set_value(m_xLineDistAtPercentBox->normalize(rAttr.GetPropLineSpace()), FieldUnit::NONE); m_xLineDist->set_active( LLINESPACE_PROP ); break; @@ -805,10 +805,10 @@ IMPL_LINK(SvxStdParagraphTabPage, LineDistHdl_Impl, weld::ComboBox&, rBox, void) case LLINESPACE_DURCH: // setting a sensible default? // limit MS min(10, aPageSize) - m_xLineDistAtMetricBox->set_min(0, FUNIT_NONE); + m_xLineDistAtMetricBox->set_min(0, FieldUnit::NONE); if (m_xLineDistAtMetricBox->get_text().isEmpty()) - m_xLineDistAtMetricBox->set_value(m_xLineDistAtMetricBox->normalize(1), FUNIT_NONE); + m_xLineDistAtMetricBox->set_value(m_xLineDistAtMetricBox->normalize(1), FieldUnit::NONE); m_xLineDistAtPercentBox->hide(); m_xLineDistAtMetricBox->show(); m_xLineDistAtMetricBox->set_sensitive(true); @@ -816,10 +816,10 @@ IMPL_LINK(SvxStdParagraphTabPage, LineDistHdl_Impl, weld::ComboBox&, rBox, void) break; case LLINESPACE_MIN: - m_xLineDistAtMetricBox->set_min(0, FUNIT_NONE); + m_xLineDistAtMetricBox->set_min(0, FieldUnit::NONE); if (m_xLineDistAtMetricBox->get_text().isEmpty()) - m_xLineDistAtMetricBox->set_value(m_xLineDistAtMetricBox->normalize(10), FUNIT_TWIP); + m_xLineDistAtMetricBox->set_value(m_xLineDistAtMetricBox->normalize(10), FieldUnit::TWIP); m_xLineDistAtPercentBox->hide(); m_xLineDistAtMetricBox->show(); m_xLineDistAtMetricBox->set_sensitive(true); @@ -829,7 +829,7 @@ IMPL_LINK(SvxStdParagraphTabPage, LineDistHdl_Impl, weld::ComboBox&, rBox, void) case LLINESPACE_PROP: if (m_xLineDistAtPercentBox->get_text().isEmpty()) - m_xLineDistAtPercentBox->set_value(m_xLineDistAtPercentBox->normalize(100), FUNIT_TWIP); + m_xLineDistAtPercentBox->set_value(m_xLineDistAtPercentBox->normalize(100), FieldUnit::TWIP); m_xLineDistAtMetricBox->hide(); m_xLineDistAtPercentBox->show(); m_xLineDistAtPercentBox->set_sensitive(true); @@ -837,12 +837,12 @@ IMPL_LINK(SvxStdParagraphTabPage, LineDistHdl_Impl, weld::ComboBox&, rBox, void) break; case LLINESPACE_FIX: { - auto nTemp = m_xLineDistAtMetricBox->get_value(FUNIT_NONE); - m_xLineDistAtMetricBox->set_min(m_xLineDistAtMetricBox->normalize(nMinFixDist), FUNIT_TWIP); + auto nTemp = m_xLineDistAtMetricBox->get_value(FieldUnit::NONE); + m_xLineDistAtMetricBox->set_min(m_xLineDistAtMetricBox->normalize(nMinFixDist), FieldUnit::TWIP); // if the value has been changed at SetMin, // it is time for the default - if (m_xLineDistAtMetricBox->get_value(FUNIT_NONE) != nTemp) + if (m_xLineDistAtMetricBox->get_value(FieldUnit::NONE) != nTemp) SetMetricValue( *m_xLineDistAtMetricBox, FIX_DIST_DEF, MapUnit::MapTwip ); // fix is only in Writer m_xLineDistAtPercentBox->hide(); m_xLineDistAtMetricBox->show(); @@ -890,11 +890,11 @@ void SvxStdParagraphTabPage::Init_Impl() void SvxStdParagraphTabPage::UpdateExample_Impl() { - m_aExampleWin.SetFirstLineOfst( static_cast<short>(m_xFLineIndent->denormalize( m_xFLineIndent->get_value( FUNIT_TWIP ) )) ); - m_aExampleWin.SetLeftMargin( static_cast<long>(m_xLeftIndent->denormalize( m_xLeftIndent->get_value( FUNIT_TWIP ) ) ) ); - m_aExampleWin.SetRightMargin( static_cast<long>(m_xRightIndent->denormalize( m_xRightIndent->get_value( FUNIT_TWIP ) ) ) ); - m_aExampleWin.SetUpper( static_cast<sal_uInt16>(m_xTopDist->denormalize( m_xTopDist->get_value( FUNIT_TWIP ) )) ); - m_aExampleWin.SetLower( static_cast<sal_uInt16>(m_xBottomDist->denormalize( m_xBottomDist->get_value( FUNIT_TWIP ) )) ); + m_aExampleWin.SetFirstLineOfst( static_cast<short>(m_xFLineIndent->denormalize( m_xFLineIndent->get_value( FieldUnit::TWIP ) )) ); + m_aExampleWin.SetLeftMargin( static_cast<long>(m_xLeftIndent->denormalize( m_xLeftIndent->get_value( FieldUnit::TWIP ) ) ) ); + m_aExampleWin.SetRightMargin( static_cast<long>(m_xRightIndent->denormalize( m_xRightIndent->get_value( FieldUnit::TWIP ) ) ) ); + m_aExampleWin.SetUpper( static_cast<sal_uInt16>(m_xTopDist->denormalize( m_xTopDist->get_value( FieldUnit::TWIP ) )) ); + m_aExampleWin.SetLower( static_cast<sal_uInt16>(m_xBottomDist->denormalize( m_xBottomDist->get_value( FieldUnit::TWIP ) )) ); int nPos = m_xLineDist->get_active(); diff --git a/cui/source/tabpages/swpossizetabpage.cxx b/cui/source/tabpages/swpossizetabpage.cxx index 5d4aecb4329d..c67b3f8eddc4 100644 --- a/cui/source/tabpages/swpossizetabpage.cxx +++ b/cui/source/tabpages/swpossizetabpage.cxx @@ -525,8 +525,8 @@ SvxSwPosSizeTabPage::SvxSwPosSizeTabPage(TabPageParent pParent, const SfxItemSet , m_bIsMultiSelection(false) , m_bIsInRightToLeft(false) , m_nProtectSizeState(TRISTATE_FALSE) - , 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_xKeepRatioCB(m_xBuilder->weld_check_button("ratio")) , m_xToPageRB(m_xBuilder->weld_radio_button("topage")) , m_xToParaRB(m_xBuilder->weld_radio_button("topara")) @@ -539,14 +539,14 @@ SvxSwPosSizeTabPage::SvxSwPosSizeTabPage(TabPageParent pParent, const SfxItemSet , m_xHoriFT(m_xBuilder->weld_label("horiposft")) , m_xHoriLB(m_xBuilder->weld_combo_box("horipos")) , m_xHoriByFT(m_xBuilder->weld_label("horibyft")) - , m_xHoriByMF(m_xBuilder->weld_metric_spin_button("byhori", FUNIT_CM)) + , m_xHoriByMF(m_xBuilder->weld_metric_spin_button("byhori", FieldUnit::CM)) , m_xHoriToFT(m_xBuilder->weld_label("horitoft")) , m_xHoriToLB(m_xBuilder->weld_combo_box("horianchor")) , m_xHoriMirrorCB(m_xBuilder->weld_check_button("mirror")) , m_xVertFT(m_xBuilder->weld_label("vertposft")) , m_xVertLB(m_xBuilder->weld_combo_box("vertpos")) , m_xVertByFT(m_xBuilder->weld_label("vertbyft")) - , m_xVertByMF(m_xBuilder->weld_metric_spin_button("byvert", FUNIT_CM)) + , m_xVertByMF(m_xBuilder->weld_metric_spin_button("byvert", FieldUnit::CM)) , m_xVertToFT(m_xBuilder->weld_label("verttoft")) , m_xVertToLB(m_xBuilder->weld_combo_box("vertanchor")) , m_xFollowCB(m_xBuilder->weld_check_button("followtextflow")) @@ -781,8 +781,8 @@ bool SvxSwPosSizeTabPage::FillItemSet( SfxItemSet* rSet) { if (m_xHoriByMF->get_value_changed_from_saved() || m_xVertByMF->get_value_changed_from_saved()) { - auto nHoriByPos = m_xHoriByMF->denormalize(m_xHoriByMF->get_value(FUNIT_TWIP)); - auto nVertByPos = m_xVertByMF->denormalize(m_xVertByMF->get_value(FUNIT_TWIP)); + auto nHoriByPos = m_xHoriByMF->denormalize(m_xHoriByMF->get_value(FieldUnit::TWIP)); + auto nVertByPos = m_xVertByMF->denormalize(m_xVertByMF->get_value(FieldUnit::TWIP)); // old rectangle with CoreUnit m_aRect = m_pSdrView->GetAllMarkedRect(); @@ -811,7 +811,7 @@ bool SvxSwPosSizeTabPage::FillItemSet( SfxItemSet* rSet) sal_uInt16 nMapPos = GetMapPos(m_pHMap, *m_xHoriLB); short nAlign = GetAlignment(m_pHMap, nMapPos, *m_xHoriToLB); short nRel = GetRelation(*m_xHoriToLB); - const auto nHoriByPos = m_xHoriByMF->denormalize(m_xHoriByMF->get_value(FUNIT_TWIP)); + const auto nHoriByPos = m_xHoriByMF->denormalize(m_xHoriByMF->get_value(FieldUnit::TWIP)); if ( nAlign != rHoriOrient.GetValue() || nRel != rHoriRelation.GetValue() || @@ -842,7 +842,7 @@ bool SvxSwPosSizeTabPage::FillItemSet( SfxItemSet* rSet) short nRel = GetRelation(*m_xVertToLB); // #i34055# - convert vertical position for // as-character anchored objects - auto nVertByPos = m_xVertByMF->denormalize(m_xVertByMF->get_value(FUNIT_TWIP)); + auto nVertByPos = m_xVertByMF->denormalize(m_xVertByMF->get_value(FieldUnit::TWIP)); if (GetAnchorType() == RndStdIds::FLY_AS_CHAR) { nVertByPos *= -1; @@ -876,8 +876,8 @@ bool SvxSwPosSizeTabPage::FillItemSet( SfxItemSet* rSet) } if (m_xWidthMF->get_value_changed_from_saved() || m_xHeightMF->get_value_changed_from_saved()) { - sal_uInt32 nWidth = static_cast<sal_uInt32>(m_xWidthMF->denormalize(m_xWidthMF->get_value(FUNIT_TWIP))); - sal_uInt32 nHeight = static_cast<sal_uInt32>(m_xHeightMF->denormalize(m_xHeightMF->get_value(FUNIT_TWIP))); + sal_uInt32 nWidth = static_cast<sal_uInt32>(m_xWidthMF->denormalize(m_xWidthMF->get_value(FieldUnit::TWIP))); + sal_uInt32 nHeight = static_cast<sal_uInt32>(m_xHeightMF->denormalize(m_xHeightMF->get_value(FieldUnit::TWIP))); rSet->Put( SfxUInt32Item( GetWhich( SID_ATTR_TRANSFORM_WIDTH ), nWidth ) ); rSet->Put( SfxUInt32Item( GetWhich( SID_ATTR_TRANSFORM_HEIGHT ), nHeight ) ); //this item is required by SdrEditView::SetGeoAttrToMarked() @@ -994,11 +994,11 @@ void SvxSwPosSizeTabPage::Reset( const SfxItemSet* rSet) pItem = GetItem( *rSet, SID_ATTR_TRANSFORM_WIDTH ); sal_Int32 nWidth = std::max( pItem ? ( static_cast<const SfxUInt32Item*>(pItem)->GetValue()) : 0, sal_uInt32(1) ); - m_xWidthMF->set_value(m_xWidthMF->normalize(nWidth), FUNIT_TWIP); + m_xWidthMF->set_value(m_xWidthMF->normalize(nWidth), FieldUnit::TWIP); pItem = GetItem( *rSet, SID_ATTR_TRANSFORM_HEIGHT ); sal_Int32 nHeight = std::max( pItem ? ( static_cast<const SfxUInt32Item*>(pItem)->GetValue()) : 0, sal_uInt32(1) ); - m_xHeightMF->set_value(m_xHeightMF->normalize(nHeight), FUNIT_TWIP); + m_xHeightMF->set_value(m_xHeightMF->normalize(nHeight), FieldUnit::TWIP); m_fWidthHeightRatio = double(nWidth) / double(nHeight); if(!m_bPositioningDisabled) @@ -1157,41 +1157,41 @@ IMPL_LINK_NOARG(SvxSwPosSizeTabPage, RangeModifyHdl, weld::Widget&, void) else aVal.nVertOrient = VertOrientation::NONE; - const auto nAtHorzPosVal = m_xHoriByMF->denormalize(m_xHoriByMF->get_value(FUNIT_TWIP)); - const auto nAtVertPosVal = m_xVertByMF->denormalize(m_xVertByMF->get_value(FUNIT_TWIP)); + const auto nAtHorzPosVal = m_xHoriByMF->denormalize(m_xHoriByMF->get_value(FieldUnit::TWIP)); + const auto nAtVertPosVal = m_xVertByMF->denormalize(m_xVertByMF->get_value(FieldUnit::TWIP)); aVal.nHPos = nAtHorzPosVal; aVal.nVPos = nAtVertPosVal; - sal_Int32 nWidth = static_cast<sal_uInt32>(m_xWidthMF->denormalize(m_xWidthMF->get_value(FUNIT_TWIP))); - sal_Int32 nHeight = static_cast<sal_uInt32>(m_xHeightMF->denormalize(m_xHeightMF->get_value(FUNIT_TWIP))); + sal_Int32 nWidth = static_cast<sal_uInt32>(m_xWidthMF->denormalize(m_xWidthMF->get_value(FieldUnit::TWIP))); + sal_Int32 nHeight = static_cast<sal_uInt32>(m_xHeightMF->denormalize(m_xHeightMF->get_value(FieldUnit::TWIP))); aVal.nWidth = nWidth; aVal.nHeight = nHeight; m_aValidateLink.Call(aVal); // minimum width also for style - m_xHeightMF->set_min(m_xHeightMF->normalize(aVal.nMinHeight), FUNIT_TWIP); - m_xWidthMF->set_min(m_xWidthMF->normalize(aVal.nMinWidth), FUNIT_TWIP); + m_xHeightMF->set_min(m_xHeightMF->normalize(aVal.nMinHeight), FieldUnit::TWIP); + m_xWidthMF->set_min(m_xWidthMF->normalize(aVal.nMinWidth), FieldUnit::TWIP); sal_Int32 nMaxWidth(aVal.nMaxWidth); sal_Int32 nMaxHeight(aVal.nMaxHeight); sal_Int64 nTmp = m_xHeightMF->normalize(nMaxHeight); - m_xHeightMF->set_max(nTmp, FUNIT_TWIP); + m_xHeightMF->set_max(nTmp, FieldUnit::TWIP); nTmp = m_xWidthMF->normalize(nMaxWidth); - m_xWidthMF->set_max(nTmp, FUNIT_TWIP); + m_xWidthMF->set_max(nTmp, FieldUnit::TWIP); m_xHoriByMF->set_range(m_xHoriByMF->normalize(aVal.nMinHPos), - m_xHoriByMF->normalize(aVal.nMaxHPos), FUNIT_TWIP); + m_xHoriByMF->normalize(aVal.nMaxHPos), FieldUnit::TWIP); if ( aVal.nHPos != nAtHorzPosVal ) - m_xHoriByMF->set_value(m_xHoriByMF->normalize(aVal.nHPos), FUNIT_TWIP); + m_xHoriByMF->set_value(m_xHoriByMF->normalize(aVal.nHPos), FieldUnit::TWIP); m_xVertByMF->set_range(m_xVertByMF->normalize(aVal.nMinVPos), - m_xVertByMF->normalize(aVal.nMaxVPos), FUNIT_TWIP); + m_xVertByMF->normalize(aVal.nMaxVPos), FieldUnit::TWIP); if ( aVal.nVPos != nAtVertPosVal ) - m_xVertByMF->set_value(m_xVertByMF->normalize(aVal.nVPos), FUNIT_TWIP); + m_xVertByMF->set_value(m_xVertByMF->normalize(aVal.nVPos), FieldUnit::TWIP); } IMPL_LINK_NOARG(SvxSwPosSizeTabPage, AnchorTypeHdl, weld::ToggleButton&, void) @@ -1342,19 +1342,19 @@ IMPL_LINK(SvxSwPosSizeTabPage, PosHdl, weld::ComboBox&, rLB, void) IMPL_LINK( SvxSwPosSizeTabPage, ModifyHdl, weld::MetricSpinButton&, rEdit, void ) { - auto nWidth = m_xWidthMF->denormalize(m_xWidthMF->get_value(FUNIT_TWIP)); - auto nHeight = m_xHeightMF->denormalize(m_xHeightMF->get_value(FUNIT_TWIP)); + auto nWidth = m_xWidthMF->denormalize(m_xWidthMF->get_value(FieldUnit::TWIP)); + auto nHeight = m_xHeightMF->denormalize(m_xHeightMF->get_value(FieldUnit::TWIP)); if (m_xKeepRatioCB->get_active()) { if ( &rEdit == m_xWidthMF.get() ) { nHeight = int(static_cast<double>(nWidth) / m_fWidthHeightRatio); - m_xHeightMF->set_value(m_xHeightMF->normalize(nHeight), FUNIT_TWIP); + m_xHeightMF->set_value(m_xHeightMF->normalize(nHeight), FieldUnit::TWIP); } else if(&rEdit == m_xHeightMF.get()) { nWidth = int(static_cast<double>(nHeight) * m_fWidthHeightRatio); - m_xWidthMF->set_value(m_xWidthMF->normalize(nWidth), FUNIT_TWIP); + m_xWidthMF->set_value(m_xWidthMF->normalize(nWidth), FieldUnit::TWIP); } } m_fWidthHeightRatio = nHeight ? double(nWidth) / double(nHeight) : 1.0; @@ -1557,16 +1557,16 @@ void SvxSwPosSizeTabPage::InitPos(RndStdIds nAnchor, bEnable = nH == HoriOrientation::NONE && nAnchor != RndStdIds::FLY_AS_CHAR; //#61359# why not in formats&& !bFormat; if (!bEnable) { - m_xHoriByMF->set_value(0, FUNIT_TWIP); + m_xHoriByMF->set_value(0, FieldUnit::TWIP); } else if(m_bIsMultiSelection) { - m_xHoriByMF->set_value(m_xHoriByMF->normalize(m_aRect.Left()), FUNIT_TWIP); + m_xHoriByMF->set_value(m_xHoriByMF->normalize(m_aRect.Left()), FieldUnit::TWIP); } else { if (nX != LONG_MAX) - m_xHoriByMF->set_value(m_xHoriByMF->normalize(nX), FUNIT_TWIP); + m_xHoriByMF->set_value(m_xHoriByMF->normalize(nX), FieldUnit::TWIP); } m_xHoriByFT->set_sensitive(bEnable); m_xHoriByMF->set_sensitive(bEnable); @@ -1574,11 +1574,11 @@ void SvxSwPosSizeTabPage::InitPos(RndStdIds nAnchor, bEnable = nV == VertOrientation::NONE; if ( !bEnable ) { - m_xVertByMF->set_value( 0, FUNIT_TWIP ); + m_xVertByMF->set_value( 0, FieldUnit::TWIP ); } else if(m_bIsMultiSelection) { - m_xVertByMF->set_value(m_xVertByMF->normalize(m_aRect.Top()), FUNIT_TWIP); + m_xVertByMF->set_value(m_xVertByMF->normalize(m_aRect.Top()), FieldUnit::TWIP); } else { @@ -1590,7 +1590,7 @@ void SvxSwPosSizeTabPage::InitPos(RndStdIds nAnchor, nY *= -1; } if ( nY != LONG_MAX ) - m_xVertByMF->set_value( m_xVertByMF->normalize(nY), FUNIT_TWIP ); + m_xVertByMF->set_value( m_xVertByMF->normalize(nY), FieldUnit::TWIP ); } m_xVertByFT->set_sensitive( bEnable ); m_xVertByMF->set_sensitive( bEnable ); @@ -1622,8 +1622,8 @@ void SvxSwPosSizeTabPage::UpdateExample() } // Size - auto nXPos = m_xHoriByMF->denormalize(m_xHoriByMF->get_value(FUNIT_TWIP)); - auto nYPos = m_xVertByMF->denormalize(m_xVertByMF->get_value(FUNIT_TWIP)); + auto nXPos = m_xHoriByMF->denormalize(m_xHoriByMF->get_value(FieldUnit::TWIP)); + auto nYPos = m_xVertByMF->denormalize(m_xVertByMF->get_value(FieldUnit::TWIP)); m_aExampleWN.SetRelPos(Point(nXPos, nYPos)); m_aExampleWN.SetAnchor( GetAnchorType() ); diff --git a/cui/source/tabpages/tabstpge.cxx b/cui/source/tabpages/tabstpge.cxx index f60015656fd3..51f864fd6cd7 100644 --- a/cui/source/tabpages/tabstpge.cxx +++ b/cui/source/tabpages/tabstpge.cxx @@ -69,8 +69,8 @@ SvxTabulatorTabPage::SvxTabulatorTabPage(TabPageParent pParent, const SfxItemSet , aCurrentTab(0) , aNewTabs(0, 0, SvxTabAdjust::Left, GetWhich(SID_ATTR_TABSTOP)) , nDefDist(0) - , eDefUnit(FUNIT_100TH_MM) - , m_xTabSpin(m_xBuilder->weld_metric_spin_button("SP_TABPOS", FUNIT_CM)) + , eDefUnit(FieldUnit::MM_100TH) + , m_xTabSpin(m_xBuilder->weld_metric_spin_button("SP_TABPOS", FieldUnit::CM)) , m_xTabBox(m_xBuilder->weld_entry_tree_view("tabgrid", "ED_TABPOS", "LB_TABPOS")) , m_xCenterTab(m_xBuilder->weld_radio_button("radiobuttonBTN_TABTYPE_CENTER")) , m_xDezTab(m_xBuilder->weld_radio_button("radiobuttonBTN_TABTYPE_DECIMAL")) @@ -634,7 +634,7 @@ IMPL_LINK_NOARG(SvxTabulatorTabPage, SelectHdl_Impl, weld::TreeView&, void) IMPL_LINK_NOARG(SvxTabulatorTabPage, ReformatHdl_Impl, weld::Widget&, void) { m_xTabSpin->set_text(m_xTabBox->get_active_text()); - m_xTabSpin->set_value(m_xTabSpin->get_value(FUNIT_NONE), FUNIT_NONE); + m_xTabSpin->set_value(m_xTabSpin->get_value(FieldUnit::NONE), FieldUnit::NONE); m_xTabBox->set_entry_text(m_xTabSpin->get_text()); } diff --git a/cui/source/tabpages/textanim.cxx b/cui/source/tabpages/textanim.cxx index 749fe4781184..d5e27cfc2113 100644 --- a/cui/source/tabpages/textanim.cxx +++ b/cui/source/tabpages/textanim.cxx @@ -103,9 +103,9 @@ SvxTextAnimationPage::SvxTextAnimationPage(TabPageParent pPage, const SfxItemSet , m_xTsbEndless(m_xBuilder->weld_check_button("TSB_ENDLESS")) , m_xNumFldCount(m_xBuilder->weld_spin_button("NUM_FLD_COUNT")) , m_xTsbPixel(m_xBuilder->weld_check_button("TSB_PIXEL")) - , m_xMtrFldAmount(m_xBuilder->weld_metric_spin_button("MTR_FLD_AMOUNT", FUNIT_PIXEL)) + , m_xMtrFldAmount(m_xBuilder->weld_metric_spin_button("MTR_FLD_AMOUNT", FieldUnit::PIXEL)) , m_xTsbAuto(m_xBuilder->weld_check_button("TSB_AUTO")) - , m_xMtrFldDelay(m_xBuilder->weld_metric_spin_button("MTR_FLD_DELAY", FUNIT_MILLISECOND)) + , m_xMtrFldDelay(m_xBuilder->weld_metric_spin_button("MTR_FLD_DELAY", FieldUnit::MILLISECOND)) { eFUnit = GetModuleFieldUnit( rInAttrs ); SfxItemPool* pPool = rOutAttrs.GetPool(); @@ -248,7 +248,7 @@ void SvxTextAnimationPage::Reset( const SfxItemSet* rAttrs ) { m_xTsbAuto->set_inconsistent(false); long nValue = static_cast<long>(static_cast<const SdrTextAniDelayItem*>(pItem)->GetValue()); - m_xMtrFldDelay->set_value(nValue, FUNIT_NONE); + m_xMtrFldDelay->set_value(nValue, FieldUnit::NONE); if( nValue == 0 ) { m_xTsbAuto->set_state( TRISTATE_TRUE ); @@ -279,12 +279,12 @@ void SvxTextAnimationPage::Reset( const SfxItemSet* rAttrs ) nValue = -nValue; if( nValue == 0 ) nValue++; - m_xMtrFldAmount->set_unit( FUNIT_CUSTOM ); + m_xMtrFldAmount->set_unit( FieldUnit::CUSTOM ); m_xMtrFldAmount->set_digits(0); - m_xMtrFldAmount->set_increments(1, 10, FUNIT_NONE); - m_xMtrFldAmount->set_range(1, 100, FUNIT_NONE); - m_xMtrFldAmount->set_value(nValue, FUNIT_NONE); + m_xMtrFldAmount->set_increments(1, 10, FieldUnit::NONE); + m_xMtrFldAmount->set_range(1, 100, FieldUnit::NONE); + m_xMtrFldAmount->set_value(nValue, FieldUnit::NONE); } else { @@ -292,8 +292,8 @@ void SvxTextAnimationPage::Reset( const SfxItemSet* rAttrs ) m_xMtrFldAmount->set_unit( eFUnit ); m_xMtrFldAmount->set_digits(2); - m_xMtrFldAmount->set_increments(10, 100, FUNIT_NONE); - m_xMtrFldAmount->set_range(1, 10000, FUNIT_NONE); + m_xMtrFldAmount->set_increments(10, 100, FieldUnit::NONE); + m_xMtrFldAmount->set_range(1, 10000, FieldUnit::NONE); SetMetricValue( *m_xMtrFldAmount, nValue, eUnit ); } @@ -391,7 +391,7 @@ bool SvxTextAnimationPage::FillItemSet( SfxItemSet* rAttrs) { if( m_xMtrFldDelay->get_value_changed_from_saved() ) { - nValue = m_xMtrFldDelay->get_value(FUNIT_NONE); + nValue = m_xMtrFldDelay->get_value(FieldUnit::NONE); bModified = true; } } @@ -407,7 +407,7 @@ bool SvxTextAnimationPage::FillItemSet( SfxItemSet* rAttrs) sal_Int64 nValue = 0; if( eState == TRISTATE_TRUE ) { - nValue = m_xMtrFldAmount->get_value(FUNIT_NONE); + nValue = m_xMtrFldAmount->get_value(FieldUnit::NONE); nValue = -nValue; } else @@ -519,7 +519,7 @@ IMPL_LINK_NOARG(SvxTextAnimationPage, ClickAutoHdl_Impl, weld::Button&, void) else { m_xMtrFldDelay->set_sensitive(true); - m_xMtrFldDelay->set_value(m_xMtrFldDelay->get_value(FUNIT_NONE), FUNIT_NONE); //to-do + m_xMtrFldDelay->set_value(m_xMtrFldDelay->get_value(FieldUnit::NONE), FieldUnit::NONE); //to-do } } @@ -528,27 +528,27 @@ IMPL_LINK_NOARG(SvxTextAnimationPage, ClickPixelHdl_Impl, weld::Button&, void) TriState eState = m_xTsbPixel->get_state(); if (eState == TRISTATE_TRUE) { - int nValue = m_xMtrFldAmount->get_value(FUNIT_NONE) / 10; + int nValue = m_xMtrFldAmount->get_value(FieldUnit::NONE) / 10; m_xMtrFldAmount->set_sensitive(true); - m_xMtrFldAmount->set_unit(FUNIT_CUSTOM); + m_xMtrFldAmount->set_unit(FieldUnit::CUSTOM); m_xMtrFldAmount->set_digits(0); - m_xMtrFldAmount->set_increments(1, 10, FUNIT_NONE); - m_xMtrFldAmount->set_range(1, 100, FUNIT_NONE); + m_xMtrFldAmount->set_increments(1, 10, FieldUnit::NONE); + m_xMtrFldAmount->set_range(1, 100, FieldUnit::NONE); - m_xMtrFldAmount->set_value(nValue, FUNIT_NONE); + m_xMtrFldAmount->set_value(nValue, FieldUnit::NONE); } else if( eState == TRISTATE_FALSE ) { - int nValue = m_xMtrFldAmount->get_value(FUNIT_NONE) * 10; + int nValue = m_xMtrFldAmount->get_value(FieldUnit::NONE) * 10; m_xMtrFldAmount->set_sensitive(true); m_xMtrFldAmount->set_unit(eFUnit); m_xMtrFldAmount->set_digits(2); - m_xMtrFldAmount->set_increments(10, 100, FUNIT_NONE); - m_xMtrFldAmount->set_range(1, 10000, FUNIT_NONE); + m_xMtrFldAmount->set_increments(10, 100, FieldUnit::NONE); + m_xMtrFldAmount->set_range(1, 10000, FieldUnit::NONE); - m_xMtrFldAmount->set_value(nValue, FUNIT_NONE); + m_xMtrFldAmount->set_value(nValue, FieldUnit::NONE); } } diff --git a/cui/source/tabpages/textattr.cxx b/cui/source/tabpages/textattr.cxx index b54f1dc97cce..b80cfd38fd7c 100644 --- a/cui/source/tabpages/textattr.cxx +++ b/cui/source/tabpages/textattr.cxx @@ -73,10 +73,10 @@ SvxTextAttrPage::SvxTextAttrPage(TabPageParent pPage, const SfxItemSet& rInAttrs , m_xTsbWordWrapText(m_xBuilder->weld_check_button("TSB_WORDWRAP_TEXT")) , m_xTsbAutoGrowSize(m_xBuilder->weld_check_button("TSB_AUTOGROW_SIZE")) , m_xFlDistance(m_xBuilder->weld_frame("FL_DISTANCE")) - , m_xMtrFldLeft(m_xBuilder->weld_metric_spin_button("MTR_FLD_LEFT", FUNIT_CM)) - , m_xMtrFldRight(m_xBuilder->weld_metric_spin_button("MTR_FLD_RIGHT", FUNIT_CM)) - , m_xMtrFldTop(m_xBuilder->weld_metric_spin_button("MTR_FLD_TOP", FUNIT_CM)) - , m_xMtrFldBottom(m_xBuilder->weld_metric_spin_button("MTR_FLD_BOTTOM", FUNIT_CM)) + , m_xMtrFldLeft(m_xBuilder->weld_metric_spin_button("MTR_FLD_LEFT", FieldUnit::CM)) + , m_xMtrFldRight(m_xBuilder->weld_metric_spin_button("MTR_FLD_RIGHT", FieldUnit::CM)) + , m_xMtrFldTop(m_xBuilder->weld_metric_spin_button("MTR_FLD_TOP", FieldUnit::CM)) + , m_xMtrFldBottom(m_xBuilder->weld_metric_spin_button("MTR_FLD_BOTTOM", FieldUnit::CM)) , m_xFlPosition(m_xBuilder->weld_frame("FL_POSITION")) , m_xCtlPosition(new weld::CustomWeld(*m_xBuilder, "CTL_POSITION", m_aCtlPosition)) , m_xTsbFullWidth(m_xBuilder->weld_check_button("TSB_FULL_WIDTH")) @@ -650,10 +650,10 @@ IMPL_LINK(SvxTextAttrPage, ClickHdl_Impl, weld::Button&, rButton, void) if( bContour && bContourEnabled ) { - m_xMtrFldLeft->set_value(0, FUNIT_NONE); - m_xMtrFldRight->set_value(0, FUNIT_NONE); - m_xMtrFldTop->set_value(0, FUNIT_NONE); - m_xMtrFldBottom->set_value(0, FUNIT_NONE); + m_xMtrFldLeft->set_value(0, FieldUnit::NONE); + m_xMtrFldRight->set_value(0, FieldUnit::NONE); + m_xMtrFldTop->set_value(0, FieldUnit::NONE); + m_xMtrFldBottom->set_value(0, FieldUnit::NONE); } // #103516# Do the setup based on states of hor/ver adjust diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx index d7af780b41aa..779c3ca096de 100644 --- a/cui/source/tabpages/tpbitmap.cxx +++ b/cui/source/tabpages/tpbitmap.cxx @@ -81,16 +81,16 @@ SvxBitmapTabPage::SvxBitmapTabPage(TabPageParent pParent, const SfxItemSet& rInA , m_xBitmapStyleLB(m_xBuilder->weld_combo_box("bitmapstyle")) , m_xSizeBox(m_xBuilder->weld_container("sizebox")) , m_xTsbScale(m_xBuilder->weld_check_button("scaletsb")) - , m_xBitmapWidth(m_xBuilder->weld_metric_spin_button("width", FUNIT_PERCENT)) - , m_xBitmapHeight(m_xBuilder->weld_metric_spin_button("height", FUNIT_PERCENT)) + , m_xBitmapWidth(m_xBuilder->weld_metric_spin_button("width", FieldUnit::PERCENT)) + , m_xBitmapHeight(m_xBuilder->weld_metric_spin_button("height", FieldUnit::PERCENT)) , m_xPositionBox(m_xBuilder->weld_container("posbox")) , m_xPositionLB(m_xBuilder->weld_combo_box("positionlb")) , m_xPositionOffBox(m_xBuilder->weld_container("posoffbox")) - , m_xPositionOffX(m_xBuilder->weld_metric_spin_button("posoffx", FUNIT_PERCENT)) - , m_xPositionOffY(m_xBuilder->weld_metric_spin_button("posoffy", FUNIT_PERCENT)) + , m_xPositionOffX(m_xBuilder->weld_metric_spin_button("posoffx", FieldUnit::PERCENT)) + , m_xPositionOffY(m_xBuilder->weld_metric_spin_button("posoffy", FieldUnit::PERCENT)) , m_xTileOffBox(m_xBuilder->weld_container("tileoffbox")) , m_xTileOffLB(m_xBuilder->weld_combo_box("tileofflb")) - , m_xTileOffset(m_xBuilder->weld_metric_spin_button("tileoffmtr", FUNIT_PERCENT)) + , m_xTileOffset(m_xBuilder->weld_metric_spin_button("tileoffmtr", FieldUnit::PERCENT)) , m_xBtnImport(m_xBuilder->weld_button("BTN_IMPORT")) , m_xCtlBitmapPreview(new weld::CustomWeld(*m_xBuilder, "CTL_BITMAP_PREVIEW", m_aCtlBitmapPreview)) , m_xBitmapLBWin(new weld::CustomWeld(*m_xBuilder, "BITMAP", *m_xBitmapLB)) @@ -163,8 +163,8 @@ void SvxBitmapTabPage::ActivatePage( const SfxItemSet& rSet ) } else { - m_xBitmapWidth->set_value( 100, FUNIT_NONE ); - m_xBitmapHeight->set_value( 100, FUNIT_NONE ); + m_xBitmapWidth->set_value( 100, FieldUnit::NONE ); + m_xBitmapHeight->set_value( 100, FieldUnit::NONE ); const_cast<SfxItemSet&>(rSet).Put( XFillBmpSizeXItem( GetCoreValue( *m_xBitmapWidth, mePoolUnit ) ) ); const_cast<SfxItemSet&>(rSet).Put( XFillBmpSizeYItem( GetCoreValue( *m_xBitmapHeight, mePoolUnit ) ) ); } @@ -208,8 +208,8 @@ bool SvxBitmapTabPage::FillItemSet( SfxItemSet* rAttrs ) case CUSTOM: case TILED: { - sal_Int64 nWidthPercent = m_xBitmapWidth->get_value(FUNIT_NONE); - sal_Int64 nHeightPercent = m_xBitmapHeight->get_value(FUNIT_NONE); + sal_Int64 nWidthPercent = m_xBitmapWidth->get_value(FieldUnit::NONE); + sal_Int64 nHeightPercent = m_xBitmapHeight->get_value(FieldUnit::NONE); if (m_xTsbScale->get_sensitive() && m_xTsbScale->get_state() == TRISTATE_TRUE) { aSetBitmapSize.setWidth( -nWidthPercent ); @@ -240,13 +240,13 @@ bool SvxBitmapTabPage::FillItemSet( SfxItemSet* rAttrs ) if (m_xPositionLB->get_sensitive()) rAttrs->Put( XFillBmpPosItem( static_cast<RectPoint>( m_xPositionLB->get_active() ) ) ); if (m_xPositionOffX->get_sensitive()) - rAttrs->Put( XFillBmpPosOffsetXItem(m_xPositionOffX->get_value(FUNIT_PERCENT))); + rAttrs->Put( XFillBmpPosOffsetXItem(m_xPositionOffX->get_value(FieldUnit::PERCENT))); if (m_xPositionOffY->get_sensitive()) - rAttrs->Put( XFillBmpPosOffsetYItem(m_xPositionOffY->get_value(FUNIT_PERCENT))); + rAttrs->Put( XFillBmpPosOffsetYItem(m_xPositionOffY->get_value(FieldUnit::PERCENT))); if (m_xTileOffBox->get_sensitive()) { TileOffset eValue = static_cast<TileOffset>(m_xTileOffLB->get_active()); - sal_uInt16 nOffsetValue = static_cast<sal_uInt16>(m_xTileOffset->get_value(FUNIT_PERCENT)); + sal_uInt16 nOffsetValue = static_cast<sal_uInt16>(m_xTileOffset->get_value(FieldUnit::PERCENT)); sal_uInt16 nRowOff = (eValue == ROW) ? nOffsetValue : 0; sal_uInt16 nColOff = (eValue == COLUMN) ? nOffsetValue : 0; rAttrs->Put( XFillBmpTileOffsetXItem(nRowOff) ); @@ -364,8 +364,8 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* rAttrs ) { if (eRelative == TRISTATE_TRUE) { - m_xBitmapWidth->set_value(nWidth, FUNIT_NONE); - m_xBitmapHeight->set_value(nHeight, FUNIT_NONE); + m_xBitmapWidth->set_value(nWidth, FieldUnit::NONE); + m_xBitmapHeight->set_value(nHeight, FieldUnit::NONE); } else { @@ -383,7 +383,7 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* rAttrs ) if( rAttrs->GetItemState( XATTR_FILLBMP_POSOFFSETX ) != SfxItemState::DONTCARE ) { sal_Int32 nValue = rAttrs->Get( XATTR_FILLBMP_POSOFFSETX ).GetValue(); - m_xPositionOffX->set_value(nValue, FUNIT_PERCENT); + m_xPositionOffX->set_value(nValue, FieldUnit::PERCENT); } else m_xPositionOffX->set_text(""); @@ -391,7 +391,7 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* rAttrs ) if( rAttrs->GetItemState( XATTR_FILLBMP_POSOFFSETY ) != SfxItemState::DONTCARE ) { sal_Int32 nValue = rAttrs->Get( XATTR_FILLBMP_POSOFFSETY ).GetValue(); - m_xPositionOffY->set_value(nValue, FUNIT_PERCENT); + m_xPositionOffY->set_value(nValue, FieldUnit::PERCENT); } else m_xPositionOffY->set_text(""); @@ -402,7 +402,7 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* rAttrs ) if(nValue > 0) { m_xTileOffLB->set_active(static_cast<sal_Int32>(ROW)); - m_xTileOffset->set_value(nValue, FUNIT_PERCENT); + m_xTileOffset->set_value(nValue, FieldUnit::PERCENT); } } @@ -412,7 +412,7 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* rAttrs ) if(nValue > 0) { m_xTileOffLB->set_active(static_cast<sal_Int32>(COLUMN)); - m_xTileOffset->set_value(nValue, FUNIT_PERCENT); + m_xTileOffset->set_value(nValue, FieldUnit::PERCENT); } } @@ -586,8 +586,8 @@ IMPL_LINK_NOARG( SvxBitmapTabPage, ModifyBitmapSizeHdl, weld::MetricSpinButton&, m_bLogicalSize = false; if (m_xTsbScale->get_state() != TRISTATE_TRUE && static_cast<BitmapStyle>(m_xBitmapStyleLB->get_active()) != TILED) { - sal_Int64 nWidthPercent = m_xBitmapWidth->denormalize(m_xBitmapWidth->get_value(FUNIT_NONE)); - sal_Int64 nHeightPercent = m_xBitmapHeight->denormalize(m_xBitmapHeight->get_value(FUNIT_NONE)); + sal_Int64 nWidthPercent = m_xBitmapWidth->denormalize(m_xBitmapWidth->get_value(FieldUnit::NONE)); + sal_Int64 nHeightPercent = m_xBitmapHeight->denormalize(m_xBitmapHeight->get_value(FieldUnit::NONE)); if (nWidthPercent == 100 && nHeightPercent == 100) m_xBitmapStyleLB->set_active(static_cast<sal_Int32>(CUSTOM)); } @@ -602,26 +602,26 @@ IMPL_LINK_NOARG( SvxBitmapTabPage, ClickScaleHdl, weld::Button&, void ) if (m_xTsbScale->get_state() == TRISTATE_TRUE) { m_xBitmapWidth->set_digits( 0 ); - m_xBitmapWidth->set_unit(FUNIT_PERCENT); - m_xBitmapWidth->set_value(100, FUNIT_NONE); - m_xBitmapWidth->set_range(0, 100, FUNIT_NONE); + m_xBitmapWidth->set_unit(FieldUnit::PERCENT); + m_xBitmapWidth->set_value(100, FieldUnit::NONE); + m_xBitmapWidth->set_range(0, 100, FieldUnit::NONE); m_xBitmapHeight->set_digits( 0 ); - m_xBitmapHeight->set_unit(FUNIT_PERCENT); - m_xBitmapHeight->set_value(100, FUNIT_NONE); - m_xBitmapHeight->set_range(0, 100, FUNIT_NONE); + m_xBitmapHeight->set_unit(FieldUnit::PERCENT); + m_xBitmapHeight->set_value(100, FieldUnit::NONE); + m_xBitmapHeight->set_range(0, 100, FieldUnit::NONE); } else { m_xBitmapWidth->set_digits( 2 ); m_xBitmapWidth->set_unit(meFieldUnit); - m_xBitmapWidth->set_value(100, FUNIT_NONE); - m_xBitmapWidth->set_range(0, 999900, FUNIT_NONE); + m_xBitmapWidth->set_value(100, FieldUnit::NONE); + m_xBitmapWidth->set_range(0, 999900, FieldUnit::NONE); m_xBitmapHeight->set_digits( 2 ); m_xBitmapHeight->set_unit(meFieldUnit); - m_xBitmapHeight->set_value(100, FUNIT_NONE); - m_xBitmapHeight->set_range(0, 999900, FUNIT_NONE); + m_xBitmapHeight->set_value(100, FieldUnit::NONE); + m_xBitmapHeight->set_range(0, 999900, FieldUnit::NONE); } ModifyBitmapStyleHdl( *m_xBitmapStyleLB ); @@ -651,8 +651,8 @@ IMPL_LINK_NOARG( SvxBitmapTabPage, ModifyBitmapStyleHdl, weld::ComboBox&, void ) { if (m_xTsbScale->get_sensitive() && m_xTsbScale->get_state() == TRISTATE_TRUE) { - aSetBitmapSize.setWidth(-m_xBitmapWidth->get_value(FUNIT_NONE)); - aSetBitmapSize.setHeight(-m_xBitmapWidth->get_value(FUNIT_NONE)); + aSetBitmapSize.setWidth(-m_xBitmapWidth->get_value(FieldUnit::NONE)); + aSetBitmapSize.setHeight(-m_xBitmapWidth->get_value(FieldUnit::NONE)); } else { @@ -685,10 +685,10 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ModifyBitmapPositionHdl, weld::ComboBox&, void IMPL_LINK_NOARG(SvxBitmapTabPage, ModifyPositionOffsetHdl, weld::MetricSpinButton&, void) { if (m_xPositionOffX->get_sensitive()) - m_rXFSet.Put( XFillBmpPosOffsetXItem( m_xPositionOffX->get_value(FUNIT_PERCENT) ) ); + m_rXFSet.Put( XFillBmpPosOffsetXItem( m_xPositionOffX->get_value(FieldUnit::PERCENT) ) ); if (m_xPositionOffY->get_sensitive()) - m_rXFSet.Put( XFillBmpPosOffsetYItem( m_xPositionOffY->get_value(FUNIT_PERCENT) ) ); + m_rXFSet.Put( XFillBmpPosOffsetYItem( m_xPositionOffY->get_value(FieldUnit::PERCENT) ) ); m_aCtlBitmapPreview.SetAttributes( m_aXFillAttr.GetItemSet() ); m_aCtlBitmapPreview.Invalidate(); @@ -700,10 +700,10 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ModifyTileOffsetHdl, weld::MetricSpinButton&, sal_uInt16 nTileYOff = 0; if(m_xTileOffLB->get_active() == static_cast<sal_Int32>(ROW)) - nTileXOff = m_xTileOffset->get_value(FUNIT_PERCENT); + nTileXOff = m_xTileOffset->get_value(FieldUnit::PERCENT); if(m_xTileOffLB->get_active() == static_cast<sal_Int32>(COLUMN)) - nTileYOff = m_xTileOffset->get_value(FUNIT_PERCENT); + nTileYOff = m_xTileOffset->get_value(FieldUnit::PERCENT); m_rXFSet.Put( XFillBmpTileOffsetXItem(nTileXOff) ); m_rXFSet.Put( XFillBmpTileOffsetYItem(nTileYOff) ); diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx index 9a902fc7270b..c7b79ed69bc2 100644 --- a/cui/source/tabpages/tpcolor.cxx +++ b/cui/source/tabpages/tpcolor.cxx @@ -85,10 +85,10 @@ SvxColorTabPage::SvxColorTabPage(TabPageParent pParent, const SfxItemSet& rInAtt , m_xYpreset(m_xBuilder->weld_entry("Y_preset")) , m_xMpreset(m_xBuilder->weld_entry("M_preset")) , m_xKpreset(m_xBuilder->weld_entry("K_preset")) - , m_xCcustom(m_xBuilder->weld_metric_spin_button("C_custom", FUNIT_PERCENT)) - , m_xYcustom(m_xBuilder->weld_metric_spin_button("Y_custom", FUNIT_PERCENT)) - , m_xMcustom(m_xBuilder->weld_metric_spin_button("M_custom", FUNIT_PERCENT)) - , m_xKcustom(m_xBuilder->weld_metric_spin_button("K_custom", FUNIT_PERCENT)) + , m_xCcustom(m_xBuilder->weld_metric_spin_button("C_custom", FieldUnit::PERCENT)) + , m_xYcustom(m_xBuilder->weld_metric_spin_button("Y_custom", FieldUnit::PERCENT)) + , m_xMcustom(m_xBuilder->weld_metric_spin_button("M_custom", FieldUnit::PERCENT)) + , m_xKcustom(m_xBuilder->weld_metric_spin_button("K_custom", FieldUnit::PERCENT)) , m_xBtnAdd(m_xBuilder->weld_button("add")) , m_xBtnDelete(m_xBuilder->weld_button("delete")) , m_xBtnWorkOn(m_xBuilder->weld_button("edit")) @@ -302,10 +302,10 @@ IMPL_LINK_NOARG(SvxColorTabPage, SpinValueHdl_Impl, weld::SpinButton&, void) IMPL_LINK_NOARG(SvxColorTabPage, MetricSpinValueHdl_Impl, weld::MetricSpinButton&, void) { // read current MtrFields, if cmyk, then k-value as transparency - aCurrentColor = Color(static_cast<sal_uInt8>(PercentToColor_Impl(m_xKcustom->get_value(FUNIT_NONE))), - static_cast<sal_uInt8>(PercentToColor_Impl(m_xCcustom->get_value(FUNIT_NONE))), - static_cast<sal_uInt8>(PercentToColor_Impl(m_xYcustom->get_value(FUNIT_NONE))), - static_cast<sal_uInt8>(PercentToColor_Impl(m_xMcustom->get_value(FUNIT_NONE)))); + aCurrentColor = Color(static_cast<sal_uInt8>(PercentToColor_Impl(m_xKcustom->get_value(FieldUnit::NONE))), + static_cast<sal_uInt8>(PercentToColor_Impl(m_xCcustom->get_value(FieldUnit::NONE))), + static_cast<sal_uInt8>(PercentToColor_Impl(m_xYcustom->get_value(FieldUnit::NONE))), + static_cast<sal_uInt8>(PercentToColor_Impl(m_xMcustom->get_value(FieldUnit::NONE)))); ConvertColorValues (aCurrentColor, ColorModel::RGB); rXFSet.Put( XFillColorItem( OUString(), aCurrentColor ) ); @@ -584,10 +584,10 @@ void SvxColorTabPage::UpdateColorValues( bool bUpdatePreset ) ConvertColorValues (aPreviousColor, eCM ); ConvertColorValues (aCurrentColor, eCM); - m_xCcustom->set_value( ColorToPercent_Impl( aCurrentColor.GetRed() ), FUNIT_PERCENT ); - m_xMcustom->set_value( ColorToPercent_Impl( aCurrentColor.GetBlue() ), FUNIT_PERCENT ); - m_xYcustom->set_value( ColorToPercent_Impl( aCurrentColor.GetGreen() ), FUNIT_PERCENT ); - m_xKcustom->set_value( ColorToPercent_Impl( aCurrentColor.GetTransparency() ), FUNIT_PERCENT ); + m_xCcustom->set_value( ColorToPercent_Impl( aCurrentColor.GetRed() ), FieldUnit::PERCENT ); + m_xMcustom->set_value( ColorToPercent_Impl( aCurrentColor.GetBlue() ), FieldUnit::PERCENT ); + m_xYcustom->set_value( ColorToPercent_Impl( aCurrentColor.GetGreen() ), FieldUnit::PERCENT ); + m_xKcustom->set_value( ColorToPercent_Impl( aCurrentColor.GetTransparency() ), FieldUnit::PERCENT ); if( bUpdatePreset ) { diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx index 6227cfd4e086..5d6cacbea86f 100644 --- a/cui/source/tabpages/tpgradnt.cxx +++ b/cui/source/tabpages/tpgradnt.cxx @@ -58,16 +58,16 @@ SvxGradientTabPage::SvxGradientTabPage(TabPageParent pParent, const SfxItemSet& , m_rXFSet(m_aXFillAttr.GetItemSet()) , m_xLbGradientType(m_xBuilder->weld_combo_box("gradienttypelb")) , m_xFtCenter(m_xBuilder->weld_label("centerft")) - , m_xMtrCenterX(m_xBuilder->weld_metric_spin_button("centerxmtr", FUNIT_PERCENT)) - , m_xMtrCenterY(m_xBuilder->weld_metric_spin_button("centerymtr", FUNIT_PERCENT)) + , m_xMtrCenterX(m_xBuilder->weld_metric_spin_button("centerxmtr", FieldUnit::PERCENT)) + , m_xMtrCenterY(m_xBuilder->weld_metric_spin_button("centerymtr", FieldUnit::PERCENT)) , m_xFtAngle(m_xBuilder->weld_label("angleft")) - , m_xMtrAngle(m_xBuilder->weld_metric_spin_button("anglemtr", FUNIT_DEGREE)) - , m_xMtrBorder(m_xBuilder->weld_metric_spin_button("bordermtr", FUNIT_PERCENT)) + , m_xMtrAngle(m_xBuilder->weld_metric_spin_button("anglemtr", FieldUnit::DEGREE)) + , m_xMtrBorder(m_xBuilder->weld_metric_spin_button("bordermtr", FieldUnit::PERCENT)) , m_xSliderBorder(m_xBuilder->weld_scale("borderslider")) , m_xLbColorFrom(new ColorListBox(m_xBuilder->weld_menu_button("colorfromlb"), pParent.GetFrameWeld())) - , m_xMtrColorFrom(m_xBuilder->weld_metric_spin_button("colorfrommtr", FUNIT_PERCENT)) + , m_xMtrColorFrom(m_xBuilder->weld_metric_spin_button("colorfrommtr", FieldUnit::PERCENT)) , m_xLbColorTo(new ColorListBox(m_xBuilder->weld_menu_button("colortolb"), pParent.GetFrameWeld())) - , m_xMtrColorTo(m_xBuilder->weld_metric_spin_button("colortomtr", FUNIT_PERCENT)) + , m_xMtrColorTo(m_xBuilder->weld_metric_spin_button("colortomtr", FieldUnit::PERCENT)) , m_xGradientLB(new SvxPresetListBox(m_xBuilder->weld_scrolled_window("gradientpresetlistwin"))) , m_xMtrIncrement(m_xBuilder->weld_spin_button("incrementmtr")) , m_xCbIncrement(m_xBuilder->weld_check_button("autoincrement")) @@ -85,8 +85,8 @@ SvxGradientTabPage::SvxGradientTabPage(TabPageParent pParent, const SfxItemSet& // as long as NOT supported by the item - m_xMtrColorTo->set_value(100, FUNIT_PERCENT); - m_xMtrColorFrom->set_value(100, FUNIT_PERCENT); + m_xMtrColorTo->set_value(100, FieldUnit::PERCENT); + m_xMtrColorFrom->set_value(100, FieldUnit::PERCENT); // setting the output device m_rXFSet.Put( XFillStyleItem(drawing::FillStyle_GRADIENT) ); @@ -210,12 +210,12 @@ bool SvxGradientTabPage::FillItemSet( SfxItemSet* rSet ) pXGradient.reset(new XGradient( m_xLbColorFrom->GetSelectEntryColor(), m_xLbColorTo->GetSelectEntryColor(), static_cast<css::awt::GradientStyle>(m_xLbGradientType->get_active()), - static_cast<long>(m_xMtrAngle->get_value(FUNIT_NONE) * 10), // should be changed in resource - static_cast<sal_uInt16>(m_xMtrCenterX->get_value(FUNIT_NONE)), - static_cast<sal_uInt16>(m_xMtrCenterY->get_value(FUNIT_NONE)), - static_cast<sal_uInt16>(m_xMtrBorder->get_value(FUNIT_NONE)), - static_cast<sal_uInt16>(m_xMtrColorFrom->get_value(FUNIT_NONE)), - static_cast<sal_uInt16>(m_xMtrColorTo->get_value(FUNIT_NONE)), + static_cast<long>(m_xMtrAngle->get_value(FieldUnit::NONE) * 10), // should be changed in resource + static_cast<sal_uInt16>(m_xMtrCenterX->get_value(FieldUnit::NONE)), + static_cast<sal_uInt16>(m_xMtrCenterY->get_value(FieldUnit::NONE)), + static_cast<sal_uInt16>(m_xMtrBorder->get_value(FieldUnit::NONE)), + static_cast<sal_uInt16>(m_xMtrColorFrom->get_value(FieldUnit::NONE)), + static_cast<sal_uInt16>(m_xMtrColorTo->get_value(FieldUnit::NONE)), static_cast<sal_uInt16>(m_xMtrIncrement->get_value()) )); } @@ -298,9 +298,9 @@ IMPL_LINK_NOARG( SvxGradientTabPage, ChangeAutoStepHdl_Impl, weld::ToggleButton& void SvxGradientTabPage::ModifiedHdl_Impl( void const * pControl ) { if (pControl == m_xMtrBorder.get()) - m_xSliderBorder->set_value(m_xMtrBorder->get_value(FUNIT_NONE)); + m_xSliderBorder->set_value(m_xMtrBorder->get_value(FieldUnit::NONE)); if (pControl == m_xSliderBorder.get()) - m_xMtrBorder->set_value(m_xSliderBorder->get_value(), FUNIT_NONE); + m_xMtrBorder->set_value(m_xSliderBorder->get_value(), FieldUnit::NONE); if (pControl == m_xMtrIncrement.get()) m_xSliderIncrement->set_value(m_xMtrIncrement->get_value()); if (pControl == m_xSliderIncrement.get()) @@ -311,12 +311,12 @@ void SvxGradientTabPage::ModifiedHdl_Impl( void const * pControl ) XGradient aXGradient( m_xLbColorFrom->GetSelectEntryColor(), m_xLbColorTo->GetSelectEntryColor(), eXGS, - static_cast<long>(m_xMtrAngle->get_value(FUNIT_NONE) * 10), // should be changed in resource - static_cast<sal_uInt16>(m_xMtrCenterX->get_value(FUNIT_NONE)), - static_cast<sal_uInt16>(m_xMtrCenterY->get_value(FUNIT_NONE)), - static_cast<sal_uInt16>(m_xMtrBorder->get_value(FUNIT_NONE)), - static_cast<sal_uInt16>(m_xMtrColorFrom->get_value(FUNIT_NONE)), - static_cast<sal_uInt16>(m_xMtrColorTo->get_value(FUNIT_NONE)), + static_cast<long>(m_xMtrAngle->get_value(FieldUnit::NONE) * 10), // should be changed in resource + static_cast<sal_uInt16>(m_xMtrCenterX->get_value(FieldUnit::NONE)), + static_cast<sal_uInt16>(m_xMtrCenterY->get_value(FieldUnit::NONE)), + static_cast<sal_uInt16>(m_xMtrBorder->get_value(FieldUnit::NONE)), + static_cast<sal_uInt16>(m_xMtrColorFrom->get_value(FieldUnit::NONE)), + static_cast<sal_uInt16>(m_xMtrColorTo->get_value(FieldUnit::NONE)), static_cast<sal_uInt16>(m_xMtrIncrement->get_value()) ); // enable/disable controls @@ -378,12 +378,12 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl, weld::Button&, void) XGradient aXGradient( m_xLbColorFrom->GetSelectEntryColor(), m_xLbColorTo->GetSelectEntryColor(), static_cast<css::awt::GradientStyle>(m_xLbGradientType->get_active()), - static_cast<long>(m_xMtrAngle->get_value(FUNIT_NONE) * 10), // should be changed in resource - static_cast<sal_uInt16>(m_xMtrCenterX->get_value(FUNIT_NONE)), - static_cast<sal_uInt16>(m_xMtrCenterY->get_value(FUNIT_NONE)), - static_cast<sal_uInt16>(m_xMtrBorder->get_value(FUNIT_NONE)), - static_cast<sal_uInt16>(m_xMtrColorFrom->get_value(FUNIT_NONE)), - static_cast<sal_uInt16>(m_xMtrColorTo->get_value(FUNIT_NONE)), + static_cast<long>(m_xMtrAngle->get_value(FieldUnit::NONE) * 10), // should be changed in resource + static_cast<sal_uInt16>(m_xMtrCenterX->get_value(FieldUnit::NONE)), + static_cast<sal_uInt16>(m_xMtrCenterY->get_value(FieldUnit::NONE)), + static_cast<sal_uInt16>(m_xMtrBorder->get_value(FieldUnit::NONE)), + static_cast<sal_uInt16>(m_xMtrColorFrom->get_value(FieldUnit::NONE)), + static_cast<sal_uInt16>(m_xMtrColorTo->get_value(FieldUnit::NONE)), static_cast<sal_uInt16>(m_xMtrIncrement->get_value()) ); m_pGradientList->Insert(o3tl::make_unique<XGradientEntry>(aXGradient, aName), nCount); @@ -417,12 +417,12 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickModifyHdl_Impl, weld::Button&, void) XGradient aXGradient( m_xLbColorFrom->GetSelectEntryColor(), m_xLbColorTo->GetSelectEntryColor(), static_cast<css::awt::GradientStyle>(m_xLbGradientType->get_active()), - static_cast<long>(m_xMtrAngle->get_value(FUNIT_NONE) * 10), // should be changed in resource - static_cast<sal_uInt16>(m_xMtrCenterX->get_value(FUNIT_NONE)), - static_cast<sal_uInt16>(m_xMtrCenterY->get_value(FUNIT_NONE)), - static_cast<sal_uInt16>(m_xMtrBorder->get_value(FUNIT_NONE)), - static_cast<sal_uInt16>(m_xMtrColorFrom->get_value(FUNIT_NONE)), - static_cast<sal_uInt16>(m_xMtrColorTo->get_value(FUNIT_NONE)), + static_cast<long>(m_xMtrAngle->get_value(FieldUnit::NONE) * 10), // should be changed in resource + static_cast<sal_uInt16>(m_xMtrCenterX->get_value(FieldUnit::NONE)), + static_cast<sal_uInt16>(m_xMtrCenterY->get_value(FieldUnit::NONE)), + static_cast<sal_uInt16>(m_xMtrBorder->get_value(FieldUnit::NONE)), + static_cast<sal_uInt16>(m_xMtrColorFrom->get_value(FieldUnit::NONE)), + static_cast<sal_uInt16>(m_xMtrColorTo->get_value(FieldUnit::NONE)), static_cast<sal_uInt16>(m_xMtrIncrement->get_value()) ); m_pGradientList->Replace(o3tl::make_unique<XGradientEntry>(aXGradient, aName), nPos); @@ -565,13 +565,13 @@ void SvxGradientTabPage::ChangeGradientHdl_Impl() m_xLbColorTo->SetNoSelection(); m_xLbColorTo->SelectEntry( pGradient->GetEndColor() ); - m_xMtrAngle->set_value(pGradient->GetAngle() / 10, FUNIT_NONE); // should be changed in resource - m_xMtrBorder->set_value(pGradient->GetBorder(), FUNIT_NONE); + m_xMtrAngle->set_value(pGradient->GetAngle() / 10, FieldUnit::NONE); // should be changed in resource + m_xMtrBorder->set_value(pGradient->GetBorder(), FieldUnit::NONE); m_xSliderBorder->set_value(pGradient->GetBorder()); - m_xMtrCenterX->set_value(pGradient->GetXOffset(), FUNIT_NONE); - m_xMtrCenterY->set_value(pGradient->GetYOffset(), FUNIT_NONE); - m_xMtrColorFrom->set_value(pGradient->GetStartIntens(), FUNIT_NONE); - m_xMtrColorTo->set_value(pGradient->GetEndIntens(), FUNIT_NONE); + m_xMtrCenterX->set_value(pGradient->GetXOffset(), FieldUnit::NONE); + m_xMtrCenterY->set_value(pGradient->GetYOffset(), FieldUnit::NONE); + m_xMtrColorFrom->set_value(pGradient->GetStartIntens(), FieldUnit::NONE); + m_xMtrColorTo->set_value(pGradient->GetEndIntens(), FieldUnit::NONE); // disable/enable controls SetControlState_Impl( eXGS ); diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx index bf89f766ed51..74c25cbefa3a 100644 --- a/cui/source/tabpages/tphatch.cxx +++ b/cui/source/tabpages/tphatch.cxx @@ -56,8 +56,8 @@ SvxHatchTabPage::SvxHatchTabPage(TabPageParent pParent, const SfxItemSet& rInAtt , m_pnColorListState(nullptr) , m_aXFillAttr(rInAttrs.GetPool()) , m_rXFSet(m_aXFillAttr.GetItemSet()) - , m_xMtrDistance(m_xBuilder->weld_metric_spin_button("distancemtr", FUNIT_MM)) - , m_xMtrAngle(m_xBuilder->weld_metric_spin_button("anglemtr", FUNIT_DEGREE)) + , m_xMtrDistance(m_xBuilder->weld_metric_spin_button("distancemtr", FieldUnit::MM)) + , m_xMtrAngle(m_xBuilder->weld_metric_spin_button("anglemtr", FieldUnit::DEGREE)) , m_xSliderAngle(m_xBuilder->weld_scale("angleslider")) , m_xLbLineType(m_xBuilder->weld_combo_box("linetypelb")) , m_xLbLineColor(new ColorListBox(m_xBuilder->weld_menu_button("linecolorlb"), pParent.GetFrameWeld())) @@ -81,9 +81,9 @@ SvxHatchTabPage::SvxHatchTabPage(TabPageParent pParent, const SfxItemSet& rInAtt switch ( eFUnit ) { - case FUNIT_M: - case FUNIT_KM: - eFUnit = FUNIT_MM; + case FieldUnit::M: + case FieldUnit::KM: + eFUnit = FieldUnit::MM; break; default: ;//prevent warning } @@ -245,7 +245,7 @@ bool SvxHatchTabPage::FillItemSet( SfxItemSet* rSet ) pXHatch.reset(new XHatch( m_xLbLineColor->GetSelectEntryColor(), static_cast<css::drawing::HatchStyle>(m_xLbLineType->get_active()), GetCoreValue( *m_xMtrDistance, m_ePoolUnit ), - static_cast<long>(m_xMtrAngle->get_value(FUNIT_NONE) * 10) )); + static_cast<long>(m_xMtrAngle->get_value(FieldUnit::NONE) * 10) )); } assert( pXHatch && "XHatch couldn't be created" ); rSet->Put( XFillStyleItem( drawing::FillStyle_HATCH ) ); @@ -337,15 +337,15 @@ IMPL_LINK( SvxHatchTabPage, ModifiedSliderHdl_Impl, weld::Scale&, rSlider, void void SvxHatchTabPage::ModifiedHdl_Impl( void const * p ) { if (p == m_xMtrAngle.get()) - m_xSliderAngle->set_value(m_xMtrAngle->get_value(FUNIT_NONE)); + m_xSliderAngle->set_value(m_xMtrAngle->get_value(FieldUnit::NONE)); if (p == m_xSliderAngle.get()) - m_xMtrAngle->set_value(m_xSliderAngle->get_value(), FUNIT_NONE); + m_xMtrAngle->set_value(m_xSliderAngle->get_value(), FieldUnit::NONE); XHatch aXHatch( m_xLbLineColor->GetSelectEntryColor(), static_cast<css::drawing::HatchStyle>(m_xLbLineType->get_active()), GetCoreValue( *m_xMtrDistance, m_ePoolUnit ), - static_cast<long>(m_xMtrAngle->get_value(FUNIT_NONE) * 10) ); + static_cast<long>(m_xMtrAngle->get_value(FieldUnit::NONE) * 10) ); m_rXFSet.Put( XFillHatchItem( OUString(), aXHatch ) ); @@ -392,7 +392,7 @@ void SvxHatchTabPage::ChangeHatchHdl_Impl() m_xLbLineColor->SelectEntry( pHatch->GetColor() ); SetMetricValue( *m_xMtrDistance, pHatch->GetDistance(), m_ePoolUnit ); long mHatchAngle = pHatch->GetAngle() / 10; - m_xMtrAngle->set_value(mHatchAngle, FUNIT_NONE); + m_xMtrAngle->set_value(mHatchAngle, FieldUnit::NONE); m_xSliderAngle->set_value(mHatchAngle); // fill ItemSet and pass it on to m_aCtlPreview @@ -452,7 +452,7 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickAddHdl_Impl, weld::Button&, void) XHatch aXHatch( m_xLbLineColor->GetSelectEntryColor(), static_cast<css::drawing::HatchStyle>(m_xLbLineType->get_active()), GetCoreValue( *m_xMtrDistance, m_ePoolUnit ), - static_cast<long>(m_xMtrAngle->get_value(FUNIT_NONE) * 10) ); + static_cast<long>(m_xMtrAngle->get_value(FieldUnit::NONE) * 10) ); m_pHatchingList->Insert(o3tl::make_unique<XHatchEntry>(aXHatch, aName), nCount); @@ -481,7 +481,7 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickModifyHdl_Impl, weld::Button&, void) XHatch aXHatch( m_xLbLineColor->GetSelectEntryColor(), static_cast<css::drawing::HatchStyle>(m_xLbLineType->get_active()), GetCoreValue( *m_xMtrDistance, m_ePoolUnit ), - static_cast<long>(m_xMtrAngle->get_value(FUNIT_NONE) * 10) ); + static_cast<long>(m_xMtrAngle->get_value(FieldUnit::NONE) * 10) ); m_pHatchingList->Replace(o3tl::make_unique<XHatchEntry>(aXHatch, aName), nPos); diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx index fa45d9916897..dad85068f793 100644 --- a/cui/source/tabpages/tpline.cxx +++ b/cui/source/tabpages/tpline.cxx @@ -94,18 +94,18 @@ SvxLineTabPage::SvxLineTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs , m_xLbLineStyle(new SvxLineLB(m_xBuilder->weld_combo_box("LB_LINE_STYLE"))) , m_xLbColor(new ColorListBox(m_xBuilder->weld_menu_button("LB_COLOR"), pParent.GetFrameWeld())) , m_xBoxWidth(m_xBuilder->weld_widget("boxWIDTH")) - , m_xMtrLineWidth(m_xBuilder->weld_metric_spin_button("MTR_FLD_LINE_WIDTH", FUNIT_CM)) + , m_xMtrLineWidth(m_xBuilder->weld_metric_spin_button("MTR_FLD_LINE_WIDTH", FieldUnit::CM)) , m_xBoxTransparency(m_xBuilder->weld_widget("boxTRANSPARENCY")) - , m_xMtrTransparent(m_xBuilder->weld_metric_spin_button("MTR_LINE_TRANSPARENT", FUNIT_PERCENT)) + , m_xMtrTransparent(m_xBuilder->weld_metric_spin_button("MTR_LINE_TRANSPARENT", FieldUnit::PERCENT)) , m_xFlLineEnds(m_xBuilder->weld_widget("FL_LINE_ENDS")) , m_xBoxArrowStyles(m_xBuilder->weld_widget("boxARROW_STYLES")) , m_xLbStartStyle(new SvxLineEndLB(m_xBuilder->weld_combo_box("LB_START_STYLE"))) , m_xBoxStart(m_xBuilder->weld_widget("boxSTART")) - , m_xMtrStartWidth(m_xBuilder->weld_metric_spin_button("MTR_FLD_START_WIDTH", FUNIT_CM)) + , m_xMtrStartWidth(m_xBuilder->weld_metric_spin_button("MTR_FLD_START_WIDTH", FieldUnit::CM)) , m_xTsbCenterStart(m_xBuilder->weld_check_button("TSB_CENTER_START")) , m_xBoxEnd(m_xBuilder->weld_widget("boxEND")) , m_xLbEndStyle(new SvxLineEndLB(m_xBuilder->weld_combo_box("LB_END_STYLE"))) - , m_xMtrEndWidth(m_xBuilder->weld_metric_spin_button("MTR_FLD_END_WIDTH", FUNIT_CM)) + , m_xMtrEndWidth(m_xBuilder->weld_metric_spin_button("MTR_FLD_END_WIDTH", FieldUnit::CM)) , m_xTsbCenterEnd(m_xBuilder->weld_check_button("TSB_CENTER_END")) , m_xCbxSynchronize(m_xBuilder->weld_check_button("CBX_SYNCHRONIZE")) , m_xMenu(m_xBuilder->weld_menu("menuSELECT")) @@ -117,8 +117,8 @@ SvxLineTabPage::SvxLineTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs , m_xFlSymbol(m_xBuilder->weld_widget("FL_SYMBOL_FORMAT")) //#58425# Symbols on a line (e.g. StarChart) , m_xGridIconSize(m_xBuilder->weld_widget("gridICON_SIZE")) , m_xSymbolMB(m_xBuilder->weld_menu_button("MB_SYMBOL_BITMAP")) - , m_xSymbolWidthMF(m_xBuilder->weld_metric_spin_button("MF_SYMBOL_WIDTH", FUNIT_CM)) - , m_xSymbolHeightMF(m_xBuilder->weld_metric_spin_button("MF_SYMBOL_HEIGHT", FUNIT_CM)) + , m_xSymbolWidthMF(m_xBuilder->weld_metric_spin_button("MF_SYMBOL_WIDTH", FieldUnit::CM)) + , m_xSymbolHeightMF(m_xBuilder->weld_metric_spin_button("MF_SYMBOL_HEIGHT", FieldUnit::CM)) , m_xSymbolRatioCB(m_xBuilder->weld_check_button("CB_SYMBOL_RATIO")) { // This Page requires ExchangeSupport @@ -129,20 +129,20 @@ SvxLineTabPage::SvxLineTabPage(TabPageParent pParent, const SfxItemSet& rInAttrs switch ( eFUnit ) { - case FUNIT_M: - case FUNIT_KM: - eFUnit = FUNIT_MM; + case FieldUnit::M: + case FieldUnit::KM: + eFUnit = FieldUnit::MM; SAL_FALLTHROUGH; // we now have mm - case FUNIT_MM: - m_xMtrLineWidth->set_increments(50, 500, FUNIT_NONE); - m_xMtrStartWidth->set_increments(50, 500, FUNIT_NONE); - m_xMtrEndWidth->set_increments(50, 500, FUNIT_NONE); + case FieldUnit::MM: + m_xMtrLineWidth->set_increments(50, 500, FieldUnit::NONE); + m_xMtrStartWidth->set_increments(50, 500, FieldUnit::NONE); + m_xMtrEndWidth->set_increments(50, 500, FieldUnit::NONE); break; - case FUNIT_INCH: - m_xMtrLineWidth->set_increments(2, 20, FUNIT_NONE); - m_xMtrStartWidth->set_increments(2, 20, FUNIT_NONE); - m_xMtrEndWidth->set_increments(2, 20, FUNIT_NONE); + case FieldUnit::INCH: + m_xMtrLineWidth->set_increments(2, 20, FieldUnit::NONE); + m_xMtrStartWidth->set_increments(2, 20, FieldUnit::NONE); + m_xMtrEndWidth->set_increments(2, 20, FieldUnit::NONE); break; default: ;// prevent warning } @@ -529,7 +529,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs ) } // Transparency - sal_uInt16 nVal = m_xMtrTransparent->get_value(FUNIT_PERCENT); + sal_uInt16 nVal = m_xMtrTransparent->get_value(FieldUnit::PERCENT); if( m_xMtrTransparent->get_value_changed_from_saved() ) { XLineTransparenceItem aItem( nVal ); @@ -774,7 +774,7 @@ void SvxLineTabPage::FillXLSet_Impl() m_rXLSet.Put( XLineEndCenterItem( false ) ); // Transparency - sal_uInt16 nVal = m_xMtrTransparent->get_value(FUNIT_PERCENT); + sal_uInt16 nVal = m_xMtrTransparent->get_value(FieldUnit::PERCENT); m_rXLSet.Put( XLineTransparenceItem( nVal ) ); m_aCtlPreview.SetLineAttributes(m_aXLineAttr.GetItemSet()); @@ -1088,7 +1088,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs ) if( rAttrs->GetItemState( XATTR_LINETRANSPARENCE ) != SfxItemState::DONTCARE ) { sal_uInt16 nTransp = rAttrs->Get( XATTR_LINETRANSPARENCE ).GetValue(); - m_xMtrTransparent->set_value(nTransp, FUNIT_PERCENT); + m_xMtrTransparent->set_value(nTransp, FieldUnit::PERCENT); ChangeTransparentHdl_Impl(*m_xMtrTransparent); } else @@ -1270,7 +1270,7 @@ IMPL_LINK_NOARG(SvxLineTabPage, ChangeStartListBoxHdl_Impl, weld::ComboBox&, voi IMPL_LINK_NOARG(SvxLineTabPage, ChangeStartModifyHdl_Impl, weld::MetricSpinButton&, void) { if (m_xCbxSynchronize->get_active()) - m_xMtrEndWidth->set_value(m_xMtrStartWidth->get_value(FUNIT_NONE), FUNIT_NONE); + m_xMtrEndWidth->set_value(m_xMtrStartWidth->get_value(FieldUnit::NONE), FieldUnit::NONE); ChangePreviewHdl_Impl(nullptr); } @@ -1340,14 +1340,14 @@ IMPL_LINK_NOARG(SvxLineTabPage, ChangeEndListBoxHdl_Impl, weld::ComboBox&, void) IMPL_LINK_NOARG(SvxLineTabPage, ChangeEndModifyHdl_Impl, weld::MetricSpinButton&, void) { if (m_xCbxSynchronize->get_active()) - m_xMtrStartWidth->set_value(m_xMtrEndWidth->get_value(FUNIT_NONE), FUNIT_NONE); + m_xMtrStartWidth->set_value(m_xMtrEndWidth->get_value(FieldUnit::NONE), FieldUnit::NONE); ChangePreviewHdl_Impl(nullptr); } IMPL_LINK_NOARG(SvxLineTabPage, ChangeTransparentHdl_Impl, weld::MetricSpinButton&, void) { - sal_uInt16 nVal = m_xMtrTransparent->get_value(FUNIT_PERCENT); + sal_uInt16 nVal = m_xMtrTransparent->get_value(FieldUnit::PERCENT); m_rXLSet.Put(XLineTransparenceItem(nVal)); @@ -1599,8 +1599,8 @@ IMPL_LINK( SvxLineTabPage, SizeHdl_Impl, weld::MetricSpinButton&, rField, void) bool bWidth = &rField == m_xSymbolWidthMF.get(); m_bLastWidthModified = bWidth; bool bRatio = m_xSymbolRatioCB->get_active(); - long nWidthVal = static_cast<long>(m_xSymbolWidthMF->denormalize(m_xSymbolWidthMF->get_value(FUNIT_100TH_MM))); - long nHeightVal= static_cast<long>(m_xSymbolHeightMF->denormalize(m_xSymbolHeightMF->get_value(FUNIT_100TH_MM))); + long nWidthVal = static_cast<long>(m_xSymbolWidthMF->denormalize(m_xSymbolWidthMF->get_value(FieldUnit::MM_100TH))); + long nHeightVal= static_cast<long>(m_xSymbolHeightMF->denormalize(m_xSymbolHeightMF->get_value(FieldUnit::MM_100TH))); nWidthVal = OutputDevice::LogicToLogic(nWidthVal,MapUnit::Map100thMM, m_ePoolUnit ); nHeightVal = OutputDevice::LogicToLogic(nHeightVal,MapUnit::Map100thMM, m_ePoolUnit); m_aSymbolSize = Size(nWidthVal,nHeightVal); @@ -1620,8 +1620,8 @@ IMPL_LINK( SvxLineTabPage, SizeHdl_Impl, weld::MetricSpinButton&, rField, void) { m_aSymbolSize.setHeight( m_aSymbolLastSize.Height() + static_cast<long>(static_cast<double>(nDelta) / fSizeRatio) ); m_aSymbolSize.setHeight( OutputDevice::LogicToLogic( m_aSymbolSize.Height(), m_ePoolUnit, MapUnit::Map100thMM ) ); -//TODO m_xSymbolHeightMF->SetUserValue(m_xSymbolHeightMF->normalize(m_aSymbolSize.Height()), FUNIT_100TH_MM); - m_xSymbolHeightMF->set_value(m_xSymbolHeightMF->normalize(m_aSymbolSize.Height()), FUNIT_100TH_MM); +//TODO m_xSymbolHeightMF->SetUserValue(m_xSymbolHeightMF->normalize(m_aSymbolSize.Height()), FieldUnit::MM_100TH); + m_xSymbolHeightMF->set_value(m_xSymbolHeightMF->normalize(m_aSymbolSize.Height()), FieldUnit::MM_100TH); } } else @@ -1632,8 +1632,8 @@ IMPL_LINK( SvxLineTabPage, SizeHdl_Impl, weld::MetricSpinButton&, rField, void) { m_aSymbolSize.setWidth( m_aSymbolLastSize.Width() + static_cast<long>(static_cast<double>(nDelta) * fSizeRatio) ); m_aSymbolSize.setWidth( OutputDevice::LogicToLogic( m_aSymbolSize.Width(), m_ePoolUnit, MapUnit::Map100thMM ) ); -//TODO m_xSymbolWidthMF->SetUserValue(m_xSymbolWidthMF->normalize(m_aSymbolSize.Width()), FUNIT_100TH_MM); - m_xSymbolWidthMF->set_value(m_xSymbolWidthMF->normalize(m_aSymbolSize.Width()), FUNIT_100TH_MM); +//TODO m_xSymbolWidthMF->SetUserValue(m_xSymbolWidthMF->normalize(m_aSymbolSize.Width()), FieldUnit::MM_100TH); + m_xSymbolWidthMF->set_value(m_xSymbolWidthMF->normalize(m_aSymbolSize.Width()), FieldUnit::MM_100TH); } } m_aCtlPreview.ResizeSymbol(m_aSymbolSize); diff --git a/cui/source/tabpages/tplnedef.cxx b/cui/source/tabpages/tplnedef.cxx index 7a3063896738..5d822005f8ba 100644 --- a/cui/source/tabpages/tplnedef.cxx +++ b/cui/source/tabpages/tplnedef.cxx @@ -64,9 +64,9 @@ SvxLineDefTabPage::SvxLineDefTabPage(TabPageParent pParent, const SfxItemSet& rI , m_xLbType2(m_xBuilder->weld_combo_box("LB_TYPE_2")) , m_xNumFldNumber1(m_xBuilder->weld_spin_button("NUM_FLD_1")) , m_xNumFldNumber2(m_xBuilder->weld_spin_button("NUM_FLD_2")) - , m_xMtrLength1(m_xBuilder->weld_metric_spin_button("MTR_FLD_LENGTH_1", FUNIT_CM)) - , m_xMtrLength2(m_xBuilder->weld_metric_spin_button("MTR_FLD_LENGTH_2", FUNIT_CM)) - , m_xMtrDistance(m_xBuilder->weld_metric_spin_button("MTR_FLD_DISTANCE", FUNIT_CM)) + , m_xMtrLength1(m_xBuilder->weld_metric_spin_button("MTR_FLD_LENGTH_1", FieldUnit::CM)) + , m_xMtrLength2(m_xBuilder->weld_metric_spin_button("MTR_FLD_LENGTH_2", FieldUnit::CM)) + , m_xMtrDistance(m_xBuilder->weld_metric_spin_button("MTR_FLD_DISTANCE", FieldUnit::CM)) , m_xCbxSynchronize(m_xBuilder->weld_check_button("CBX_SYNCHRONIZE")) , m_xBtnAdd(m_xBuilder->weld_button("BTN_ADD")) , m_xBtnModify(m_xBuilder->weld_button("BTN_MODIFY")) @@ -83,9 +83,9 @@ SvxLineDefTabPage::SvxLineDefTabPage(TabPageParent pParent, const SfxItemSet& rI switch ( eFUnit ) { - case FUNIT_M: - case FUNIT_KM: - eFUnit = FUNIT_MM; + case FieldUnit::M: + case FieldUnit::KM: + eFUnit = FieldUnit::MM; break; default: ; //prevent warning } @@ -412,7 +412,7 @@ void SvxLineDefTabPage::ChangeMetricHdl_Impl(weld::ToggleButton* p) SetMetricValue( *m_xMtrLength2, nTmp2, ePoolUnit ); SetMetricValue( *m_xMtrDistance, nTmp3, ePoolUnit ); } - else if( m_xCbxSynchronize->get_active() && m_xMtrLength1->get_unit() != FUNIT_PERCENT ) + else if( m_xCbxSynchronize->get_active() && m_xMtrLength1->get_unit() != FieldUnit::PERCENT ) { long nTmp1, nTmp2, nTmp3; @@ -434,9 +434,9 @@ void SvxLineDefTabPage::ChangeMetricHdl_Impl(weld::ToggleButton* p) m_xMtrLength2->set_digits(0); m_xMtrDistance->set_digits(0); - m_xMtrLength1->set_unit(FUNIT_PERCENT); - m_xMtrLength2->set_unit(FUNIT_PERCENT); - m_xMtrDistance->set_unit(FUNIT_PERCENT); + m_xMtrLength1->set_unit(FieldUnit::PERCENT); + m_xMtrLength2->set_unit(FieldUnit::PERCENT); + m_xMtrDistance->set_unit(FieldUnit::PERCENT); SetMetricValue( *m_xMtrLength1, nTmp1, ePoolUnit ); SetMetricValue( *m_xMtrLength2, nTmp2, ePoolUnit ); diff --git a/cui/source/tabpages/tpshadow.cxx b/cui/source/tabpages/tpshadow.cxx index 7535392dc327..4b5d57c0e668 100644 --- a/cui/source/tabpages/tpshadow.cxx +++ b/cui/source/tabpages/tpshadow.cxx @@ -56,9 +56,9 @@ SvxShadowTabPage::SvxShadowTabPage(TabPageParent pParent, const SfxItemSet& rInA , m_aCtlPosition(this) , m_xTsbShowShadow(m_xBuilder->weld_check_button("TSB_SHOW_SHADOW")) , m_xGridShadow(m_xBuilder->weld_widget("gridSHADOW")) - , m_xMtrDistance(m_xBuilder->weld_metric_spin_button("MTR_FLD_DISTANCE", FUNIT_CM)) + , m_xMtrDistance(m_xBuilder->weld_metric_spin_button("MTR_FLD_DISTANCE", FieldUnit::CM)) , m_xLbShadowColor(new ColorListBox(m_xBuilder->weld_menu_button("LB_SHADOW_COLOR"), pParent.GetFrameWeld())) - , m_xMtrTransparent(m_xBuilder->weld_metric_spin_button("MTR_SHADOW_TRANSPARENT", FUNIT_PERCENT)) + , m_xMtrTransparent(m_xBuilder->weld_metric_spin_button("MTR_SHADOW_TRANSPARENT", FieldUnit::PERCENT)) , m_xCtlPosition(new weld::CustomWeld(*m_xBuilder, "CTL_POSITION", m_aCtlPosition)) , m_xCtlXRectPreview(new weld::CustomWeld(*m_xBuilder, "CTL_COLOR_PREVIEW", m_aCtlXRectPreview)) { @@ -70,9 +70,9 @@ SvxShadowTabPage::SvxShadowTabPage(TabPageParent pParent, const SfxItemSet& rInA switch ( eFUnit ) { - case FUNIT_M: - case FUNIT_KM: - eFUnit = FUNIT_MM; + case FieldUnit::M: + case FieldUnit::KM: + eFUnit = FieldUnit::MM; break; default: ;//prevent warning } @@ -302,7 +302,7 @@ bool SvxShadowTabPage::FillItemSet( SfxItemSet* rAttrs ) } // transparency - sal_uInt16 nVal = static_cast<sal_uInt16>(m_xMtrTransparent->get_value(FUNIT_PERCENT)); + sal_uInt16 nVal = static_cast<sal_uInt16>(m_xMtrTransparent->get_value(FieldUnit::PERCENT)); if (m_xMtrTransparent->get_value_changed_from_saved()) { SdrPercentItem aItem( makeSdrShadowTransparenceItem(nVal) ); @@ -397,7 +397,7 @@ void SvxShadowTabPage::Reset( const SfxItemSet* rAttrs ) if( rAttrs->GetItemState( SDRATTR_SHADOWTRANSPARENCE ) != SfxItemState::DONTCARE ) { sal_uInt16 nTransp = rAttrs->Get( SDRATTR_SHADOWTRANSPARENCE ).GetValue(); - m_xMtrTransparent->set_value(nTransp, FUNIT_PERCENT); + m_xMtrTransparent->set_value(nTransp, FieldUnit::PERCENT); } else m_xMtrTransparent->set_text(""); @@ -451,7 +451,7 @@ IMPL_LINK_NOARG(SvxShadowTabPage, ModifyShadowHdl_Impl, weld::MetricSpinButton&, m_rXFSet.Put( XFillStyleItem( drawing::FillStyle_NONE ) ); m_rXFSet.Put( XFillColorItem( OUString(), m_xLbShadowColor->GetSelectEntryColor() ) ); - sal_uInt16 nVal = static_cast<sal_uInt16>(m_xMtrTransparent->get_value(FUNIT_PERCENT)); + sal_uInt16 nVal = static_cast<sal_uInt16>(m_xMtrTransparent->get_value(FieldUnit::PERCENT)); m_rXFSet.Put( XFillTransparenceItem( nVal ) ); // shadow removal diff --git a/cui/source/tabpages/tptrans.cxx b/cui/source/tabpages/tptrans.cxx index b75bf87daa37..7c3240da457d 100644 --- a/cui/source/tabpages/tptrans.cxx +++ b/cui/source/tabpages/tptrans.cxx @@ -107,7 +107,7 @@ void SvxTransparenceTabPage::ActivateLinear(bool bActivate) IMPL_LINK_NOARG(SvxTransparenceTabPage, ModifyTransparentHdl_Impl, weld::MetricSpinButton&, void) { - sal_uInt16 nPos = m_xMtrTransparent->get_value(FUNIT_PERCENT); + sal_uInt16 nPos = m_xMtrTransparent->get_value(FieldUnit::PERCENT); rXFSet.Put(XFillTransparenceItem(nPos)); // preview @@ -133,16 +133,16 @@ void SvxTransparenceTabPage::ModifiedTrgrHdl_Impl(const weld::ComboBox* pControl } // preview - sal_uInt8 nStartCol = static_cast<sal_uInt8>((static_cast<sal_uInt16>(m_xMtrTrgrStartValue->get_value(FUNIT_PERCENT)) * 255) / 100); - sal_uInt8 nEndCol = static_cast<sal_uInt8>((static_cast<sal_uInt16>(m_xMtrTrgrEndValue->get_value(FUNIT_PERCENT)) * 255) / 100); + sal_uInt8 nStartCol = static_cast<sal_uInt8>((static_cast<sal_uInt16>(m_xMtrTrgrStartValue->get_value(FieldUnit::PERCENT)) * 255) / 100); + sal_uInt8 nEndCol = static_cast<sal_uInt8>((static_cast<sal_uInt16>(m_xMtrTrgrEndValue->get_value(FieldUnit::PERCENT)) * 255) / 100); XGradient aTmpGradient( Color(nStartCol, nStartCol, nStartCol), Color(nEndCol, nEndCol, nEndCol), static_cast<css::awt::GradientStyle>(m_xLbTrgrGradientType->get_active()), - static_cast<sal_uInt16>(m_xMtrTrgrAngle->get_value(FUNIT_DEGREE)) * 10, - static_cast<sal_uInt16>(m_xMtrTrgrCenterX->get_value(FUNIT_PERCENT)), - static_cast<sal_uInt16>(m_xMtrTrgrCenterY->get_value(FUNIT_PERCENT)), - static_cast<sal_uInt16>(m_xMtrTrgrBorder->get_value(FUNIT_PERCENT)), + static_cast<sal_uInt16>(m_xMtrTrgrAngle->get_value(FieldUnit::DEGREE)) * 10, + static_cast<sal_uInt16>(m_xMtrTrgrCenterX->get_value(FieldUnit::PERCENT)), + static_cast<sal_uInt16>(m_xMtrTrgrCenterY->get_value(FieldUnit::PERCENT)), + static_cast<sal_uInt16>(m_xMtrTrgrBorder->get_value(FieldUnit::PERCENT)), 100, 100); XFillFloatTransparenceItem aItem( aTmpGradient); @@ -211,18 +211,18 @@ SvxTransparenceTabPage::SvxTransparenceTabPage(TabPageParent pParent, const SfxI , m_xRbtTransOff(m_xBuilder->weld_radio_button("RBT_TRANS_OFF")) , m_xRbtTransLinear(m_xBuilder->weld_radio_button("RBT_TRANS_LINEAR")) , m_xRbtTransGradient(m_xBuilder->weld_radio_button("RBT_TRANS_GRADIENT")) - , m_xMtrTransparent(m_xBuilder->weld_metric_spin_button("MTR_TRANSPARENT", FUNIT_PERCENT)) + , m_xMtrTransparent(m_xBuilder->weld_metric_spin_button("MTR_TRANSPARENT", FieldUnit::PERCENT)) , m_xGridGradient(m_xBuilder->weld_widget("gridGradient")) , m_xLbTrgrGradientType(m_xBuilder->weld_combo_box("LB_TRGR_GRADIENT_TYPES")) , m_xFtTrgrCenterX(m_xBuilder->weld_label("FT_TRGR_CENTER_X")) - , m_xMtrTrgrCenterX(m_xBuilder->weld_metric_spin_button("MTR_TRGR_CENTER_X", FUNIT_PERCENT)) + , m_xMtrTrgrCenterX(m_xBuilder->weld_metric_spin_button("MTR_TRGR_CENTER_X", FieldUnit::PERCENT)) , m_xFtTrgrCenterY(m_xBuilder->weld_label("FT_TRGR_CENTER_Y")) - , m_xMtrTrgrCenterY(m_xBuilder->weld_metric_spin_button("MTR_TRGR_CENTER_Y", FUNIT_PERCENT)) + , m_xMtrTrgrCenterY(m_xBuilder->weld_metric_spin_button("MTR_TRGR_CENTER_Y", FieldUnit::PERCENT)) , m_xFtTrgrAngle(m_xBuilder->weld_label("FT_TRGR_ANGLE")) - , m_xMtrTrgrAngle(m_xBuilder->weld_metric_spin_button("MTR_TRGR_ANGLE", FUNIT_DEGREE)) - , m_xMtrTrgrBorder(m_xBuilder->weld_metric_spin_button("MTR_TRGR_BORDER", FUNIT_PERCENT)) - , m_xMtrTrgrStartValue(m_xBuilder->weld_metric_spin_button("MTR_TRGR_START_VALUE", FUNIT_PERCENT)) - , m_xMtrTrgrEndValue(m_xBuilder->weld_metric_spin_button("MTR_TRGR_END_VALUE", FUNIT_PERCENT)) + , m_xMtrTrgrAngle(m_xBuilder->weld_metric_spin_button("MTR_TRGR_ANGLE", FieldUnit::DEGREE)) + , m_xMtrTrgrBorder(m_xBuilder->weld_metric_spin_button("MTR_TRGR_BORDER", FieldUnit::PERCENT)) + , m_xMtrTrgrStartValue(m_xBuilder->weld_metric_spin_button("MTR_TRGR_START_VALUE", FieldUnit::PERCENT)) + , m_xMtrTrgrEndValue(m_xBuilder->weld_metric_spin_button("MTR_TRGR_END_VALUE", FieldUnit::PERCENT)) , m_xCtlBitmapBorder(m_xBuilder->weld_widget("bitmap_border")) , m_xCtlXRectBorder(m_xBuilder->weld_widget("trans_border")) , m_xCtlBitmapPreview(new weld::CustomWeld(*m_xBuilder, "CTL_BITMAP_PREVIEW", m_aCtlBitmapPreview)) @@ -234,12 +234,12 @@ SvxTransparenceTabPage::SvxTransparenceTabPage(TabPageParent pParent, const SfxI m_xRbtTransGradient->connect_toggled(LINK(this, SvxTransparenceTabPage, ClickTransGradientHdl_Impl)); // linear transparency - m_xMtrTransparent->set_value(50, FUNIT_PERCENT); + m_xMtrTransparent->set_value(50, FieldUnit::PERCENT); m_xMtrTransparent->connect_value_changed(LINK(this, SvxTransparenceTabPage, ModifyTransparentHdl_Impl)); // gradient transparency - m_xMtrTrgrEndValue->set_value(100, FUNIT_PERCENT); - m_xMtrTrgrStartValue->set_value(0, FUNIT_PERCENT); + m_xMtrTrgrEndValue->set_value(100, FieldUnit::PERCENT); + m_xMtrTrgrStartValue->set_value(0, FieldUnit::PERCENT); Link<weld::MetricSpinButton&,void> aLink = LINK( this, SvxTransparenceTabPage, ModifiedTrgrEditHdl_Impl); m_xLbTrgrGradientType->connect_changed(LINK(this, SvxTransparenceTabPage, ModifiedTrgrListBoxHdl_Impl)); m_xMtrTrgrCenterX->connect_value_changed( aLink ); @@ -277,7 +277,7 @@ bool SvxTransparenceTabPage::FillItemSet(SfxItemSet* rAttrs) if (m_xMtrTransparent->get_sensitive()) { // linear transparence - sal_uInt16 nPos = m_xMtrTransparent->get_value(FUNIT_PERCENT); + sal_uInt16 nPos = m_xMtrTransparent->get_value(FieldUnit::PERCENT); if (m_xMtrTransparent->get_value_changed_from_saved() || !bLinearActive) { XFillTransparenceItem aItem(nPos); @@ -304,16 +304,16 @@ bool SvxTransparenceTabPage::FillItemSet(SfxItemSet* rAttrs) || m_xMtrTrgrStartValue->get_value_changed_from_saved() || m_xMtrTrgrEndValue->get_value_changed_from_saved()) { - sal_uInt8 nStartCol = static_cast<sal_uInt8>((static_cast<sal_uInt16>(m_xMtrTrgrStartValue->get_value(FUNIT_PERCENT)) * 255) / 100); - sal_uInt8 nEndCol = static_cast<sal_uInt8>((static_cast<sal_uInt16>(m_xMtrTrgrEndValue->get_value(FUNIT_PERCENT)) * 255) / 100); + sal_uInt8 nStartCol = static_cast<sal_uInt8>((static_cast<sal_uInt16>(m_xMtrTrgrStartValue->get_value(FieldUnit::PERCENT)) * 255) / 100); + sal_uInt8 nEndCol = static_cast<sal_uInt8>((static_cast<sal_uInt16>(m_xMtrTrgrEndValue->get_value(FieldUnit::PERCENT)) * 255) / 100); XGradient aTmpGradient( Color(nStartCol, nStartCol, nStartCol), Color(nEndCol, nEndCol, nEndCol), static_cast<css::awt::GradientStyle>(m_xLbTrgrGradientType->get_active()), - static_cast<sal_uInt16>(m_xMtrTrgrAngle->get_value(FUNIT_DEGREE)) * 10, - static_cast<sal_uInt16>(m_xMtrTrgrCenterX->get_value(FUNIT_PERCENT)), - static_cast<sal_uInt16>(m_xMtrTrgrCenterY->get_value(FUNIT_PERCENT)), - static_cast<sal_uInt16>(m_xMtrTrgrBorder->get_value(FUNIT_PERCENT)), + static_cast<sal_uInt16>(m_xMtrTrgrAngle->get_value(FieldUnit::DEGREE)) * 10, + static_cast<sal_uInt16>(m_xMtrTrgrCenterX->get_value(FieldUnit::PERCENT)), + static_cast<sal_uInt16>(m_xMtrTrgrCenterY->get_value(FieldUnit::PERCENT)), + static_cast<sal_uInt16>(m_xMtrTrgrBorder->get_value(FieldUnit::PERCENT)), 100, 100); XFillFloatTransparenceItem aItem(aTmpGradient); @@ -377,16 +377,16 @@ void SvxTransparenceTabPage::Reset(const SfxItemSet* rAttrs) const XGradient& rGradient = static_cast<const XFillFloatTransparenceItem*>(pGradientItem)->GetGradientValue(); css::awt::GradientStyle eXGS(rGradient.GetGradientStyle()); m_xLbTrgrGradientType->set_active(sal::static_int_cast< sal_Int32 >(eXGS)); - m_xMtrTrgrAngle->set_value(rGradient.GetAngle() / 10, FUNIT_DEGREE); - m_xMtrTrgrBorder->set_value(rGradient.GetBorder(), FUNIT_PERCENT); - m_xMtrTrgrCenterX->set_value(rGradient.GetXOffset(), FUNIT_PERCENT); - m_xMtrTrgrCenterY->set_value(rGradient.GetYOffset(), FUNIT_PERCENT); - m_xMtrTrgrStartValue->set_value(static_cast<sal_uInt16>(((static_cast<sal_uInt16>(rGradient.GetStartColor().GetRed()) + 1) * 100) / 255), FUNIT_PERCENT); - m_xMtrTrgrEndValue->set_value(static_cast<sal_uInt16>(((static_cast<sal_uInt16>(rGradient.GetEndColor().GetRed()) + 1) * 100) / 255), FUNIT_PERCENT); + m_xMtrTrgrAngle->set_value(rGradient.GetAngle() / 10, FieldUnit::DEGREE); + m_xMtrTrgrBorder->set_value(rGradient.GetBorder(), FieldUnit::PERCENT); + m_xMtrTrgrCenterX->set_value(rGradient.GetXOffset(), FieldUnit::PERCENT); + m_xMtrTrgrCenterY->set_value(rGradient.GetYOffset(), FieldUnit::PERCENT); + m_xMtrTrgrStartValue->set_value(static_cast<sal_uInt16>(((static_cast<sal_uInt16>(rGradient.GetStartColor().GetRed()) + 1) * 100) / 255), FieldUnit::PERCENT); + m_xMtrTrgrEndValue->set_value(static_cast<sal_uInt16>(((static_cast<sal_uInt16>(rGradient.GetEndColor().GetRed()) + 1) * 100) / 255), FieldUnit::PERCENT); // linear transparence sal_uInt16 nTransp = static_cast<const XFillTransparenceItem*>(pLinearItem)->GetValue(); - m_xMtrTransparent->set_value(bLinearActive ? nTransp : 50, FUNIT_PERCENT); + m_xMtrTransparent->set_value(bLinearActive ? nTransp : 50, FieldUnit::PERCENT); ModifyTransparentHdl_Impl(*m_xMtrTransparent); // select the correct radio button diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx index eac242eda649..3da5625fb774 100644 --- a/cui/source/tabpages/transfrm.cxx +++ b/cui/source/tabpages/transfrm.cxx @@ -172,11 +172,11 @@ SvxAngleTabPage::SvxAngleTabPage(TabPageParent pParent, const SfxItemSet& rInAtt : SvxTabPage(pParent, "cui/ui/rotationtabpage.ui", "Rotation", rInAttrs) , rOutAttrs(rInAttrs) , pView(nullptr) - , eDlgUnit(FUNIT_NONE) + , eDlgUnit(FieldUnit::NONE) , m_aCtlRect(this) , m_xFlPosition(m_xBuilder->weld_widget("FL_POSITION")) - , m_xMtrPosX(m_xBuilder->weld_metric_spin_button("MTR_FLD_POS_X", FUNIT_CM)) - , m_xMtrPosY(m_xBuilder->weld_metric_spin_button("MTR_FLD_POS_Y", FUNIT_CM)) + , m_xMtrPosX(m_xBuilder->weld_metric_spin_button("MTR_FLD_POS_X", FieldUnit::CM)) + , m_xMtrPosY(m_xBuilder->weld_metric_spin_button("MTR_FLD_POS_Y", FieldUnit::CM)) , m_xCtlRect(new weld::CustomWeld(*m_xBuilder, "CTL_RECT", m_aCtlRect)) , m_xFlAngle(m_xBuilder->weld_widget("FL_ANGLE")) , m_xNfAngle(m_xBuilder->weld_spin_button("NF_ANGLE")) @@ -201,7 +201,7 @@ void SvxAngleTabPage::Construct() SetFieldUnit(*m_xMtrPosX, eDlgUnit, true); SetFieldUnit(*m_xMtrPosY, eDlgUnit, true); - if (FUNIT_MILE == eDlgUnit || FUNIT_KM == eDlgUnit) + if (FieldUnit::MILE == eDlgUnit || FieldUnit::KM == eDlgUnit) { m_xMtrPosX->set_digits(3); m_xMtrPosY->set_digits(3); @@ -336,56 +336,56 @@ void SvxAngleTabPage::PointChanged(weld::DrawingArea* pDrawingArea, RectPoint eR { case RectPoint::LT: { - m_xMtrPosX->set_value( basegfx::fround64(maRange.getMinX()), FUNIT_NONE ); - m_xMtrPosY->set_value( basegfx::fround64(maRange.getMinY()), FUNIT_NONE ); + m_xMtrPosX->set_value( basegfx::fround64(maRange.getMinX()), FieldUnit::NONE ); + m_xMtrPosY->set_value( basegfx::fround64(maRange.getMinY()), FieldUnit::NONE ); break; } case RectPoint::MT: { - m_xMtrPosX->set_value( basegfx::fround64(maRange.getCenter().getX()), FUNIT_NONE ); - m_xMtrPosY->set_value( basegfx::fround64(maRange.getMinY()), FUNIT_NONE ); + m_xMtrPosX->set_value( basegfx::fround64(maRange.getCenter().getX()), FieldUnit::NONE ); + m_xMtrPosY->set_value( basegfx::fround64(maRange.getMinY()), FieldUnit::NONE ); break; } case RectPoint::RT: { - m_xMtrPosX->set_value( basegfx::fround64(maRange.getMaxX()), FUNIT_NONE ); - m_xMtrPosY->set_value( basegfx::fround64(maRange.getMinY()), FUNIT_NONE ); + m_xMtrPosX->set_value( basegfx::fround64(maRange.getMaxX()), FieldUnit::NONE ); + m_xMtrPosY->set_value( basegfx::fround64(maRange.getMinY()), FieldUnit::NONE ); break; } case RectPoint::LM: { - m_xMtrPosX->set_value( basegfx::fround64(maRange.getMinX()), FUNIT_NONE ); - m_xMtrPosY->set_value( basegfx::fround64(maRange.getCenter().getY()), FUNIT_NONE ); + m_xMtrPosX->set_value( basegfx::fround64(maRange.getMinX()), FieldUnit::NONE ); + m_xMtrPosY->set_value( basegfx::fround64(maRange.getCenter().getY()), FieldUnit::NONE ); break; } case RectPoint::MM: { - m_xMtrPosX->set_value( basegfx::fround64(maRange.getCenter().getX()), FUNIT_NONE ); - m_xMtrPosY->set_value( basegfx::fround64(maRange.getCenter().getY()), FUNIT_NONE ); + m_xMtrPosX->set_value( basegfx::fround64(maRange.getCenter().getX()), FieldUnit::NONE ); + m_xMtrPosY->set_value( basegfx::fround64(maRange.getCenter().getY()), FieldUnit::NONE ); break; } case RectPoint::RM: { - m_xMtrPosX->set_value( basegfx::fround64(maRange.getMaxX()), FUNIT_NONE ); - m_xMtrPosY->set_value( basegfx::fround64(maRange.getCenter().getY()), FUNIT_NONE ); + m_xMtrPosX->set_value( basegfx::fround64(maRange.getMaxX()), FieldUnit::NONE ); + m_xMtrPosY->set_value( basegfx::fround64(maRange.getCenter().getY()), FieldUnit::NONE ); break; } case RectPoint::LB: { - m_xMtrPosX->set_value( basegfx::fround64(maRange.getMinX()), FUNIT_NONE ); - m_xMtrPosY->set_value( basegfx::fround64(maRange.getMaxY()), FUNIT_NONE ); + m_xMtrPosX->set_value( basegfx::fround64(maRange.getMinX()), FieldUnit::NONE ); + m_xMtrPosY->set_value( basegfx::fround64(maRange.getMaxY()), FieldUnit::NONE ); break; } case RectPoint::MB: { - m_xMtrPosX->set_value( basegfx::fround64(maRange.getCenter().getX()), FUNIT_NONE ); - m_xMtrPosY->set_value( basegfx::fround64(maRange.getMaxY()), FUNIT_NONE ); + m_xMtrPosX->set_value( basegfx::fround64(maRange.getCenter().getX()), FieldUnit::NONE ); + m_xMtrPosY->set_value( basegfx::fround64(maRange.getMaxY()), FieldUnit::NONE ); break; } case RectPoint::RB: { - m_xMtrPosX->set_value( basegfx::fround64(maRange.getMaxX()), FUNIT_NONE ); - m_xMtrPosY->set_value( basegfx::fround64(maRange.getMaxY()), FUNIT_NONE ); + m_xMtrPosX->set_value( basegfx::fround64(maRange.getMaxX()), FieldUnit::NONE ); + m_xMtrPosY->set_value( basegfx::fround64(maRange.getMaxY()), FieldUnit::NONE ); break; } } @@ -401,19 +401,19 @@ SvxSlantTabPage::SvxSlantTabPage(TabPageParent pParent, const SfxItemSet& rInAtt : SfxTabPage(pParent, "cui/ui/slantcornertabpage.ui", "SlantAndCornerRadius", &rInAttrs) , rOutAttrs(rInAttrs) , pView(nullptr) - , eDlgUnit(FUNIT_NONE) + , eDlgUnit(FieldUnit::NONE) , m_xFlRadius(m_xBuilder->weld_widget("FL_RADIUS")) - , m_xMtrRadius(m_xBuilder->weld_metric_spin_button("MTR_FLD_RADIUS", FUNIT_CM)) + , m_xMtrRadius(m_xBuilder->weld_metric_spin_button("MTR_FLD_RADIUS", FieldUnit::CM)) , m_xFlAngle(m_xBuilder->weld_widget("FL_SLANT")) - , m_xMtrAngle(m_xBuilder->weld_metric_spin_button("MTR_FLD_ANGLE", FUNIT_DEGREE)) + , m_xMtrAngle(m_xBuilder->weld_metric_spin_button("MTR_FLD_ANGLE", FieldUnit::DEGREE)) { for (int i = 0; i < 2; ++i) { m_aControlGroups[i] = m_xBuilder->weld_widget("controlgroups" + OString::number(i+1)); m_aControlGroupX[i] = m_xBuilder->weld_widget("controlgroupx" + OString::number(i+1)); - m_aControlX[i] = m_xBuilder->weld_metric_spin_button("controlx" + OString::number(i+1), FUNIT_CM); + m_aControlX[i] = m_xBuilder->weld_metric_spin_button("controlx" + OString::number(i+1), FieldUnit::CM); m_aControlGroupY[i] = m_xBuilder->weld_widget("controlgroupy" + OString::number(i+1)); - m_aControlY[i] = m_xBuilder->weld_metric_spin_button("controly" + OString::number(i+1), FUNIT_CM); + m_aControlY[i] = m_xBuilder->weld_metric_spin_button("controly" + OString::number(i+1), FieldUnit::CM); } // this page needs ExchangeSupport @@ -463,7 +463,7 @@ bool SvxSlantTabPage::FillItemSet(SfxItemSet* rAttrs) if (m_xMtrAngle->get_value_changed_from_saved()) { - sal_Int32 nValue = static_cast<sal_Int32>(m_xMtrAngle->get_value(FUNIT_NONE)); + sal_Int32 nValue = static_cast<sal_Int32>(m_xMtrAngle->get_value(FieldUnit::NONE)); rAttrs->Put( SfxInt32Item( SID_ATTR_TRANSFORM_SHEAR, nValue ) ); bModified = true; } @@ -609,7 +609,7 @@ void SvxSlantTabPage::Reset(const SfxItemSet* rAttrs) if( pItem ) { - m_xMtrAngle->set_value(static_cast<const SfxInt32Item*>(pItem)->GetValue(), FUNIT_NONE); + m_xMtrAngle->set_value(static_cast<const SfxInt32Item*>(pItem)->GetValue(), FieldUnit::NONE); } else { @@ -685,11 +685,11 @@ void SvxSlantTabPage::Reset(const SfxItemSet* rAttrs) if (aMaxPosition.X() == aMinPosition.X()) m_aControlGroupX[i]->set_sensitive(false); else - m_aControlX[i]->set_range(aMinPosition.X(), aMaxPosition.X(), FUNIT_MM); + m_aControlX[i]->set_range(aMinPosition.X(), aMaxPosition.X(), FieldUnit::MM); if (aMaxPosition.Y() == aMinPosition.Y()) m_aControlGroupY[i]->set_sensitive(false); else - m_aControlY[i]->set_range(aMinPosition.Y(), aMaxPosition.Y(), FUNIT_MM); + m_aControlY[i]->set_range(aMinPosition.Y(), aMaxPosition.Y(), FieldUnit::MM); } //restore geometry @@ -751,7 +751,7 @@ SvxPositionSizeTabPage::SvxPositionSizeTabPage(TabPageParent pParent, const SfxI : SvxTabPage(pParent, "cui/ui/possizetabpage.ui", "PositionAndSize", rInAttrs) , mrOutAttrs(rInAttrs) , mpView(nullptr) - , meDlgUnit(FUNIT_NONE) + , meDlgUnit(FieldUnit::NONE) , mnProtectSizeState(TRISTATE_FALSE) , mbPageDisabled(false) , mbProtectDisabled(false) @@ -764,14 +764,14 @@ SvxPositionSizeTabPage::SvxPositionSizeTabPage(TabPageParent pParent, const SfxI , m_aCtlPos(this) , m_aCtlSize(this) , m_xFlPosition(m_xBuilder->weld_widget("FL_POSITION")) - , m_xMtrPosX(m_xBuilder->weld_metric_spin_button("MTR_FLD_POS_X", FUNIT_CM)) - , m_xMtrPosY(m_xBuilder->weld_metric_spin_button("MTR_FLD_POS_Y", FUNIT_CM)) + , m_xMtrPosX(m_xBuilder->weld_metric_spin_button("MTR_FLD_POS_X", FieldUnit::CM)) + , m_xMtrPosY(m_xBuilder->weld_metric_spin_button("MTR_FLD_POS_Y", FieldUnit::CM)) , m_xCtlPos(new weld::CustomWeld(*m_xBuilder, "CTL_POSRECT", m_aCtlPos)) , m_xFlSize(m_xBuilder->weld_widget("FL_SIZE")) , m_xFtWidth(m_xBuilder->weld_label("FT_WIDTH")) - , m_xMtrWidth(m_xBuilder->weld_metric_spin_button("MTR_FLD_WIDTH", FUNIT_CM)) + , m_xMtrWidth(m_xBuilder->weld_metric_spin_button("MTR_FLD_WIDTH", FieldUnit::CM)) , m_xFtHeight(m_xBuilder->weld_label("FT_HEIGHT")) - , m_xMtrHeight(m_xBuilder->weld_metric_spin_button("MTR_FLD_HEIGHT", FUNIT_CM)) + , m_xMtrHeight(m_xBuilder->weld_metric_spin_button("MTR_FLD_HEIGHT", FieldUnit::CM)) , m_xCbxScale(m_xBuilder->weld_check_button("CBX_SCALE")) , m_xCtlSize(new weld::CustomWeld(*m_xBuilder, "CTL_SIZERECT", m_aCtlSize)) , m_xFlProtect(m_xBuilder->weld_widget("FL_PROTECT")) @@ -820,7 +820,7 @@ void SvxPositionSizeTabPage::Construct() SetFieldUnit( *m_xMtrWidth, meDlgUnit, true ); SetFieldUnit( *m_xMtrHeight, meDlgUnit, true ); - if(FUNIT_MILE == meDlgUnit || FUNIT_KM == meDlgUnit) + if(FieldUnit::MILE == meDlgUnit || FieldUnit::KM == meDlgUnit) { m_xMtrPosX->set_digits( 3 ); m_xMtrPosY->set_digits( 3 ); @@ -966,13 +966,13 @@ bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet* rOutAttrs ) Fraction aUIScale = mpView->GetModel()->GetUIScale(); // get Width - double nWidth = static_cast<double>(m_xMtrWidth->get_value(FUNIT_100TH_MM)); + double nWidth = static_cast<double>(m_xMtrWidth->get_value(FieldUnit::MM_100TH)); long lWidth = long(nWidth * static_cast<double>(aUIScale)); lWidth = OutputDevice::LogicToLogic( lWidth, MapUnit::Map100thMM, mePoolUnit ); lWidth = static_cast<long>(m_xMtrWidth->denormalize( lWidth )); // get Height - double nHeight = static_cast<double>(m_xMtrHeight->get_value(FUNIT_100TH_MM)); + double nHeight = static_cast<double>(m_xMtrHeight->get_value(FieldUnit::MM_100TH)); long lHeight = long(nHeight * static_cast<double>(aUIScale)); lHeight = OutputDevice::LogicToLogic( lHeight, MapUnit::Map100thMM, mePoolUnit ); lHeight = static_cast<long>(m_xMtrHeight->denormalize( lHeight )); @@ -1075,7 +1075,7 @@ void SvxPositionSizeTabPage::Reset( const SfxItemSet* ) double fTmpWidth((OutputDevice::LogicToLogic(static_cast<sal_Int32>(mfOldWidth), mePoolUnit, MapUnit::Map100thMM)) / fUIScale); if (m_xMtrWidth->get_digits()) fTmpWidth *= pow(10.0, m_xMtrWidth->get_digits()); - m_xMtrWidth->set_value(static_cast<int>(fTmpWidth), FUNIT_100TH_MM); + m_xMtrWidth->set_value(static_cast<int>(fTmpWidth), FieldUnit::MM_100TH); } { // #i75273# set height @@ -1084,7 +1084,7 @@ void SvxPositionSizeTabPage::Reset( const SfxItemSet* ) double fTmpHeight((OutputDevice::LogicToLogic(static_cast<sal_Int32>(mfOldHeight), mePoolUnit, MapUnit::Map100thMM)) / fUIScale); if (m_xMtrHeight->get_digits()) fTmpHeight *= pow(10.0, m_xMtrHeight->get_digits()); - m_xMtrHeight->set_value(static_cast<int>(fTmpHeight), FUNIT_100TH_MM); + m_xMtrHeight->set_value(static_cast<int>(fTmpHeight), FieldUnit::MM_100TH); } pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_PROTECT_SIZE ); @@ -1149,8 +1149,8 @@ DeactivateRC SvxPositionSizeTabPage::DeactivatePage( SfxItemSet* _pSet ) { if( _pSet ) { - double fX(static_cast<double>(m_xMtrPosX->get_value(FUNIT_NONE))); - double fY(static_cast<double>(m_xMtrPosY->get_value(FUNIT_NONE))); + double fX(static_cast<double>(m_xMtrPosX->get_value(FieldUnit::NONE))); + double fY(static_cast<double>(m_xMtrPosY->get_value(FieldUnit::NONE))); GetTopLeftPosition(fX, fY, maRange); const ::tools::Rectangle aOutRectangle( @@ -1304,8 +1304,8 @@ void SvxPositionSizeTabPage::SetMinMaxPosition() fBottom = o3tl::clamp(fBottom, -fMaxLong, fMaxLong); // #i75273# normalizing when setting the min/max values was wrong, removed - m_xMtrPosX->set_range(basegfx::fround64(fLeft), basegfx::fround64(fRight), FUNIT_NONE); - m_xMtrPosY->set_range(basegfx::fround64(fTop), basegfx::fround64(fBottom), FUNIT_NONE); + m_xMtrPosX->set_range(basegfx::fround64(fLeft), basegfx::fround64(fRight), FieldUnit::NONE); + m_xMtrPosY->set_range(basegfx::fround64(fTop), basegfx::fround64(fBottom), FieldUnit::NONE); // size fLeft = maWorkRange.getMinX(); @@ -1382,8 +1382,8 @@ void SvxPositionSizeTabPage::SetMinMaxPosition() } // #i75273# normalizing when setting the min/max values was wrong, removed - m_xMtrWidth->set_max(basegfx::fround64(fNewX), FUNIT_NONE); - m_xMtrHeight->set_max(basegfx::fround64(fNewY), FUNIT_NONE); + m_xMtrWidth->set_max(basegfx::fround64(fNewX), FieldUnit::NONE); + m_xMtrHeight->set_max(basegfx::fround64(fNewY), FieldUnit::NONE); } void SvxPositionSizeTabPage::GetTopLeftPosition(double& rfX, double& rfY, const basegfx::B2DRange& rRange) @@ -1450,56 +1450,56 @@ void SvxPositionSizeTabPage::PointChanged(weld::DrawingArea* pDrawingArea, RectP { case RectPoint::LT: { - m_xMtrPosX->set_value( basegfx::fround64(maRange.getMinX()), FUNIT_NONE ); - m_xMtrPosY->set_value( basegfx::fround64(maRange.getMinY()), FUNIT_NONE ); + m_xMtrPosX->set_value( basegfx::fround64(maRange.getMinX()), FieldUnit::NONE ); + m_xMtrPosY->set_value( basegfx::fround64(maRange.getMinY()), FieldUnit::NONE ); break; } case RectPoint::MT: { - m_xMtrPosX->set_value( basegfx::fround64(maRange.getCenter().getX()), FUNIT_NONE ); - m_xMtrPosY->set_value( basegfx::fround64(maRange.getMinY()), FUNIT_NONE ); + m_xMtrPosX->set_value( basegfx::fround64(maRange.getCenter().getX()), FieldUnit::NONE ); + m_xMtrPosY->set_value( basegfx::fround64(maRange.getMinY()), FieldUnit::NONE ); break; } case RectPoint::RT: { - m_xMtrPosX->set_value( basegfx::fround64(maRange.getMaxX()), FUNIT_NONE ); - m_xMtrPosY->set_value( basegfx::fround64(maRange.getMinY()), FUNIT_NONE ); + m_xMtrPosX->set_value( basegfx::fround64(maRange.getMaxX()), FieldUnit::NONE ); + m_xMtrPosY->set_value( basegfx::fround64(maRange.getMinY()), FieldUnit::NONE ); break; } case RectPoint::LM: { - m_xMtrPosX->set_value( basegfx::fround64(maRange.getMinX()), FUNIT_NONE ); - m_xMtrPosY->set_value( basegfx::fround64(maRange.getCenter().getY()), FUNIT_NONE ); + m_xMtrPosX->set_value( basegfx::fround64(maRange.getMinX()), FieldUnit::NONE ); + m_xMtrPosY->set_value( basegfx::fround64(maRange.getCenter().getY()), FieldUnit::NONE ); break; } case RectPoint::MM: { - m_xMtrPosX->set_value( basegfx::fround64(maRange.getCenter().getX()), FUNIT_NONE ); - m_xMtrPosY->set_value( basegfx::fround64(maRange.getCenter().getY()), FUNIT_NONE ); + m_xMtrPosX->set_value( basegfx::fround64(maRange.getCenter().getX()), FieldUnit::NONE ); + m_xMtrPosY->set_value( basegfx::fround64(maRange.getCenter().getY()), FieldUnit::NONE ); break; } case RectPoint::RM: { - m_xMtrPosX->set_value( basegfx::fround64(maRange.getMaxX()), FUNIT_NONE ); - m_xMtrPosY->set_value( basegfx::fround64(maRange.getCenter().getY()), FUNIT_NONE ); + m_xMtrPosX->set_value( basegfx::fround64(maRange.getMaxX()), FieldUnit::NONE ); + m_xMtrPosY->set_value( basegfx::fround64(maRange.getCenter().getY()), FieldUnit::NONE ); break; } case RectPoint::LB: { - m_xMtrPosX->set_value( basegfx::fround64(maRange.getMinX()), FUNIT_NONE ); - m_xMtrPosY->set_value( basegfx::fround64(maRange.getMaxY()), FUNIT_NONE ); + m_xMtrPosX->set_value( basegfx::fround64(maRange.getMinX()), FieldUnit::NONE ); + m_xMtrPosY->set_value( basegfx::fround64(maRange.getMaxY()), FieldUnit::NONE ); break; } case RectPoint::MB: { - m_xMtrPosX->set_value( basegfx::fround64(maRange.getCenter().getX()), FUNIT_NONE ); - m_xMtrPosY->set_value( basegfx::fround64(maRange.getMaxY()), FUNIT_NONE ); + m_xMtrPosX->set_value( basegfx::fround64(maRange.getCenter().getX()), FieldUnit::NONE ); + m_xMtrPosY->set_value( basegfx::fround64(maRange.getMaxY()), FieldUnit::NONE ); break; } case RectPoint::RB: { - m_xMtrPosX->set_value( basegfx::fround64(maRange.getMaxX()), FUNIT_NONE ); - m_xMtrPosY->set_value( basegfx::fround64(maRange.getMaxY()), FUNIT_NONE ); + m_xMtrPosX->set_value( basegfx::fround64(maRange.getMaxX()), FieldUnit::NONE ); + m_xMtrPosY->set_value( basegfx::fround64(maRange.getMaxY()), FieldUnit::NONE ); break; } } @@ -1527,21 +1527,21 @@ IMPL_LINK_NOARG(SvxPositionSizeTabPage, ChangeWidthHdl, weld::MetricSpinButton&, { if( m_xCbxScale->get_active() && m_xCbxScale->get_sensitive() ) { - sal_Int64 nHeight(basegfx::fround64((mfOldHeight * static_cast<double>(m_xMtrWidth->get_value(FUNIT_NONE))) / mfOldWidth)); + sal_Int64 nHeight(basegfx::fround64((mfOldHeight * static_cast<double>(m_xMtrWidth->get_value(FieldUnit::NONE))) / mfOldWidth)); int nMin, nMax; - m_xMtrHeight->get_range(nMin, nMax, FUNIT_NONE); + m_xMtrHeight->get_range(nMin, nMax, FieldUnit::NONE); if (nHeight <= nMax) { - m_xMtrHeight->set_value(nHeight, FUNIT_NONE); + m_xMtrHeight->set_value(nHeight, FieldUnit::NONE); } else { nHeight = nMax; - m_xMtrHeight->set_value(nHeight, FUNIT_NONE); + m_xMtrHeight->set_value(nHeight, FieldUnit::NONE); const sal_Int64 nWidth(basegfx::fround64((mfOldWidth * static_cast<double>(nHeight)) / mfOldHeight)); - m_xMtrWidth->set_value(nWidth, FUNIT_NONE); + m_xMtrWidth->set_value(nWidth, FieldUnit::NONE); } } } @@ -1550,21 +1550,21 @@ IMPL_LINK_NOARG(SvxPositionSizeTabPage, ChangeHeightHdl, weld::MetricSpinButton& { if( m_xCbxScale->get_active() && m_xCbxScale->get_sensitive() ) { - sal_Int64 nWidth(basegfx::fround64((mfOldWidth * static_cast<double>(m_xMtrHeight->get_value(FUNIT_NONE))) / mfOldHeight)); + sal_Int64 nWidth(basegfx::fround64((mfOldWidth * static_cast<double>(m_xMtrHeight->get_value(FieldUnit::NONE))) / mfOldHeight)); int nMin, nMax; - m_xMtrWidth->get_range(nMin, nMax, FUNIT_NONE); + m_xMtrWidth->get_range(nMin, nMax, FieldUnit::NONE); if (nWidth <= nMax) { - m_xMtrWidth->set_value(nWidth, FUNIT_NONE); + m_xMtrWidth->set_value(nWidth, FieldUnit::NONE); } else { nWidth = nMax; - m_xMtrWidth->set_value(nWidth, FUNIT_NONE); + m_xMtrWidth->set_value(nWidth, FieldUnit::NONE); const sal_Int64 nHeight(basegfx::fround64((mfOldHeight * static_cast<double>(nWidth)) / mfOldWidth)); - m_xMtrHeight->set_value(nHeight, FUNIT_NONE); + m_xMtrHeight->set_value(nHeight, FieldUnit::NONE); } } } |