Kaydet (Commit) 128145e2 authored tarafından Caolán McNamara's avatar Caolán McNamara

tdf#125011 large ui scaling factor overflows spinbutton range

Change-Id: I6e41318a92f02e3cd7fde5c52272582345362533
Reviewed-on: https://gerrit.libreoffice.org/71659
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 85cdb680
...@@ -88,18 +88,19 @@ void CopyDlg::Reset() ...@@ -88,18 +88,19 @@ void CopyDlg::Reset()
// Set Min/Max values // Set Min/Max values
::tools::Rectangle aRect = mpView->GetAllMarkedRect(); ::tools::Rectangle aRect = mpView->GetAllMarkedRect();
Size aPageSize = mpView->GetSdrPageView()->GetPage()->GetSize(); Size aPageSize = mpView->GetSdrPageView()->GetPage()->GetSize();
auto const n1 = m_xMtrFldMoveX->normalize(long(1000000 / maUIScale));
auto const n2 = m_xMtrFldMoveX->convert_value_from(n1, FieldUnit::MM_100TH); // tdf#125011 draw/impress sizes are in mm_100th already, "normalize" to
double fScaleFactor = m_xMtrFldMoveX->convert_value_to(n2, FieldUnit::NONE)/1000000.0; // decimal shift by number of decimal places the widgets are using (2) then
// scale by the ui scaling factor
long nPageWidth = aPageSize.Width() * fScaleFactor; auto nPageWidth = long(m_xMtrFldMoveX->normalize(aPageSize.Width()) / maUIScale);
long nPageHeight = aPageSize.Height() * fScaleFactor; auto nPageHeight = long(m_xMtrFldMoveX->normalize(aPageSize.Height()) / maUIScale);
long nRectWidth = aRect.GetWidth() * fScaleFactor; auto nRectWidth = long(m_xMtrFldMoveX->normalize(aRect.GetWidth()) / maUIScale);
long nRectHeight = aRect.GetHeight() * fScaleFactor; auto nRectHeight = long(m_xMtrFldMoveX->normalize(aRect.GetHeight()) / maUIScale);
m_xMtrFldMoveX->set_range(-nPageWidth, nPageWidth, FieldUnit::NONE);
m_xMtrFldMoveY->set_range(-nPageHeight, nPageHeight, FieldUnit::NONE); m_xMtrFldMoveX->set_range(-nPageWidth, nPageWidth, FieldUnit::MM_100TH);
m_xMtrFldWidth->set_range(-nRectWidth, nPageWidth, FieldUnit::NONE); m_xMtrFldMoveY->set_range(-nPageHeight, nPageHeight, FieldUnit::MM_100TH);
m_xMtrFldHeight->set_range(-nRectHeight, nPageHeight, FieldUnit::NONE); m_xMtrFldWidth->set_range(-nRectWidth, nPageWidth, FieldUnit::MM_100TH);
m_xMtrFldHeight->set_range(-nRectHeight, nPageHeight, FieldUnit::MM_100TH);
const SfxPoolItem* pPoolItem = nullptr; const SfxPoolItem* pPoolItem = nullptr;
OUString aStr; OUString aStr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment