diff options
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/ui/annotations/annotationtag.cxx | 60 | ||||
-rw-r--r-- | sd/source/ui/app/scalectrl.cxx | 40 | ||||
-rw-r--r-- | sd/source/ui/app/sdpopup.cxx | 24 |
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)); } } |