svx/source/fmcomp/gridcell.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
New commits: commit 6c2f0c1001b0586b3092e80d63866ae018f09eb8 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Wed Jul 22 16:26:31 2015 +0200 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 diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index fe76271..8208231 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 ) commit 3b9e66fdcade5a222a9dc99ad74627473b1fd4e7 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Wed Jul 22 16:25:28 2015 +0200 tdf#92725 FormattedField: when model value is NULL, force empty display string as opposed to implicitly keeping whatever unrelated string was there before. Change-Id: Ifaf1b41e951e97f209ecb617b32ec4f7522b1d08 diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index 9a5a28d..fe76271 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -1576,7 +1576,7 @@ void DbFormattedField::updateFromModel( Reference< XPropertySet > _rxModel ) OUString sText; Any aValue = _rxModel->getPropertyValue( FM_PROP_EFFECTIVE_VALUE ); - if ( aValue >>= sText ) + if ( !aValue.hasValue() || (aValue >>= sText) ) { // our effective value is transferred as string pFormattedWindow->SetTextFormatted( sText ); pFormattedWindow->SetSelection( Selection( SELECTION_MAX, SELECTION_MIN ) ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits