Skip to content

Commit

Permalink
Fix bug #72558
Browse files Browse the repository at this point in the history
  • Loading branch information
PolyakovKirill committed Jan 17, 2025
1 parent a2b817b commit fb934ef
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
14 changes: 12 additions & 2 deletions Common/3dParty/html/css/src/CCompiledStyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace NSCSS
m_arParentsStyles(oStyle.m_arParentsStyles), m_sId(oStyle.m_sId),
m_nDpi(oStyle.m_nDpi), m_UnitMeasure(oStyle.m_UnitMeasure), m_dCoreFontSize(oStyle.m_dCoreFontSize),
m_oFont(oStyle.m_oFont), m_oMargin(oStyle.m_oMargin), m_oPadding(oStyle.m_oPadding), m_oBackground(oStyle.m_oBackground),
m_oText(oStyle.m_oText), m_oBorder(oStyle.m_oBorder), m_oDisplay(oStyle.m_oDisplay){}
m_oText(oStyle.m_oText), m_oBorder(oStyle.m_oBorder), m_oDisplay(oStyle.m_oDisplay), m_oTransform(oStyle.m_oTransform){}

CCompiledStyle::~CCompiledStyle()
{
Expand All @@ -44,6 +44,7 @@ namespace NSCSS
m_oPadding += oElement.m_oPadding;
m_oText += oElement.m_oText;
m_oDisplay += oElement.m_oDisplay;
m_oTransform += oElement.m_oTransform;

if (!oElement.m_sId.empty())
m_sId += L'+' + oElement.m_sId;
Expand All @@ -66,6 +67,7 @@ namespace NSCSS
m_oPadding = oElement.m_oPadding;
m_oText = oElement.m_oText;
m_oDisplay = oElement.m_oDisplay;
m_oTransform = oElement.m_oTransform;

return *this;
}
Expand All @@ -78,7 +80,8 @@ namespace NSCSS
m_oMargin == oStyle.m_oMargin &&
m_oPadding == oStyle.m_oPadding &&
m_oText == oStyle.m_oText &&
m_oDisplay == oStyle.m_oDisplay;
m_oDisplay == oStyle.m_oDisplay &&
m_oTransform == oStyle.m_oTransform;
}

void CCompiledStyle::StyleEquation(CCompiledStyle &oFirstStyle, CCompiledStyle &oSecondStyle)
Expand All @@ -90,6 +93,7 @@ namespace NSCSS
NSProperties::CText ::Equation(oFirstStyle.m_oText, oSecondStyle.m_oText);
NSProperties::CBorder ::Equation(oFirstStyle.m_oBorder, oSecondStyle.m_oBorder);
NSProperties::CDisplay ::Equation(oFirstStyle.m_oDisplay, oSecondStyle.m_oDisplay);
NSProperties::CTransform ::Equation(oFirstStyle.m_oTransform, oSecondStyle.m_oTransform);
}

void CCompiledStyle::SetDpi(const unsigned short &uiDpi)
Expand Down Expand Up @@ -431,6 +435,12 @@ namespace NSCSS
m_oDisplay.SetVAlign(pPropertie.second, unLevel, bHardMode);
break;
}
//TRANSFORM
CASE(L"transform"):
{
m_oTransform.SetMatrix(pPropertie.second, unLevel, bHardMode);
break;
}
default: AddOtherStyle(pPropertie, unLevel, bHardMode);
}
}
Expand Down
3 changes: 2 additions & 1 deletion Common/3dParty/html/css/src/CCompiledStyle.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ namespace NSCSS
NSProperties::CText m_oText;
NSProperties::CBorder m_oBorder;
NSProperties::CDisplay m_oDisplay;
NSProperties::CTransform m_oTransform;

CCompiledStyle();
CCompiledStyle(const CCompiledStyle& oStyle);

~CCompiledStyle();
virtual ~CCompiledStyle();

void SetDpi(const unsigned short& uiDpi);
void SetUnitMeasure(const UnitMeasure& enUnitMeasure);
Expand Down
2 changes: 1 addition & 1 deletion Common/3dParty/html/css/src/xhtml/CDocumentStyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ namespace NSCSS
return;

if (!oStyle.m_oFont.GetSize().Empty())
oXmlElement.AddPropertiesInR(RProperties::R_Sz, std::to_wstring(static_cast<int>(oStyle.m_oFont.GetSize().ToDouble(NSCSS::Point) * 2. + 0.5))); // Значения шрифта увеличивает на 2
oXmlElement.AddPropertiesInR(RProperties::R_Sz, std::to_wstring(static_cast<int>(oStyle.m_oFont.GetSize().ToDouble(NSCSS::Point) * 2. * oStyle.m_oTransform.GetMatrix().GetFinalValue().sy() + 0.5))); // Значения шрифта увеличивает на 2

if (oStyle.m_oText.GetDecoration().m_oLine.Underline())
oXmlElement.AddPropertiesInR(RProperties::R_U, (!oStyle.m_oText.GetDecoration().m_oStyle.Empty()) ? oStyle.m_oText.GetDecoration().m_oStyle.ToWString() : L"single");
Expand Down
3 changes: 2 additions & 1 deletion HtmlFile2/htmlfile2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4766,7 +4766,8 @@ HRESULT CHtmlFile2::OpenBatchHtml(const std::vector<std::wstring>& sSrc, const s
m_internal->m_oLightReader.Clear();
m_internal->m_sBase.clear();
}
m_internal->m_oStylesCalculator.Clear();
//Если очищать, то каждый раз при использовании внешнего css файла он заново парсится
// m_internal->m_oStylesCalculator.Clear();
}

m_internal->write();
Expand Down

0 comments on commit fb934ef

Please sign in to comment.