From 500d0c61325b097df66f6a8f1981e71bf30ff139 Mon Sep 17 00:00:00 2001 From: Neil Date: Thu, 16 Jul 2020 08:04:11 +1000 Subject: Backport: Make EncodingFamily an enum class for more type safety. Backport of changeset 8408:e89f22691610. --- src/PositionCache.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/PositionCache.cxx') diff --git a/src/PositionCache.cxx b/src/PositionCache.cxx index 5b9c2ddd4..06e3586f2 100644 --- a/src/PositionCache.cxx +++ b/src/PositionCache.cxx @@ -505,10 +505,10 @@ TextSegment BreakFinder::Next() { const int prev = nextBreak; while (nextBreak < lineRange.end) { int charWidth = 1; - if (encodingFamily == efUnicode) + if (encodingFamily == EncodingFamily::unicode) charWidth = UTF8DrawBytes(reinterpret_cast(&ll->chars[nextBreak]), static_cast(lineRange.end - nextBreak)); - else if (encodingFamily == efDBCS) + else if (encodingFamily == EncodingFamily::dbcs) charWidth = pdoc->DBCSDrawBytes( &ll->chars[nextBreak], static_cast(lineRange.end - nextBreak)); const Representation *repr = preprs->RepresentationFromCharacter(&ll->chars[nextBreak], charWidth); -- cgit v1.2.3