summaryrefslogtreecommitdiff
path: root/sw/source/uibase/uiview/viewdraw.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-07-30 10:41:30 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-07-30 12:16:48 +0200
commitfd80650672d5d3a0b585d6d46a1b1b0cd4012faf (patch)
treeca23283c97c9bb16594ff3d3abd6d97a4c163bb7 /sw/source/uibase/uiview/viewdraw.cxx
parent1c080b887c1ef28cb2e98173d0121bcae3167075 (diff)
loplugin:flatten in sw/uibase/sidebar..sw/uibase/uno
Change-Id: Ifc9c838ffc94e89d2049969ef28d66fed853548b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99765 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/uibase/uiview/viewdraw.cxx')
-rw-r--r--sw/source/uibase/uiview/viewdraw.cxx72
1 files changed, 36 insertions, 36 deletions
diff --git a/sw/source/uibase/uiview/viewdraw.cxx b/sw/source/uibase/uiview/viewdraw.cxx
index 281e2d09553c..85f9082b977f 100644
--- a/sw/source/uibase/uiview/viewdraw.cxx
+++ b/sw/source/uibase/uiview/viewdraw.cxx
@@ -381,48 +381,48 @@ void SwView::ExitDraw()
{
NoRotate();
- if(m_pShell)
+ if(!m_pShell)
+ return;
+
+ // the shell may be invalid at close/reload/SwitchToViewShell
+ SfxDispatcher* pDispatch = GetViewFrame()->GetDispatcher();
+ sal_uInt16 nIdx = 0;
+ SfxShell* pTest = nullptr;
+ do
{
- // the shell may be invalid at close/reload/SwitchToViewShell
- SfxDispatcher* pDispatch = GetViewFrame()->GetDispatcher();
- sal_uInt16 nIdx = 0;
- SfxShell* pTest = nullptr;
- do
- {
- pTest = pDispatch->GetShell(nIdx++);
- }
- while( pTest && pTest != this && pTest != m_pShell);
- if(pTest == m_pShell &&
- // don't call LeaveSelFrameMode() etc. for the below,
- // because objects may still be selected:
- dynamic_cast< const SwDrawBaseShell *>( m_pShell ) == nullptr &&
- dynamic_cast< const SwBezierShell *>( m_pShell ) == nullptr &&
- dynamic_cast< const svx::ExtrusionBar *>( m_pShell ) == nullptr &&
- dynamic_cast< const svx::FontworkBar *>( m_pShell ) == nullptr)
- {
- SdrView *pSdrView = m_pWrtShell->GetDrawView();
+ pTest = pDispatch->GetShell(nIdx++);
+ }
+ while( pTest && pTest != this && pTest != m_pShell);
+ if(!(pTest == m_pShell &&
+ // don't call LeaveSelFrameMode() etc. for the below,
+ // because objects may still be selected:
+ dynamic_cast< const SwDrawBaseShell *>( m_pShell ) == nullptr &&
+ dynamic_cast< const SwBezierShell *>( m_pShell ) == nullptr &&
+ dynamic_cast< const svx::ExtrusionBar *>( m_pShell ) == nullptr &&
+ dynamic_cast< const svx::FontworkBar *>( m_pShell ) == nullptr))
+ return;
- if (pSdrView && pSdrView->IsGroupEntered())
- {
- pSdrView->LeaveOneGroup();
- pSdrView->UnmarkAll();
- GetViewFrame()->GetBindings().Invalidate(SID_ENTER_GROUP);
- }
+ SdrView *pSdrView = m_pWrtShell->GetDrawView();
- if (GetDrawFuncPtr())
- {
- if (m_pWrtShell->IsSelFrameMode())
- m_pWrtShell->LeaveSelFrameMode();
- GetDrawFuncPtr()->Deactivate();
+ if (pSdrView && pSdrView->IsGroupEntered())
+ {
+ pSdrView->LeaveOneGroup();
+ pSdrView->UnmarkAll();
+ GetViewFrame()->GetBindings().Invalidate(SID_ENTER_GROUP);
+ }
- SetDrawFuncPtr(nullptr);
- LeaveDrawCreate();
+ if (GetDrawFuncPtr())
+ {
+ if (m_pWrtShell->IsSelFrameMode())
+ m_pWrtShell->LeaveSelFrameMode();
+ GetDrawFuncPtr()->Deactivate();
- GetViewFrame()->GetBindings().Invalidate(SID_INSERT_DRAW);
- }
- GetEditWin().SetPointer(PointerStyle::Text);
- }
+ SetDrawFuncPtr(nullptr);
+ LeaveDrawCreate();
+
+ GetViewFrame()->GetBindings().Invalidate(SID_INSERT_DRAW);
}
+ GetEditWin().SetPointer(PointerStyle::Text);
}
// Disable rotate mode