Skip to content

Commit

Permalink
Silence harmless GCC warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Blake-Madden committed Jul 16, 2024
1 parent e68cd15 commit c4fabec
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions src/base/reportbuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4614,20 +4614,30 @@ namespace Wisteria
if (origin->IsOk())
{
if (origin->IsValueString())
{ loadStringToPosition(origin->GetValueString()); }
{
loadStringToPosition(origin->GetValueString());
}
else if (origin->IsValueNumber())
{ position = origin->GetValueNumber(); }
{
position = origin->GetValueNumber();
}
}
else if (positionNode->IsValueString())
{ loadStringToPosition(positionNode->GetValueString()); }
{
loadStringToPosition(positionNode->GetValueString());
}
else if (positionNode->IsValueNumber())
{ position = positionNode->GetValueNumber(); }
{
position = positionNode->GetValueNumber();
}
std::optional<double> doubleStartOffset =
positionNode->HasProperty(L"offset") ?
std::optional<double>(positionNode->GetProperty(L"offset")->GetValueNumber()) :
std::nullopt;
std::optional<double>(positionNode->GetProperty(L"offset")->GetValueNumber()) :
std::nullopt;
if (position.has_value() && doubleStartOffset.has_value())
{ position.value() += doubleStartOffset.value(); }
{
position = position.value_or(0) + doubleStartOffset.value();
}

return position;
}
Expand Down

0 comments on commit c4fabec

Please sign in to comment.