diff options
author | Neil <nyamatongwe@gmail.com> | 2021-05-20 16:38:48 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2021-05-20 16:38:48 +1000 |
commit | 7f8a8cfb32aecb70fe10ef26fe096f4092f7e673 (patch) | |
tree | 9363cf8193aff09a46a4c0d845e4d3762d749d89 /src/Document.cxx | |
parent | 1a4952f5f7b03e65dbe1f38fb7826748e5b8d66f (diff) | |
download | scintilla-mirror-7f8a8cfb32aecb70fe10ef26fe096f4092f7e673.tar.gz |
Prefer Sci::invalidPosition to INVALID_POSITION as Scintilla.h will eventually
not be visible to most code.
Diffstat (limited to 'src/Document.cxx')
-rw-r--r-- | src/Document.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Document.cxx b/src/Document.cxx index fbe407515..c8f474eaa 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -945,14 +945,14 @@ Sci_Position SCI_METHOD Document::GetRelativePosition(Sci_Position positionStart while (characterOffset != 0) { const Sci::Position posNext = NextPosition(pos, increment); if (posNext == pos) - return INVALID_POSITION; + return Sci::invalidPosition; pos = posNext; characterOffset -= increment; } } else { pos = positionStart + characterOffset; if ((pos < 0) || (pos > Length())) - return INVALID_POSITION; + return Sci::invalidPosition; } return pos; } @@ -964,7 +964,7 @@ Sci::Position Document::GetRelativePositionUTF16(Sci::Position positionStart, Sc while (characterOffset != 0) { const Sci::Position posNext = NextPosition(pos, increment); if (posNext == pos) - return INVALID_POSITION; + return Sci::invalidPosition; if (std::abs(pos-posNext) > 3) // 4 byte character = 2*UTF16. characterOffset -= increment; pos = posNext; @@ -973,7 +973,7 @@ Sci::Position Document::GetRelativePositionUTF16(Sci::Position positionStart, Sc } else { pos = positionStart + characterOffset; if ((pos < 0) || (pos > LengthNoExcept())) - return INVALID_POSITION; + return Sci::invalidPosition; } return pos; } |