diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2015-07-22 16:26:31 +0200 |
---|---|---|
committer | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2015-07-31 00:05:33 +0000 |
commit | df9dce5ee3036cea2dd4dd4ec055c8836454d84e (patch) | |
tree | 69819acaa7a369b00da41fdb19fb00b4a23b5e86 | |
parent | 5c3a4419d10f1645fc1dd4d160b674a0b274cf2e (diff) |
tdf#90889 ListBox in grid: properly set selection on change from model
In particular when changing row.
1) Teach DbCellControl about "SelectedItems" as known value property.
2) Fix DbListBox::updateFromModel to actually use the SelectedItems
it reads from the model, as opposed to throwing it away.
Change-Id: I7074c13b3d271bf2362aa059378aa857682a040b
Reviewed-on: https://gerrit.libreoffice.org/17300
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
-rw-r--r-- | svx/source/fmcomp/gridcell.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index 1e0cd51cdaca..54c868a98505 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -572,6 +572,7 @@ DbCellControl::DbCellControl( DbGridColumn& _rColumn, bool /*_bText*/ ) implDoPropertyListening( FM_PROP_STATE, false ); implDoPropertyListening( FM_PROP_TEXT, false ); implDoPropertyListening( FM_PROP_EFFECTIVE_VALUE, false ); + implDoPropertyListening( FM_PROP_SELECT_SEQ, false ); // be listener at the bound field as well try @@ -676,6 +677,7 @@ void DbCellControl::_propertyChanged(const PropertyChangeEvent& _rEvent) throw(R || _rEvent.PropertyName == FM_PROP_STATE || _rEvent.PropertyName == FM_PROP_TEXT || _rEvent.PropertyName == FM_PROP_EFFECTIVE_VALUE + || _rEvent.PropertyName == FM_PROP_SELECT_SEQ ) { // it was one of the known "value" properties if ( !isValuePropertyLocked() ) @@ -2645,7 +2647,7 @@ void DbListBox::updateFromModel( Reference< XPropertySet > _rxModel ) OSL_ENSURE( _rxModel.is() && m_pWindow, "DbListBox::updateFromModel: invalid call!" ); Sequence< sal_Int16 > aSelection; - _rxModel->getPropertyValue( FM_PROP_SELECT_SEQ ); + _rxModel->getPropertyValue( FM_PROP_SELECT_SEQ ) >>= aSelection; sal_Int16 nSelection = -1; if ( aSelection.getLength() > 0 ) |