aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2014-07-08 13:08:02 +1000
committerNeil <nyamatongwe@gmail.com>2014-07-08 13:08:02 +1000
commit7a875962c50e21c6403bdeecc549faca72a3bea1 (patch)
treeb401353891efd11380cbf35c2bcd178bc08aacdc /src
parentf2749ccb2d9dbf953733900f02aa0baa6e695cd7 (diff)
downloadscintilla-mirror-7a875962c50e21c6403bdeecc549faca72a3bea1.tar.gz
Specifying some methods as const as they are used from display and measurement
code that will be changed to have read-only access.
Diffstat (limited to 'src')
-rw-r--r--src/Editor.cxx9
-rw-r--r--src/Editor.h6
2 files changed, 8 insertions, 7 deletions
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<Window &>(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<int>(rcClient.bottom - rcClient.top);
//Platform::DebugPrintf("lines on screen = %d\n", htClient / lineHeight + 1);
diff --git a/src/Editor.h b/src/Editor.h
index c7d44c16d..103891e71 100644
--- a/src/Editor.h
+++ b/src/Editor.h
@@ -333,14 +333,14 @@ protected: // ScintillaBase subclass needs access to much of Editor
// The top left visible point in main window coordinates. Will be 0,0 except for
// scroll views where it will be equivalent to the current scroll position.
- virtual Point GetVisibleOriginInMain();
+ virtual Point GetVisibleOriginInMain() const;
Point DocumentPointFromView(Point ptView); // Convert a point from view space to document
int TopLineOfMain() const; // Return the line at Main's y coordinate 0
- virtual PRectangle GetClientRectangle();
+ virtual PRectangle GetClientRectangle() const;
virtual PRectangle GetClientDrawingRectangle();
PRectangle GetTextRectangle();
- int LinesOnScreen();
+ int LinesOnScreen() const;
int LinesToScroll();
int MaxScrollPos();
SelectionPosition ClampPositionIntoDocument(SelectionPosition sp) const;