mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
TableCellSpacing
This commit is contained in:
@ -2270,9 +2270,10 @@ public:
|
||||
CString Look;
|
||||
CString Layout;
|
||||
CString tblPrChange;
|
||||
CString TableCellSpacing;
|
||||
bool IsEmpty()
|
||||
{
|
||||
return Jc.IsEmpty() && TableInd.IsEmpty() && TableW.IsEmpty() && TableCellMar.IsEmpty() && TableBorders.IsEmpty() && Shd.IsEmpty() && tblpPr.IsEmpty()&& Style.IsEmpty() && Look.IsEmpty() && tblPrChange.IsEmpty();
|
||||
return Jc.IsEmpty() && TableInd.IsEmpty() && TableW.IsEmpty() && TableCellMar.IsEmpty() && TableBorders.IsEmpty() && Shd.IsEmpty() && tblpPr.IsEmpty()&& Style.IsEmpty() && Look.IsEmpty() && tblPrChange.IsEmpty() && TableCellSpacing.IsEmpty();
|
||||
}
|
||||
CString Write(bool bBandSize, bool bLayout)
|
||||
{
|
||||
@ -2288,6 +2289,8 @@ public:
|
||||
sRes.Append(TableW);
|
||||
if(false == Jc.IsEmpty())
|
||||
sRes.Append(Jc);
|
||||
if(false == TableCellSpacing.IsEmpty())
|
||||
sRes.Append(TableCellSpacing);
|
||||
if(false == TableInd.IsEmpty())
|
||||
sRes.Append(TableInd);
|
||||
if(false == TableBorders.IsEmpty())
|
||||
|
||||
@ -1629,6 +1629,13 @@ public:
|
||||
res = Read1(length, &Binary_tblPrReader::ReadTblPrChange, this, &tblPrChange);
|
||||
pWiterTblPr->tblPrChange = tblPrChange.ToString(_T("w:tblPrChange"));
|
||||
}
|
||||
else if( c_oSerProp_tblPrType::TableCellSpacing == type )
|
||||
{
|
||||
double dSpacing = m_oBufferedStream.GetDouble();
|
||||
dSpacing /=2;
|
||||
long nSpacing = SerializeCommon::Round( g_dKoef_mm_to_twips * dSpacing);
|
||||
pWiterTblPr->TableCellSpacing.Format(_T("<w:tblCellSpacing w:w=\"%d\" w:type=\"dxa\"/>"), nSpacing);
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
|
||||
@ -248,7 +248,8 @@ extern int g_nCurFormatVersion;
|
||||
Style = 10,
|
||||
tblpPr2 = 11,
|
||||
Layout = 12,
|
||||
tblPrChange = 13
|
||||
tblPrChange = 13,
|
||||
TableCellSpacing = 14
|
||||
};}
|
||||
namespace c_oSer_tblpPrType{enum c_oSer_tblpPrType
|
||||
{
|
||||
|
||||
@ -1706,6 +1706,20 @@ namespace BinDocxRW
|
||||
WriteTblPrChange(tblPr.m_oTblPrChange.get());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(tblPr.m_oTblCellSpacing.IsInit())
|
||||
{
|
||||
const ComplexTypes::Word::CTblWidth& cs = tblPr.m_oTblCellSpacing.get();
|
||||
if(cs.m_oW.IsInit() && false == cs.m_oW->IsPercent() &&
|
||||
cs.m_oType.IsInit() && SimpleTypes::tblwidthDxa == cs.m_oType->GetValue())
|
||||
{
|
||||
SimpleTypes::CPoint oPoint;
|
||||
oPoint.FromTwips(cs.m_oW->GetValue());
|
||||
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerProp_tblPrType::TableCellSpacing);
|
||||
m_oBcw.m_oStream.WriteDouble(oPoint.ToMm() * 2);//Умножаем на 2 из-за разного понимания cellSpacing
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
};
|
||||
void WriteTblMar(const OOX::Logic::CTblCellMar& cellMar)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user