For bug 59181

This commit is contained in:
Daria Ermakova
2025-12-29 14:57:48 +03:00
parent b000343b86
commit fd2710e46e
2 changed files with 24 additions and 5 deletions

View File

@ -338,6 +338,7 @@ namespace DocFileFormat
if ((chpxs != NULL) && (chpxFcs != NULL) && !chpxFcs->empty())//? второе
{
size_t i = 0;
bool changechpx = false;
// write a runs for each CHPX
for (size_t it = 0; it < chpxs->size(); ++it)
@ -346,9 +347,18 @@ namespace DocFileFormat
int fcChpxStart = ((chpxFcs) && (i < chpxFcs->size())) ? chpxFcs->at(i) : fc;
int fcChpxEnd = fcEnd;
if ((chpxFcs) && ( i < chpxFcs->size() - 1))
fcChpxEnd = chpxFcs->at(i + 1);
if (i > 0)
{
int previous = chpxFcs->at(i-1);
if ((fcChpxStart != fc) && (previous > fcChpxStart))
{
fcChpxStart = previous;
changechpx = true;
}
}
if ((chpxFcs) && ( i < chpxFcs->size() - 1))
fcChpxEnd = chpxFcs->at(i + 1);
//it's the first chpx and it starts before the paragraph
@ -427,7 +437,13 @@ namespace DocFileFormat
}
else
{
cp = writeRun(chpxChars, chpxs->at(it), cp);
if (changechpx == true)
{
size_t a = it - 1;
cp = writeRun(chpxChars, chpxs->at(a), cp);
}
else
cp = writeRun(chpxChars, chpxs->at(it), cp);
}
}
}