summaryrefslogtreecommitdiff
path: root/sd/source/ui/view/viewshel.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-02-14 09:10:23 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-02-15 07:48:14 +0100
commitc2429e3e95a4298f43c468f36a1a2832992dd40e (patch)
treef43bd173eabe863b896de6057b5aee2f92d808d5 /sd/source/ui/view/viewshel.cxx
parentb89f239aa9d3d4660380bbd0c893aecde0986032 (diff)
loplugin:flatten in sd/source/ui/view
Change-Id: I28e75ec162cde89fe1aa7d85aecce7ce80878d88 Reviewed-on: https://gerrit.libreoffice.org/67828 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source/ui/view/viewshel.cxx')
-rw-r--r--sd/source/ui/view/viewshel.cxx168
1 files changed, 84 insertions, 84 deletions
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx
index 66ae776d158f..c0fb2aa674a6 100644
--- a/sd/source/ui/view/viewshel.cxx
+++ b/sd/source/ui/view/viewshel.cxx
@@ -485,22 +485,22 @@ void ViewShell::MouseButtonDown(const MouseEvent& rMEvt, ::sd::Window* pWin)
if( GetView() )
bConsumed = GetView()->getSmartTags().MouseButtonDown( rMEvt );
- if( !bConsumed )
+ if( bConsumed )
+ return;
+
+ rtl::Reference< sdr::SelectionController > xSelectionController( GetView()->getSelectionController() );
+ if( !xSelectionController.is() || !xSelectionController->onMouseButtonDown( rMEvt, pWin ) )
{
- rtl::Reference< sdr::SelectionController > xSelectionController( GetView()->getSelectionController() );
- if( !xSelectionController.is() || !xSelectionController->onMouseButtonDown( rMEvt, pWin ) )
- {
- if(HasCurrentFunction())
- GetCurrentFunction()->MouseButtonDown(rMEvt);
- }
- else
+ if(HasCurrentFunction())
+ GetCurrentFunction()->MouseButtonDown(rMEvt);
+ }
+ else
+ {
+ if (HasCurrentFunction())
{
- if (HasCurrentFunction())
- {
- FuText* pTextFunction = dynamic_cast<FuText*>(GetCurrentFunction().get());
- if (pTextFunction != nullptr)
- pTextFunction->InvalidateBindings();
- }
+ FuText* pTextFunction = dynamic_cast<FuText*>(GetCurrentFunction().get());
+ if (pTextFunction != nullptr)
+ pTextFunction->InvalidateBindings();
}
}
}
@@ -671,23 +671,23 @@ void ViewShell::Command(const CommandEvent& rCEvt, ::sd::Window* pWin)
{
bool bDone = HandleScrollCommand (rCEvt, pWin);
- if( !bDone )
+ if( bDone )
+ return;
+
+ if( rCEvt.GetCommand() == CommandEventId::InputLanguageChange )
{
- if( rCEvt.GetCommand() == CommandEventId::InputLanguageChange )
- {
- //#i42732# update state of fontname if input language changes
- GetViewFrame()->GetBindings().Invalidate( SID_ATTR_CHAR_FONT );
- GetViewFrame()->GetBindings().Invalidate( SID_ATTR_CHAR_FONTHEIGHT );
- }
- else
- {
- bool bConsumed = false;
- if( GetView() )
- bConsumed = GetView()->getSmartTags().Command(rCEvt);
+ //#i42732# update state of fontname if input language changes
+ GetViewFrame()->GetBindings().Invalidate( SID_ATTR_CHAR_FONT );
+ GetViewFrame()->GetBindings().Invalidate( SID_ATTR_CHAR_FONTHEIGHT );
+ }
+ else
+ {
+ bool bConsumed = false;
+ if( GetView() )
+ bConsumed = GetView()->getSmartTags().Command(rCEvt);
- if( !bConsumed && HasCurrentFunction())
- GetCurrentFunction()->Command(rCEvt);
- }
+ if( !bConsumed && HasCurrentFunction())
+ GetCurrentFunction()->Command(rCEvt);
}
}
@@ -810,29 +810,29 @@ bool ViewShell::HandleScrollCommand(const CommandEvent& rCEvt, ::sd::Window* pWi
void ViewShell::SetupRulers()
{
- if(mbHasRulers && (mpContentWindow.get() != nullptr) && !SlideShow::IsRunning(GetViewShellBase()))
- {
- long nHRulerOfs = 0;
+ if(!(mbHasRulers && (mpContentWindow.get() != nullptr) && !SlideShow::IsRunning(GetViewShellBase())))
+ return;
+
+ long nHRulerOfs = 0;
- if ( mpVerticalRuler.get() == nullptr )
+ if ( mpVerticalRuler.get() == nullptr )
+ {
+ mpVerticalRuler.reset(CreateVRuler(GetActiveWindow()));
+ if ( mpVerticalRuler.get() != nullptr )
{
- mpVerticalRuler.reset(CreateVRuler(GetActiveWindow()));
- if ( mpVerticalRuler.get() != nullptr )
- {
- nHRulerOfs = mpVerticalRuler->GetSizePixel().Width();
- mpVerticalRuler->SetActive();
- mpVerticalRuler->Show();
- }
+ nHRulerOfs = mpVerticalRuler->GetSizePixel().Width();
+ mpVerticalRuler->SetActive();
+ mpVerticalRuler->Show();
}
- if ( mpHorizontalRuler.get() == nullptr )
+ }
+ if ( mpHorizontalRuler.get() == nullptr )
+ {
+ mpHorizontalRuler.reset(CreateHRuler(GetActiveWindow()));
+ if ( mpHorizontalRuler.get() != nullptr )
{
- mpHorizontalRuler.reset(CreateHRuler(GetActiveWindow()));
- if ( mpHorizontalRuler.get() != nullptr )
- {
- mpHorizontalRuler->SetWinPos(nHRulerOfs);
- mpHorizontalRuler->SetActive();
- mpHorizontalRuler->Show();
- }
+ mpHorizontalRuler->SetWinPos(nHRulerOfs);
+ mpHorizontalRuler->SetActive();
+ mpHorizontalRuler->Show();
}
}
}
@@ -1154,52 +1154,52 @@ SfxUndoManager* ViewShell::ImpGetUndoManager() const
void ViewShell::ImpGetUndoStrings(SfxItemSet &rSet) const
{
SfxUndoManager* pUndoManager = ImpGetUndoManager();
- if(pUndoManager)
- {
- sal_uInt16 nCount(pUndoManager->GetUndoActionCount());
- if(nCount)
- {
- // prepare list
- std::vector<OUString> aStringList;
- aStringList.reserve(nCount);
- for (sal_uInt16 a = 0; a < nCount; ++a)
- {
- // generate one String in list per undo step
- aStringList.push_back( pUndoManager->GetUndoActionComment(a) );
- }
+ if(!pUndoManager)
+ return;
- // set item
- rSet.Put(SfxStringListItem(SID_GETUNDOSTRINGS, &aStringList));
- }
- else
+ sal_uInt16 nCount(pUndoManager->GetUndoActionCount());
+ if(nCount)
+ {
+ // prepare list
+ std::vector<OUString> aStringList;
+ aStringList.reserve(nCount);
+ for (sal_uInt16 a = 0; a < nCount; ++a)
{
- rSet.DisableItem(SID_GETUNDOSTRINGS);
+ // generate one String in list per undo step
+ aStringList.push_back( pUndoManager->GetUndoActionComment(a) );
}
+
+ // set item
+ rSet.Put(SfxStringListItem(SID_GETUNDOSTRINGS, &aStringList));
+ }
+ else
+ {
+ rSet.DisableItem(SID_GETUNDOSTRINGS);
}
}
void ViewShell::ImpGetRedoStrings(SfxItemSet &rSet) const
{
SfxUndoManager* pUndoManager = ImpGetUndoManager();
- if(pUndoManager)
+ if(!pUndoManager)
+ return;
+
+ sal_uInt16 nCount(pUndoManager->GetRedoActionCount());
+ if(nCount)
{
- sal_uInt16 nCount(pUndoManager->GetRedoActionCount());
- if(nCount)
- {
- // prepare list
- ::std::vector< OUString > aStringList;
- aStringList.reserve(nCount);
- for(sal_uInt16 a = 0; a < nCount; a++)
- // generate one String in list per undo step
- aStringList.push_back( pUndoManager->GetRedoActionComment(a) );
-
- // set item
- rSet.Put(SfxStringListItem(SID_GETREDOSTRINGS, &aStringList));
- }
- else
- {
- rSet.DisableItem(SID_GETREDOSTRINGS);
- }
+ // prepare list
+ ::std::vector< OUString > aStringList;
+ aStringList.reserve(nCount);
+ for(sal_uInt16 a = 0; a < nCount; a++)
+ // generate one String in list per undo step
+ aStringList.push_back( pUndoManager->GetRedoActionComment(a) );
+
+ // set item
+ rSet.Put(SfxStringListItem(SID_GETREDOSTRINGS, &aStringList));
+ }
+ else
+ {
+ rSet.DisableItem(SID_GETREDOSTRINGS);
}
}