aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/PositionCache.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2019-04-25 09:47:54 +1000
committerNeil <nyamatongwe@gmail.com>2019-04-25 09:47:54 +1000
commit05a151ffddea04578679bf4a9bc821b19db31e43 (patch)
treed0aad218039e13d67fd55df85074589c79f7d33c /src/PositionCache.cxx
parent8fc2c35cc482adb64899b78b7d8d00548ba33340 (diff)
downloadscintilla-mirror-05a151ffddea04578679bf4a9bc821b19db31e43.tar.gz
Bug [#1223]. Removed duplicate code.
Diffstat (limited to 'src/PositionCache.cxx')
-rw-r--r--src/PositionCache.cxx3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/PositionCache.cxx b/src/PositionCache.cxx
index 17bde4891..ea281f7ab 100644
--- a/src/PositionCache.cxx
+++ b/src/PositionCache.cxx
@@ -794,13 +794,13 @@ void PositionCache::MeasureWidths(Surface *surface, const ViewStyle &vstyle, uns
probe = probe2;
}
}
+ FontAlias fontStyle = vstyle.styles[styleNumber].font;
if (len > BreakFinder::lengthStartSubdivision) {
// Break up into segments
unsigned int startSegment = 0;
XYPOSITION xStartSegment = 0;
while (startSegment < len) {
const unsigned int lenSegment = pdoc->SafeSegment(s + startSegment, len - startSegment, BreakFinder::lengthEachSubdivision);
- FontAlias fontStyle = vstyle.styles[styleNumber].font;
surface->MeasureWidths(fontStyle, std::string_view(s + startSegment, lenSegment), positions + startSegment);
for (unsigned int inSeg = 0; inSeg < lenSegment; inSeg++) {
positions[startSegment + inSeg] += xStartSegment;
@@ -809,7 +809,6 @@ void PositionCache::MeasureWidths(Surface *surface, const ViewStyle &vstyle, uns
startSegment += lenSegment;
}
} else {
- FontAlias fontStyle = vstyle.styles[styleNumber].font;
surface->MeasureWidths(fontStyle, std::string_view(s, len), positions);
}
if (probe < pces.size()) {