edior: use document-getter more consistently
This commit is contained in:
parent
8f94efbc62
commit
b85a3bddcb
@ -681,7 +681,10 @@ static int getScrollPos(HWND hwnd, int bar)
|
||||
|
||||
void TrackView::setRows(size_t rows)
|
||||
{
|
||||
document->setRows(rows);
|
||||
SyncDocument *doc = getDocument();
|
||||
assert(doc);
|
||||
|
||||
doc->setRows(rows);
|
||||
InvalidateRect(getWin(), NULL, FALSE);
|
||||
setEditRow(min(editRow, int(rows) - 1));
|
||||
}
|
||||
|
||||
@ -34,8 +34,10 @@ public:
|
||||
void setRows(size_t rows);
|
||||
size_t getRows() const
|
||||
{
|
||||
if (NULL == document) return 0;
|
||||
return document->getRows();
|
||||
const SyncDocument *doc = getDocument();
|
||||
if (!doc)
|
||||
return 0;
|
||||
return doc->getRows();
|
||||
}
|
||||
|
||||
void setFont(HFONT font);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user