Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
FlachyJoe authored and wwmayer committed Oct 9, 2023
1 parent 908f6c9 commit 191aee5
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/App/Document.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -833,10 +833,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");
Expand Down

0 comments on commit 191aee5

Please sign in to comment.