diff --git a/uppsrc/CtrlLib/TabCtrl.cpp b/uppsrc/CtrlLib/TabCtrl.cpp index 9494848b6..76f47f593 100644 --- a/uppsrc/CtrlLib/TabCtrl.cpp +++ b/uppsrc/CtrlLib/TabCtrl.cpp @@ -136,7 +136,8 @@ void TabCtrl::Layout() if(tab.GetCount() && tab.Top().Right() < TabsRight()) x0 = 0; SyncHot(); - ScrollInto(sel); + if(sel < tab.GetCount()) + ScrollInto(sel); pane.VSizePos(style->tabheight + style->edge.top, style->edge.bottom) .HSizePos(style->edge.left, style->edge.right); left.LeftPos(0, 16).TopPos(th - 16, 16); diff --git a/uppsrc/RichText/RichText.h b/uppsrc/RichText/RichText.h index 177fa572e..2bdaf1d8a 100644 --- a/uppsrc/RichText/RichText.h +++ b/uppsrc/RichText/RichText.h @@ -105,7 +105,7 @@ struct RichTextLayoutTracer { virtual void EndTable(PageY y); virtual void TableRow(const Rect& page, PageY y, int i, const RichTable& table); virtual void EndTableRow(PageY y); - virtual void TableCell(const Rect& page, PageY y, int i, int j, const RichTable& table); + virtual void TableCell(const Rect& page, PageY y, int i, int j, const RichTable& table, PageY ny); virtual void EndTableCell(PageY y); }; diff --git a/uppsrc/RichText/TablePaint.cpp b/uppsrc/RichText/TablePaint.cpp index 8b6ba5778..f0bdc8b1a 100644 --- a/uppsrc/RichText/TablePaint.cpp +++ b/uppsrc/RichText/TablePaint.cpp @@ -75,7 +75,7 @@ bool RichTable::RowPaint(PageDraw& pw, const RichStyles& st, const Layout& tab, } if(paint) { if(pw.tracer) - pw.tracer->TableCell(rc.page, rc.py, i, j, *this); + pw.tracer->TableCell(rc.page, rc.py, i, j, *this, pyy); row[j].Paint(pw, rc, pyy, xpg, y, ny, pi, sel && j >= pi.cells.left && i >= pi.cells.top && j + cell.hspan <= pi.cells.right && i + cell.vspan <= pi.cells.bottom); diff --git a/uppsrc/RichText/TextData.cpp b/uppsrc/RichText/TextData.cpp index 2ca0a2e36..c29701167 100644 --- a/uppsrc/RichText/TextData.cpp +++ b/uppsrc/RichText/TextData.cpp @@ -344,7 +344,7 @@ void RichTextLayoutTracer::Table(const Rect& page, PageY y, const RichTable& tab void RichTextLayoutTracer::EndTable(PageY y) {} void RichTextLayoutTracer::TableRow(const Rect& page, PageY y, int i, const RichTable& table) {} void RichTextLayoutTracer::EndTableRow(PageY y) {} -void RichTextLayoutTracer::TableCell(const Rect& page, PageY y, int i, int j, const RichTable& table) {} +void RichTextLayoutTracer::TableCell(const Rect& page, PageY y, int i, int j, const RichTable& table, PageY npy) {} void RichTextLayoutTracer::EndTableCell(PageY y) {} END_UPP_NAMESPACE