From 3fe056899ac8ad4882f59e196aaa56cd31c2e547 Mon Sep 17 00:00:00 2001 From: Neil Date: Mon, 14 May 2018 14:39:55 +1000 Subject: Modernize Platform.h (4) - update Surface to use string_view for text arguments. --- src/CallTip.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/CallTip.cxx') diff --git a/src/CallTip.cxx b/src/CallTip.cxx index 2eab1146f..437933af9 100644 --- a/src/CallTip.cxx +++ b/src/CallTip.cxx @@ -154,13 +154,13 @@ void CallTip::DrawChunk(Surface *surface, int &x, const char *s, } else if (IsTabCharacter(s[startSeg])) { xEnd = NextTabPos(x); } else { - xEnd = x + static_cast(lround(surface->WidthText(font, s + startSeg, endSeg - startSeg))); + std::string_view segText(s + startSeg, endSeg - startSeg); + xEnd = x + static_cast(lround(surface->WidthText(font, segText))); if (draw) { rcClient.left = static_cast(x); rcClient.right = static_cast(xEnd); surface->DrawTextTransparent(rcClient, font, static_cast(ytext), - s+startSeg, endSeg - startSeg, - highlight ? colourSel : colourUnSel); + segText, highlight ? colourSel : colourUnSel); } } x = xEnd; -- cgit v1.2.3