Remove magic numbers and hard type enums in DimensionFormatter.h.h

- Remove currently present magic numbers
- Hard type enums, so magic numbers can no longer be introduced. We don't want people to introduce magic numbers.
This commit is contained in:
Benjamin Bræstrup Sayoc
2025-01-30 22:45:48 +01:00
committed by WandererFan
parent 97b34f9c57
commit c53679422b
7 changed files with 56 additions and 41 deletions

View File

@@ -1981,9 +1981,10 @@ void CmdTechDrawExtensionArcLengthAnnotation::activated(int iMsg)
// Use virtual dimension view helper to format resulting value
TechDraw::DrawViewDimension helperDim;
using Format = DimensionFormatter::Format;
std::string valueStr = helperDim.formatValue(totalLength,
QString::fromUtf8(helperDim.FormatSpec.getStrValue().data()),
helperDim.isMultiValueSchema() ? 0 : 1);
helperDim.isMultiValueSchema() ? Format::UNALTERED : Format::FORMATTED);
balloon->Text.setValue("" + valueStr);
// Set balloon format to be referencing dimension-like