diff --git a/src/kits/interface/TextView.cpp b/src/kits/interface/TextView.cpp index b50d1e47a0..4d4e7f169f 100644 --- a/src/kits/interface/TextView.cpp +++ b/src/kits/interface/TextView.cpp @@ -4170,8 +4170,8 @@ BTextView::_StyledWidth(int32 fromOffset, int32 length, float* outAscent, // iterate through the style runs const BFont *font = NULL; - int32 numChars; - while ((numChars = fStyles->Iterate(fromOffset, length, fInline, &font, + int32 numBytes; + while ((numBytes = fStyles->Iterate(fromOffset, length, fInline, &font, NULL, &ascent, &descent)) != 0) { maxAscent = max_c(ascent, maxAscent); maxDescent = max_c(descent, maxDescent); @@ -4180,18 +4180,18 @@ BTextView::_StyledWidth(int32 fromOffset, int32 length, float* outAscent, // Use _BWidthBuffer_ if possible if (BPrivate::gWidthBuffer != NULL) { result += BPrivate::gWidthBuffer->StringWidth(*fText, fromOffset, - numChars, font); + numBytes, font); } else { #endif - const char* text = fText->GetString(fromOffset, &numChars); - result += font->StringWidth(text, numChars); + const char* text = fText->GetString(fromOffset, &numBytes); + result += font->StringWidth(text, numBytes); #if USE_WIDTHBUFFER } #endif - fromOffset += numChars; - length -= numChars; + fromOffset += numBytes; + length -= numBytes; } if (outAscent != NULL)