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:
Rodolfo Ribeiro Gomes
2013-11-11 22:24:20 -02:00
committed by Noel Grandin
parent 44b113fd38
commit b29464a8fa

View File

@@ -732,13 +732,28 @@ void ThumbnailView::MakeItemVisible( sal_uInt16 nItemId )
void ThumbnailView::MouseButtonDown( const MouseEvent& rMEvt ) void ThumbnailView::MouseButtonDown( const MouseEvent& rMEvt )
{ {
if ( rMEvt.IsLeft() ) if ( !rMEvt.IsLeft() )
{ {
Control::MouseButtonDown( rMEvt );
return;
}
size_t nPos = ImplGetItem(rMEvt.GetPosPixel()); size_t nPos = ImplGetItem(rMEvt.GetPosPixel());
ThumbnailViewItem* pItem = ImplGetItem(nPos); 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.GetClicks() == 1 )
{ {
if (rMEvt.IsMod1()) if (rMEvt.IsMod1())
@@ -827,18 +842,6 @@ void ThumbnailView::MouseButtonDown( const MouseEvent& rMEvt )
//fire accessible event?? //fire accessible event??
} }
else if ( rMEvt.GetClicks() == 2 )
{
OnItemDblClicked(pItem);
}
return;
}
else if (!pItem)
deselectItems( );
}
Control::MouseButtonDown( rMEvt );
} }
void ThumbnailView::MouseButtonUp( const MouseEvent& rMEvt ) void ThumbnailView::MouseButtonUp( const MouseEvent& rMEvt )