comparison data/model/EditableDenseThreeDimensionalModel.cpp @ 942:0009b2b066e0

Merge
author Chris Cannam
date Wed, 02 Jul 2014 08:42:33 +0100
parents 3be40cf40c49 5bd05a24e32a
children cc27f35aa75c
comparison
equal deleted inserted replaced
941:3be40cf40c49 942:0009b2b066e0
155 155
156 EditableDenseThreeDimensionalModel::Column 156 EditableDenseThreeDimensionalModel::Column
157 EditableDenseThreeDimensionalModel::getColumn(int index) const 157 EditableDenseThreeDimensionalModel::getColumn(int index) const
158 { 158 {
159 QReadLocker locker(&m_lock); 159 QReadLocker locker(&m_lock);
160 if (int(index) >= m_data.size()) return Column(); 160 if (index < 0 || index >= m_data.size()) return Column();
161 return expandAndRetrieve(index); 161 return expandAndRetrieve(index);
162 } 162 }
163 163
164 float 164 float
165 EditableDenseThreeDimensionalModel::getValueAt(int index, int n) const 165 EditableDenseThreeDimensionalModel::getValueAt(int index, int n) const
388 } 388 }
389 389
390 QString 390 QString
391 EditableDenseThreeDimensionalModel::getBinName(int n) const 391 EditableDenseThreeDimensionalModel::getBinName(int n) const
392 { 392 {
393 if ((int)m_binNames.size() > n) return m_binNames[n]; 393 if (n >= 0 && (int)m_binNames.size() > n) return m_binNames[n];
394 else return ""; 394 else return "";
395 } 395 }
396 396
397 void 397 void
398 EditableDenseThreeDimensionalModel::setBinName(int n, QString name) 398 EditableDenseThreeDimensionalModel::setBinName(int n, QString name)