Closed
Bug 334704
Opened 18 years ago
Closed 18 years ago
calIDuration.addDuration doesn't work well with isNegative
Categories
(Calendar :: Internal Components, defect)
Calendar
Internal Components
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: jminta, Assigned: mvl)
Details
Attachments
(1 file)
1.15 KB,
patch
|
dmosedale
:
first-review+
|
Details | Diff | Splinter Review |
js> var dur1 = Components.classes["@mozilla.org/calendar/duration;1"].createInstance(Components.interfaces.calIDuration); js> var dur2 = Components.classes["@mozilla.org/calendar/duration;1"].createInstance(Components.interfaces.calIDuration); js> dur1.days = 8; 8 js> dur2.days = 8; 8 js> dur2.isNegative = true; true js> dur1.normalize(); js> dur2.normalize(); js> dur2.addDuration(dur1); js> dur2; -P2W2D This is killing us in month-view performance, because we always recreate the grid. My guess is that icalDurations may stick the negative signs on the .weeks (.days, etc) attributes, while we don't. This would cause the observed behavior. http://lxr.mozilla.org/mozilla/source/calendar/base/src/calDuration.cpp#249
Assignee | ||
Comment 1•18 years ago
|
||
I wonder how i managed to get this wrong... But with the patch, it passes my testcase.
Comment 2•18 years ago
|
||
Comment on attachment 219053 [details] [diff] [review] fix r=dmose
Attachment #219053 -
Flags: first-review?(dmose) → first-review+
Assignee | ||
Comment 3•18 years ago
|
||
patch checked in
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•