summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorNoel <noel.grandin@collabora.co.uk>2021-03-26 13:35:54 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-03-26 18:02:19 +0100
commitb624b13b3d5a8e573c7de8158cadc66b1982d157 (patch)
tree56948e6a5e8d7f5a7cbde6328a27f13ecd8a72bc /sd
parent8136620ff432bf17815bef1f88c7531edb839d23 (diff)
loplugin:flatten
Change-Id: Ib7a895fba66f8dc9b6501e61631c02694053b7fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113157 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/annotations/annotationtag.cxx60
-rw-r--r--sd/source/ui/app/scalectrl.cxx40
-rw-r--r--sd/source/ui/app/sdpopup.cxx24
3 files changed, 62 insertions, 62 deletions
diff --git a/sd/source/ui/annotations/annotationtag.cxx b/sd/source/ui/annotations/annotationtag.cxx
index 4e79f8d337f9..052245ac15fd 100644
--- a/sd/source/ui/annotations/annotationtag.cxx
+++ b/sd/source/ui/annotations/annotationtag.cxx
@@ -616,43 +616,43 @@ IMPL_LINK(AnnotationTag, WindowEventHandler, VclWindowEvent&, rEvent, void)
if( !pWindow )
return;
- if( pWindow == mpListenWindow )
+ if( pWindow != mpListenWindow )
+ return;
+
+ switch( rEvent.GetId() )
{
- switch( rEvent.GetId() )
+ case VclEventId::WindowMouseButtonUp:
{
- case VclEventId::WindowMouseButtonUp:
- {
- // if we stop pressing the button without a mouse move we open the popup
- mpListenWindow->RemoveEventListener( LINK(this, AnnotationTag, WindowEventHandler));
- mpListenWindow = nullptr;
- if( !mpAnnotationWindow )
- OpenPopup(false);
- }
- break;
- case VclEventId::WindowMouseMove:
- {
- // if we move the mouse after a button down we want to start dragging
- mpListenWindow->RemoveEventListener( LINK(this, AnnotationTag, WindowEventHandler));
- mpListenWindow = nullptr;
+ // if we stop pressing the button without a mouse move we open the popup
+ mpListenWindow->RemoveEventListener( LINK(this, AnnotationTag, WindowEventHandler));
+ mpListenWindow = nullptr;
+ if( !mpAnnotationWindow )
+ OpenPopup(false);
+ }
+ break;
+ case VclEventId::WindowMouseMove:
+ {
+ // if we move the mouse after a button down we want to start dragging
+ mpListenWindow->RemoveEventListener( LINK(this, AnnotationTag, WindowEventHandler));
+ mpListenWindow = nullptr;
- SdrHdl* pHdl = mrView.PickHandle(maMouseDownPos);
- if( pHdl )
- {
- mrView.BrkAction();
- const sal_uInt16 nDrgLog = static_cast<sal_uInt16>(pWindow->PixelToLogic(Size(DRGPIX,0)).Width());
+ SdrHdl* pHdl = mrView.PickHandle(maMouseDownPos);
+ if( pHdl )
+ {
+ mrView.BrkAction();
+ const sal_uInt16 nDrgLog = static_cast<sal_uInt16>(pWindow->PixelToLogic(Size(DRGPIX,0)).Width());
- rtl::Reference< AnnotationTag > xTag( this );
+ rtl::Reference< AnnotationTag > xTag( this );
- SdrDragMethod* pDragMethod = new AnnotationDragMove( mrView, xTag );
- mrView.BegDragObj(maMouseDownPos, nullptr, pHdl, nDrgLog, pDragMethod );
- }
+ SdrDragMethod* pDragMethod = new AnnotationDragMove( mrView, xTag );
+ mrView.BegDragObj(maMouseDownPos, nullptr, pHdl, nDrgLog, pDragMethod );
}
- break;
- case VclEventId::ObjectDying:
- mpListenWindow = nullptr;
- break;
- default: break;
}
+ break;
+ case VclEventId::ObjectDying:
+ mpListenWindow = nullptr;
+ break;
+ default: break;
}
}
diff --git a/sd/source/ui/app/scalectrl.cxx b/sd/source/ui/app/scalectrl.cxx
index 6ab069f8a1e4..d1b8dc277fce 100644
--- a/sd/source/ui/app/scalectrl.cxx
+++ b/sd/source/ui/app/scalectrl.cxx
@@ -83,26 +83,26 @@ void SdScaleControl::Command(const CommandEvent& rCEvt)
::tools::Rectangle aRect(rCEvt.GetMousePosPixel(), Size(1, 1));
weld::Window* pParent = weld::GetPopupParent(GetStatusBar(), aRect);
OString sResult = xPopup->popup_at_rect(pParent, aRect);
- if (!sResult.isEmpty())
- {
- sal_Int32 i = sResult.toUInt32();
- sal_Int32 nX;
- sal_Int32 nY;
- if (i > 11)
- nX = 1;
- else
- nX = aTable[(12 - i) % 12];
- if (i > 11)
- nY = aTable[i % 12];
- else
- nY = 1;
- pDoc->SetUIScale(Fraction(nX, nY));
-
- SfxBindings& pBindings = pViewFrame->GetBindings();
- pBindings.Invalidate(SID_SCALE); //update statusbar
- pBindings.Invalidate(SID_ATTR_METRIC); //update sidebar
- pViewShellBase->UpdateBorder(true); // update ruler
- }
+ if (sResult.isEmpty())
+ return;
+
+ sal_Int32 i = sResult.toUInt32();
+ sal_Int32 nX;
+ sal_Int32 nY;
+ if (i > 11)
+ nX = 1;
+ else
+ nX = aTable[(12 - i) % 12];
+ if (i > 11)
+ nY = aTable[i % 12];
+ else
+ nY = 1;
+ pDoc->SetUIScale(Fraction(nX, nY));
+
+ SfxBindings& pBindings = pViewFrame->GetBindings();
+ pBindings.Invalidate(SID_SCALE); //update statusbar
+ pBindings.Invalidate(SID_ATTR_METRIC); //update sidebar
+ pViewShellBase->UpdateBorder(true); // update ruler
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/app/sdpopup.cxx b/sd/source/ui/app/sdpopup.cxx
index ebccfe8cb4c9..52a0435351de 100644
--- a/sd/source/ui/app/sdpopup.cxx
+++ b/sd/source/ui/app/sdpopup.cxx
@@ -152,19 +152,19 @@ void SdFieldPopup::Fill( LanguageType eLanguage )
void SdFieldPopup::Execute(weld::Window* pParent, const tools::Rectangle& rRect)
{
OString sIdent = m_xPopup->popup_at_rect(pParent, rRect);
- if (!sIdent.isEmpty())
+ if (sIdent.isEmpty())
+ return;
+
+ if (sIdent == "1" || sIdent == "2")
{
- if (sIdent == "1" || sIdent == "2")
- {
- m_xPopup->set_active("1", sIdent == "1");
- m_xPopup->set_active("2", sIdent == "2");
- }
- else
- {
- int nCount = m_xPopup->n_children();
- for (int i = 3; i < nCount; i++)
- m_xPopup->set_active(OString::number(i), sIdent == OString::number(i));
- }
+ m_xPopup->set_active("1", sIdent == "1");
+ m_xPopup->set_active("2", sIdent == "2");
+ }
+ else
+ {
+ int nCount = m_xPopup->n_children();
+ for (int i = 3; i < nCount; i++)
+ m_xPopup->set_active(OString::number(i), sIdent == OString::number(i));
}
}