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)
|
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));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user