Skip to content

Commit

Permalink
PartDesign: [skip ci] fixes #4371: Changing Hole profile from ISO to …
Browse files Browse the repository at this point in the history
…nothing is not possible: "Hole: Cannot get value from invalid enumeration"
  • Loading branch information
wwmayer committed Sep 23, 2020
1 parent 4a1f813 commit fe3f1b5
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Mod/PartDesign/App/FeatureHole.cpp
Expand Up @@ -599,6 +599,9 @@ void Hole::onChanged(const App::Property *prop)
ThreadSize.setEnums(ThreadSize_None_Enums);
ThreadClass.setEnums(ThreadClass_None_Enums);
HoleCutType.setEnums(HoleCutType_None_Enums);
ThreadSize.setValue(0L);
ThreadClass.setValue(0L);
HoleCutType.setValue(0L);
Threaded.setReadOnly(true);
ThreadSize.setReadOnly(true);
ThreadFit.setReadOnly(true);
Expand Down Expand Up @@ -627,6 +630,9 @@ void Hole::onChanged(const App::Property *prop)
ThreadSize.setEnums(ThreadSize_ISOmetric_Enums);
ThreadClass.setEnums(ThreadClass_ISOmetric_Enums);
HoleCutType.setEnums(HoleCutType_ISOmetric_Enums);
ThreadSize.setValue(0L);
ThreadClass.setValue(0L);
HoleCutType.setValue(0L);
Threaded.setReadOnly(false);
ThreadSize.setReadOnly(false);
ThreadFit.setReadOnly(false);
Expand All @@ -640,6 +646,9 @@ void Hole::onChanged(const App::Property *prop)
ThreadSize.setEnums(ThreadSize_ISOmetricfine_Enums);
ThreadClass.setEnums(ThreadClass_ISOmetricfine_Enums);
HoleCutType.setEnums(HoleCutType_ISOmetricfine_Enums);
ThreadSize.setValue(0L);
ThreadClass.setValue(0L);
HoleCutType.setValue(0L);
Threaded.setReadOnly(false);
ThreadSize.setReadOnly(false);
ThreadFit.setReadOnly(false);
Expand All @@ -653,6 +662,9 @@ void Hole::onChanged(const App::Property *prop)
ThreadSize.setEnums(ThreadSize_UNC_Enums);
ThreadClass.setEnums(ThreadClass_UNC_Enums);
HoleCutType.setEnums(HoleCutType_UNC_Enums);
ThreadSize.setValue(0L);
ThreadClass.setValue(0L);
HoleCutType.setValue(0L);
Threaded.setReadOnly(false);
ThreadSize.setReadOnly(false);
ThreadFit.setReadOnly(false);
Expand Down Expand Up @@ -680,6 +692,9 @@ void Hole::onChanged(const App::Property *prop)
ThreadSize.setEnums(ThreadSize_UNF_Enums);
ThreadClass.setEnums(ThreadClass_UNF_Enums);
HoleCutType.setEnums(HoleCutType_UNF_Enums);
ThreadSize.setValue(0L);
ThreadClass.setValue(0L);
HoleCutType.setValue(0L);
Threaded.setReadOnly(false);
ThreadSize.setReadOnly(false);
ThreadFit.setReadOnly(false);
Expand Down Expand Up @@ -707,6 +722,9 @@ void Hole::onChanged(const App::Property *prop)
ThreadSize.setEnums(ThreadSize_UNEF_Enums);
ThreadClass.setEnums(ThreadClass_UNEF_Enums);
HoleCutType.setEnums(HoleCutType_UNEF_Enums);
ThreadSize.setValue(0L);
ThreadClass.setValue(0L);
HoleCutType.setValue(0L);
Threaded.setReadOnly(false);
ThreadSize.setReadOnly(false);
ThreadFit.setReadOnly(false);
Expand Down

2 comments on commit fe3f1b5

@berberic2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit seems to break PartDesign feature Hole UI
see: https://forum.freecadweb.org/viewtopic.php?f=19&t=50695

@wwmayer
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted the commit.

Please sign in to comment.