aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/LineMarker.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2018-05-14 14:39:55 +1000
committerNeil <nyamatongwe@gmail.com>2018-05-14 14:39:55 +1000
commit3fe056899ac8ad4882f59e196aaa56cd31c2e547 (patch)
treedcbd61fefbf0dad1472713d890b7c9d6fc8d4814 /src/LineMarker.cxx
parentc4aa7826f3d2178e39e5bff2f6886d7d3d3f46d7 (diff)
downloadscintilla-mirror-3fe056899ac8ad4882f59e196aaa56cd31c2e547.tar.gz
Modernize Platform.h (4) - update Surface to use string_view for text arguments.
Diffstat (limited to 'src/LineMarker.cxx')
-rw-r--r--src/LineMarker.cxx8
1 files changed, 4 insertions, 4 deletions
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 <cmath>
#include <stdexcept>
+#include <string>
#include <string_view>
#include <vector>
#include <map>
@@ -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<char>(markType - SC_MARK_CHARACTER);
- const XYPOSITION width = surface->WidthText(fontForCharacter, character, 1);
+ std::string character(1, static_cast<char>(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<XYPOSITION>(centreX - 6);