From 7f7c10aaacf7d3b64efc7e8b0d374474eb9bc738 Mon Sep 17 00:00:00 2001 From: cxl Date: Sun, 25 Oct 2009 17:58:33 +0000 Subject: [PATCH] RichText: RichTextLayoutTracer added npy parameter to TableCell git-svn-id: svn://ultimatepp.org/upp/trunk@1655 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/CtrlLib/TabCtrl.cpp | 3 ++- uppsrc/RichText/RichText.h | 2 +- uppsrc/RichText/TablePaint.cpp | 2 +- uppsrc/RichText/TextData.cpp | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) 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