Commit Graph

575 Commits

Author SHA1 Message Date
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
Michał Janiszewski
a5e07418df Replace custom ARRAYSIZE macro with std::size (#208)
* Replace custom ARRAYSIZE macro with std::size
2019-03-14 21:06:12 -07:00
Stephanie Anderl
d37c75fec2
Fixes #282 Narrator does not convey error information when no more Right Parenthesis can be added in expression. (#284)
* Added narrator announcements when right parenthesis is clicked
2019-03-14 16:20:05 -07:00
Guillaume Rischard
ac5292cf88 Optimised images losslessly. (#229)
Saved 301 KB out of 9.2 MB. 15.8% per file on average (up to 82.2%)
Fixes #.
Saves 301 KB (although not all files are included in the build)
Description of the changes:
For PNG files: used a combination of Pngcrush, OxiPNG, AdvPNG, PNGOUT and Zopfli
For GIF files: used Gifsicle
How changes were validated:
No changes to behaviour or source code.
Previewed the changed files to make sure they still work
2019-03-13 16:37:50 -07:00
Rudy Huyn
6f4ecf35b3 Remove RenderTransform that is never used (#247) 2019-03-13 15:08:51 -07:00
Michał Janiszewski
be31288187 Fix declarations of functions (#186)
Move file-scope functions to anonymous namespaces.
Drop #pragma once from .cpp files
2019-03-13 13:15:08 -07:00
Jeff Genovy
251578047f Make 73 numeric constants const, moving them into .rdata (#234)
This change makes the 73 variables in ratconst.h actually
inline const, which allows them to move from the mutable .data
section of the executable, and into the read-only .rdata
section instead.

Moving data to the .rdata section has a number of benefits,
such as preventing possible corruption due to stray writes,
or other memory corruption.

Additionally, the initialization at run-time start-up is no
longer needed, so there is also a reduction in the .text
(code) section as well.

As a result the overall size of the Calculator.exe binary
(on x64 Release builds) decreases by 1,536 bytes (or ~1.5 KB)
with no change in behavior other than a small performance benefit.
2019-03-13 13:10:14 -07:00
Rudy Huyn
7663c0d5f2 Remove .editorconfig from sln (#290)
#225 accidentally added a duplicate .editorconfig to the repo as well as to the solution.
#257 removed the duplicate .editorconfig, but not its entry in the solution.
This update removes the extra .editorconfig reference to a version that #257 already removed from the repo.
2019-03-13 12:50:23 -07:00
Howard Wolosky
29c362657b
Remove logging of invalid pasted text (#286)
Addressing community feedback for removal of diagnostic data
2019-03-13 03:34:06 -07:00
Jeff Genovy
e6bd36ec2a Eliminate redundant copies of EMPTY_UNIT object, saving 2.5 KB. (#235)
### Description of the changes:

There are currently 11 copies of the `EMPTY_UNIT` object in the
`Calculator.exe` binary, which not only wastes space/footprint in the
binary itself, but also means that each copy must be separately
initialized, which effects performance.

The reason for this is that the object is defined in a shared header
file, which then is included by multiple .cpp files, causing each
translation unit (.obj) to get a full complete copy of the object.

By marking the object as `inline` we can
instruct the linker to define the object once, as we do
not need to have 11 unique versions of the EMPTY_UNIT object,
we only need 1.

The net result is that the `Calculator.exe` binary size is reduced by
2,560 bytes (or 2.5 KB) with no change in behavior, other than
the small performance benefit of not initializing 10 redundant copies
of the object.

### How changes were validated:
- Manually tested.
2019-03-12 19:24:37 -07:00
Rudy Huyn
a80d082242 CopyPasteManagerTest fails to test all values (#269)
CopyPasteManager unit tests were not fully run, the first item of arrays were never tested. (Luckily, the not-tested values were ok).

Updated from using a pre-decrement while loop to using a standard for loop with an iterator.
2019-03-12 14:58:47 -07:00
Johan Laanstra
67fa2286eb Remove duplicate .editorconfig. (#257)
* Remove duplicate .editorconfig
* Update .editorconfig to remove forcing crlf as discussed in #225.
2019-03-11 17:04:17 -07:00
Rudy Huyn
0f615faff9 Remove end-of-line from .editorconfig (#239)
* Add Editor config

* reset sln

* remove end-of-line setting
2019-03-09 15:46:32 -08:00
Shamkhal Maharramov
a98cb50a70 fix: redundant semicolons (#230)
### Description of the changes:
- Remove redundant semicolons in:
  - [x] UnitConverter.cpp
  - [x] DateCalculator.xaml.cpp
  - [x] CopyPasteManagerTest.cpp

### How changes were validated:
-  Manual
2019-03-09 08:16:05 -08:00
Rudy Huyn
140a5b3b21 add .editorconfig to set some basic coding styles (#225)
To maintain consistent code style between contributors and simplify merging, the solution should provide a .editorconfig to set some basic rules (already used by the current code source).

- use `UTF-8` with BOM (some files are without)
- use CR-LF
- use <kbd>Space</kbd> to indent (sorry #teamTab)
- trim trailing whitespace 
- be sure to add a new line at the end of files.

[Documentation](https://docs.microsoft.com/en-us/visualstudio/ide/create-portable-custom-editor-options?view=vs-2017)
2019-03-09 08:09:51 -08:00
Petr Sedláček
248b762b80 Fix indentation and extra newline (#198) 2019-03-08 23:47:40 -08:00
Ruige Lee
595ae6a8ff Update punctuation in README.md (#205) 2019-03-08 23:18:41 -08:00
Brett Waldbaum
64c6493312
Build with /W4 (#197)
All projects are built with warning level 4 (/W4) and treat warnings as errors (/WX).
Fixed build errors resulting from enabling these compiler flags.
2019-03-08 23:15:28 -08:00
marcellogianola
e0f70e8c37 fixed typo (#171) 2019-03-08 13:46:36 -08:00
Michał Janiszewski
c85d7ec454 Compare locale strings, not their pointers (#183)
Change the stored locale type to wstring to make the comparison operator
work.
2019-03-08 13:45:39 -08:00
Michał Janiszewski
0197bf18c1 Add override keyword where applicable (#188) 2019-03-08 11:18:01 -08:00
Lorenz Nickel
c1174e057d Remove invalid links from comments (#201)
Remove invalid links from comments
2019-03-08 10:28:35 -08:00
Michał Janiszewski
c6b770eec8 Fix usage of temporary string (#185) 2019-03-07 22:10:20 -08:00
Michał Janiszewski
c325cb1b3a Remove duplicated condition checks (#187) 2019-03-07 22:09:37 -08:00
Michał Janiszewski
13ba479a0c Remove unused variable (#184) 2019-03-07 21:38:40 -08:00
Michał Janiszewski
e2c7db644d Mark classes as final where applicable (#189) 2019-03-07 19:46:53 -08:00
Michał Janiszewski
0166daf5c7 Replace escape sequences with path separators in include paths 2019-03-07 15:51:00 -08:00
Josh Soref
84941c698e Spelling (#135) 2019-03-07 10:27:13 -08:00
Christian Oliff
07f4cc1926 HTTPS link to editorconfig.org (#134) 2019-03-07 10:02:44 -08:00
Michał Janiszewski
2320697562 Catch polymorphic types by const-ref (#125) 2019-03-07 09:45:51 -08:00
Rudy Huyn
20afac5572 Modify how default units are selected for conversions (#126) 2019-03-07 09:24:34 -08:00
Josh Soref
8a75dcd09d Switch urls from http: to https: (#137) 2019-03-07 08:56:25 -08:00
Karan Nandwani
dc00380d0f updating nuget.org source to point to V3 (#129) 2019-03-07 07:33:22 -08:00
Josh Soref
6a1c2e4bbf Fix smart quotes (#131) 2019-03-06 18:47:27 -08:00
Jared Fuchs
8fa9a691cc Fix comment on IsEven
Looks like the comment on IsEven should read this way instead of "The assumption here is its numerator is 1 and we are testing the numerator is even or not"
2019-03-06 17:14:50 -08:00
Michał Janiszewski
6c0e4e81e7 Remove unused values 2019-03-06 16:47:02 -08:00
Michał Janiszewski
ca01a7e444 Add explicit [[fallthrough]] attribute 2019-03-06 16:44:28 -08:00
Edward Betts
0197fa41da Correct spelling mistakes 2019-03-06 16:10:14 -08:00
Michał Janiszewski
07ff1c372f Fix initialization order in CEngine (#118)
The order of initialization of fields is required to match the one in
class member fields declaration.
2019-03-06 14:51:21 -08:00
Barry Langer
1eb717f336 windows store is now called microsoft store 2019-03-06 11:51:52 -08:00
Matt Cooley
941d211181
Update pipelines badge on README to point to public CI (#99) 2019-03-06 10:45:00 -08:00
Daniel Belcher
057401f5f2 Suppress conversion warning in Ratpack/conv.cpp.
When building for x64, the compiler complains:
    warning C4267: 'argument': conversion from 'size_t' to 'ULONG', possible loss of data

In practice, the number string will not exceed a ULONG in length.
2019-03-05 21:42:24 -08:00
Stephanie Anderl
b865b1b2aa
Add Checked Event Handler to Add/Subtract Radio Buttons to enable Narrator (#91)
* added bug report and feature request issue tempaltes

* copied pull_request_template.md to .github folder

* Updated the DateCalculation narrator logic to use PropertyChangedCallbacks for the DateResultLabel and DateDiffAllUnitsResultLabel TextBlocks.

* Reverted textblock callback changes and added an event handler for when the radio buttons are checked.

* Revert NarratorAnnouncement.h changes and removed unused code from DataCalculator.xaml.h. Updated comments in RaiseNotification method in DateCalculator.xaml.cpp

* Reverted changes in NarratorAnnouncement.h and NarratorAnnouncement.cpp

* Added SAL annotation to AddSubtractOption_Checked

* Remove namespaces from input types on AddSubtractOption_Checked
2019-03-05 20:26:37 -08:00