less if-nesting in ThumnailView
Easier to read. Change-Id: I1ceb551d8badffb211b1f444b61375a03cac1348 Signed-off-by: Rodolfo Ribeiro Gomes <rodolforg@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/6643 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
This commit is contained in:
committed by
Noel Grandin
parent
44b113fd38
commit
b29464a8fa
@@ -732,13 +732,28 @@ void ThumbnailView::MakeItemVisible( sal_uInt16 nItemId )
|
||||
|
||||
void ThumbnailView::MouseButtonDown( const MouseEvent& rMEvt )
|
||||
{
|
||||
if ( rMEvt.IsLeft() )
|
||||
if ( !rMEvt.IsLeft() )
|
||||
{
|
||||
Control::MouseButtonDown( rMEvt );
|
||||
return;
|
||||
}
|
||||
|
||||
size_t nPos = ImplGetItem(rMEvt.GetPosPixel());
|
||||
ThumbnailViewItem* pItem = ImplGetItem(nPos);
|
||||
|
||||
if (pItem)
|
||||
if ( !pItem )
|
||||
{
|
||||
deselectItems();
|
||||
Control::MouseButtonDown( rMEvt );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( rMEvt.GetClicks() == 2 )
|
||||
{
|
||||
OnItemDblClicked(pItem);
|
||||
return;
|
||||
}
|
||||
|
||||
if ( rMEvt.GetClicks() == 1 )
|
||||
{
|
||||
if (rMEvt.IsMod1())
|
||||
@@ -827,18 +842,6 @@ void ThumbnailView::MouseButtonDown( const MouseEvent& rMEvt )
|
||||
|
||||
//fire accessible event??
|
||||
}
|
||||
else if ( rMEvt.GetClicks() == 2 )
|
||||
{
|
||||
OnItemDblClicked(pItem);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
else if (!pItem)
|
||||
deselectItems( );
|
||||
}
|
||||
|
||||
Control::MouseButtonDown( rMEvt );
|
||||
}
|
||||
|
||||
void ThumbnailView::MouseButtonUp( const MouseEvent& rMEvt )
|
||||
|
Reference in New Issue
Block a user