Files
core/ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXTableRowReader.h
Elen.Subbotina c880c3d18d RtfFormatWriter - fix styled tables
git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@67841 954022d7-b5bf-4e40-9824-e11837661b57
2016-05-21 00:54:12 +03:00

55 lines
1.7 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#pragma once
#include "OOXTableCellReader.h"
#include "OOXtrPrReader.h"
#include "../RtfDocument.h"
#include "../RtfTableRow.h"
class OOXTableRowReader
{
private:
OOX::Logic::CTr *m_ooxRowTable;
public:
OOXTableRowReader(OOX::Logic::CTr *ooxRowTable)
{
m_ooxRowTable = ooxRowTable;
}
bool Parse( ReaderParameter oParam ,RtfTableRow& oOutputRow, int nCurRow, int nRowCount)
{
if (m_ooxRowTable == NULL) return false;
CcnfStyle oConditionStyle;
//с начала применяем свойства
if( m_ooxRowTable->m_oTableRowProperties )
{
OOXtrPrReader otrPrReader(m_ooxRowTable->m_oTableRowProperties);
otrPrReader.Parse( oParam, oOutputRow.m_oProperty, oConditionStyle);// может поменяться на любой condition(first row)
}
int nCellCount = m_ooxRowTable->m_nCountCell, nCurCell = 0;
for( int i = 0; i < m_ooxRowTable->m_arrItems.size(); i++)
{
if (m_ooxRowTable->m_arrItems[i] == NULL) continue;
if (m_ooxRowTable->m_arrItems[i]->getType() != OOX::et_w_tc)continue;//todooo bookmarks
RtfTableCellPtr oNewCell( new RtfTableCell() );
OOX::Logic::CTc *ooxCell = NULL;
if (nCurCell < m_ooxRowTable->m_arrItems.size())
ooxCell = dynamic_cast<OOX::Logic::CTc *>(m_ooxRowTable->m_arrItems[i]);
OOXTableCellReader oCellReader(ooxCell);
oCellReader.Parse( oParam, *oNewCell, oConditionStyle, nCurCell++, nCurRow, nCellCount, nRowCount );
//добавляем cell
oOutputRow.AddItem(oNewCell);
//свойства cell в row
oOutputRow.m_oProperty.AddItem( oNewCell->m_oProperty );
}
return true;
}
};