Closed Bug 370390 Opened 19 years ago Closed 19 years ago

can't drag an event to a previous day in weekview

Categories

(Calendar :: Calendar Frontend, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mvl, Assigned: mvl)

Details

Attachments

(1 file)

In weekview, when dragging an item to a previous day (say from today to yesterday), the event moves to somewhere in 2002.
The problem was in calDateTime. Subtracting dates did not work properly with unsigned numbers. PR_USEC_PER_SEC is unsigned, and then the division fails. Making it signed fixed the problem
Assignee: nobody → mvl
Status: NEW → ASSIGNED
Attachment #255100 - Flags: first-review?(daniel.boelzle)
Comment on attachment 255100 [details] [diff] [review] patch caldatetime Side-Note: my msvc doesn't show this problem, seems to promote UL literal to __int64 for division. 1st r=dbo.
Attachment #255100 - Flags: first-review?(daniel.boelzle) → first-review+
patch checked in. Might indeed be a gcc only problem.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
(In reply to comment #3) > Might indeed be a gcc only problem. Hmm. I don't know whether this is really a problem of gcc or something that's left open: The C++ standard states that e.g. dividing a long and an unsigned short, the unsigned short is to be promoted to signed long if it can be converted safely (which it can). In this case we do a division long long and unsigned long (literal). So (extrapolating) the standard, we could assume to safely deduce it to signed, but... Anyway, long long is not standardized, so it's safe (and clearer) to put in the cast.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: