From 05a151ffddea04578679bf4a9bc821b19db31e43 Mon Sep 17 00:00:00 2001 From: Neil Date: Thu, 25 Apr 2019 09:47:54 +1000 Subject: Bug [#1223]. Removed duplicate code. --- src/PositionCache.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') 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()) { -- cgit v1.2.3