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

567 Коммитов

Автор SHA1 Сообщение Дата
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
Michał Janiszewski 426a6c058d Remove expression with no effects from CalculatorManager (#337) 2019-03-20 16:43:51 -07:00
Shamkhal Maharramov 251ffffc50 Propose code-cleanups#2 (#253)
Description of the changes:

Remove redundancy
Simplify if statements
2019-03-20 14:28:30 -07:00
Michał Janiszewski 683b91aeec Remove redundant type qualifiers on function return type (#329) 2019-03-20 14:22:31 -07:00
Michał Janiszewski 94f0e8b320 Replace fallthrough comment with C++17's attribute (#334) 2019-03-20 14:19:30 -07:00
Dave Grochocki 47f4757f07 Update Roadmap.md (#339)
Adding Graphing Mode to the roadmap.
2019-03-20 14:13:57 -07:00
Michał Janiszewski 462694dcef Remove unused member field from CalculatorHistory (#330) 2019-03-20 10:58:32 -07:00
Daniel Belcher 3bff99b323 ViewModelProperties namespaces converted to static member properties. (#306) 2019-03-20 09:56:59 -07:00
Rudy Huyn 4b6b8fa8fa Fix auto-scaling of CalculationResult when the current locale displays currency symbols on the right (#246)
* Fix auto-scaling of CalculationResult when the current locale displays symbols at the right

* Formatting

* add padding

* modify padding of ValueContainer
2019-03-20 09:54:02 -07:00
Rudy Huyn 21e15c426e hide history button in programmer mode (#327)
Description of the changes:
  Hide the History button when in Programmer mode via VisualState

How changes were validated:
  Open Standard mode
  Switch to Programmer mode
  Verify that the History button isn't visible

Fixes #326
2019-03-18 14:22:44 -07:00
Rudy Huyn 62b2fafdd0 Fix formatting issues with CurrencyConverter and some locales (#242)
The ViewModel wrongly assumed that non-breaking spaces were only used between the value and the symbol. It's not the case of all locales using non-breaking spaces as a thousand delimiter (French for example).

When it was the case, the function only replaced the first thousand delimiter found and kept the extra space at the end of the string, generating 2 issues:

Extra space at the end: #240
Bad formatting of the number: #232

Description of the changes:
   Replace currencyResult.find(L'\u00a0') by a regex only removing spaces at the end of the string.

Fixes #240 and #232
2019-03-18 14:09:13 -07:00
Michał Janiszewski 3d18dd38c2 Add explicit [[fallthrough]] attributes in Ratpack (#323) 2019-03-18 14:02:02 -07:00
Shamkhal Maharramov 965e36cc5d Propose minor code-cleanups (#241)
Description of the changes:
Remove unnecessary 'else', 'continue' statements

How changes were validated:
Manual.
2019-03-18 13:38:04 -07:00
Cyril b8b0fdf86b Improving code style : verbosity, indentation levels (#200)
Fixing some nested if() statements and reducing indentation levels.

Making some sections less verbose, e.g:

if (a == 1)
{
    b = true;
}
else
{
    b = false;
}
↓

b = (a == 1)
2019-03-18 12:31:04 -07:00
Rudy Huyn cd7c266a6b Fix issue with Date diff when it includes a Daylight Saving Time (#193)
The application uses local time to calculate the number of days between 2 dates. If a Daylight Saving Time takes place during this period of time (only Clocks Forward 2am->3am), the application will miss 1 day and fail to calculate the number of days/weeks/months between the 2 dates.
image

Description of the changes:
DateCalculationEngine uses local time to modify dates, however, AddDays, AddWeeks,... won't add 24 hours or 7 days if DST happens between the 2 dates, but instead add ~23.9/24.1 hours or ~6.9/7.1 days (depends if it's the DST clock backward or clock forward). When the DST is clock forward, DateCalculationEngine will miss one day.

Solution
use UTC dates to calculate date difference.

Extra Fix:
use calendar->FirstPeriodInThisDay and calendar->FirstHourInThisPeriod in ClipTime (else it will set the time to 12PM (noon) in some regions.
replace OBSERVABLE_PROPERTY_RW by OBSERVABLE_PROPERTY_R when possible.
remove the definition of CheckClipTimeSameDay (implementation missing)

How changes were validated:
Tested manually with different regions (FR, US, ES, JP).

Fixes #178
2019-03-18 11:22:32 -07:00
Rudy Huyn e40791d7ad Fix compilation issues due to unsigned/signed warnings treated as errors (#317) 2019-03-15 21:21:30 -07:00
Brandon Williams 4a41e37c87 Added support for pasting of monetary values (#176)
Fixes #52

Description of the changes:
Added support for pasting of prefix currency symbols supported by the Windows keyboard.
yen or yuan (¥)
unspecified currency sign (¤)
Ghanaian cedi (₵)
dollar or peso ($)
colón (₡)
won (₩)
shekel (₪)
naira (₦)
Indian rupee (₹)
pound (£)
euro (€)

How changes were validated:
Manually tested each prefix currency symbol supported by the Windows keyboard and ran unit tests.
2019-03-15 17:45:49 -07:00
Rudy Huyn ca15f05227 DateDiff: Optimize how we build the string used when we calculate the difference between 2 dates (#195)
Optimize how we build the result of GetDateDiffString and GetDateDiffStringInDays, using std::wstring (mutuable) instead of Platform::String (immutable)
2019-03-15 17:20:33 -07:00
Nikita Potapenko 244fd8deee Fix grid.Row (#279)
Fixes #265
Fixes invalid grid.Row assignment for decimalSeparatorButton
2019-03-15 02:06:10 -07:00
Will 1113ff4b86 Updating comments per the C++ core guidelines and removing trailing whitespace (#194)
Fixed comments that were inconsistent with the style guidelines described in C++ core guidelines and the modern C++/WinRT language projections and removed trailing whitespace.

Inserted a space after the beginning of the comment so the text wasn't touching the // on all occurrences.

Removed all occurrences of trailing whitespace
2019-03-14 23:30:07 -07:00
Rudy Huyn 62317fd63b Activate TextSelection on all interesting values/results (#213)
If we allow users to select texts, the application will feel more like a "Desktop app", will be easier to use on a tablet and users will be more prompt to use Ctrl+C to use the result in another app.
2019-03-14 22:35:55 -07:00
Satya 7cad778cc0 Fix memory leak (#300)
Free memory allocated to temp before returning from the function.
2019-03-14 21:21:17 -07:00