sd/source/ui/dlg/copydlg.cxx | 38 +++++++++++++++++++------------------- sd/source/ui/dlg/dlgsnap.cxx | 18 +++++++++--------- sd/source/ui/inc/copydlg.hxx | 2 +- sd/source/ui/inc/dlgsnap.hxx | 2 +- 4 files changed, 30 insertions(+), 30 deletions(-)
New commits: commit 6ec6259d878ff255f89ab75c3cd5c7692fbe5a70 Author: Noel Grandin <[email protected]> AuthorDate: Mon Mar 23 11:46:31 2026 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Tue Mar 24 11:30:51 2026 +0100 Fraction->double in SdSnapLineDlg Change-Id: I1cda893057073a9d51a991e2be6c1101a24c3435 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202566 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/sd/source/ui/dlg/dlgsnap.cxx b/sd/source/ui/dlg/dlgsnap.cxx index 6df16c14f597..cdbb148a3cf9 100644 --- a/sd/source/ui/dlg/dlgsnap.cxx +++ b/sd/source/ui/dlg/dlgsnap.cxx @@ -38,7 +38,7 @@ */ SdSnapLineDlg::SdSnapLineDlg(weld::Window* pWindow, const SfxItemSet& rInAttrs, ::sd::View const * pView) : GenericDialogController(pWindow, u"modules/sdraw/ui/dlgsnap.ui"_ustr, u"SnapObjectDialog"_ustr) - , aUIScale(pView->GetDoc().GetUIScale()) + , mfUIScale(pView->GetDoc().GetUIScale()) , m_xFtX(m_xBuilder->weld_label(u"xlabel"_ustr)) , m_xMtrFldX(m_xBuilder->weld_metric_spin_button(u"x"_ustr, FieldUnit::CM)) , m_xFtY(m_xBuilder->weld_label(u"ylabel"_ustr)) @@ -83,18 +83,18 @@ SdSnapLineDlg::SdSnapLineDlg(weld::Window* pWindow, const SfxItemSet& rInAttrs, auto const n4 = msb->convert_value_to(n3, FieldUnit::NONE); return n4; }; - m_xMtrFldX->set_range(map(m_xMtrFldX, sal_Int32(aLeftTop.X() / aUIScale)), - map(m_xMtrFldX, sal_Int32(aRightBottom.X() / aUIScale)), + m_xMtrFldX->set_range(map(m_xMtrFldX, sal_Int32(aLeftTop.X() / mfUIScale)), + map(m_xMtrFldX, sal_Int32(aRightBottom.X() / mfUIScale)), FieldUnit::NONE); - m_xMtrFldY->set_range(map(m_xMtrFldY, sal_Int32(aLeftTop.Y() / aUIScale)), - map(m_xMtrFldY, sal_Int32(aRightBottom.Y() / aUIScale)), + m_xMtrFldY->set_range(map(m_xMtrFldY, sal_Int32(aLeftTop.Y() / mfUIScale)), + map(m_xMtrFldY, sal_Int32(aRightBottom.Y() / mfUIScale)), FieldUnit::NONE); // set values nXValue = rInAttrs.Get(ATTR_SNAPLINE_X).GetValue(); nYValue = rInAttrs.Get(ATTR_SNAPLINE_Y).GetValue(); - nXValue = sal_Int32(nXValue / aUIScale); - nYValue = sal_Int32(nYValue / aUIScale); + nXValue = sal_Int32(nXValue / mfUIScale); + nYValue = sal_Int32(nYValue / mfUIScale); SetMetricValue(*m_xMtrFldX, nXValue, MapUnit::Map100thMM); SetMetricValue(*m_xMtrFldY, nYValue, MapUnit::Map100thMM); @@ -137,8 +137,8 @@ void SdSnapLineDlg::GetAttr(SfxItemSet& rOutAttrs) else if (m_xRbVert->get_active()) eKind = SnapKind::Vertical; else eKind = SnapKind::Point; - nXValue = sal_Int32(GetCoreValue(*m_xMtrFldX, MapUnit::Map100thMM) * aUIScale); - nYValue = sal_Int32(GetCoreValue(*m_xMtrFldY, MapUnit::Map100thMM) * aUIScale); + nXValue = sal_Int32(GetCoreValue(*m_xMtrFldX, MapUnit::Map100thMM) * mfUIScale); + nYValue = sal_Int32(GetCoreValue(*m_xMtrFldY, MapUnit::Map100thMM) * mfUIScale); rOutAttrs.Put(SfxUInt16Item(ATTR_SNAPLINE_KIND, static_cast<sal_uInt16>(eKind))); rOutAttrs.Put(SfxInt32Item(ATTR_SNAPLINE_X, nXValue)); diff --git a/sd/source/ui/inc/dlgsnap.hxx b/sd/source/ui/inc/dlgsnap.hxx index d40749a3d19d..040371def3e3 100644 --- a/sd/source/ui/inc/dlgsnap.hxx +++ b/sd/source/ui/inc/dlgsnap.hxx @@ -39,7 +39,7 @@ class SdSnapLineDlg final : public weld::GenericDialogController private: int nXValue; int nYValue; - Fraction aUIScale; + double mfUIScale; std::unique_ptr<weld::Label> m_xFtX; std::unique_ptr<weld::MetricSpinButton> m_xMtrFldX; commit 69af36db01340549308f37af72cd08541684ae52 Author: Noel Grandin <[email protected]> AuthorDate: Mon Mar 23 11:45:27 2026 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Tue Mar 24 11:30:42 2026 +0100 Fraction->double in CopyDlg Change-Id: If57bb9ea9c39602946eeffbb6a09b8b8d3bd6c4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/202565 Reviewed-by: Noel Grandin <[email protected]> Tested-by: Jenkins diff --git a/sd/source/ui/dlg/copydlg.cxx b/sd/source/ui/dlg/copydlg.cxx index 3eeaa82c8fd6..5432288d7022 100644 --- a/sd/source/ui/dlg/copydlg.cxx +++ b/sd/source/ui/dlg/copydlg.cxx @@ -43,7 +43,7 @@ constexpr char TOKEN = ';'; CopyDlg::CopyDlg(weld::Window* pWindow, const SfxItemSet& rInAttrs, ::sd::View* pInView) : SfxDialogController(pWindow, u"modules/sdraw/ui/copydlg.ui"_ustr, u"DuplicateDialog"_ustr) , mrOutAttrs(rInAttrs) - , maUIScale(pInView->GetDoc().GetUIScale()) + , mfUIScale(pInView->GetDoc().GetUIScale()) , mpView(pInView) , m_xNumFldCopies(m_xBuilder->weld_spin_button(u"copies"_ustr)) , m_xBtnSetViewData(m_xBuilder->weld_button(u"viewdata"_ustr)) @@ -98,10 +98,10 @@ void CopyDlg::Reset() // tdf#125011 draw/impress sizes are in mm_100th already, "normalize" to // decimal shift by number of decimal places the widgets are using (2) then // scale by the ui scaling factor - auto nPageWidth = tools::Long(m_xMtrFldMoveX->normalize(aPageSize.Width()) / maUIScale); - auto nPageHeight = tools::Long(m_xMtrFldMoveX->normalize(aPageSize.Height()) / maUIScale); - auto nRectWidth = tools::Long(m_xMtrFldMoveX->normalize(aRect.GetWidth()) / maUIScale); - auto nRectHeight = tools::Long(m_xMtrFldMoveX->normalize(aRect.GetHeight()) / maUIScale); + auto nPageWidth = tools::Long(m_xMtrFldMoveX->normalize(aPageSize.Width()) / mfUIScale); + auto nPageHeight = tools::Long(m_xMtrFldMoveX->normalize(aPageSize.Height()) / mfUIScale); + auto nRectWidth = tools::Long(m_xMtrFldMoveX->normalize(aRect.GetWidth()) / mfUIScale); + auto nRectHeight = tools::Long(m_xMtrFldMoveX->normalize(aRect.GetHeight()) / mfUIScale); m_xMtrFldMoveX->set_range(-nPageWidth, nPageWidth, FieldUnit::MM_100TH); m_xMtrFldMoveY->set_range(-nPageHeight, nPageHeight, FieldUnit::MM_100TH); @@ -126,12 +126,12 @@ void CopyDlg::Reset() tools::Long nMoveX = 500; if( const SfxInt32Item* pPoolItem = mrOutAttrs.GetItemIfSet( ATTR_COPY_MOVE_X ) ) nMoveX = pPoolItem->GetValue(); - SetMetricValue( *m_xMtrFldMoveX, tools::Long(nMoveX / maUIScale), MapUnit::Map100thMM); + SetMetricValue( *m_xMtrFldMoveX, tools::Long(nMoveX / mfUIScale), MapUnit::Map100thMM); tools::Long nMoveY = 500; if( const SfxInt32Item* pPoolItem = mrOutAttrs.GetItemIfSet( ATTR_COPY_MOVE_Y ) ) nMoveY = pPoolItem->GetValue(); - SetMetricValue( *m_xMtrFldMoveY, tools::Long(nMoveY / maUIScale), MapUnit::Map100thMM); + SetMetricValue( *m_xMtrFldMoveY, tools::Long(nMoveY / mfUIScale), MapUnit::Map100thMM); if( const SdrAngleItem* pPoolItem = mrOutAttrs.GetItemIfSet( ATTR_COPY_ANGLE ) ) m_xMtrFldAngle->set_value( pPoolItem->GetValue().get(), FieldUnit::NONE); @@ -141,12 +141,12 @@ void CopyDlg::Reset() tools::Long nWidth = 0; if( const SfxInt32Item* pPoolItem = mrOutAttrs.GetItemIfSet( ATTR_COPY_WIDTH ) ) nWidth = pPoolItem->GetValue(); - SetMetricValue( *m_xMtrFldWidth, tools::Long(nWidth / maUIScale), MapUnit::Map100thMM); + SetMetricValue( *m_xMtrFldWidth, tools::Long(nWidth / mfUIScale), MapUnit::Map100thMM); tools::Long nHeight = 0; if( const SfxInt32Item* pPoolItem = mrOutAttrs.GetItemIfSet( ATTR_COPY_HEIGHT ) ) nHeight = pPoolItem->GetValue(); - SetMetricValue( *m_xMtrFldHeight, tools::Long(nHeight / maUIScale), MapUnit::Map100thMM); + SetMetricValue( *m_xMtrFldHeight, tools::Long(nHeight / mfUIScale), MapUnit::Map100thMM); if( const XColorItem* pPoolItem = mrOutAttrs.GetItemIfSet( ATTR_COPY_START_COLOR ) ) { @@ -182,10 +182,10 @@ void CopyDlg::Reset() */ void CopyDlg::GetAttr( SfxItemSet& rOutAttrs ) { - tools::Long nMoveX = tools::Long( GetCoreValue( *m_xMtrFldMoveX, MapUnit::Map100thMM) * maUIScale); - tools::Long nMoveY = tools::Long( GetCoreValue( *m_xMtrFldMoveY, MapUnit::Map100thMM) * maUIScale); - tools::Long nHeight = tools::Long( GetCoreValue( *m_xMtrFldHeight, MapUnit::Map100thMM) * maUIScale); - tools::Long nWidth = tools::Long( GetCoreValue( *m_xMtrFldWidth, MapUnit::Map100thMM) * maUIScale); + tools::Long nMoveX = tools::Long( GetCoreValue( *m_xMtrFldMoveX, MapUnit::Map100thMM) * mfUIScale); + tools::Long nMoveY = tools::Long( GetCoreValue( *m_xMtrFldMoveY, MapUnit::Map100thMM) * mfUIScale); + tools::Long nHeight = tools::Long( GetCoreValue( *m_xMtrFldHeight, MapUnit::Map100thMM) * mfUIScale); + tools::Long nWidth = tools::Long( GetCoreValue( *m_xMtrFldWidth, MapUnit::Map100thMM) * mfUIScale); rOutAttrs.Put( SfxUInt16Item( ATTR_COPY_NUMBER, static_cast<sal_uInt16>(m_xNumFldCopies->get_value()) ) ); rOutAttrs.Put( SfxInt32Item( ATTR_COPY_MOVE_X, nMoveX ) ); @@ -223,9 +223,9 @@ IMPL_LINK_NOARG(CopyDlg, SetViewData, weld::Button&, void) ::tools::Rectangle aRect = mpView->GetAllMarkedRect(); SetMetricValue( *m_xMtrFldMoveX, tools::Long( aRect.GetWidth() / - maUIScale ), MapUnit::Map100thMM); + mfUIScale ), MapUnit::Map100thMM); SetMetricValue( *m_xMtrFldMoveY, tools::Long( aRect.GetHeight() / - maUIScale ), MapUnit::Map100thMM); + mfUIScale ), MapUnit::Map100thMM); // sets color attribute if( const XColorItem* pPoolItem = mrOutAttrs.GetItemIfSet( ATTR_COPY_START_COLOR ) ) @@ -243,13 +243,13 @@ IMPL_LINK_NOARG(CopyDlg, SetDefault, weld::Button&, void) m_xNumFldCopies->set_value(1); tools::Long nValue = 500; - SetMetricValue( *m_xMtrFldMoveX, tools::Long(nValue / maUIScale), MapUnit::Map100thMM); - SetMetricValue( *m_xMtrFldMoveY, tools::Long(nValue / maUIScale), MapUnit::Map100thMM); + SetMetricValue( *m_xMtrFldMoveX, tools::Long(nValue / mfUIScale), MapUnit::Map100thMM); + SetMetricValue( *m_xMtrFldMoveY, tools::Long(nValue / mfUIScale), MapUnit::Map100thMM); nValue = 0; m_xMtrFldAngle->set_value(nValue, FieldUnit::DEGREE); - SetMetricValue( *m_xMtrFldWidth, tools::Long(nValue / maUIScale), MapUnit::Map100thMM); - SetMetricValue( *m_xMtrFldHeight, tools::Long(nValue / maUIScale), MapUnit::Map100thMM); + SetMetricValue( *m_xMtrFldWidth, tools::Long(nValue / mfUIScale), MapUnit::Map100thMM); + SetMetricValue( *m_xMtrFldHeight, tools::Long(nValue / mfUIScale), MapUnit::Map100thMM); // set color attribute if( const XColorItem* pPoolItem = mrOutAttrs.GetItemIfSet( ATTR_COPY_START_COLOR ) ) diff --git a/sd/source/ui/inc/copydlg.hxx b/sd/source/ui/inc/copydlg.hxx index 5e5d9a2a3b7e..04f518223fbc 100644 --- a/sd/source/ui/inc/copydlg.hxx +++ b/sd/source/ui/inc/copydlg.hxx @@ -44,7 +44,7 @@ public: private: const SfxItemSet& mrOutAttrs; - Fraction maUIScale; + double mfUIScale; ::sd::View* mpView; std::unique_ptr<weld::SpinButton> m_xNumFldCopies;
