Closed Bug 846575 Opened 9 years ago Closed 9 years ago

Create a convenience member of ReflowConfig for isBalancing

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla22

People

(Reporter: jwir3, Assigned: jwir3)

Details

Attachments

(1 file)

Currently, to check if we're balancing columns in nsColumnSetFrame, we use a comparison of ColumnBalanceData.mBalanceColCount to INT32_MAX. Instead of doing this everywhere, we should add a convenience function, IsBalancing() to ColumnBalanceData, to help clean up the code and make it a bit more readable.
Summary: Create a convenience function for isBalancing → Create a convenience member of ReflowConfig for isBalancing
Attached patch b846575Splinter Review
Also pushed to try:

https://tbpl.mozilla.org/?tree=Try&rev=53dc72d8c5a4
Assignee: nobody → sjohnson
Attachment #721881 - Flags: review?(fantasai.bugs)
Comment on attachment 721881 [details] [diff] [review]
b846575

+  ReflowConfig config = { numColumns, colWidth, expectedWidthLeftOver, colGap,
+                          colHeight, numColumns < INT32_MAX };

Any reason "numColumns < INT32_MAX" isn't just "isBalancing"?
Attachment #721881 - Flags: review?(fantasai.bugs) → review+
(In reply to fantasai from comment #2)
> Any reason "numColumns < INT32_MAX" isn't just "isBalancing"?

Nope, other than I wrote that first then refactored the rest of the function, and promptly forgot. ;) I've changed it, and I'll push it to inbound as soon as inbound opens back up.
Inbound:
https://hg.mozilla.org/integration/mozilla-inbound/rev/31823d274fd1
Target Milestone: --- → mozilla22
https://hg.mozilla.org/mozilla-central/rev/31823d274fd1
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.