From ff52afecc9744d9b3910db1ad42adbf1a4922578 Mon Sep 17 00:00:00 2001 From: Kirill Polyakov Date: Mon, 17 Jun 2024 17:50:50 +0300 Subject: [PATCH] Fix bug #68252 --- .../html/css/src/CCssCalculator_Private.cpp | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Common/3dParty/html/css/src/CCssCalculator_Private.cpp b/Common/3dParty/html/css/src/CCssCalculator_Private.cpp index 13742628af..e6a9160dd0 100644 --- a/Common/3dParty/html/css/src/CCssCalculator_Private.cpp +++ b/Common/3dParty/html/css/src/CCssCalculator_Private.cpp @@ -516,14 +516,8 @@ namespace NSCSS { oStyle.AddParent(arSelectors[i].m_wsName); - // Скидываем некоторые внешние стили, которые внутри таблицы переопределяются - if (L"table" == arSelectors[i].m_wsName) - { - oStyle.m_oFont.GetLineHeight().Clear(); - oStyle.m_oPadding.Clear(); - oStyle.m_oMargin.Clear(); - bInTable = true; - } + if (!bInTable) + bInTable = IsTableElement(arSelectors[i].m_wsName); if (bInTable) { @@ -531,8 +525,6 @@ namespace NSCSS oStyle.m_oBorder.Clear(); } - bInTable = IsTableElement(arSelectors[i].m_wsName); - CCompiledStyle oTempStyle; oTempStyle.AddStyle(arSelectors[i].m_mAttributes, i + 1); @@ -559,6 +551,14 @@ namespace NSCSS oTempStyle.AddStyle(arSelectors[i].m_wsStyle, i + 1, true); oStyle += oTempStyle; + + // Скидываем некоторые внешние стили, которые внутри таблицы переопределяются + if (bInTable && i < arSelectors.size() - 1) + { + oStyle.m_oFont.GetLineHeight().Clear(); + oStyle.m_oPadding.Clear(); + oStyle.m_oMargin.Clear(); + } } oStyle.SetID(arSelectors.back().m_wsName + ((!arSelectors.back().m_wsClass.empty()) ? L'.' + arSelectors.back().m_wsClass : L"") + ((arSelectors.back().m_wsId.empty()) ? L"" : L'#' + arSelectors.back().m_wsId) + L'-' + std::to_wstring(++m_nCountNodes));