[TD]fix handling of company name in template fields

This commit is contained in:
wandererfan
2024-06-29 10:34:15 -04:00
committed by WandererFan
parent f53fd6d474
commit bc51b1ac23
2 changed files with 8 additions and 2 deletions

View File

@@ -145,8 +145,11 @@ QString DrawTemplate::getAutofillValue(const QString &id) const
QDateTime date = QDateTime::currentDateTime();
return date.toString(QLocale().dateFormat(QLocale::ShortFormat));
}
// organization
else if (id.compare(QString::fromUtf8(Autofill::Organization)) == 0) {
// organization ( also organisation/owner/company )
else if (id.compare(QString::fromUtf8(Autofill::Organization)) == 0 ||
id.compare(QString::fromUtf8(Autofill::Organisation)) == 0 ||
id.compare(QString::fromUtf8(Autofill::Owner)) == 0 ||
id.compare(QString::fromUtf8(Autofill::Company)) == 0 ) {
auto value = QString::fromUtf8(doc->Company.getValue());
if (!value.isEmpty()) {
return value;

View File

@@ -74,6 +74,9 @@ public:
static constexpr const char *Author = "author";
static constexpr const char *Date = "date";
static constexpr const char *Organization = "organization";
static constexpr const char *Organisation = "organisation";
static constexpr const char *Owner = "owner";
static constexpr const char *Company = "company";
static constexpr const char *Scale = "scale";
static constexpr const char *Sheet = "sheet";
static constexpr const char *Title = "title";