diff --git a/sources/editor/ui/dynamictextfieldeditor.cpp b/sources/editor/ui/dynamictextfieldeditor.cpp index 6a9816962..15c3872e3 100644 --- a/sources/editor/ui/dynamictextfieldeditor.cpp +++ b/sources/editor/ui/dynamictextfieldeditor.cpp @@ -222,7 +222,11 @@ void DynamicTextFieldEditor::fillInfoComboBox() if(type & ElementData::AllReport) { strl = QETInformation::folioReportInfoKeys(); - //We use a QMap because the keys of the map are sorted, then no matter the current local, + } + else { + strl = QETInformation::elementInfoKeys(); + } + //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 info_map; for(const QString& str : strl) @@ -231,13 +235,6 @@ 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 m_elmt_info_cb -> addItem(strl[i], QETInformation::translatedInfoKey(strl[i])); - } - } } void DynamicTextFieldEditor::on_m_x_sb_editingFinished() diff --git a/sources/ui/compositetexteditdialog.cpp b/sources/ui/compositetexteditdialog.cpp index 63deb7091..045615e3d 100644 --- a/sources/ui/compositetexteditdialog.cpp +++ b/sources/ui/compositetexteditdialog.cpp @@ -67,9 +67,16 @@ void CompositeTextEditDialog::setUpComboBox() qstrl = QETInformation::elementInfoKeys(); qstrl.removeAll("formula"); } - for (int i=0; i m_info_cb -> addItem(qstrl[i], QETInformation::translatedInfoKey(qstrl[i])); - + + //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 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)); } }