Commit 5869c7a0 authored by ElenaSubbotina's avatar ElenaSubbotina

RtfFormatWriter - fix table cell width (auto)

parent bbd429a9
......@@ -1140,7 +1140,7 @@ bool RtfTableCellPropsCommand::ExecuteCommand(RtfDocument& oDocument, RtfReader&
}
}
COMMAND_RTF_INT ( "clwWidth", cellProps->m_nWidth, sCommand, hasParameter, parameter )
COMMAND_RTF_BOOL( "clhidemark",cellProps->m_bHideMark, sCommand, hasParameter, parameter )
COMMAND_RTF_BOOL( "clhidemark", cellProps->m_bHideMark, sCommand, hasParameter, parameter )
COMMAND_RTF_INT ( "clvertalt", cellProps->m_eAlign, sCommand, true, RtfCellProperty::ca_Top )
COMMAND_RTF_INT ( "clvertalc", cellProps->m_eAlign, sCommand, true, RtfCellProperty::ca_Center )
COMMAND_RTF_INT ( "clvertalb", cellProps->m_eAlign, sCommand, true, RtfCellProperty::ca_Bottom )
......
......@@ -164,7 +164,9 @@ bool OOXTableReader::Parse( ReaderParameter oParam, RtfTable& oOutputTable )
for( int i = 0; i < m_ooxTable->m_oTblGrid->m_arrGridCol.size(); i++ )
{
if (m_ooxTable->m_oTblGrid->m_arrGridCol[i] && m_ooxTable->m_oTblGrid->m_arrGridCol[i]->m_oW.IsInit())
oOutputTable.m_aTableGrid.push_back( m_ooxTable->m_oTblGrid->m_arrGridCol[i]->m_oW->ToTwips() );
{
oOutputTable.m_aTableGrid.push_back( m_ooxTable->m_oTblGrid->m_arrGridCol[i]->m_oW->ToTwips() );
}
}
}
......
......@@ -114,8 +114,19 @@ public:
if( m_ooxTableCellProps->m_oTcW.IsInit() && m_ooxTableCellProps->m_oTcW->m_oW.IsInit())
{
oOutputProperty.m_nWidth = m_ooxTableCellProps->m_oTcW->m_oW->GetValue();
oOutputProperty.m_eWidthUnits = m_ooxTableCellProps->m_oTcW->m_oW->IsPercent() ? mu_Percent : mu_Twips;
bool auto_ = false;
if (m_ooxTableCellProps->m_oTcW->m_oType.IsInit() && m_ooxTableCellProps->m_oTcW->m_oType->GetValue() == SimpleTypes::tblwidthAuto)
auto_ = true;
if (auto_)
{
oOutputProperty.m_eWidthUnits = mu_Auto;
}
else
{
oOutputProperty.m_nWidth = m_ooxTableCellProps->m_oTcW->m_oW->GetValue();
oOutputProperty.m_eWidthUnits = m_ooxTableCellProps->m_oTcW->m_oW->IsPercent() ? mu_Percent : mu_Twips;
}
}
if( m_ooxTableCellProps->m_oHideMark.IsInit())
oOutputProperty.m_bHideMark = m_ooxTableCellProps->m_oHideMark->m_oVal.ToBool() ? 1 : 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment