Skip to content

Commit

Permalink
Prefer one-argument constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
brdvd committed Jan 25, 2025
1 parent a6ac88a commit 1dda133
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/convertfunctor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -965,8 +965,8 @@ void ConvertToCmnFunctor::SplitDurationIntoCmn(
const int semiBrevisDots = (prolatioMajor) ? 1 : 0;
const int brevisDots = (tempusPerfectum) ? 1 : 0;

const Fraction semiBrevis = Fraction(1, 1) * abs(mensur->GetProlatio()) / 2;
const Fraction brevis = Fraction(1, 1) * abs(mensur->GetTempus());
const Fraction semiBrevis = Fraction(1) * abs(mensur->GetProlatio()) / 2;
const Fraction brevis = Fraction(1) * abs(mensur->GetTempus());

// First see if we are expecting a breve and if the duration is long enough
if (elementDur == DURATION_breve) {
Expand Down
2 changes: 1 addition & 1 deletion src/durationinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Fraction DurationInterface::GetInterfaceAlignmentMensuralDuration(

if (!currentMensur) {
LogWarning("No current mensur for calculating duration");
return Fraction(1, 1);
return Fraction(1);
}

if (this->HasNum() || this->HasNumbase()) {
Expand Down
6 changes: 3 additions & 3 deletions src/horizontalaligner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -516,15 +516,15 @@ void Alignment::Reset()
Object::Reset();

m_xRel = 0;
m_time = Fraction(0, 1);
m_time = Fraction(0);
m_type = ALIGNMENT_DEFAULT;

ClearGraceAligners();
this->ClearGraceAligners();
}

Alignment::~Alignment()
{
ClearGraceAligners();
this->ClearGraceAligners();
}

void Alignment::ClearGraceAligners()
Expand Down
8 changes: 4 additions & 4 deletions src/layerelement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ Fraction LayerElement::GetAlignmentDuration(
const AlignMeterParams &params, bool notGraceOnly, data_NOTATIONTYPE notationType) const
{
if (this->IsGraceNote() && notGraceOnly) {
return Fraction(0, 1);
return Fraction(0);
}

// Mensural chords are aligned looking at the duration of the notes
Expand Down Expand Up @@ -777,7 +777,7 @@ Fraction LayerElement::GetAlignmentDuration(
return (syllable->GetLast() == this) ? NEUME_MEDIUM_SPACE : NEUME_SMALL_SPACE;
}
else {
return Fraction(0, 1);
return Fraction(0);
}
}

Expand All @@ -791,7 +791,7 @@ Fraction LayerElement::GetSameAsContentAlignmentDuration(
const AlignMeterParams &params, bool notGraceOnly, data_NOTATIONTYPE notationType) const
{
if (!this->HasSameasLink() || !this->GetSameasLink()->Is({ BEAM, FTREM, TUPLET })) {
return Fraction(0, 1);
return Fraction(0);
}

const LayerElement *sameas = vrv_cast<const LayerElement *>(this->GetSameasLink());
Expand All @@ -804,7 +804,7 @@ Fraction LayerElement::GetContentAlignmentDuration(
const AlignMeterParams &params, bool notGraceOnly, data_NOTATIONTYPE notationType) const
{
if (!this->Is({ BEAM, FTREM, TUPLET })) {
return Fraction(0, 1);
return Fraction(0);
}

Fraction duration;
Expand Down
2 changes: 1 addition & 1 deletion src/view_element.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1166,7 +1166,7 @@ void View::DrawMRest(DeviceContext *dc, LayerElement *element, Layer *layer, Sta

const bool drawingCueSize = mRest->GetDrawingCueSize();
int x = mRest->GetDrawingX();
const bool isDouble = (measure->m_measureAligner.GetMaxTime() >= Fraction(2, 1));
const bool isDouble = (measure->m_measureAligner.GetMaxTime() >= Fraction(2));
int y = isDouble ? element->GetDrawingY() - m_doc->GetDrawingDoubleUnit(staffSize) : element->GetDrawingY();
char32_t rest = isDouble ? SMUFL_E4E2_restDoubleWhole : SMUFL_E4E3_restWhole;

Expand Down

0 comments on commit 1dda133

Please sign in to comment.