[TD]respect locale for date autofill (#18132)
* [TD]respect locale for date autofill * [TD]fix merge conflict * Apply suggestions from code review --------- Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
This commit is contained in:
@@ -77,14 +77,21 @@ void TemplateTextField::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||
|
||||
ui.setFieldName(fieldNameStr);
|
||||
ui.setFieldContent(tmplte->EditableTexts[fieldNameStr]);
|
||||
|
||||
auto qName = QString::fromStdString(fieldNameStr);
|
||||
auto svgTemplate = dynamic_cast<DrawSVGTemplate*>(tmplte);
|
||||
if (svgTemplate) {
|
||||
// preset the autofill with the current value - something might have changed since this field was created
|
||||
m_autofillString = svgTemplate->getAutofillByEditableName(qName);
|
||||
}
|
||||
ui.setAutofillContent(m_autofillString.toStdString());
|
||||
|
||||
if (ui.exec() == QDialog::Accepted) {
|
||||
QString qsClean = ui.getFieldContent();
|
||||
std::string utf8Content = qsClean.toUtf8().constData();
|
||||
if (ui.getAutofillState()) {
|
||||
auto svgTemplate = dynamic_cast<DrawSVGTemplate*>(tmplte);
|
||||
if (svgTemplate) {
|
||||
// unlikely, but something could have changed since we grabbed the autofill value
|
||||
QString fieldName = QString::fromStdString(fieldNameStr);
|
||||
QString autofillValue = svgTemplate->getAutofillByEditableName(fieldName);
|
||||
if (!autofillValue.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user