This commit is contained in:
Florian Foinant-Willig
2023-11-11 10:59:19 -03:00
committed by Adrián Insaurralde Avalos
parent 9aebd3fe5a
commit 198e7ef9b5
+8 -4
View File
@@ -830,10 +830,14 @@ Document::Document(const char* documentName)
auto paramGrp {App::GetApplication().GetParameterGroupByPath(
"User parameter:BaseApp/Preferences/Document")};
auto index = static_cast<int>(paramGrp->GetInt("prefLicenseType", 0));
const char* name = App::licenseItems.at(index).at(App::posnOfFullName);
const char* url = App::licenseItems.at(index).at(App::posnOfUrl);
std::string licenseUrl = (paramGrp->GetASCII("prefLicenseUrl", url));
const char* name = "";
const char* url = "";
std::string licenseUrl = "";
if (index >= 0 && index < App::countOfLicenses) {
name = App::licenseItems.at(index).at(App::posnOfFullName);
url = App::licenseItems.at(index).at(App::posnOfUrl);
licenseUrl = (paramGrp->GetASCII("prefLicenseUrl", url));
}
ADD_PROPERTY_TYPE(License, (name), 0, Prop_None, "License string of the Item");
ADD_PROPERTY_TYPE(
LicenseURL, (licenseUrl.c_str()), 0, Prop_None, "URL to the license text/contract");