Opened 7 years ago
Closed 7 years ago
#13508 closed bug (fixed)
[Patch] Resolve Style Formatting Issue in BTimeUnitFormat/BDurationFormat
Reported by: | akshay | Owned by: | pulkomandy |
---|---|---|---|
Priority: | normal | Milestone: | Unscheduled |
Component: | Kits/Locale Kit | Version: | R1/Development |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
Issue:
BTimeUnitFormat doesn't incorporate style formatting while formatting a time unit. Format() does take style as an argument but the style is not used anywhere. So currently the abbreviated style(B_TIME_UNIT_ABBREVIATED) doesn't work and by default the time unit is formatted to the full style.
Fix:
- Move the style flag from BTimeUnitFormat::Format() to the BTimeUnitFormat constructors and call the relevant icu::TimeUnitFormat constructor.
- Map the Haiku defined style unit to the corresponding ICU unit.
- Move the style flag from BDurationFormat::Format() to the BDurationFormat constructors to map the changes in BTimeUnitFormat.
Attachments (2)
Change History (12)
by , 7 years ago
Attachment: | 0001-Fix-style-formatting-issue-in-BTimeUnitFormat-and-up.patch added |
---|
comment:1 by , 7 years ago
patch: | 0 → 1 |
---|
comment:2 by , 7 years ago
comment:3 by , 7 years ago
- I'll fix the commit message.
- Just to keep the order same: http://www.icu-project.org/apiref/icu4c/tmutfmt_8h_source.html
- Will fix the indentation issue.
- 'sk' was for static constant? kTimeUnitStyleToICU is fine to me.
comment:4 by , 7 years ago
I understand the logic for "sk", but I don't think we usually combine the letters. I could be wrong :)
The order for the constants does not need to be the same as there is a map to convert them. I think the important thing would be that all our constants are in the same order, and IIRC we went with "shortest to longest" for other formatting constants (for example for date formats), so it would be nice to have them all in the same order in the public APIs.
comment:5 by , 7 years ago
Don't know about that. Don't see any mention to static constant in coding guidelines. Also the patch submission guidelines says this: "When patching existing files that do not follow our Coding Guidelines, it is preferable to apply the stylization to the entire file. If that is not possible, then conform to the pervading style being used." So do I change the same for skUnitMap?
Okay I'll change it to the original order.
comment:6 by , 7 years ago
patch: | 1 → 0 |
---|
by , 7 years ago
Attachment: | 0001-Fix-style-formatting-issue-in-BTimeUnitFormat-update.patch added |
---|
comment:7 by , 7 years ago
patch: | 0 → 1 |
---|
comment:10 by , 7 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Commit message:
TimeUnitFormat.h:
DurationFormat.cpp
TimeUnitFormat.cpp