This commit is contained in:
Kirill Polyakov
2026-01-12 22:05:31 +03:00
parent 2ff12c06a4
commit 614222ee44

View File

@ -795,7 +795,8 @@ void CConverter2OOXML::WriteTable(const CCtrlTable* pTable, short shParaShapeID,
}
}
unColIndex += oValue.second->GetColSpan() - 1;
if (oValue.second->GetColSpan() > 1)
unColIndex += oValue.second->GetColSpan() - 1;
}
}
@ -831,10 +832,16 @@ void CConverter2OOXML::WriteTable(const CCtrlTable* pTable, short shParaShapeID,
oBuilder.WriteString(L"</w:tbl>");
oState.m_oLastNode.m_eType = TConversionState::TLastNode::ELastNodeType::Table;
oState.m_oLastNode.m_unParaIndex = oState.m_unParaIndex;
oState.m_bInTable = bTableInTable;
if (oState.m_bInTable)
{
oBuilder.WriteString(L"<w:p><w:r><w:rPr><w:vanish/></w:rPr></w:r></w:p>");
oState.m_oLastNode.m_eType = TConversionState::TLastNode::ELastNodeType::Paragraph;
}
else
oState.m_oLastNode.m_eType = TConversionState::TLastNode::ELastNodeType::Table;
}
void CConverter2OOXML::WriteTableProperties(const CCtrlTable* pTable, short shParaShapeID, short shParaStyleID, NSStringUtils::CStringBuilder& oBuilder, TConversionState& oState)
@ -884,10 +891,10 @@ void CConverter2OOXML::WriteCell(const CTblCell* pCell, NSStringUtils::CStringBu
oBuilder.WriteString(L"<w:tcPr>");
oBuilder.WriteString(L"<w:tcW w:w=\"" + std::to_wstring(Transform::HWPUINT2Twips(pCell->GetWidth())) + L"\" w:type=\"dxa\"/>");
if (1 != pCell->GetColSpan())
if (1 < pCell->GetColSpan())
oBuilder.WriteString(L"<w:gridSpan w:val=\"" + std::to_wstring(pCell->GetColSpan()) + L"\"/>");
if (1 != pCell->GetRowSpan())
if (1 < pCell->GetRowSpan())
oBuilder.WriteString(L"<w:vMerge w:val=\"" + HWP_STRING(((ECellCreator::FILE == eCellCreator) ? L"restart" : L"continue")) + L"\"/>");
WriteCellProperties(pCell->GetBorderFillID(), oBuilder);