Related i#113308: fix import of RTF table rows having no cells

This commit is contained in:
Miklos Vajna 2011-11-16 11:08:06 +01:00
parent c269a684f1
commit bec1bff6af

View file

@ -1395,7 +1395,6 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
m_aStates.top().aTableCellsAttributes.pop_front(); m_aStates.top().aTableCellsAttributes.pop_front();
replayBuffer(m_aTableBuffer); replayBuffer(m_aTableBuffer);
} }
m_aStates.top().nCells = 0;
m_aStates.top().aTableCellSprms = m_aDefaultState.aTableCellSprms; m_aStates.top().aTableCellSprms = m_aDefaultState.aTableCellSprms;
m_aStates.top().aTableCellAttributes = m_aDefaultState.aTableCellAttributes; m_aStates.top().aTableCellAttributes = m_aDefaultState.aTableCellAttributes;
@ -1413,6 +1412,7 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
NS_ooxml::LN_CT_TblPrBase_tblW, NS_ooxml::LN_CT_TblWidth_w, pWValue); NS_ooxml::LN_CT_TblPrBase_tblW, NS_ooxml::LN_CT_TblWidth_w, pWValue);
RTFValue::Pointer_t pRowValue(new RTFValue(1)); RTFValue::Pointer_t pRowValue(new RTFValue(1));
if (m_aStates.top().nCells > 0)
m_aStates.top().aTableRowSprms->push_back(make_pair(NS_sprm::LN_PRow, pRowValue)); m_aStates.top().aTableRowSprms->push_back(make_pair(NS_sprm::LN_PRow, pRowValue));
writerfilter::Reference<Properties>::Pointer_t const pTableRowProperties( writerfilter::Reference<Properties>::Pointer_t const pTableRowProperties(
new RTFReferenceProperties(m_aStates.top().aTableRowAttributes, m_aStates.top().aTableRowSprms) new RTFReferenceProperties(m_aStates.top().aTableRowAttributes, m_aStates.top().aTableRowSprms)
@ -1422,6 +1422,7 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
tableBreak(); tableBreak();
m_bNeedPap = true; m_bNeedPap = true;
m_aTableBuffer.clear(); m_aTableBuffer.clear();
m_aStates.top().nCells = 0;
m_aStates.top().aTableCellsSprms.clear(); m_aStates.top().aTableCellsSprms.clear();
m_aStates.top().aTableCellsAttributes.clear(); m_aStates.top().aTableCellsAttributes.clear();
} }