From 4bdc8cf08ec39e768b3dfab6856c6e29e1d3bb61 Mon Sep 17 00:00:00 2001 From: Neil Date: Thu, 25 Apr 2019 09:47:54 +1000 Subject: Backport: Bug [#1223]. Removed duplicate code. Backport of changeset 7470:e9627636de12. --- 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 b1b55bd50..8910a2955 100644 --- a/src/PositionCache.cxx +++ b/src/PositionCache.cxx @@ -686,13 +686,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, s + startSegment, lenSegment, positions + startSegment); for (unsigned int inSeg = 0; inSeg < lenSegment; inSeg++) { positions[startSegment + inSeg] += xStartSegment; @@ -701,7 +701,6 @@ void PositionCache::MeasureWidths(Surface *surface, const ViewStyle &vstyle, uns startSegment += lenSegment; } } else { - FontAlias fontStyle = vstyle.styles[styleNumber].font; surface->MeasureWidths(fontStyle, s, len, positions); } if (probe < pces.size()) { -- cgit v1.2.3