Core: Set unit scheme when switching between unsaved documents

Fixes #17297
This commit is contained in:
wmayer
2024-10-20 20:13:01 +02:00
committed by Yorik van Havre
parent 1576df5937
commit 5435b3e4db

View File

@@ -1027,7 +1027,7 @@ void Application::slotActiveDocument(const App::Document& Doc)
// Update the application to show the unit change
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath(
"User parameter:BaseApp/Preferences/Units");
if (Doc.FileName.getValue()[0] != '\0' && !hGrp->GetBool("IgnoreProjectSchema")) {
if (!hGrp->GetBool("IgnoreProjectSchema")) {
int userSchema = Doc.UnitSystem.getValue();
Base::UnitsApi::setSchema(static_cast<Base::UnitSystem>(userSchema));
getMainWindow()->setUserSchema(userSchema);