From 7a875962c50e21c6403bdeecc549faca72a3bea1 Mon Sep 17 00:00:00 2001 From: Neil Date: Tue, 8 Jul 2014 13:08:02 +1000 Subject: Specifying some methods as const as they are used from display and measurement code that will be changed to have read-only access. --- src/Editor.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/Editor.cxx') diff --git a/src/Editor.cxx b/src/Editor.cxx index d3e5f3090..686012f32 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -355,7 +355,7 @@ void Editor::RefreshStyleData() { } } -Point Editor::GetVisibleOriginInMain() { +Point Editor::GetVisibleOriginInMain() const { return Point(0,0); } @@ -379,8 +379,9 @@ int Editor::TopLineOfMain() const { return topLine; } -PRectangle Editor::GetClientRectangle() { - return wMain.GetClientPosition(); +PRectangle Editor::GetClientRectangle() const { + Window &win = const_cast(wMain); + return win.GetClientPosition(); } PRectangle Editor::GetClientDrawingRectangle() { @@ -394,7 +395,7 @@ PRectangle Editor::GetTextRectangle() { return rc; } -int Editor::LinesOnScreen() { +int Editor::LinesOnScreen() const { PRectangle rcClient = GetClientRectangle(); int htClient = static_cast(rcClient.bottom - rcClient.top); //Platform::DebugPrintf("lines on screen = %d\n", htClient / lineHeight + 1); -- cgit v1.2.3