summaryrefslogtreecommitdiff
path: root/svtools/source/control/valueset.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svtools/source/control/valueset.cxx')
-rw-r--r--svtools/source/control/valueset.cxx51
1 files changed, 29 insertions, 22 deletions
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx
index bb48c11c7c0b..62193eadf735 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -1418,7 +1418,7 @@ void ValueSet::KeyInput( const KeyEvent& rKEvt )
{
USHORT nLastItem = (USHORT)mpImpl->mpItemList->Count();
USHORT nItemPos = VALUESET_ITEM_NOTFOUND;
- USHORT nCurPos;
+ USHORT nCurPos = VALUESET_ITEM_NONEITEM;
USHORT nCalcPos;
if ( !nLastItem || !ImplGetFirstItem() )
@@ -1431,8 +1431,6 @@ void ValueSet::KeyInput( const KeyEvent& rKEvt )
if ( mnSelItemId )
nCurPos = GetItemPos( mnSelItemId );
- else
- nCurPos = VALUESET_ITEM_NONEITEM;
nCalcPos = nCurPos;
//switch off selection mode if key travelling is used
@@ -1528,30 +1526,20 @@ void ValueSet::KeyInput( const KeyEvent& rKEvt )
nCalcPos - ( nLineCount * mnCols ));
else
{
- if( (KEY_UP == rKEvt.GetKeyCode().GetCode() ) && (GetStyle() & WB_MENUSTYLEVALUESET) )
+ if ( mpNoneItem )
{
- Window* pParent = GetParent();
- pParent->GrabFocus();
- pParent->KeyInput( rKEvt );
- break;
+ mnCurCol = nCalcPos%mnCols;
+ nItemPos = VALUESET_ITEM_NONEITEM;
}
else
{
- if ( mpNoneItem )
- {
- mnCurCol = nCalcPos%mnCols;
- nItemPos = VALUESET_ITEM_NONEITEM;
- }
+ if ( nLastItem+1 <= mnCols )
+ nItemPos = nCalcPos;
else
{
- if ( nLastItem+1 <= mnCols )
- nItemPos = nCalcPos;
- else
- {
- nItemPos = ((((nLastItem+1)/mnCols)-1)*mnCols)+(nCalcPos%mnCols);
- if ( nItemPos+mnCols <= nLastItem )
- nItemPos = nItemPos + mnCols;
- }
+ nItemPos = ((((nLastItem+1)/mnCols)-1)*mnCols)+(nCalcPos%mnCols);
+ if ( nItemPos+mnCols <= nLastItem )
+ nItemPos = nItemPos + mnCols;
}
}
}
@@ -1580,6 +1568,7 @@ void ValueSet::KeyInput( const KeyEvent& rKEvt )
nCalcPos + ( nLineCount * mnCols ));
else
{
+#if 0
if( (KEY_DOWN == rKEvt.GetKeyCode().GetCode() ) && (GetStyle() & WB_MENUSTYLEVALUESET) )
{
Window* pParent = GetParent();
@@ -1588,6 +1577,7 @@ void ValueSet::KeyInput( const KeyEvent& rKEvt )
break;
}
else
+#endif
{
if ( mpNoneItem )
{
@@ -1620,7 +1610,6 @@ void ValueSet::KeyInput( const KeyEvent& rKEvt )
bDefault = TRUE;
break;
}
-
if(!bDefault)
EndSelection();
if ( nItemPos != VALUESET_ITEM_NOTFOUND )
@@ -1630,6 +1619,7 @@ void ValueSet::KeyInput( const KeyEvent& rKEvt )
nItemId = GetItemId( nItemPos );
else
nItemId = 0;
+
if ( nItemId != mnSelItemId )
{
SelectItem( nItemId );
@@ -2278,6 +2268,7 @@ void ValueSet::SelectItem( USHORT nItemId )
::com::sun::star::uno::Any aOldAny, aNewAny;
ImplFireAccessibleEvent( ::com::sun::star::accessibility::AccessibleEventId::SELECTION_CHANGED, aOldAny, aNewAny );
}
+ mpImpl->maHighlightHdl.Call(this);
}
}
@@ -2749,3 +2740,19 @@ bool ValueSet::IsRTLActive (void)
return Application::GetSettings().GetLayoutRTL() && IsRTLEnabled();
}
+// -----------------------------------------------------------------------
+
+void ValueSet::SetHighlightHdl( const Link& rLink )
+{
+ mpImpl->maHighlightHdl = rLink;
+}
+
+// -----------------------------------------------------------------------
+
+const Link& ValueSet::GetHighlightHdl() const
+{
+ return mpImpl->maHighlightHdl;
+}
+
+// -----------------------------------------------------------------------
+