TechDraw: Use freecad_cast whenever possible

This commit is contained in:
Kacper Donat
2025-04-25 00:05:45 +02:00
committed by Benjamin Nauck
parent 4bd2cdeb2a
commit b999ce0336
45 changed files with 94 additions and 94 deletions

View File

@@ -112,7 +112,7 @@ DrawViewDimension* DrawDimHelper::makeExtentDim(DrawViewPart* dvp, std::vector<s
Base::Interpreter().runStringArg(
"App.activeDocument().%s.DirExtent = %d", dimName.c_str(), dimNum);
auto* dimExt = dynamic_cast<DrawViewDimExtent*>(doc->getObject(dimName.c_str()));
auto* dimExt = freecad_cast<DrawViewDimExtent*>(doc->getObject(dimName.c_str()));
if (!dimExt) {
throw Base::TypeError("Dim extent not found");
}
@@ -174,7 +174,7 @@ void DrawDimHelper::makeExtentDim3d(DrawViewPart* dvp, ReferenceVector reference
Base::Interpreter().runStringArg(
"App.activeDocument().%s.DirExtent = %d", dimName.c_str(), dimNum);
auto* dimExt = dynamic_cast<DrawViewDimExtent*>(doc->getObject(dimName.c_str()));
auto* dimExt = freecad_cast<DrawViewDimExtent*>(doc->getObject(dimName.c_str()));
if (!dimExt) {
throw Base::TypeError("Dim extent not found");
}