Skip to content

Commit 872e7fb

Browse files
committed
Fix bug #73479
Fix calculation of the first line indentation
1 parent aac6c96 commit 872e7fb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tests/word/document-calculation/paragraph/paragraph-wrap.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -278,15 +278,15 @@ $(function () {
278278
test([
279279
["", "VeryLongLongLongLongLongLongLongWord\r\n"],
280280
], [
281-
[[L_FIELD + leftInd, imageX0], [imageX1 + leftInd + firstLine, PAGE_W - R_FIELD]]
281+
[[L_FIELD + firstLine + leftInd, imageX0], [imageX1 + leftInd + firstLine, PAGE_W - R_FIELD]]
282282
]);
283283

284284
firstLine = 0;
285285
leftInd = 10 * charWidth;
286286
test([
287287
["", "VeryLongLongLongLongLongLongLongWord\r\n"],
288288
], [
289-
[[L_FIELD + leftInd, imageX0], [imageX1, PAGE_W - R_FIELD]]
289+
[[L_FIELD + firstLine + leftInd, imageX0], [imageX1, PAGE_W - R_FIELD]]
290290
]);
291291

292292
// Check the indentation when the first range is empty

word/Editor/Paragraph_Recalculate.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2204,7 +2204,7 @@ Paragraph.prototype.private_RecalculateRange = function(CurRange, CurL
22042204
if (PRS.getCompatibilityMode() >= AscCommon.document_compatibility_mode_Word15)
22052205
shift = Math.max(paraPr.Ind.FirstLine, 0);
22062206
else
2207-
shift = paraPr.Ind.FirstLine < 0.001 ? paraPr.Ind.Left + paraPr.Ind.FirstLine : paraPr.Ind.FirstLine;
2207+
shift = paraPr.Ind.FirstLine < -AscWord.EPSILON ? paraPr.Ind.Left + paraPr.Ind.FirstLine : paraPr.Ind.FirstLine;
22082208

22092209
if (paraPr.Bidi)
22102210
Range.XEnd -= shift;

0 commit comments

Comments
 (0)