diff options
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r-- | src/Editor.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 0c1336aa0..e5c997cf4 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -1775,7 +1775,7 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) { PRectangle rcSelMargin = rcMargin; rcSelMargin.right = rcMargin.left; - for (int margin = 0; margin < vs.margins; margin++) { + for (int margin = 0; margin <= SC_MAX_MARGIN; margin++) { if (vs.ms[margin].width > 0) { rcSelMargin.left = rcSelMargin.right; @@ -3727,7 +3727,7 @@ long Editor::FormatRange(bool draw, Sci_RangeToFormat *pfr) { // Modify the view style for printing as do not normally want any of the transient features to be printed // Printing supports only the line number margin. int lineNumberIndex = -1; - for (int margin = 0; margin < ViewStyle::margins; margin++) { + for (int margin = 0; margin <= SC_MAX_MARGIN; margin++) { if ((vsPrint.ms[margin].style == SC_MARGIN_NUMBER) && (vsPrint.ms[margin].width > 0)) { lineNumberIndex = margin; } else { @@ -4455,7 +4455,7 @@ void Editor::NotifyIndicatorClick(bool click, int position, bool shift, bool ctr bool Editor::NotifyMarginClick(Point pt, bool shift, bool ctrl, bool alt) { int marginClicked = -1; int x = 0; - for (int margin = 0; margin < ViewStyle::margins; margin++) { + for (int margin = 0; margin <= SC_MAX_MARGIN; margin++) { if ((pt.x >= x) && (pt.x < x + vs.ms[margin].width)) marginClicked = margin; x += vs.ms[margin].width; @@ -6122,7 +6122,7 @@ bool Editor::PointInSelMargin(Point pt) { Window::Cursor Editor::GetMarginCursor(Point pt) { int x = 0; - for (int margin = 0; margin < ViewStyle::margins; margin++) { + for (int margin = 0; margin <= SC_MAX_MARGIN; margin++) { if ((pt.x >= x) && (pt.x < x + vs.ms[margin].width)) return static_cast<Window::Cursor>(vs.ms[margin].cursor); x += vs.ms[margin].width; @@ -7056,7 +7056,7 @@ void Editor::AddStyledText(char *buffer, int appendLength) { } static bool ValidMargin(unsigned long wParam) { - return wParam < ViewStyle::margins; + return wParam <= SC_MAX_MARGIN; } static char *CharPtrFromSPtr(sptr_t lParam) { |