aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/MarginView.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2016-01-31 14:38:11 +1100
committerNeil <nyamatongwe@gmail.com>2016-01-31 14:38:11 +1100
commitd94214b41cc24a20d69076a4f6dbd43a48d137e2 (patch)
tree6f829cecd7a2f4e4d54e9508c4d7f3d5b9c19256 /src/MarginView.cxx
parentdc4cef62cd7114c9a96f40005aeb983a7ea0c701 (diff)
downloadscintilla-mirror-d94214b41cc24a20d69076a4f6dbd43a48d137e2.tar.gz
Replace expressions to find level number of a fold level with function call.
Simplifies code by removing any precedence issues and is shorter.
Diffstat (limited to 'src/MarginView.cxx')
-rw-r--r--src/MarginView.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/MarginView.cxx b/src/MarginView.cxx
index f164a7cb1..52a2cb2dd 100644
--- a/src/MarginView.cxx
+++ b/src/MarginView.cxx
@@ -243,7 +243,7 @@ void MarginView::PaintMargin(Surface *surface, int topLine, PRectangle rc, PRect
levelPrev = model.pdoc->GetLevel(lineBack);
}
if (!(levelPrev & SC_FOLDLEVELHEADERFLAG)) {
- if ((level & SC_FOLDLEVELNUMBERMASK) < (levelPrev & SC_FOLDLEVELNUMBERMASK))
+ if (LevelNumber(level) < LevelNumber(levelPrev))
needWhiteClosure = true;
}
}
@@ -279,8 +279,8 @@ void MarginView::PaintMargin(Surface *surface, int topLine, PRectangle rc, PRect
// Decide which fold indicator should be displayed
const int level = model.pdoc->GetLevel(lineDoc);
const int levelNext = model.pdoc->GetLevel(lineDoc + 1);
- const int levelNum = level & SC_FOLDLEVELNUMBERMASK;
- const int levelNextNum = levelNext & SC_FOLDLEVELNUMBERMASK;
+ const int levelNum = LevelNumber(level);
+ const int levelNextNum = LevelNumber(levelNext);
if (level & SC_FOLDLEVELHEADERFLAG) {
if (firstSubLine) {
if (levelNum < levelNextNum) {
@@ -312,7 +312,7 @@ void MarginView::PaintMargin(Surface *surface, int topLine, PRectangle rc, PRect
needWhiteClosure = false;
const int firstFollowupLine = model.cs.DocFromDisplay(model.cs.DisplayFromDoc(lineDoc + 1));
const int firstFollowupLineLevel = model.pdoc->GetLevel(firstFollowupLine);
- const int secondFollowupLineLevelNum = model.pdoc->GetLevel(firstFollowupLine + 1) & SC_FOLDLEVELNUMBERMASK;
+ const int secondFollowupLineLevelNum = LevelNumber(model.pdoc->GetLevel(firstFollowupLine + 1));
if (!model.cs.GetExpanded(lineDoc)) {
if ((firstFollowupLineLevel & SC_FOLDLEVELWHITEFLAG) &&
(levelNum > secondFollowupLineLevelNum))
@@ -380,7 +380,7 @@ void MarginView::PaintMargin(Surface *surface, int topLine, PRectangle rc, PRect
sprintf(number, "%c%c %03X %03X",
(lev & SC_FOLDLEVELHEADERFLAG) ? 'H' : '_',
(lev & SC_FOLDLEVELWHITEFLAG) ? 'W' : '_',
- lev & SC_FOLDLEVELNUMBERMASK,
+ LevelNumber(lev),
lev >> 16
);
} else {