mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-10 18:05:41 +08:00
Fix bug#67829
This commit is contained in:
@ -25,7 +25,7 @@ namespace NSCSS
|
||||
}
|
||||
|
||||
CString::CString()
|
||||
: CValue(L"", 0, false)
|
||||
: CValue(L"", 0, false)
|
||||
{}
|
||||
|
||||
CString::CString(const std::wstring &wsValue, unsigned int unLevel, bool bImportant)
|
||||
@ -1508,6 +1508,15 @@ namespace NSCSS
|
||||
m_oColor == oBorderSide.m_oColor;
|
||||
}
|
||||
|
||||
CBorderSide &CBorderSide::operator =(const CBorderSide &oBorderSide)
|
||||
{
|
||||
m_oWidth = oBorderSide.m_oWidth;
|
||||
m_oStyle = oBorderSide.m_oStyle;
|
||||
m_oColor = oBorderSide.m_oColor;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
// BORDER
|
||||
CBorder::CBorder()
|
||||
{
|
||||
@ -1744,6 +1753,18 @@ namespace NSCSS
|
||||
m_oBottom == oBorder.m_oBottom;
|
||||
}
|
||||
|
||||
CBorder &CBorder::operator =(const CBorder &oBorder)
|
||||
{
|
||||
m_oLeft = oBorder.m_oLeft;
|
||||
m_oTop = oBorder.m_oTop;
|
||||
m_oRight = oBorder.m_oRight;
|
||||
m_oBottom = oBorder.m_oBottom;
|
||||
|
||||
m_enCollapse = oBorder.m_enCollapse;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
// TEXT
|
||||
CText::CText()
|
||||
{}
|
||||
|
||||
@ -444,6 +444,7 @@ namespace NSCSS
|
||||
|
||||
CBorderSide& operator+=(const CBorderSide& oBorderSide);
|
||||
bool operator==(const CBorderSide& oBorderSide) const;
|
||||
CBorderSide& operator =(const CBorderSide& oBorderSide);
|
||||
private:
|
||||
CDigit m_oWidth;
|
||||
CString m_oStyle;
|
||||
@ -513,6 +514,8 @@ namespace NSCSS
|
||||
|
||||
CBorder& operator+=(const CBorder& oBorder);
|
||||
bool operator==(const CBorder& oBorder) const;
|
||||
|
||||
CBorder& operator =(const CBorder& oBorder);
|
||||
private:
|
||||
CBorderSide m_oLeft;
|
||||
CBorderSide m_oTop;
|
||||
|
||||
@ -196,34 +196,49 @@ struct TTableCellStyle
|
||||
std::wstring m_wsVAlign;
|
||||
|
||||
TTableCellStyle(){}
|
||||
|
||||
|
||||
bool Empty()
|
||||
{
|
||||
return m_oWidth.Empty() && m_oHeight.Empty() && m_oBorder.Empty() && m_oPadding.Empty() && m_wsVAlign.empty() && m_wsVAlign.empty();
|
||||
}
|
||||
|
||||
void Copy(const TTableCellStyle* pTableCellStyle)
|
||||
{
|
||||
if (NULL == pTableCellStyle)
|
||||
return;
|
||||
|
||||
m_oWidth = pTableCellStyle->m_oWidth;
|
||||
m_oHeight = pTableCellStyle->m_oHeight;
|
||||
m_oBorder = pTableCellStyle->m_oBorder;
|
||||
m_oPadding = pTableCellStyle->m_oPadding;
|
||||
m_oBackground = pTableCellStyle->m_oBackground;
|
||||
|
||||
m_wsHAlign = pTableCellStyle->m_wsHAlign;
|
||||
m_wsVAlign = pTableCellStyle->m_wsVAlign;
|
||||
}
|
||||
};
|
||||
|
||||
class CTableCell
|
||||
{
|
||||
public:
|
||||
CTableCell()
|
||||
: m_unColspan(1), m_unRowSpan(1), m_bIsMerged(false), m_enMode(ParseModeBody)
|
||||
: m_unColspan(1), m_unRowSpan(1), m_bIsMerged(false), m_bIsEmpty(false), m_enMode(ParseModeBody)
|
||||
{}
|
||||
|
||||
CTableCell(UINT unColspan, UINT unRowspan, bool bIsMerged)
|
||||
: m_unColspan(unColspan), m_unRowSpan(unRowspan), m_bIsMerged(bIsMerged), m_enMode(ParseModeBody)
|
||||
CTableCell(UINT unColspan, UINT unRowspan, bool bIsMerged, bool bIsEmpty)
|
||||
: m_unColspan(unColspan), m_unRowSpan(unRowspan), m_bIsMerged(bIsMerged), m_bIsEmpty(bIsEmpty), m_enMode(ParseModeBody)
|
||||
{}
|
||||
|
||||
CTableCell(CTableCell& oCell)
|
||||
: m_unColspan(oCell.m_unColspan), m_unRowSpan(oCell.m_unRowSpan), m_bIsMerged(oCell.m_bIsMerged),
|
||||
m_enMode(oCell.m_enMode), m_oStyles(oCell.m_oStyles)
|
||||
m_bIsEmpty(oCell.m_bIsEmpty), m_enMode(oCell.m_enMode), m_oStyles(oCell.m_oStyles)
|
||||
{
|
||||
m_oData.SetText(oCell.m_oData.GetData());
|
||||
}
|
||||
|
||||
bool Empty()
|
||||
{
|
||||
return 0 == m_oData.GetCurSize();
|
||||
return m_bIsEmpty;
|
||||
}
|
||||
|
||||
CTableCell* Copy()
|
||||
@ -233,10 +248,9 @@ public:
|
||||
|
||||
static CTableCell* CreateEmpty(UINT unColspan = 1, bool m_bIsMerged = false, const TTableCellStyle* pStyle = NULL)
|
||||
{
|
||||
CTableCell *pCell = new CTableCell(unColspan, 1, m_bIsMerged);
|
||||
CTableCell *pCell = new CTableCell(unColspan, 1, m_bIsMerged, true);
|
||||
|
||||
if (NULL != pStyle)
|
||||
pCell->m_oStyles = *pStyle;
|
||||
pCell->m_oStyles.Copy(pStyle);
|
||||
|
||||
return pCell;
|
||||
}
|
||||
@ -413,6 +427,7 @@ private:
|
||||
UINT m_unRowSpan;
|
||||
|
||||
bool m_bIsMerged;
|
||||
bool m_bIsEmpty;
|
||||
ERowParseMode m_enMode;
|
||||
|
||||
TTableCellStyle m_oStyles;
|
||||
@ -2206,7 +2221,7 @@ private:
|
||||
void ParseTableRows(CTable& oTable, std::vector<NSCSS::CNode>& sSelectors, const CTextSettings& oTS, ERowParseMode eMode)
|
||||
{
|
||||
std::vector<TRowspanElement> arRowspanElements;
|
||||
|
||||
|
||||
int nDeath = m_oLightReader.GetDepth();
|
||||
while (m_oLightReader.ReadNextSiblingNode(nDeath))
|
||||
{
|
||||
@ -2234,6 +2249,9 @@ private:
|
||||
{
|
||||
CTableCell *pCell = new CTableCell();
|
||||
|
||||
if (NULL == pCell)
|
||||
continue;
|
||||
|
||||
pCell->SetMode(eMode);
|
||||
|
||||
GetSubClass(pCell->GetData(), sSelectors);
|
||||
|
||||
Reference in New Issue
Block a user