diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-01-25 14:29:26 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-01-25 14:33:32 +0000 |
commit | 05fcc0ff9f55e739871b3ad42b57935541f9a8a5 (patch) | |
tree | 2eab695ed0cc6df6390ba867dd1fba5904c7ff36 /svtools | |
parent | a6218ad20adf29675194ad7f422bfa0d5ddf5a73 (diff) |
coverity#440858 Argument cannot be negative
Change-Id: Ia2725c54ef5850e5c66a79fbe54956769582b013
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/brwbox/brwbox1.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx index 657d29c3c92d..334040c82f7c 100644 --- a/svtools/source/brwbox/brwbox1.cxx +++ b/svtools/source/brwbox/brwbox1.cxx @@ -299,7 +299,6 @@ void BrowseBox::InsertDataColumn( sal_uInt16 nItemId, const OUString& rText, ColumnInserted( nPos ); } - sal_uInt16 BrowseBox::ToggleSelectedColumn() { sal_uInt16 nSelectedColId = BROWSER_INVALIDID; @@ -307,7 +306,9 @@ sal_uInt16 BrowseBox::ToggleSelectedColumn() { DoHideCursor( "ToggleSelectedColumn" ); ToggleSelection(); - nSelectedColId = (*pCols)[ pColSel->FirstSelected() ]->GetId(); + long nSelected = pColSel->FirstSelected(); + if (nSelected != static_cast<long>(SFX_ENDOFSELECTION)) + nSelectedColId = (*pCols)[nSelected]->GetId(); pColSel->SelectAll(false); } return nSelectedColId; |