Closed
Bug 325459
Opened 19 years ago
Closed 19 years ago
monthview's relayout fails
Categories
(Calendar :: Internal Components, defect)
Calendar
Internal Components
Tracking
(Not tracked)
RESOLVED
FIXED
Lightning 0.1
People
(Reporter: mvl, Unassigned)
References
Details
Attachments
(4 files, 2 obsolete files)
1.11 KB,
patch
|
dmosedale
:
first-review+
|
Details | Diff | Splinter Review |
1.20 KB,
patch
|
dmosedale
:
first-review+
|
Details | Diff | Splinter Review |
6.28 KB,
patch
|
Details | Diff | Splinter Review | |
4.92 KB,
patch
|
dmosedale
:
first-review+
|
Details | Diff | Splinter Review |
monthview's relayout does some math with durations, but that fails, due to a bug with adding negative durations. And if it succeeds, it gets the wrong duration (34 days, that's not a multiple of 7) And fixing that uncovers other bugs...
Reporter | ||
Comment 1•19 years ago
|
||
This patch fixes the duration part, but applying it will raise errors in the month view.
Comment 2•19 years ago
|
||
GetInSeconds is now aware of the is_neg-flag.
Attachment #210357 -
Flags: first-review?(mvl)
Reporter | ||
Comment 3•19 years ago
|
||
Comment on attachment 210357 [details] [diff] [review] patch for GetInSeconds I can't review this yet, because those patches will break the monthview. It would be best to create one big patch out of those small patches that fixes everything. (also, please don't use tabs)
Attachment #210357 -
Flags: first-review?(mvl)
Comment 4•19 years ago
|
||
dmose reviewed the initial checkin of this code. This cleans up my mess (How did I write such bad code?). The problems were mostly reference errors from moving reuseExistingGrid into a separate function. Combined with the other patches on this bug, there needed to be a restructuring of the logic for when we can and cannot reuse the grid. Before, we would get a 7 or -7 in the duration, now we need to check isNegative. I also broke out some of the easier if() cases with returns, to avoid excessive indentation. A patch -w will follow to make it clear what code actually changed.
Comment 6•19 years ago
|
||
Comment on attachment 210427 [details] [diff] [review] patch -w bah... this still isn't right :-( It doesn't reuse the grid when rows don't need to be added or subtracted.
Attachment #210427 -
Attachment is obsolete: true
Attachment #210427 -
Flags: first-review?(dmose)
Reporter | ||
Comment 7•19 years ago
|
||
I think that calculating the duration is wrong: it doesn't take the last day into account, because the last day is inclusive, not exclusive.
Comment 8•19 years ago
|
||
Patch fixes the previous issue of not re-using every time we actually could. With this new version, we should reuse the grid every month (expect, of course, when the view is first loaded).
Attachment #210426 -
Attachment is obsolete: true
Comment 9•19 years ago
|
||
updated patch -w for review
Attachment #210478 -
Flags: first-review?(dmose)
Comment 10•19 years ago
|
||
(In reply to comment #7) > I think that calculating the duration is wrong: it doesn't take the last day > into account, because the last day is inclusive, not exclusive. > The duration does come out at X weeks+6 days, but it comes out that way for both the old grid and the new start/end date, so it's ok.
Comment 11•19 years ago
|
||
Comment on attachment 210353 [details] [diff] [review] partial patch, just fixes calDuration.cpp r=dmose, but with a modified comment. Two negatives cannot ever add together to become a positive.
Attachment #210353 -
Flags: first-review+
Comment 12•19 years ago
|
||
Comment on attachment 210357 [details] [diff] [review] patch for GetInSeconds r=dmose
Attachment #210357 -
Flags: first-review+
Updated•19 years ago
|
OS: Linux → All
Hardware: PC → All
Target Milestone: --- → Lightning 0.1
Comment 13•19 years ago
|
||
Comment on attachment 210478 [details] [diff] [review] patch -w Looks good; just a couple of nits: > > // If we've already drawn a view once, then in almost all cases we > // can resuse most of the grid. We may need to add or subtract a row Fix the "reuse" spelling as long as you're here? > // but this is still much faster than recreating all rows. > var canReuse = false; This var can go away now, I think. >+ >+ // OK, so we're off by one month. We either need to add or subtract s/month/week/, right? >+ var gridrows = this.monthgridrows; >+ Since this only gets referenced once, how about just accessing it directly rather than creating a temporary? r=dmose with those addressed
Attachment #210478 -
Flags: first-review?(dmose) → first-review+
Reporter | ||
Comment 14•19 years ago
|
||
Comment on attachment 210353 [details] [diff] [review] partial patch, just fixes calDuration.cpp >+ // Check if we need to add or substract. Remeber, two negatives >+ // can add to something positive. >+ if (idt.is_neg != mDuration.is_neg) { A better comment: // Calculate the new absolute value of the duration // For two negative durations, the abs. value will increase, // so use + in that case. // Ofcourse, also use + when both durations are positive.
Comment 15•19 years ago
|
||
All patches checked in
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Comment 16•18 years ago
|
||
The bugspam monkeys have struck again. They are currently chewing on default assignees for Calendar. Be afraid for your sanity!
Assignee: base → nobody
You need to log in
before you can comment on or make changes to this bug.
Description
•