summaryrefslogtreecommitdiff
path: root/cui/source/tabpages/transfrm.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-04-17 14:48:19 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-04-17 15:50:58 +0200
commit3e57aad962c9d24c535daff893db203314709cfc (patch)
tree5744fcaae69751cdd4174f5da6024ba656e77ccc /cui/source/tabpages/transfrm.cxx
parentbb3ea0ae51bb943f7bb3dca80eee153f9c55c03e (diff)
loplugin:flatten in cui
Change-Id: I0ea0784ab8c4542747da1e15fa7c60c60bccb602 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92423 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui/source/tabpages/transfrm.cxx')
-rw-r--r--cui/source/tabpages/transfrm.cxx176
1 files changed, 88 insertions, 88 deletions
diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx
index 612410ac94e6..77c3b7e7e8d2 100644
--- a/cui/source/tabpages/transfrm.cxx
+++ b/cui/source/tabpages/transfrm.cxx
@@ -328,64 +328,64 @@ DeactivateRC SvxAngleTabPage::DeactivatePage( SfxItemSet* _pSet )
void SvxAngleTabPage::PointChanged(weld::DrawingArea* pDrawingArea, RectPoint eRP)
{
- if (pDrawingArea == m_aCtlRect.GetDrawingArea())
+ if (pDrawingArea != m_aCtlRect.GetDrawingArea())
+ return;
+
+ switch(eRP)
{
- switch(eRP)
+ case RectPoint::LT:
{
- case RectPoint::LT:
- {
- 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()), FieldUnit::NONE );
- m_xMtrPosY->set_value( basegfx::fround64(maRange.getMinY()), FieldUnit::NONE );
- break;
- }
- case RectPoint::RT:
- {
- 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()), 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()), 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()), 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()), 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()), FieldUnit::NONE );
- m_xMtrPosY->set_value( basegfx::fround64(maRange.getMaxY()), FieldUnit::NONE );
- break;
- }
- case RectPoint::RB:
- {
- m_xMtrPosX->set_value( basegfx::fround64(maRange.getMaxX()), FieldUnit::NONE );
- m_xMtrPosY->set_value( basegfx::fround64(maRange.getMaxY()), FieldUnit::NONE );
- break;
- }
+ 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()), FieldUnit::NONE );
+ m_xMtrPosY->set_value( basegfx::fround64(maRange.getMinY()), FieldUnit::NONE );
+ break;
+ }
+ case RectPoint::RT:
+ {
+ 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()), 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()), 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()), 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()), 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()), FieldUnit::NONE );
+ m_xMtrPosY->set_value( basegfx::fround64(maRange.getMaxY()), FieldUnit::NONE );
+ break;
+ }
+ case RectPoint::RB:
+ {
+ m_xMtrPosX->set_value( basegfx::fround64(maRange.getMaxX()), FieldUnit::NONE );
+ m_xMtrPosY->set_value( basegfx::fround64(maRange.getMaxY()), FieldUnit::NONE );
+ break;
}
}
}
@@ -1516,47 +1516,47 @@ void SvxPositionSizeTabPage::DisableProtect()
IMPL_LINK_NOARG(SvxPositionSizeTabPage, ChangeWidthHdl, weld::MetricSpinButton&, void)
{
- if( m_xCbxScale->get_active() && m_xCbxScale->get_sensitive() )
- {
- 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, FieldUnit::NONE);
+ if( !(m_xCbxScale->get_active() && m_xCbxScale->get_sensitive()) )
+ return;
- if (nHeight <= nMax)
- {
- m_xMtrHeight->set_value(nHeight, FieldUnit::NONE);
- }
- else
- {
- nHeight = nMax;
- m_xMtrHeight->set_value(nHeight, FieldUnit::NONE);
+ 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, FieldUnit::NONE);
- const sal_Int64 nWidth(basegfx::fround64((mfOldWidth * static_cast<double>(nHeight)) / mfOldHeight));
- m_xMtrWidth->set_value(nWidth, FieldUnit::NONE);
- }
+ if (nHeight <= nMax)
+ {
+ m_xMtrHeight->set_value(nHeight, FieldUnit::NONE);
+ }
+ else
+ {
+ nHeight = nMax;
+ m_xMtrHeight->set_value(nHeight, FieldUnit::NONE);
+
+ const sal_Int64 nWidth(basegfx::fround64((mfOldWidth * static_cast<double>(nHeight)) / mfOldHeight));
+ m_xMtrWidth->set_value(nWidth, FieldUnit::NONE);
}
}
IMPL_LINK_NOARG(SvxPositionSizeTabPage, ChangeHeightHdl, weld::MetricSpinButton&, void)
{
- if( m_xCbxScale->get_active() && m_xCbxScale->get_sensitive() )
- {
- 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, FieldUnit::NONE);
+ if( !(m_xCbxScale->get_active() && m_xCbxScale->get_sensitive()) )
+ return;
- if (nWidth <= nMax)
- {
- m_xMtrWidth->set_value(nWidth, FieldUnit::NONE);
- }
- else
- {
- nWidth = nMax;
- m_xMtrWidth->set_value(nWidth, FieldUnit::NONE);
+ 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, FieldUnit::NONE);
- const sal_Int64 nHeight(basegfx::fround64((mfOldHeight * static_cast<double>(nWidth)) / mfOldWidth));
- m_xMtrHeight->set_value(nHeight, FieldUnit::NONE);
- }
+ if (nWidth <= nMax)
+ {
+ m_xMtrWidth->set_value(nWidth, FieldUnit::NONE);
+ }
+ else
+ {
+ nWidth = nMax;
+ m_xMtrWidth->set_value(nWidth, FieldUnit::NONE);
+
+ const sal_Int64 nHeight(basegfx::fround64((mfOldHeight * static_cast<double>(nWidth)) / mfOldWidth));
+ m_xMtrHeight->set_value(nHeight, FieldUnit::NONE);
}
}