mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
Fix bug 70352
This commit is contained in:
@ -929,10 +929,16 @@ namespace NSDocxRenderer
|
||||
pNextLine->m_pLine = pCurrLine;
|
||||
}
|
||||
}
|
||||
else if (!is_font_effect && pCurrCont->IsDuplicate(pNextCont.get(), eVType))
|
||||
else if (!is_font_effect && pCurrCont->IsDuplicate(pNextCont.get(), eVType, eHType))
|
||||
{
|
||||
pNextCont = nullptr;
|
||||
pCurrCont->m_iNumDuplicates++;
|
||||
// if (!pCurrCont->m_pFontStyle.get()->bBold)
|
||||
// {
|
||||
// CFontStyle font_style = *pCurrCont->m_pFontStyle;
|
||||
// font_style.bBold = true;
|
||||
// pCurrCont->m_pFontStyle = m_pFontStyleManager->GetOrAddFontStyle(font_style);
|
||||
// }
|
||||
}
|
||||
}
|
||||
if (pNextLine && pNextLine->IsCanBeDeleted())
|
||||
@ -1270,20 +1276,9 @@ namespace NSDocxRenderer
|
||||
{
|
||||
for (size_t i = 0; i < m_arTextLines.size(); ++i)
|
||||
{
|
||||
auto& pCurrLine = m_arTextLines[i];
|
||||
if (!pCurrLine)
|
||||
continue;
|
||||
|
||||
for (size_t j = 0; j < pCurrLine->m_arConts.size(); ++j)
|
||||
{
|
||||
auto& pCurrCont = pCurrLine->m_arConts[j];
|
||||
if (!pCurrCont)
|
||||
continue;
|
||||
|
||||
if (pCurrCont->m_iNumDuplicates > 0)
|
||||
pCurrLine->m_iNumDuplicates = std::max(pCurrLine->m_iNumDuplicates, pCurrCont->m_iNumDuplicates);
|
||||
}
|
||||
pCurrLine->MergeConts();
|
||||
auto& curr_line = m_arTextLines[i];
|
||||
if (!curr_line) continue;
|
||||
curr_line->MergeConts();
|
||||
}
|
||||
DetermineDominantGraphics();
|
||||
}
|
||||
@ -1559,19 +1554,6 @@ namespace NSDocxRenderer
|
||||
if (!curr_line)
|
||||
continue;
|
||||
|
||||
// если у текущей линии есть дубликаты, то создаем из них шейпы
|
||||
if (curr_line->m_iNumDuplicates > 0)
|
||||
{
|
||||
size_t duplicates = curr_line->m_iNumDuplicates;
|
||||
m_arShapes.push_back(CreateSingleLineShape(curr_line));
|
||||
while (duplicates > 0)
|
||||
{
|
||||
m_arShapes.push_back(CreateSingleLineShape(curr_line));
|
||||
duplicates--;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
// если линия пересекается с предыдущей линией
|
||||
if (index && m_arTextLines[index - 1])
|
||||
{
|
||||
|
||||
@ -95,12 +95,12 @@ namespace NSDocxRenderer
|
||||
return eHorizontalCrossingType::hctCurrentOutsideNext;
|
||||
}
|
||||
else if (m_dLeft < oSrc->m_dLeft && m_dRight < oSrc->m_dRight &&
|
||||
(m_dRight >= oSrc->m_dLeft || fabs(m_dRight - oSrc->m_dLeft) < c_dTHE_SAME_STRING_Y_PRECISION_MM))
|
||||
(m_dRight >= oSrc->m_dLeft || fabs(m_dRight - oSrc->m_dLeft) < c_dTHE_SAME_STRING_X_PRECISION_MM))
|
||||
{
|
||||
return eHorizontalCrossingType::hctCurrentLeftOfNext;
|
||||
}
|
||||
else if (m_dLeft > oSrc->m_dLeft && m_dRight > oSrc->m_dRight &&
|
||||
(m_dLeft <= oSrc->m_dRight || fabs(m_dLeft - oSrc->m_dRight) < c_dTHE_SAME_STRING_Y_PRECISION_MM))
|
||||
(m_dLeft <= oSrc->m_dRight || fabs(m_dLeft - oSrc->m_dRight) < c_dTHE_SAME_STRING_X_PRECISION_MM))
|
||||
{
|
||||
return eHorizontalCrossingType::hctCurrentRightOfNext;
|
||||
}
|
||||
@ -109,8 +109,8 @@ namespace NSDocxRenderer
|
||||
{
|
||||
return eHorizontalCrossingType::hctDublicate;
|
||||
}
|
||||
else if (fabs(m_dLeft - oSrc->m_dLeft) < c_dTHE_SAME_STRING_Y_PRECISION_MM &&
|
||||
fabs(m_dRight - oSrc->m_dRight) < c_dTHE_SAME_STRING_Y_PRECISION_MM)
|
||||
else if (fabs(m_dLeft - oSrc->m_dLeft) < c_dTHE_SAME_STRING_X_PRECISION_MM &&
|
||||
fabs(m_dRight - oSrc->m_dRight) < c_dTHE_SAME_STRING_X_PRECISION_MM)
|
||||
{
|
||||
return eHorizontalCrossingType::hctLeftAndRightBordersMatch;
|
||||
}
|
||||
|
||||
@ -195,8 +195,7 @@ namespace NSDocxRenderer
|
||||
(this_top <= other_bot || fabs(this_top - other_bot) < c_dTHE_SAME_STRING_Y_PRECISION_MM))
|
||||
return eVerticalCrossingType::vctCurrentBelowNext;
|
||||
|
||||
else if (this_top == other_top && this_bot == other_bot &&
|
||||
m_dLeft == pCont->m_dLeft && m_dRight == pCont->m_dRight)
|
||||
else if (this_top == other_top && this_bot == other_bot)
|
||||
return eVerticalCrossingType::vctDublicate;
|
||||
|
||||
else if (fabs(this_top - other_top) < c_dTHE_SAME_STRING_Y_PRECISION_MM &&
|
||||
@ -529,11 +528,17 @@ namespace NSDocxRenderer
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool CContText::IsDuplicate(CContText* pCont, eVerticalCrossingType eVType) const noexcept
|
||||
bool CContText::IsDuplicate(CContText* pCont, eVerticalCrossingType eVType, eHorizontalCrossingType eHType) const noexcept
|
||||
{
|
||||
if (eVType == eVerticalCrossingType::vctDublicate && m_oText == pCont->m_oText)
|
||||
return true;
|
||||
return false;
|
||||
return m_oText == pCont->m_oText &&
|
||||
eVType == eVerticalCrossingType::vctDublicate &&
|
||||
eHType == eHorizontalCrossingType::hctDublicate;
|
||||
|
||||
// return m_oText == pCont->m_oText &&
|
||||
// eVType == eVerticalCrossingType::vctDublicate &&
|
||||
// (eHType == eHorizontalCrossingType::hctDublicate ||
|
||||
// eHType == eHorizontalCrossingType::hctCurrentLeftOfNext ||
|
||||
// eHType == eHorizontalCrossingType::hctCurrentRightOfNext);
|
||||
}
|
||||
|
||||
bool CContText::IsOnlySpaces() const
|
||||
|
||||
@ -110,7 +110,7 @@ namespace NSDocxRenderer
|
||||
bool IsEqual(const CContText* pCont) const noexcept;
|
||||
|
||||
UINT GetNumberOfFeatures() const noexcept;
|
||||
bool IsDuplicate(CContText *pCont, eVerticalCrossingType eVType) const noexcept;
|
||||
bool IsDuplicate(CContText* pCont, eVerticalCrossingType eVType, eHorizontalCrossingType eHType) const noexcept;
|
||||
|
||||
bool IsOnlySpaces() const;
|
||||
double CalculateSpace() const noexcept;
|
||||
|
||||
@ -469,7 +469,7 @@ namespace NSDocxRenderer
|
||||
//CheckFontNameStyle(wsName, L"light");
|
||||
|
||||
CheckFontNameStyle(wsName, L"condensedbold");
|
||||
CheckFontNameStyle(wsName, L"semibold");
|
||||
if (CheckFontNameStyle(wsName, L"semibold")) bBold = true;
|
||||
if (CheckFontNameStyle(wsName, L"boldmt")) bBold = true;
|
||||
if (CheckFontNameStyle(wsName, L"bold")) bBold = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user