mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-20 13:23:13 -07:00
Refactor UnitConverterDataLoader.cpp to correctly add pressure units
The commit fixes a bug in the code where the pressure units were not being added correctly. The issue was resolved by moving the `emplace` statement after adding the `pressureUnits` vector.
This commit is contained in:
parent
c251337a53
commit
a01f7a9e3c
1 changed files with 1 additions and 1 deletions
|
@ -756,9 +756,9 @@ void UnitConverterDataLoader::GetUnits(_In_ unordered_map<ViewMode, vector<Order
|
||||||
OrderedUnit{ UnitConverterUnits::Pressure_Pascal, GetLocalizedStringName(L"UnitName_Pascal"), GetLocalizedStringName(L"UnitAbbreviation_Pascal"), 5 });
|
OrderedUnit{ UnitConverterUnits::Pressure_Pascal, GetLocalizedStringName(L"UnitName_Pascal"), GetLocalizedStringName(L"UnitAbbreviation_Pascal"), 5 });
|
||||||
pressureUnits.push_back(OrderedUnit{
|
pressureUnits.push_back(OrderedUnit{
|
||||||
UnitConverterUnits::Pressure_PSI, GetLocalizedStringName(L"UnitName_PSI"), GetLocalizedStringName(L"UnitAbbreviation_PSI"), 6, false, false, false });
|
UnitConverterUnits::Pressure_PSI, GetLocalizedStringName(L"UnitName_PSI"), GetLocalizedStringName(L"UnitAbbreviation_PSI"), 6, false, false, false });
|
||||||
unitMap.emplace(ViewMode::Pressure, pressureUnits);
|
|
||||||
pressureUnits.push_back(OrderedUnit{
|
pressureUnits.push_back(OrderedUnit{
|
||||||
UnitConverterUnits::Pressure_Torr, GetLocalizedStringName(L"UnitName_Torr"), GetLocalizedStringName(L"UnitAbbreviation_Torr"), 7});
|
UnitConverterUnits::Pressure_Torr, GetLocalizedStringName(L"UnitName_Torr"), GetLocalizedStringName(L"UnitAbbreviation_Torr"), 7});
|
||||||
|
unitMap.emplace(ViewMode::Pressure, pressureUnits);
|
||||||
|
|
||||||
vector<OrderedUnit> angleUnits;
|
vector<OrderedUnit> angleUnits;
|
||||||
angleUnits.push_back(OrderedUnit{ UnitConverterUnits::Angle_Degree,
|
angleUnits.push_back(OrderedUnit{ UnitConverterUnits::Angle_Degree,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue