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/LineMarker.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/LineMarker.cxx') diff --git a/src/LineMarker.cxx b/src/LineMarker.cxx index a2f7e299e..53231d778 100644 --- a/src/LineMarker.cxx +++ b/src/LineMarker.cxx @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -377,14 +378,13 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac DrawMinus(surface, centreX, centreY, blobSize, colourTail); } else if (markType >= SC_MARK_CHARACTER) { - char character[1]; - character[0] = static_cast(markType - SC_MARK_CHARACTER); - const XYPOSITION width = surface->WidthText(fontForCharacter, character, 1); + std::string character(1, static_cast(markType - SC_MARK_CHARACTER)); + const XYPOSITION width = surface->WidthText(fontForCharacter, character); PRectangle rcText = rc; rcText.left += (rc.Width() - width) / 2; rcText.right = rc.left + width; surface->DrawTextClipped(rcText, fontForCharacter, rcText.bottom - 2, - character, 1, fore, back); + character, fore, back); } else if (markType == SC_MARK_DOTDOTDOT) { XYPOSITION right = static_cast(centreX - 6); -- cgit v1.2.3