Refinement of the width of cells in tables

This commit is contained in:
Kirill Poljakov
2022-06-22 16:51:09 +03:00
parent 7e5421862b
commit c3bddd9e5d
3 changed files with 38 additions and 20 deletions

View File

@ -1001,13 +1001,19 @@ namespace NSCSS
CASE(L"width"):
{
const size_t unPositionImp = pPropertie.second.find(L"!i");
int nParentValue = m_pDisplay.GetWidth();
if (0 >= nParentValue)
nParentValue = m_oDeviceWindow.m_ushWidth;
if (unPositionImp == std::wstring::npos)
{
m_pDisplay.SetWidth(ConvertUnitMeasure(pPropertie.second, m_oDeviceWindow.m_ushWidth, ScalingDirectionX), unLevel, bHardMode);
m_pDisplay.SetWidth(ConvertUnitMeasure(pPropertie.second, nParentValue, ScalingDirectionX), unLevel, bHardMode);
}
else if (unPositionImp != 0)
{
m_pDisplay.SetWidth(ConvertUnitMeasure(pPropertie.second.substr(0, unPositionImp - 1), m_oDeviceWindow.m_ushWidth, ScalingDirectionX), unLevel, true);
m_pDisplay.SetWidth(ConvertUnitMeasure(pPropertie.second.substr(0, unPositionImp - 1), nParentValue, ScalingDirectionX), unLevel, true);
m_pDisplay.SetImportantWidth(true);
}

View File

@ -276,8 +276,8 @@ namespace NSCSS
if (!oStyle.m_pMargin.Empty() && oStyle.m_pMargin.GetPermission())
{
sSpacingValue += L"w:after=\"" + oStyle.m_pMargin.GetTopSideW() + L"\" ";
sSpacingValue += L"w:before=\"" + oStyle.m_pMargin.GetTopSideW() + L"\" ";
sSpacingValue += L"w:afterAutospacing=\"1\" w:after=\"" + oStyle.m_pMargin.GetTopSideW() + L"\" ";
sSpacingValue += L"w:beforeAutospacing=\"1\" w:before=\"" + oStyle.m_pMargin.GetTopSideW() + L"\" ";
}
else/* if (!oStyle.m_pBorder.Empty() || !oStyle.m_pMargin.GetPermission())*/
sSpacingValue += L"w:after=\"0\" w:before=\"0\"";