Closed Bug 393412 Opened 13 years ago Closed 13 years ago

calPeriod code improvements

Categories

(Calendar :: Internal Components, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: dbo, Assigned: dbo)

Details

Attachments

(1 file)

No description provided.
Attachment #277905 - Flags: review?(mvl)
Comment on attachment 277905 [details] [diff] [review]
some improvements

>Index: mozilla/calendar/base/src/calPeriod.cpp
> NS_IMETHODIMP calPeriod::SetStart(calIDateTime *aValue)
>-    aValue->GetInTimezone(NS_LITERAL_CSTRING("UTC"), getter_AddRefs(mStart));
>-    return mStart->MakeImmutable();
>+    nsresult rv = aValue->GetInTimezone(
>+        NS_LITERAL_CSTRING("UTC"), getter_AddRefs(mStart));
>+    if (NS_SUCCEEDED(rv))
>+        rv = mStart->MakeImmutable();
>+    return rv;
I would prefer to use NS_ENSURE_SUCCESS after the GetInTimezone call, so you get a bit more information when something fails and you use a debug build.

> NS_IMETHODIMP calPeriod::SetEnd(calIDateTime *aValue)
Same in this method.

r=mvl
Attachment #277905 - Flags: review?(mvl) → review+
Checked in on HEAD and MOZILLA_1_8_BRANCH.
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → 0.7
verified
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.