Base: Quantity: use isDimensionless whenever feasible
Quantity is often queried for Unit just to see if it has a dimension. Ask Quantity directly using isDimensionless() method and modify that method not to care about Quantity value validity; no user was ever asking for value validity.
This commit is contained in:
@@ -201,8 +201,8 @@ int EditDatumDialog::exec(bool atCursor)
|
||||
void EditDatumDialog::accepted()
|
||||
{
|
||||
Base::Quantity newQuant = ui_ins_datum->labelEdit->value();
|
||||
if (newQuant.isQuantity() || (Constr->Type == Sketcher::SnellsLaw && newQuant.isDimensionless())
|
||||
|| (Constr->Type == Sketcher::Weight && newQuant.isDimensionless())) {
|
||||
if (Constr->Type == Sketcher::SnellsLaw || Constr->Type == Sketcher::Weight
|
||||
|| !newQuant.isDimensionless()) {
|
||||
|
||||
// save the value for the history
|
||||
ui_ins_datum->labelEdit->pushToHistory();
|
||||
|
||||
Reference in New Issue
Block a user