0
0
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:
Arin Alexander
2020-02-03 21:50:28 +03:00
parent 2b5a79e79c
commit f73055e347
8 changed files with 40 additions and 21 deletions

View File

@@ -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;
}