summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--svtools/source/contnr/svimpbox.cxx22
1 files changed, 18 insertions, 4 deletions
diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx
index 99ca76f95dcf..e0718ac6b127 100644
--- a/svtools/source/contnr/svimpbox.cxx
+++ b/svtools/source/contnr/svimpbox.cxx
@@ -2237,8 +2237,13 @@ bool SvImpLBox::KeyInput( const KeyEvent& rKEvt)
case KEY_RIGHT:
{
- if( bSubLstOpLR && IsNowExpandable() )
- pView->Expand( pCursor );
+ if( bSubLstOpLR )
+ {
+ // only try to expand if sublist is expandable,
+ // otherwise ignore the key press
+ if( IsNowExpandable() )
+ pView->Expand( pCursor );
+ }
else if ( bIsCellFocusEnabled && pCursor )
{
if ( nCurTabPos < ( pView->TabCount() - 1 /*!2*/ ) )
@@ -2304,8 +2309,17 @@ bool SvImpLBox::KeyInput( const KeyEvent& rKEvt)
}
}
}
- else if( bSubLstOpLR && IsExpandable() )
- pView->Collapse( pCursor );
+ else if( bSubLstOpLR )
+ {
+ if( IsExpandable() && pView->IsExpanded( pCursor ) )
+ pView->Collapse( pCursor );
+ else
+ {
+ pNewCursor = pView->GetParent( pCursor );
+ if( pNewCursor )
+ SetCursor( pNewCursor );
+ }
+ }
else
bKeyUsed = false;
break;