mirror of
https://github.com/fralx/LimeReport.git
synced 2025-11-20 06:30:03 +03:00
TOC generation has been fixed
This commit is contained in:
@@ -719,24 +719,35 @@ QVariant CallbackDatasource::dataByKeyField(const QString& columnName, const QSt
|
||||
{
|
||||
int backupCurrentRow = m_currentRow;
|
||||
QVariant result = QVariant();
|
||||
first();
|
||||
if (!checkIfEmpty()){
|
||||
int currentRow = 0;
|
||||
do {
|
||||
QVariant key = callbackData(keyColumnName, currentRow);
|
||||
|
||||
m_currentRow = m_lastKeyRow;
|
||||
if (next()){
|
||||
for (int i = 0; i < 10; ++i){
|
||||
QVariant key = callbackData(keyColumnName, m_currentRow);
|
||||
if (key == keyData){
|
||||
result = callbackData(columnName, currentRow);
|
||||
break;
|
||||
result = callbackData(columnName, m_currentRow);
|
||||
m_lastKeyRow = m_currentRow;
|
||||
m_currentRow = backupCurrentRow;
|
||||
return result;
|
||||
}
|
||||
currentRow++;
|
||||
} while (next());
|
||||
if (!next()) break;
|
||||
}
|
||||
}
|
||||
|
||||
first();
|
||||
if (backupCurrentRow != -1){
|
||||
for (int i = 0; i < backupCurrentRow; ++i)
|
||||
next();
|
||||
if (!checkIfEmpty()){
|
||||
do {
|
||||
QVariant key = callbackData(keyColumnName, m_currentRow);
|
||||
if (key == keyData){
|
||||
result = callbackData(columnName, m_currentRow);
|
||||
m_lastKeyRow = m_currentRow;
|
||||
m_currentRow = backupCurrentRow;
|
||||
return result;
|
||||
}
|
||||
} while (next());
|
||||
}
|
||||
|
||||
m_currentRow = backupCurrentRow;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user