From kde-commits Sat Oct 31 22:38:35 2009 From: =?utf-8?q?Jaros=C5=82aw=20Staniek?= Date: Sat, 31 Oct 2009 22:38:35 +0000 To: kde-commits Subject: koffice/kexi/plugins/forms Message-Id: <1257028715.589309.27987.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=125702872318466 SVN commit 1043168 by staniek: Forms *fix recently introduced possible crash (happens when there are no focusable daata-aware widget in the data view) M +4 -1 kexiformscrollview.cpp --- trunk/koffice/kexi/plugins/forms/kexiformscrollview.cpp #1043167:1043168 @@ -103,7 +103,10 @@ if (m_currentItem != m_previousRecord) { fillDataItems(*m_currentItem, cursorAtNewRow()); m_previousRecord = m_currentItem; - QWidget *w = dbFormWidget()->orderedDataAwareWidgets()->at(m_curCol); + QWidget *w = 0; + if (m_curCol >= 0 && m_curCol < dbFormWidget()->orderedDataAwareWidgets()->count()) { + w = dbFormWidget()->orderedDataAwareWidgets()->at(m_curCol); + } if (w) { w->setFocus(); // re-focus, as we could have lost focus, e.g. when navigator button was clicked // select all