From 8a75dcd09d6630ac24e049af9ebb1164fdfac9bf Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 7 Mar 2019 11:56:25 -0500 Subject: [PATCH 1/5] Switch urls from http: to https: (#137) --- CONTRIBUTING.md | 4 ++-- NOTICE.txt | 2 +- README.md | 2 +- docs/NewFeatureProcess.md | 4 ++-- src/CalcManager/CalculatorResource.h | 2 +- src/CalcViewModel/CalcViewModel.vcxproj | 2 +- src/Calculator/Calculator.vcxproj | 2 +- .../Views/CalculatorProgrammerBitFlipPanel.xaml.cpp | 2 +- .../Views/CalculatorScientificAngleButtons.xaml.cpp | 2 +- src/Calculator/Views/CalculatorStandardOperators.xaml.cpp | 2 +- src/Calculator/Views/DateCalculator.xaml.cpp | 2 +- src/Calculator/Views/HistoryList.xaml.cpp | 2 +- src/Calculator/Views/Memory.xaml.cpp | 2 +- src/Calculator/Views/NumberPad.xaml.cpp | 2 +- src/Calculator/Views/SupplementaryResults.xaml.cpp | 2 +- src/Calculator/Views/UnitConverter.xaml.cpp | 2 +- src/CalculatorUnitTests/UnitTestApp.rd.xml | 2 +- src/CalculatorUnitTests/UnitTestApp.xaml.cpp | 2 +- 18 files changed, 20 insertions(+), 20 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e0217867..9bab5f16 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -41,7 +41,7 @@ To learn how to build the code and run tests, follow the instructions in the [RE ### Style guidelines The code in this project uses several different coding styles, depending on the age and history of the code. Please attempt to match the style of surrounding code as much as possible. In new -components, prefer the patterns described in the [C++ core guidelines](http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines) +components, prefer the patterns described in the [C++ core guidelines](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines) and the [modern C++/WinRT language projections](https://docs.microsoft.com/en-us/windows/uwp/cpp-and-winrt-apis/). ### Testing @@ -91,4 +91,4 @@ You don't need to sign a CLA until you're ready to create a pull request. When y created, it is classified by a bot. If the change is trivial (i.e. you just fixed a typo) then the bot will label the PR `cla-not-required`. Otherwise, it's classified as `cla-required`. In that case, the system will also tell you how you can sign the CLA. Once you have signed a CLA, the -current and all future pull requests will be labeled as `cla-signed`. \ No newline at end of file +current and all future pull requests will be labeled as `cla-signed`. diff --git a/NOTICE.txt b/NOTICE.txt index 60d809cb..d115a691 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -2,7 +2,7 @@ THIRD PARTY SOFTWARE NOTICES AND INFORMATION Do Not Translate or Localize This software incorporates material from third parties. Microsoft makes certain -open source code available at http://3rdpartysource.microsoft.com, or you may +open source code available at https://3rdpartysource.microsoft.com, or you may send a check or money order for US $5.00, including the product name, the open source component name, and version number, to: diff --git a/README.md b/README.md index ba76c48b..23afe0de 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ For information regarding Windows Calculator plans and release schedule, please ## Data / Telemetry This project collects usage data and sends it to Microsoft to help improve our products and services. -Read our [privacy statement](http://go.microsoft.com/fwlink/?LinkId=521839) to learn more. +Read our [privacy statement](https://go.microsoft.com/fwlink/?LinkId=521839) to learn more. Telemetry is disabled in development builds by default, and can be enabled with the `SEND_TELEMETRY` build flag. diff --git a/docs/NewFeatureProcess.md b/docs/NewFeatureProcess.md index 6aa2e22a..66c9a635 100644 --- a/docs/NewFeatureProcess.md +++ b/docs/NewFeatureProcess.md @@ -131,9 +131,9 @@ new features, the Microsoft team considers at least these items: - [ ] Microsoft must plan to keep these dependencies secure and functional for the lifetime of the app (which might be several years). - [ ] The app should be fully functional if some network requests are slow or fail. Tools like - [Fiddler](http://docs.telerik.com/fiddler/knowledgebase/fiddlerscript/perftesting) + [Fiddler](https://docs.telerik.com/fiddler/knowledgebase/fiddlerscript/perftesting) can be used to simulate slow or failed requests. ## Step 4: Final product review and merge to master After the technical review is complete, the product team will review the finished product to make -sure the final implementation is ready to [release to Windows customers](Roadmap.md#Releases). \ No newline at end of file +sure the final implementation is ready to [release to Windows customers](Roadmap.md#Releases). diff --git a/src/CalcManager/CalculatorResource.h b/src/CalcManager/CalculatorResource.h index 51db56da..51bdd8b6 100644 --- a/src/CalcManager/CalculatorResource.h +++ b/src/CalcManager/CalculatorResource.h @@ -15,7 +15,7 @@ namespace CalculationManager // and the ids to define them with can be seen in EngineStrings.h // with SIDS prefix. Additionally it must provide values for string // ids "sDecimal", "sThousand" and "sGrouping". See - // http://technet.microsoft.com/en-us/library/cc782655(v=ws.10).aspx + // https://technet.microsoft.com/en-us/library/cc782655(v=ws.10).aspx // for what these values refer to. virtual std::wstring GetCEngineString(const std::wstring& id) = 0; }; diff --git a/src/CalcViewModel/CalcViewModel.vcxproj b/src/CalcViewModel/CalcViewModel.vcxproj index 8ace7400..33715487 100644 --- a/src/CalcViewModel/CalcViewModel.vcxproj +++ b/src/CalcViewModel/CalcViewModel.vcxproj @@ -402,7 +402,7 @@ - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see https://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. diff --git a/src/Calculator/Calculator.vcxproj b/src/Calculator/Calculator.vcxproj index 7dd449e1..60aef8f3 100644 --- a/src/Calculator/Calculator.vcxproj +++ b/src/Calculator/Calculator.vcxproj @@ -844,7 +844,7 @@ - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see https://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. diff --git a/src/Calculator/Views/CalculatorProgrammerBitFlipPanel.xaml.cpp b/src/Calculator/Views/CalculatorProgrammerBitFlipPanel.xaml.cpp index a6b8bfeb..579c627e 100644 --- a/src/Calculator/Views/CalculatorProgrammerBitFlipPanel.xaml.cpp +++ b/src/Calculator/Views/CalculatorProgrammerBitFlipPanel.xaml.cpp @@ -23,7 +23,7 @@ using namespace Windows::UI::Xaml::Controls; using namespace Windows::UI::Xaml::Data; using namespace Windows::UI::Xaml::Input; -// The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236 +// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236 CalculatorProgrammerBitFlipPanel::CalculatorProgrammerBitFlipPanel() : m_updatingCheckedStates(false) diff --git a/src/Calculator/Views/CalculatorScientificAngleButtons.xaml.cpp b/src/Calculator/Views/CalculatorScientificAngleButtons.xaml.cpp index 981b2168..16f0cc5d 100644 --- a/src/Calculator/Views/CalculatorScientificAngleButtons.xaml.cpp +++ b/src/Calculator/Views/CalculatorScientificAngleButtons.xaml.cpp @@ -27,7 +27,7 @@ using namespace Windows::UI::Xaml::Navigation; using namespace Windows::UI::ViewManagement; using namespace Windows::UI::Core; -// The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236 +// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236 CalculatorScientificAngleButtons::CalculatorScientificAngleButtons() : m_isErrorVisualState(false) diff --git a/src/Calculator/Views/CalculatorStandardOperators.xaml.cpp b/src/Calculator/Views/CalculatorStandardOperators.xaml.cpp index 672d1a6e..a74a91f8 100644 --- a/src/Calculator/Views/CalculatorStandardOperators.xaml.cpp +++ b/src/Calculator/Views/CalculatorStandardOperators.xaml.cpp @@ -22,7 +22,7 @@ using namespace Windows::UI::Xaml::Input; using namespace Windows::UI::Xaml::Media; using namespace Windows::UI::Xaml::Navigation; -// The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236 +// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236 CalculatorStandardOperators::CalculatorStandardOperators() : m_isErrorVisualState(false) diff --git a/src/Calculator/Views/DateCalculator.xaml.cpp b/src/Calculator/Views/DateCalculator.xaml.cpp index 386e5243..0df8cd3e 100644 --- a/src/Calculator/Views/DateCalculator.xaml.cpp +++ b/src/Calculator/Views/DateCalculator.xaml.cpp @@ -36,7 +36,7 @@ using namespace Windows::UI::Xaml::Input; using namespace Windows::UI::Xaml::Media; using namespace Windows::UI::Xaml::Navigation; -// The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236 +// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236 DateCalculator::DateCalculator() { diff --git a/src/Calculator/Views/HistoryList.xaml.cpp b/src/Calculator/Views/HistoryList.xaml.cpp index 0705884e..76786330 100644 --- a/src/Calculator/Views/HistoryList.xaml.cpp +++ b/src/Calculator/Views/HistoryList.xaml.cpp @@ -29,7 +29,7 @@ using namespace Windows::UI::ViewManagement; namespace MUXC = Microsoft::UI::Xaml::Controls; -// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=390556 +// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=390556 DEPENDENCY_PROPERTY_INITIALIZATION(HistoryList, RowHeight); diff --git a/src/Calculator/Views/Memory.xaml.cpp b/src/Calculator/Views/Memory.xaml.cpp index ab69417b..fc69b10c 100644 --- a/src/Calculator/Views/Memory.xaml.cpp +++ b/src/Calculator/Views/Memory.xaml.cpp @@ -31,7 +31,7 @@ using namespace Windows::UI::Xaml::Media; using namespace Windows::UI::Xaml::Navigation; using namespace Windows::UI::ViewManagement; -// The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236 +// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236 DEPENDENCY_PROPERTY_INITIALIZATION(Memory, RowHeight); diff --git a/src/Calculator/Views/NumberPad.xaml.cpp b/src/Calculator/Views/NumberPad.xaml.cpp index 7c51f040..714aeabf 100644 --- a/src/Calculator/Views/NumberPad.xaml.cpp +++ b/src/Calculator/Views/NumberPad.xaml.cpp @@ -27,7 +27,7 @@ using namespace Windows::UI::Xaml::Media; using namespace Windows::UI::Xaml::Navigation; using namespace CalculatorApp::Common; -// The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236 +// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236 DEPENDENCY_PROPERTY_INITIALIZATION(NumberPad, ButtonStyle); diff --git a/src/Calculator/Views/SupplementaryResults.xaml.cpp b/src/Calculator/Views/SupplementaryResults.xaml.cpp index e5d10494..d598ae93 100644 --- a/src/Calculator/Views/SupplementaryResults.xaml.cpp +++ b/src/Calculator/Views/SupplementaryResults.xaml.cpp @@ -25,7 +25,7 @@ using namespace Windows::UI::Xaml::Interop; using namespace Windows::UI::Xaml::Media; using namespace Windows::UI::Xaml::Navigation; -// The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236 +// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236 Object^ DelighterUnitToStyleConverter::Convert(Object^ value, TypeName /*targetType*/, Object^ /*parameter*/, String^ /*language*/) { diff --git a/src/Calculator/Views/UnitConverter.xaml.cpp b/src/Calculator/Views/UnitConverter.xaml.cpp index add80774..1116c04d 100644 --- a/src/Calculator/Views/UnitConverter.xaml.cpp +++ b/src/Calculator/Views/UnitConverter.xaml.cpp @@ -38,7 +38,7 @@ using namespace Windows::UI::Xaml::Media; using namespace Windows::UI::Xaml::Navigation; using namespace Windows::UI::ViewManagement; -// The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236 +// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236 // Calculate number of 100-nanosecond intervals in 500 milliseconds. // There are 10,000 intervals in 1 ms. diff --git a/src/CalculatorUnitTests/UnitTestApp.rd.xml b/src/CalculatorUnitTests/UnitTestApp.rd.xml index 4a861a6f..b84bd4ba 100644 --- a/src/CalculatorUnitTests/UnitTestApp.rd.xml +++ b/src/CalculatorUnitTests/UnitTestApp.rd.xml @@ -3,7 +3,7 @@ developers. However, you can modify these parameters to modify the behavior of the .NET Native optimizer. - Runtime Directives are documented at http://go.microsoft.com/fwlink/?LinkID=391919 + Runtime Directives are documented at https://go.microsoft.com/fwlink/?LinkID=391919 To fully enable reflection for App1.MyClass and all of its public/private members diff --git a/src/CalculatorUnitTests/UnitTestApp.xaml.cpp b/src/CalculatorUnitTests/UnitTestApp.xaml.cpp index c9d685ad..de9d5bb1 100644 --- a/src/CalculatorUnitTests/UnitTestApp.xaml.cpp +++ b/src/CalculatorUnitTests/UnitTestApp.xaml.cpp @@ -25,7 +25,7 @@ using namespace Windows::UI::Xaml::Interop; using namespace Windows::UI::Xaml::Media; using namespace Windows::UI::Xaml::Navigation; -// The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=402347&clcid=0x409 +// The Blank Application template is documented at https://go.microsoft.com/fwlink/?LinkId=402347&clcid=0x409 /// /// Initializes the singleton application object. This is the first line of authored code From 20afac5572d5a25a5cd5fed70dabc64f239f5661 Mon Sep 17 00:00:00 2001 From: Rudy Huyn Date: Thu, 7 Mar 2019 09:24:34 -0800 Subject: [PATCH 2/5] Modify how default units are selected for conversions (#126) --- .../DataLoaders/UnitConverterDataLoader.cpp | 79 ++++++++----------- .../DataLoaders/UnitConverterDataLoader.h | 1 - 2 files changed, 34 insertions(+), 46 deletions(-) diff --git a/src/CalcViewModel/DataLoaders/UnitConverterDataLoader.cpp b/src/CalcViewModel/DataLoaders/UnitConverterDataLoader.cpp index 754b3ee8..19ee3baf 100644 --- a/src/CalcViewModel/DataLoaders/UnitConverterDataLoader.cpp +++ b/src/CalcViewModel/DataLoaders/UnitConverterDataLoader.cpp @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #include "pch.h" @@ -156,27 +156,34 @@ void UnitConverterDataLoader::GetCategories(_In_ shared_ptr>& unitMap) { - bool USSource, USTarget; - bool UKSource, UKTarget; - bool Source, Target; + // US + Federated States of Micronesia, Marshall Islands, Palau + bool useUSCustomaryAndFahrenheit = m_currentRegionCode == L"US" || + m_currentRegionCode == L"PW" || + m_currentRegionCode == L"FM" || + m_currentRegionCode == L"MH" || + m_currentRegionCode == L"PW"; - USSource = (GetRegion() == L"US") ? true : false; - USTarget = USSource; + // useUSCustomaryAndFahrenheit + Liberia + // Source: https://en.wikipedia.org/wiki/Metrication + bool useUSCustomary = useUSCustomaryAndFahrenheit || m_currentRegionCode == L"LR"; - UKSource = (GetRegion() == L"UK") ? true : false; - UKTarget = UKSource; + // Use 'Système International' (International System of Units - Metrics) + bool useSI = !useUSCustomary; - Source = (GetRegion() == L"Others") ? true : false; - Target = Source; + // useUSCustomaryAndFahrenheit + the Bahamas, the Cayman Islands and Liberia + // Source: http://en.wikipedia.org/wiki/Fahrenheit + bool useFahrenheit = useUSCustomaryAndFahrenheit || m_currentRegionCode == "BS" || m_currentRegionCode == "KY" || m_currentRegionCode == "LR"; + + bool useWattInsteadOfKilowatt = m_currentRegionCode == "GB"; vector areaUnits; areaUnits.push_back(OrderedUnit{ UnitConverterUnits::Area_Acre, GetLocalizedStringName(L"UnitName_Acre"), GetLocalizedStringName(L"UnitAbbreviation_Acre"), 9 }); areaUnits.push_back(OrderedUnit{ UnitConverterUnits::Area_Hectare, GetLocalizedStringName(L"UnitName_Hectare"), GetLocalizedStringName(L"UnitAbbreviation_Hectare"), 4 }); areaUnits.push_back(OrderedUnit{ UnitConverterUnits::Area_SquareCentimeter, GetLocalizedStringName(L"UnitName_SquareCentimeter"), GetLocalizedStringName(L"UnitAbbreviation_SquareCentimeter"), 2 }); - areaUnits.push_back(OrderedUnit{ UnitConverterUnits::Area_SquareFoot, GetLocalizedStringName(L"UnitName_SquareFoot"), GetLocalizedStringName(L"UnitAbbreviation_SquareFoot"), 7, (UKSource || Source), USTarget, false }); + areaUnits.push_back(OrderedUnit{ UnitConverterUnits::Area_SquareFoot, GetLocalizedStringName(L"UnitName_SquareFoot"), GetLocalizedStringName(L"UnitAbbreviation_SquareFoot"), 7, useSI, useUSCustomary, false }); areaUnits.push_back(OrderedUnit{ UnitConverterUnits::Area_SquareInch, GetLocalizedStringName(L"UnitName_SquareInch"), GetLocalizedStringName(L"UnitAbbreviation_SquareInch"), 6 }); areaUnits.push_back(OrderedUnit{ UnitConverterUnits::Area_SquareKilometer, GetLocalizedStringName(L"UnitName_SquareKilometer"), GetLocalizedStringName(L"UnitAbbreviation_SquareKilometer"), 5 }); - areaUnits.push_back(OrderedUnit{ UnitConverterUnits::Area_SquareMeter, GetLocalizedStringName(L"UnitName_SquareMeter"), GetLocalizedStringName(L"UnitAbbreviation_SquareMeter"), 3, USSource, (UKTarget || Target), false}); + areaUnits.push_back(OrderedUnit{ UnitConverterUnits::Area_SquareMeter, GetLocalizedStringName(L"UnitName_SquareMeter"), GetLocalizedStringName(L"UnitAbbreviation_SquareMeter"), 3, useUSCustomary, useSI, false}); areaUnits.push_back(OrderedUnit{ UnitConverterUnits::Area_SquareMile, GetLocalizedStringName(L"UnitName_SquareMile"), GetLocalizedStringName(L"UnitAbbreviation_SquareMile"), 10 }); areaUnits.push_back(OrderedUnit{ UnitConverterUnits::Area_SquareMillimeter, GetLocalizedStringName(L"UnitName_SquareMillimeter"), GetLocalizedStringName(L"UnitAbbreviation_SquareMillimeter"), 1 }); areaUnits.push_back(OrderedUnit{ UnitConverterUnits::Area_SquareYard, GetLocalizedStringName(L"UnitName_SquareYard"), GetLocalizedStringName(L"UnitAbbreviation_SquareYard"), 8 }); @@ -240,9 +247,9 @@ void UnitConverterDataLoader::GetUnits(_In_ unordered_map lengthUnits; - lengthUnits.push_back(OrderedUnit{ UnitConverterUnits::Length_Centimeter, GetLocalizedStringName(L"UnitName_Centimeter"), GetLocalizedStringName(L"UnitAbbreviation_Centimeter"), 4 , USSource, (Target || UKTarget), false}); + lengthUnits.push_back(OrderedUnit{ UnitConverterUnits::Length_Centimeter, GetLocalizedStringName(L"UnitName_Centimeter"), GetLocalizedStringName(L"UnitAbbreviation_Centimeter"), 4, useUSCustomary, useSI, false}); lengthUnits.push_back(OrderedUnit{ UnitConverterUnits::Length_Foot, GetLocalizedStringName(L"UnitName_Foot"), GetLocalizedStringName(L"UnitAbbreviation_Foot"), 8 }); - lengthUnits.push_back(OrderedUnit{ UnitConverterUnits::Length_Inch, GetLocalizedStringName(L"UnitName_Inch"), GetLocalizedStringName(L"UnitAbbreviation_Inch"), 7 , (Source|| UKSource), USTarget, false }); + lengthUnits.push_back(OrderedUnit{ UnitConverterUnits::Length_Inch, GetLocalizedStringName(L"UnitName_Inch"), GetLocalizedStringName(L"UnitAbbreviation_Inch"), 7 , useSI, useUSCustomary, false }); lengthUnits.push_back(OrderedUnit{ UnitConverterUnits::Length_Kilometer, GetLocalizedStringName(L"UnitName_Kilometer"), GetLocalizedStringName(L"UnitAbbreviation_Kilometer"), 6 }); lengthUnits.push_back(OrderedUnit{ UnitConverterUnits::Length_Meter, GetLocalizedStringName(L"UnitName_Meter"), GetLocalizedStringName(L"UnitAbbreviation_Meter"), 5 }); lengthUnits.push_back(OrderedUnit{ UnitConverterUnits::Length_Micron, GetLocalizedStringName(L"UnitName_Micron"), GetLocalizedStringName(L"UnitAbbreviation_Micron"), 2 }); @@ -260,16 +267,16 @@ void UnitConverterDataLoader::GetUnits(_In_ unordered_map tempUnits; - tempUnits.push_back(OrderedUnit{ UnitConverterUnits::Temperature_DegreesCelsius, GetLocalizedStringName(L"UnitName_DegreesCelsius"), GetLocalizedStringName(L"UnitAbbreviation_DegreesCelsius"), 1, USSource, (Target || UKTarget), false }); - tempUnits.push_back(OrderedUnit{ UnitConverterUnits::Temperature_DegreesFahrenheit, GetLocalizedStringName(L"UnitName_DegreesFahrenheit"), GetLocalizedStringName(L"UnitAbbreviation_DegreesFahrenheit"), 2 , (Source || UKSource), USTarget, false }); + tempUnits.push_back(OrderedUnit{ UnitConverterUnits::Temperature_DegreesCelsius, GetLocalizedStringName(L"UnitName_DegreesCelsius"), GetLocalizedStringName(L"UnitAbbreviation_DegreesCelsius"), 1, useFahrenheit, !useFahrenheit, false }); + tempUnits.push_back(OrderedUnit{ UnitConverterUnits::Temperature_DegreesFahrenheit, GetLocalizedStringName(L"UnitName_DegreesFahrenheit"), GetLocalizedStringName(L"UnitAbbreviation_DegreesFahrenheit"), 2 , !useFahrenheit, useFahrenheit, false }); tempUnits.push_back(OrderedUnit{ UnitConverterUnits::Temperature_Kelvin, GetLocalizedStringName(L"UnitName_Kelvin"), GetLocalizedStringName(L"UnitAbbreviation_Kelvin"), 3 }); unitMap.emplace(ViewMode::Temperature, tempUnits); @@ -287,11 +294,11 @@ void UnitConverterDataLoader::GetUnits(_In_ unordered_map speedUnits; speedUnits.push_back(OrderedUnit{ UnitConverterUnits::Speed_CentimetersPerSecond, GetLocalizedStringName(L"UnitName_CentimetersPerSecond"), GetLocalizedStringName(L"UnitAbbreviation_CentimetersPerSecond"), 1 }); speedUnits.push_back(OrderedUnit{ UnitConverterUnits::Speed_FeetPerSecond, GetLocalizedStringName(L"UnitName_FeetPerSecond"), GetLocalizedStringName(L"UnitAbbreviation_FeetPerSecond"), 4 }); - speedUnits.push_back(OrderedUnit{ UnitConverterUnits::Speed_KilometersPerHour, GetLocalizedStringName(L"UnitName_KilometersPerHour"), GetLocalizedStringName(L"UnitAbbreviation_KilometersPerHour"), 3 ,(USSource || UKSource), Target, false }); + speedUnits.push_back(OrderedUnit{ UnitConverterUnits::Speed_KilometersPerHour, GetLocalizedStringName(L"UnitName_KilometersPerHour"), GetLocalizedStringName(L"UnitAbbreviation_KilometersPerHour"), 3 , useUSCustomary, useSI, false }); speedUnits.push_back(OrderedUnit{ UnitConverterUnits::Speed_Knot, GetLocalizedStringName(L"UnitName_Knot"), GetLocalizedStringName(L"UnitAbbreviation_Knot"), 6 }); speedUnits.push_back(OrderedUnit{ UnitConverterUnits::Speed_Mach, GetLocalizedStringName(L"UnitName_Mach"), GetLocalizedStringName(L"UnitAbbreviation_Mach"), 7 }); speedUnits.push_back(OrderedUnit{ UnitConverterUnits::Speed_MetersPerSecond, GetLocalizedStringName(L"UnitName_MetersPerSecond"), GetLocalizedStringName(L"UnitAbbreviation_MetersPerSecond"), 2 }); - speedUnits.push_back(OrderedUnit{ UnitConverterUnits::Speed_MilesPerHour, GetLocalizedStringName(L"UnitName_MilesPerHour"), GetLocalizedStringName(L"UnitAbbreviation_MilesPerHour"), 5, Source, (UKTarget || USTarget), false }); + speedUnits.push_back(OrderedUnit{ UnitConverterUnits::Speed_MilesPerHour, GetLocalizedStringName(L"UnitName_MilesPerHour"), GetLocalizedStringName(L"UnitAbbreviation_MilesPerHour"), 5, useSI, useUSCustomary, false }); speedUnits.push_back(OrderedUnit{ UnitConverterUnits::Speed_Turtle, GetLocalizedStringName(L"UnitName_Turtle"), GetLocalizedStringName(L"UnitAbbreviation_Turtle"), 8 ,false, false, true }); speedUnits.push_back(OrderedUnit{ UnitConverterUnits::Speed_Horse, GetLocalizedStringName(L"UnitName_Horse"), GetLocalizedStringName(L"UnitAbbreviation_Horse"),9 , false, false, true }); speedUnits.push_back(OrderedUnit{ UnitConverterUnits::Speed_Jet, GetLocalizedStringName(L"UnitName_Jet"), GetLocalizedStringName(L"UnitAbbreviation_Jet"), 10, false, false, true }); @@ -309,14 +316,14 @@ void UnitConverterDataLoader::GetUnits(_In_ unordered_mapData(); } - wstring UnitConverterDataLoader::GetRegion() - { - if ((m_currentRegionCode == L"US") || - (m_currentRegionCode == L"LR") || - (m_currentRegionCode == L"MM")) - { - return L"US"; - } - else if (m_currentRegionCode == L"GB") - { - return L"UK"; - } - else - { - return L"Others"; - } - } - void UnitConverterDataLoader::GetExplicitConversionData(_In_ unordered_map>& unitToUnitConversionList) { /* categoryId, ParentUnitId, UnitId, ratio, offset, offsetfirst*/ diff --git a/src/CalcViewModel/DataLoaders/UnitConverterDataLoader.h b/src/CalcViewModel/DataLoaders/UnitConverterDataLoader.h index b48b8e09..17565edf 100644 --- a/src/CalcViewModel/DataLoaders/UnitConverterDataLoader.h +++ b/src/CalcViewModel/DataLoaders/UnitConverterDataLoader.h @@ -64,7 +64,6 @@ namespace CalculatorApp void GetExplicitConversionData(_In_ std::unordered_map>& unitToUnitConversionList); std::wstring GetLocalizedStringName(_In_ Platform::String^ stringId); - std::wstring GetRegion(); std::shared_ptr> m_categoryList; std::shared_ptr m_categoryToUnits; From 2320697562b44a675f3d9192c9dcd59231534ecf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Thu, 7 Mar 2019 18:45:51 +0100 Subject: [PATCH 3/5] Catch polymorphic types by const-ref (#125) --- src/CalcManager/CalculatorVector.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/CalcManager/CalculatorVector.h b/src/CalcManager/CalculatorVector.h index 5ddf5300..9e8c1a72 100644 --- a/src/CalcManager/CalculatorVector.h +++ b/src/CalcManager/CalculatorVector.h @@ -14,7 +14,7 @@ public: { *item = m_vector.at(index); } - catch (std::out_of_range /*ex*/) + catch (const std::out_of_range& /*ex*/) { hr = E_BOUNDS; } @@ -34,7 +34,7 @@ public: { m_vector[index] = item; } - catch (std::out_of_range /*ex*/) + catch (const std::out_of_range& /*ex*/) { hr = E_BOUNDS; } @@ -63,7 +63,7 @@ public: auto iter = m_vector.begin() + index; m_vector.insert(iter, item); } - catch (std::bad_alloc /*ex*/) + catch (const std::bad_alloc& /*ex*/) { hr = E_OUTOFMEMORY; } @@ -92,7 +92,7 @@ public: { m_vector.push_back(item); } - catch (std::bad_alloc /*ex*/) + catch (const std::bad_alloc& /*ex*/) { hr = E_OUTOFMEMORY; } From 07f4cc1926e3d5a5c64ed7fab4faa4ae864ab112 Mon Sep 17 00:00:00 2001 From: Christian Oliff Date: Fri, 8 Mar 2019 03:02:44 +0900 Subject: [PATCH 4/5] HTTPS link to editorconfig.org (#134) --- .editorconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.editorconfig b/.editorconfig index e844ca00..f3416ab7 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,4 +1,4 @@ -## IDE-independent coding style via EditorConfig: http://editorconfig.org/ +## IDE-independent coding style via EditorConfig: https://editorconfig.org/ root = true @@ -8,4 +8,4 @@ indent_size = 4 end_of_line = crlf charset = utf-8 trim_trailing_whitespace = true -insert_final_newline = true \ No newline at end of file +insert_final_newline = true From 84941c698e33a9dada6c51cb37f411ebf54798cc Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 7 Mar 2019 13:27:13 -0500 Subject: [PATCH 5/5] Spelling (#135) --- docs/ManualTests.md | 2 +- .../CalculatorAppLauncher.cs | 2 +- .../Utilities/PerfTestConstants.cs | 2 +- .../Config/AppLifecycle.Iterations.xml | 2 +- .../Config/AppLifecycle.Profile.wprp | 2 +- .../Calculator.UITests/Tests/AppLifecycleTests.cs | 4 ++-- src/CalcManager/CEngine/History.cpp | 10 +++++----- src/CalcManager/CEngine/scicomm.cpp | 6 +++--- src/CalcManager/CalculatorManager.cpp | 14 +++++++------- src/CalcManager/Header Files/History.h | 2 +- src/CalcManager/Ratpack/rat.cpp | 4 ++-- .../Common/AlwaysSelectedCollectionView.h | 2 +- .../Common/Automation/LiveRegionHost.h | 2 +- src/CalcViewModel/Common/NavCategory.cpp | 6 +++--- src/CalcViewModel/Common/NavCategory.h | 2 +- src/CalcViewModel/Common/ValidatingConverters.h | 4 ++-- .../DataLoaders/CurrencyDataLoader.cpp | 2 +- src/CalcViewModel/DateCalculatorViewModel.cpp | 2 +- src/CalcViewModel/DateCalculatorViewModel.h | 2 +- src/CalcViewModel/UnitConverterViewModel.cpp | 4 ++-- src/CalcViewModel/UnitConverterViewModel.h | 6 +++--- .../Common/AlwaysSelectedCollectionView.h | 2 +- .../DesignData/DesignStandardCalculatorViewModel.h | 2 +- src/Calculator/Resources/en-GB/Resources.resw | 2 +- src/Calculator/Resources/en-US/Resources.resw | 2 +- src/CalculatorUnitTests/CalculatorManagerTest.cpp | 14 +++++++------- src/CalculatorUnitTests/CopyPasteManagerTest.cpp | 10 +++++----- src/CalculatorUnitTests/MultiWindowUnitTests.cpp | 4 ++-- src/CalculatorUnitTests/UnitTestApp.rd.xml | 2 +- 29 files changed, 60 insertions(+), 60 deletions(-) diff --git a/docs/ManualTests.md b/docs/ManualTests.md index 6fbc6716..a1d9de58 100644 --- a/docs/ManualTests.md +++ b/docs/ManualTests.md @@ -124,7 +124,7 @@ Steps: m. “( )" Parenthesis -**All Calulators Test: Verify memory functions** +**All Calculators Test: Verify memory functions** Steps: 1. Launch the "Calculator" app. 2. Navigate to "Standard" Calculator. diff --git a/internal/Calculator.UIAutomationLibrary/CalculatorAppLauncher.cs b/internal/Calculator.UIAutomationLibrary/CalculatorAppLauncher.cs index b90c984e..df2ad9c3 100644 --- a/internal/Calculator.UIAutomationLibrary/CalculatorAppLauncher.cs +++ b/internal/Calculator.UIAutomationLibrary/CalculatorAppLauncher.cs @@ -20,7 +20,7 @@ namespace Calculator.UIAutomationLibrary { public const string CoreWindowClassName = "Windows.UI.Core.CoreWindow"; - // This doesn't actually work right now becaue popup will disappear + // This doesn't actually work right now because popup will disappear // Bug 13713223: ContentDialog/Popup does not show up in the UIA tree when Windows.Current.Content has an AutomationName set. // public static readonly UICondition TopLevelWindowUICondition = UICondition.CreateFromId(Constants.TopLevelWindowAutomationId); public static readonly UICondition CoreWindowUICondition = UICondition.CreateFromClassName(CoreWindowClassName) diff --git a/internal/Calculator.UIAutomationLibrary/Utilities/PerfTestConstants.cs b/internal/Calculator.UIAutomationLibrary/Utilities/PerfTestConstants.cs index ae329b7c..02c0206d 100644 --- a/internal/Calculator.UIAutomationLibrary/Utilities/PerfTestConstants.cs +++ b/internal/Calculator.UIAutomationLibrary/Utilities/PerfTestConstants.cs @@ -36,6 +36,6 @@ namespace Calculator.UIAutomationLibrary /// /// These are uses with the DataSource test property to specify iteration info. /// - public const string AppLifecycleInterationsSource = "Table:" + ConfigDirectory + "AppLifecycle.Iterations.xml#PerformanceConfigurations"; + public const string AppLifecycleIterationsSource = "Table:" + ConfigDirectory + "AppLifecycle.Iterations.xml#PerformanceConfigurations"; } } diff --git a/internal/Calculator.UITests/Config/AppLifecycle.Iterations.xml b/internal/Calculator.UITests/Config/AppLifecycle.Iterations.xml index 91a96bc8..65cec859 100644 --- a/internal/Calculator.UITests/Config/AppLifecycle.Iterations.xml +++ b/internal/Calculator.UITests/Config/AppLifecycle.Iterations.xml @@ -1,7 +1,7 @@