Граф коммитов

1138 Коммитов

Автор SHA1 Сообщение Дата
Rudy Huyn 9728ccf119 Fix bug when the negate sign is before a space (#345)
* Ignore None characters while parsing the clipboard

* reformat
2019-04-26 16:07:14 -07:00
Hassan Uraizee 8e1a14793a Added WinAppDriver UI Tests to the Calculator Project. (#411) 2019-04-25 16:54:36 -07:00
Matt Cooley cf7ec5f729
Miscellaneous updates to internal release builds (#477) 2019-04-25 16:54:07 -07:00
Eric Wong 1dee9dc984
Fix #471 (#473)
[JaEra] Calc: subtracting 1-year from date during Reiwa 1 yields unexpected results.
2019-04-24 13:37:49 -07:00
Daniel Belcher b03a026f6c
Allow vcxproj and sln files to merge as text. (#474)
Description of the changes:
This will cause Git to insert conflict markers in the file and make it easier to identify and fix merge conflicts. Previously, Git would complain about conflicts with these files, but no markers were inserted.

How changes were validated:
Manual.

Checkout feature/GraphingCalculator and merge in upstream/master. Git identifies merge conflicts present for Calculator.vcxproj but there are no conflict markers in the file. Abort the merge.
Merge in dabelc/MergeProjectFilesAsText. Confirm Git is able to merge Calculator.vcxproj.
2019-04-24 12:05:19 -07:00
Daniel Belcher 861d4ef408
Update the .gitignore to ignore GraphingImplOverrides.props. (#472)
Description of the changes:
Update the .gitignore to ignore GraphingImplOverrides.props.

This update already exists in the feature branch but we can merge it to master now to make development of the feature easier and prevent accidentally commiting this file.

How changes were validated:
Manual.

Switch to feature branch. Add GraphingImplOverrides.props
Switch to dabelc/IgnoreGraphingImplOverrides.props. Confirm git shows no files changed but props file is present.
2019-04-23 16:41:48 -07:00
Bharat Raghunathan 452f18fd8e Update README to include infinite precision (#470)
Fixes #119

Added infinite precision as a feature in README.md and in ApplicationArchitecture.md

How changes were validated:
Manual preview of README and ApplicationArchitecture.md
2019-04-23 10:30:31 -07:00
Eric Wong 2a29947a28 Collapse CurrencySecondaryStatus when no text is present in the text block (#467)
Fixes #313
In Scan/Item mode, Narrator focus navigates to hidden element “No next item” after “Update rates” link in "Currency Converter" window #313

Description of the changes:
Adds an x:Name to the CurrencySecondaryStatus text block
Adds a NormalCurrencyStatus visual state to the CurrencySecondaryStatusStates
Adds functionality to the CurrencySecondaryStatusStates to show or hide the CurrencySecondaryStatus text block.

How changes were validated:
Verified that the textblock is not visible in the accessibility tree via inspect.exe from the windows sdk.
Verified that Narrator also does not stop on the block when in scan mode.
Verified that the textblock is visible in the accessibility tree and read out in Narrator when the ChargesMayApplyCurrencyStatus or FailedCurrencyStatus viewstates are set.
2019-04-22 17:30:59 -07:00
Nicholas Baron cdd2b1c8ad Updates to copypastemanager (#390)
Related to #55 and #64
Description of the changes:
Added constexpr to formerly static const or #define variables
Applied C++ Core Guideline NR.2
Added auto and const in appropriate places

How changes were validated:
Used the provided unit tests
2019-04-22 16:59:13 -07:00
cheezwhines fab21191e2 Clicking on the same element in the hamburger view should re-open that view, like the menu items do (#447)
Fixes #437.
Clicking on the same element in the hamburger view should re-open that view, like the menu items do

Description of the changes:
-Fixed the bug that was listed

How changes were validated:
-manual
2019-04-19 18:59:10 -07:00
Rudy Huyn bd04c92c1c Simplify title bar (#442)
Fixes #407 (partially) and #441

Description of the changes:
Remove TitleBarHelper and all <Border x:Name="CustomTitleBar" />
Let the system defines the draggable region
Centralize all events and functions associated to the title bar in a single control TitleBar instead of code splitted between MainPage/TitleBar/HistoryList/Memory.
Use the standard title bar when high contrast is activated instead of the custom one.
Modify the color of the title when the window doesn't have focus
Fix the right padding of the title bar with high contrast

How changes were validated:
Manually tested with LtR and RtL languages
Manually tested with high contrast
Tested when History and Memory flyout are opened
2019-04-19 18:49:08 -07:00
Rudy Huyn 0d31d5a5a2 Fix UI issues with UnitConverter in RtL (#410)
Fix #409 - Some content in Currency Converter not right-aligned properly in RtL
Fix #59 Currency symbol precedence is opposite of system setting in RTL languages

Description of the changes:
Add a property FlowDirectionHorizontalAlignment in UnitConverter to align some controls to the right (without modifying the FlowDirection of their parent items)
Force FlowDirection of Value1Container and Value2Container to LeftToRight (but align panels to the right)

How changes were validated:
Tested with LtR and RtL languages and with currency symbols on the left and on the right.
2019-04-19 18:37:50 -07:00
Eric Wong 43b2d4e536 Fix test code that never executes (#465)
Fixes #175.
Fixes loop in test code to verify that commands not supported by the unit converter viewmodel result in no-op.

Description of the changes:
Removed loop of range of enums with a being tested for no-ops since it added no intrinsic value (and the way that the range was handled was incorrect).  Considered adding an iterator over a static list of commands to validate against, but determined it didn't add any notable value.

How changes were validated:
Ran modified test to ensure it passes
2019-04-18 17:05:44 -07:00
Lance McCarthy 8520d3fc74 Refactored XAML x:Names (#433)
Description of the changes:
-Refactored all x:Names to use the generally accepted Pascal-Casing

How changes were validated:
Unit Tests
Manual Tests
2019-04-18 16:01:47 -07:00
Rudy Huyn de65db6197 Decrease CPU usage of OverflowTextBlock + optimization (#403)
Fixes #402 and #414
Divide by 4 the CPU usage of OverflowTextBlock when buttons are pressed very quickly.

Description of the changes:

Xaml-side:
OverflowTextBlock has some performance issues:
double scrollviewer: the listview was in a scrollviewer, while the control already containing one -> it breaks the virtualization of the listview and impacts on UI performance.
The listview used a StackPanel, this panel doesn't support virtualization of ListViewItems contrary to ItemsStackPanel

No ListView-specific features were used, an ItemsControl is more efficient and lighter.
refactor how we manage the visibility of the left/right buttons in OverflowTextBlock, the new version is more reactive and will not display the right arrow when not necessary (see GIF below).
remove the ItemContainerSelector ExpressionItemContainerStyle, not really used by OverflowTextBlock

remove UI glitches generated by ChangeView when users type fast (control partially hidden and scrolling issues, see the GIF below).
only modify the accessibility view when it's necessary

ViewModel-side:
stop fully refreshing ExpressionTokens in StandardCalculatorViewModel when a new command were sent, instead, use a IObservableVector to only send new tokens to the UI (in average only 1 or 2 UI items are refreshed while the full expression was refreshed before)

How changes were validated:
Manually
2019-04-18 15:21:33 -07:00
Daniel Belcher d21a47d5a1
Compile CalcManager project with or without precompiled headers (#436)
Fixes #324 .

Description of the changes:
In an effort to support other compilers (#109), this change reworks how precompiled headers are handled. For toolchains where precompiled headers are not used, there is unnecessary compilation cost because each source file explicity includes the pch, meaning all system headers in the pch were recompiled for each translation unit. This change modifies the project's files so that each translation unit includes a minimal set of dependent headers. For MSVC users, the precompiled headers option is still enabled and the precompiled header is added to each translation unit using the compiler's Forced Includes option. The end result is that MSVC users still see the same build times, but other toolchains are free to use or not use precompiled headers.

Risks introduced
Given that our CI build uses MSVC, this change introduces the risk that a system header is added to the pch and the CalcManager project builds correctly, but builds could be broken for other toolsets that don't use pch. We know we want to add support for Clang in our CI build (#211). It seems reasonable to also compile without precompiled headers there so that we can regression test this setup.

How changes were validated:
Rebuild CalcManager project. Compile time: ~4.5s.
Disable precompiled headers, keeping explicit include for pch in each source file. Compile time: ~13s.
Remove explicit pch inclusion and add the appropriate headers to each translation unit to allow the project to compile. Compile time: ~8s.
Re-enable pch and include it using the Forced Includes compiler option. MSVC compile time: ~4.5s.
Minor changes
Delete 'targetver.h'. I found this while looking around for system headers in the project. It's unused and unreferenced so let's remove it.
2019-04-17 17:28:45 -07:00
Seulgi Kim 853704c1c2 Add support for Pyeong, a Korean floorspace unit. (#444)
Fixes #382
Description of the changes:
Add Pyeong as an Area conversion unit.
Pyeong shows up only if the user's current region is Korea ( i.e. region is either KP or KR ).
Added Korean translation for Pyeong (평). For other locales, we default to English ( Pyeong ).
How changes were validated:
Manually tested the below

For non-Korean regions, Pyeong does not show up.

Korean region with Korean locale => Pyeong shows up and Pyeong is correctly translated.
pyeong_Korean

Korean region with English locale => Pyeong shows up and Pyeong is in English.
pyeong_English

Korean region with simplified Chinese locale => Pyeong shows up and Pyeong is in English.
pyeong_Chinese
2019-04-16 17:53:08 -07:00
jatinkumar c150cd4ece Removed AppBar, OperatorTextBox and OperandTextBox controls (#440)
Fixes #407 
Removed AppBar, OperatorTextBox and OperandTextBox controls
2019-04-16 17:46:07 -07:00
Rudy Huyn 7a7ceb5888 Modify how modulo is calculated in Normal and Scientific mode. (#412)
## Fixes #111

> The modulo operator on this calculator gives the result that is different to the most used calculators.

The current `modrate` function is the equivalent of rem(...)/remainder(...), not mod(...)/modulo(...) available in some popular Math apps. 

### Description of the changes:
- rename `modrate` in `remrate` to be more accurate.
- add `modrate`, calculating modulo similarly to Matlab, Bing, Google calculator, Maxima, Wolfram Alpha and Microsoft Excel 
- Add `RationalMath::Mod` using `modrate` as an alternative to `Rational::operator%` using `remrate`
- Add a helper `SIGN` to retrieve the sign of a `Rational`.
- modify `CalcEngine` to use `modrate` in Normal and Scientific mode and `remrate` in Programmer mode.

### How changes were validated:
- manually and unit tests added
2019-04-16 17:17:24 -07:00
Rudy Huyn ad25feda6b Keep input when users refresh currency rates (#369)
Fixes #260

Description of the changes:
prevent UnitConverterViewModel to reset values when users click on update rates.
recompute UnitConverter's caches (m_ratioMap and m_categoryToUnits) once rates are updated (but check first if the user did/didn't change the category)

How changes were validated:
Manually tested with fake currency rates (HTTP responses modified on the fly via FiddlerCore)
Verified that it works no matter the selected field (From or To)
Verified that the currencies selected are kept after a refresh
2019-04-16 11:29:43 -07:00
Matt Cooley 775771d62a
Internal builds now require the OAuth access token (#457) 2019-04-15 14:12:10 -07:00
Rudy Huyn 5a6c6f4274 Prevent the application to crash when the current page is Date Calculation and users paste a text (#391)
Fix the else condition in ApplicationViewModel::OnPaste

How changes were validated:
Manually

Fixes #389
2019-04-15 09:51:06 -07:00
Rudy Huyn 109326508f Improve the support of Narrator with parenthesis (#368)
* Modify how we manage Narrator with parenthesis and refactor right parenthesis

* Optimization

* remove extra spaces

* take feedback into account
2019-04-15 09:31:02 -07:00
Michał Janiszewski afdda581a4 Drop unneeded const-qualifier on return type (#396) 2019-04-12 13:40:02 -07:00
Pepe Rivera f6f10444f7 Simplify some of the calc engine string logic (#449)
Description of the changes:
Currently Calculator handles strings by defining integers for each type of function that can be performed, this integer will eventually correspond with an index in s_engineStrings which holds the corresponding display string for each function. Some functions such as Sin can have multiple strings (degrees, rads, grads, inverse). Functions like Sin are mapped to another array called "rgUfne" where a new integer is given depending on the output string which will then be given to s_engineStrings. The new integer returned by the "rgUfne" array runs the risk of overlapping with any new functions that may be added in CCommand.h. Furthermore, it is expected that the strings in s_engineStrings and rgUfne are defined in a particular order (not necessarily sequential), otherwise the logic will break. This makes adding new strings for new functions confusing and difficult, since a lot of the logic is not clearly defined.

This PR attempts to make this a bit simpler by changing the s_engineStrings and rgUfne arrays to be unordered_maps instead of arrays. For s_engineStrings the keys will now be strings, allowing the existing logic for indexing to be used by simply converting the number into a string to access the value. This will also allow us to create keys in the future that are not limited to integers but to strings that hold more meaning.

The rgUfne array will also be updated to be a map that will take in an integer and give you the corresponding string that can be passed to s_engineStrings. The UFNE object in the rgUfne array will also be updated to hold all the possible string keys for a function, instead of indexing them on other numbers that may overlap with existing definitions.

Now to add a new string for a new IDC_FOO function, we would just need to add the "FooString" resource keys to the g_sids array and use the updated rgUfne map to link the IDC_FOO value to the corresponding "FooString" resource key. This way the resource key can be a meaningful string, and not an integer that must be in any particular order.

How changes were validated:
Tested each function manually in standard, scientific, and programmer modes.
2019-04-11 15:20:01 -07:00
Dave Grochocki 47a2741218
Updating Contributing (#431)
Updating Contributing documentation:
* Adding reference to spec repository for feature development
* Adding localization issue template
* Adding clarifications for contributions and PRs
2019-04-09 17:36:36 -07:00
Daniel Belcher 7ac750f7e5
Fix invalid check of m_precedenceOpCount (#298)
The conditional m_precedenceOpCount >= 0 was always true because m_precendenceOpCount is an unsigned type. Update the conditional to simply be true and rely on a break statement in the loop. Although this member variable used to be a signed type, in practice, the value was never less than 0.

How changes were validated:
Manual. Unit tests pass locally.
2019-04-09 14:12:28 -07:00
Rudy Huyn af41a183a7 Optimize and simplify CalculationResult to be able to update the FontSize and the DisplayMargin without fully updating the Style. (#217)
- Merge the 3 CalculationResultStyle(S|M|L) in App.xaml
- Only modify CalculationResult::*FontSize in Calculator.xaml instead of fully updating the style of the control.
- Create a new property MaxFontSize in order to be able to update it without being forced to fully update the Style (because m_startingFontSize was set in OnApplyTemplate)
- Modify how DisplayMargin is managed to prevent the textblock Margin to shift when we update its value (without fully updating the Style).
2019-04-05 13:04:39 -07:00
Matt Cooley e7eace57f8
Update localized strings 2019-04-04 (#438) 2019-04-05 08:39:29 -07:00
Rudy Huyn 6f49b17bf0 Add Reveal Highlight on AccentCalcButtonStyle + fix accessibility iss… (#374)
Add Reveal Highlight effect on the 4 basic operator buttons + Equal button (effect more visible with purple and all grey-ish accent colors). Also fixes a high contrast issue when the operator buttons were pressed.
2019-04-04 16:55:12 -07:00
Matt Cooley 71e34c6f01
Fix inline script in loc pipeline (#434) 2019-04-04 16:11:13 -07:00
Matt Cooley 6d779a8815
Updating version of release builds to 1904 (#422) 2019-04-04 09:19:59 -07:00
Sonali Agrawal cb31349ee2 Update README to add description of "date calculation" functionality (#365)
Fixes #140.

Added a one-liner description about the date calculation functionality

Description of the changes:
* This change maintains consistency by writing it after the description of the programmer calculator so that it matches the order of the positions of these functionalities in the hamburger menu of the calculator.
* Just like the other descriptions, this is also a one-liner
* This description covers both the functionality under "date calculation" i.e. the difference between the dates and adding/subtracting a date from another.

Co-Authored-By: sonali9696 <sonali9696@gmail.com>
2019-04-03 06:45:47 -07:00
Michał Janiszewski f6a6aae6e6 Add additional defines for MSVC ARM and ARM64 to conv.cpp (#399)
Fixes ARM(64) regression introduced with #212
2019-03-28 11:17:06 -07:00
Michał Janiszewski 7a48f66807 Replace custom types with standard ones (#212)
Replace custom types with standard ones
2019-03-26 14:30:46 -07:00
Rudy Huyn ef3f5e9cbb Improve performance of SupplementaryResult + Modify the height of RowDltrUnits when UnitConverter is in Landscape (#249)
* Modify the height of RowDltrUnits when UnitConverter  is in LandscapeLayout mode

* clean

* Use the same layout than the existing one while fixing the issue

* Refactor SupplementaryItemsControl to improve performance, not rely on parents and not force the parent element to be HorizonAlignment="stretch"

* take feedback into account

* add HorizontalNoOverflowStackPanel to vcproj.filters

* format conditionals

* replace max by std::max
2019-03-26 11:24:36 -07:00
Rudy Huyn e9aea9237d Fix padding of unit converter when the current locale displays symbols on the left (#373) 2019-03-26 10:54:14 -07:00
Matt Cooley 74b78a67be Don't run component governance detection in postbuild steps (#381)
See also #353.

In the internal build environment, there's an auto-injected component governance task which needs to run once during the build. This task doesn't need to run during the unit test, package, and internal release jobs.
2019-03-26 10:03:42 -07:00
Rudy Huyn 176718211a Accept plus/minus sign before a parenthesis in ClipboardManager (#346)
Modify scientificModePatterns regexes to support minus sign before parenthesis.
2019-03-25 19:09:05 -07:00
Daniel Belcher 19e61e2b53 Disable use of min/max macros defined by Windows headers. (#363)
Description of the changes:
  Disable Windows-provided min/max macros using the NOMINMAX flag. Add the flag to each project's pch to disable the macros across the solution.

How changes were validated:
  Project builds.
  Unit tests pass.
  Smoke tests.

Fixes #362.
2019-03-25 11:28:29 -07:00
Matt Cooley e55ffe5b8d [Build] Remove conditional inclusion of resw files (#360)
The .resw files for all languages are expected to be checked into the repo (this used to not the the case). Let's remove the conditions in the project file which ignore them if they don't exist.

Additionally removes pseudo-loc resource references from the build as pseudo-loc resources aren't currently being generated.
2019-03-25 11:16:15 -07:00
Rudy Huyn 65045e9375 Update the year in the Copyright string (#320)
Templatize the copyright string and use a build variable to set the year for use across the entire app.

How changes were validated:
Tested with English and French and with different dates.
2019-03-25 11:11:24 -07:00
Matt Cooley 4603d387ae
Updating version of release builds to 1903 (#361) 2019-03-22 15:46:10 -07:00
Matt Cooley e2d6a325e3
[Build] Update localization handoff pipeline (#359)
Update the localization build so that it sends strings to our internal localization system on a nightly basis and produces a patch file which we can use to check translations back into the repo.
2019-03-22 13:59:06 -07:00
Matt Cooley c4361e2bdf
Update localized strings (#357) 2019-03-22 12:29:18 -07:00
Matt Cooley 2a7c53a27d
Add TemporaryKey.pfx (#354) 2019-03-21 17:03:42 -07:00
Matt Cooley 6cb10df947
Disable component governance task in localization build (#353)
Internally, a "component detection" task is automatically injected into builds to make sure we're not using any components with known security vulnerabilities. Because this task runs during the main app builds, it doesn't also need to run in the pipeline which hands off strings to the localization system.
2019-03-21 12:27:05 -07:00
Shamkhal Maharramov fd317f5623 Simplify multiple "or" operators (#341)
Use implicit enum to int conversion to simplify some value checking against the Command enum.
2019-03-21 10:43:59 -07:00
Michał Janiszewski 80a5fa01b0 Make CalculatorManager final rather than sealed (#331)
I have no idea if it is required to be `sealed`, I have seen no `^`
operator which makes me think it could be a regular C++ code, barring
the concurrency stuff.
2019-03-20 17:23:09 -07:00
Michał Janiszewski 597caf9c6b Fix order of initialization list in CalculatorManager, COpndCommand (#332)
This ensures the initialization order matches the layout of member
fields in class declaration
2019-03-20 16:45:30 -07:00