summaryrefslogtreecommitdiff
path: root/svtools/source/brwbox/editbrowsebox2.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-11-22 11:26:08 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-11-22 11:54:12 +0100
commit1ae61b0ac4187b2938647f3ca0289a070a5dc7d2 (patch)
tree9461c0532919f4fe61f3e0e3fa8556e954244fbd /svtools/source/brwbox/editbrowsebox2.cxx
parent04bb9549e0a0ee567f3bd48a7707286c5abd631a (diff)
loplugin:flatten in svtools
almost completely automatically rewritten, only had to tweak the indentation on a couple of lines. Change-Id: Ieec92e5b602d180d7ec556e3421ce3c835c1f646 Reviewed-on: https://gerrit.libreoffice.org/45072 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svtools/source/brwbox/editbrowsebox2.cxx')
-rw-r--r--svtools/source/brwbox/editbrowsebox2.cxx94
1 files changed, 47 insertions, 47 deletions
diff --git a/svtools/source/brwbox/editbrowsebox2.cxx b/svtools/source/brwbox/editbrowsebox2.cxx
index d705b99d063a..3d962b425501 100644
--- a/svtools/source/brwbox/editbrowsebox2.cxx
+++ b/svtools/source/brwbox/editbrowsebox2.cxx
@@ -65,24 +65,24 @@ void EditBrowseBox::implCreateActiveAccessible( )
DBG_ASSERT( IsEditing(), "EditBrowseBox::implCreateActiveAccessible: not to be called if we're not editing currently!" );
DBG_ASSERT( !m_aImpl->m_xActiveCell.is(), "EditBrowseBox::implCreateActiveAccessible: not to be called if the old one is still alive!" );
- if ( !m_aImpl->m_xActiveCell.is() && IsEditing() )
- {
- Reference< XAccessible > xCont = aController->GetWindow().GetAccessible();
- Reference< XAccessible > xMy = GetAccessible();
- if ( xMy.is() && xCont.is() )
- {
- m_aImpl->m_xActiveCell = getAccessibleFactory().createEditBrowseBoxTableCellAccess(
- xMy, // parent accessible
- xCont, // control accessible
- VCLUnoHelper::GetInterface( &aController->GetWindow() ), // focus window (for notifications)
- *this, // the browse box
- GetCurRow(),
- GetColumnPos( GetCurColumnId() )
- );
-
- commitBrowseBoxEvent( CHILD, makeAny( m_aImpl->m_xActiveCell ), Any() );
- }
- }
+ if ( !(!m_aImpl->m_xActiveCell.is() && IsEditing()) )
+ return;
+
+ Reference< XAccessible > xCont = aController->GetWindow().GetAccessible();
+ Reference< XAccessible > xMy = GetAccessible();
+ if ( !(xMy.is() && xCont.is()) )
+ return;
+
+ m_aImpl->m_xActiveCell = getAccessibleFactory().createEditBrowseBoxTableCellAccess(
+ xMy, // parent accessible
+ xCont, // control accessible
+ VCLUnoHelper::GetInterface( &aController->GetWindow() ), // focus window (for notifications)
+ *this, // the browse box
+ GetCurRow(),
+ GetColumnPos( GetCurColumnId() )
+ );
+
+ commitBrowseBoxEvent( CHILD, makeAny( m_aImpl->m_xActiveCell ), Any() );
}
@@ -127,40 +127,40 @@ void EditBrowseBox::DetermineFocus( const GetFocusFlags _nGetFocusFlags )
pWindow = pWindow->GetParent())
bFocus = pWindow == this;
- if (bFocus != bHasFocus)
- {
- bHasFocus = bFocus;
+ if (bFocus == bHasFocus)
+ return;
+
+ bHasFocus = bFocus;
+
+ if ( !(GetBrowserFlags( ) & EditBrowseBoxFlags::SMART_TAB_TRAVEL) )
+ return;
+
+ if ( !(bHasFocus // we got the focus
+ && ( _nGetFocusFlags & GetFocusFlags::Tab )) // using the TAB key
+ )
+ return;
- if ( GetBrowserFlags( ) & EditBrowseBoxFlags::SMART_TAB_TRAVEL )
+ long nRows = GetRowCount();
+ sal_uInt16 nCols = ColCount();
+
+ if ( ( nRows > 0 ) && ( nCols > 0 ) )
+ {
+ if ( _nGetFocusFlags & GetFocusFlags::Forward )
{
- if ( bHasFocus // we got the focus
- && ( _nGetFocusFlags & GetFocusFlags::Tab ) // using the TAB key
- )
+ if ( GetColumnId( 0 ) != HandleColumnId )
{
- long nRows = GetRowCount();
- sal_uInt16 nCols = ColCount();
-
- if ( ( nRows > 0 ) && ( nCols > 0 ) )
- {
- if ( _nGetFocusFlags & GetFocusFlags::Forward )
- {
- if ( GetColumnId( 0 ) != HandleColumnId )
- {
- GoToRowColumnId( 0, GetColumnId( 0 ) );
- }
- else
- { // the first column is the handle column -> not focussable
- if ( nCols > 1 )
- GoToRowColumnId( 0, GetColumnId( 1 ) );
- }
- }
- else if ( _nGetFocusFlags & GetFocusFlags::Backward )
- {
- GoToRowColumnId( nRows - 1, GetColumnId( nCols -1 ) );
- }
- }
+ GoToRowColumnId( 0, GetColumnId( 0 ) );
+ }
+ else
+ { // the first column is the handle column -> not focussable
+ if ( nCols > 1 )
+ GoToRowColumnId( 0, GetColumnId( 1 ) );
}
}
+ else if ( _nGetFocusFlags & GetFocusFlags::Backward )
+ {
+ GoToRowColumnId( nRows - 1, GetColumnId( nCols -1 ) );
+ }
}
}