pull/314
This commit is contained in:
Laurent Trinques 2024-12-22 14:25:30 +01:00
parent fef351df8b
commit 3992c60c45
2 changed files with 11 additions and 15 deletions

View File

@ -222,11 +222,7 @@ void DynamicTextFieldEditor::fillInfoComboBox()
if(type & ElementData::AllReport) {
strl = QETInformation::folioReportInfoKeys();
}
else {
strl = QETInformation::elementInfoKeys();
}
//We use a QMap because the keys of the map are sorted, then no matter the current local,
//We use a QMap because the keys of the map are sorted, then no matter the current local,
//the value of the combo box are always alphabetically sorted
QMap <QString, QString> info_map;
for(const QString& str : strl)
@ -235,6 +231,13 @@ void DynamicTextFieldEditor::fillInfoComboBox()
for (const QString& key : info_map.keys())
ui -> m_elmt_info_cb -> addItem(key, info_map.value(key));
}
else {
strl = QETInformation::elementInfoKeys();
for (int i=0; i<strl.size();++i) {
ui -> m_elmt_info_cb -> addItem(strl[i], QETInformation::translatedInfoKey(strl[i]));
}
}
}
void DynamicTextFieldEditor::on_m_x_sb_editingFinished()

View File

@ -67,16 +67,9 @@ void CompositeTextEditDialog::setUpComboBox()
qstrl = QETInformation::elementInfoKeys();
qstrl.removeAll("formula");
}
//We use a QMap because the keys of the map are sorted, then no matter the current local,
//the value of the combo box are always alphabetically sorted
QMap <QString, QString> info_map;
for(const QString& str : qstrl) {
info_map.insert(QETInformation::translatedInfoKey(str),
is_report ? QETInformation::folioReportInfoToVar(str) : QETInformation::elementInfoToVar(str));
}
for(const QString& key : info_map.keys()) {
ui->m_info_cb->addItem(key, info_map.value(key));
for (int i=0; i<qstrl.size();++i) {
ui -> m_info_cb -> addItem(qstrl[i], QETInformation::translatedInfoKey(qstrl[i]));
}
}