Fix two painting glitches in the TableReportView:

 - The estimated viewport width can be an underestimate.  When this
   happens, the horizontal scrollbar will have a greater range than
   necessary to show the content, so it was possible to scroll past the
   right end of the header.  Fix this and simplify the header width
   computation.

 - The estimated viewport height can also be an underestimate.  When this
   happens, the drawRow2 value computed in paintEvent can be one too small.
   The drawRow1 + visibleItemCount() value can also be much larger than
   needed -- if the paint event only affects the bottom-most row, then we
   should not draw an entire viewport's worth of rows.  On OS X, there was
   a problem where the bottom-most row flickered on and off as paint events
   alternately covered the entire viewport or just the part under the
   horizontal scrollbar.  Fix this by using event->rect().bottom(), just
   like we're already using event->rect().top() to compute drawRow1.