edior: use document-getter more consistently

This commit is contained in:
Erik Faye-Lund 2011-07-16 14:40:24 +02:00
parent 8f94efbc62
commit b85a3bddcb
2 changed files with 8 additions and 3 deletions

View File

@ -681,7 +681,10 @@ static int getScrollPos(HWND hwnd, int bar)
void TrackView::setRows(size_t rows) void TrackView::setRows(size_t rows)
{ {
document->setRows(rows); SyncDocument *doc = getDocument();
assert(doc);
doc->setRows(rows);
InvalidateRect(getWin(), NULL, FALSE); InvalidateRect(getWin(), NULL, FALSE);
setEditRow(min(editRow, int(rows) - 1)); setEditRow(min(editRow, int(rows) - 1));
} }

View File

@ -34,8 +34,10 @@ public:
void setRows(size_t rows); void setRows(size_t rows);
size_t getRows() const size_t getRows() const
{ {
if (NULL == document) return 0; const SyncDocument *doc = getDocument();
return document->getRows(); if (!doc)
return 0;
return doc->getRows();
} }
void setFont(HFONT font); void setFont(HFONT font);