void CRTFTablePostProcessor::UpdateLastUsedCellDefs(RTFTable* pTable, FormatingFastVector& vRowCelldefs)
{
	if(pTable->m_pLastUsedCellDefs.size())
	{ 
		VDELETE(pTable->m_pLastUsedCellDefs)
		pTable->m_pLastUsedCellDefs.clear();
	}
//	In theory CHECK_ALGORITHM_INTEGRITY((x64_int_cast)vRowCelldefs.size()); but we saw nasty stuff from word and deal with the condition now
	for(unsigned int j=0; j<(x64_int_cast)vRowCelldefs.size(); j++)
	{
		RTFformatting* pCellToSave = new RTFformatting(m_pParentCollection->GetFileContext(), flCell);
		THROW_IF_FAILED_TO_ALLOCATE_MEMORY(pCellToSave, _T("Failed to allocate RTFformatting"));

		*pCellToSave = *(vRowCelldefs.at(j));
		pTable->m_pLastUsedCellDefs.push_back(pCellToSave);
	}
	VDELETE(vRowCelldefs);
}
void CTestRTFTablePostProcessor::TestWhitespaceSplittingTable()
{
	ComparisonContext cContext;
	ReadRTFFromFile(TESTFILE_TABLESPLIT_00);

	int iStartAt = FindTheFirstTableObjectIndex();
	m_pfileSource->PostProcess(m_pfileSource);
	const RTFObject* prtfObj = m_pfileSource->At(iStartAt);
	assertTest(prtfObj->GetType() == rotTable);

	RTFTable* prtfTable = (RTFTable*) prtfObj;
	AssertIfTableDoesNotHaveThisManyCells(prtfTable, 6);
	VDELETE(prtfTable->m_pTableSplittingWhitespace);
}
void CTestRTFTablePostProcessor::TestNestedTableWithTabDefAfter()
{
	ComparisonContext cContext;
	ReadRTFFromFile(TESTFILE_TABLENESTTABDEF_01);

	int iStartAt = FindTheFirstTableObjectIndex();
	m_pfileSource->PostProcess(m_pfileSource);
	// just not blowing up is good proof
	const RTFObject* prtfObj = m_pfileSource->At(iStartAt);
	assertTest(prtfObj->GetType() == rotTable);

	RTFTable* prtfTable = (RTFTable*) prtfObj;
	AssertIfTableDoesNotHaveThisManyCells(prtfTable, 1);
	VDELETE(prtfTable->m_pTableSplittingWhitespace);
}
void CTestRTFTablePostProcessor::TestFieldInTable()
{
	// shouldn't go bang on last par in the field
	ComparisonContext cContext;
	ReadRTFFromFile(TESTFILE_FIELDINTABLE);

	int iStartAt = FindTheFirstTableObjectIndex();
	m_pfileSource->PostProcess(m_pfileSource);
	// just not blowing up is good proof
	const RTFObject* prtfObj = m_pfileSource->At(iStartAt);
	assertTest(prtfObj->GetType() == rotTable);

	// unnecessary after this
	RTFTable* prtfTable = (RTFTable*) prtfObj;
	AssertIfTableDoesNotHaveThisManyCells(prtfTable, 2);
	VDELETE(prtfTable->m_pTableSplittingWhitespace);

}
Beispiel #5
0
 ~ResourceNode()
 {
     if(wzType) VDELETE(wzType);
     if(wzName) VDELETE(wzName);
 };
Beispiel #6
0
RTFuserprops::~RTFuserprops()
{
	VDELETE(theRTFuserprops);
}
Beispiel #7
0
RTFlistlevel::~RTFlistlevel()
{
	delete theRTFformatting;
	VDELETE(the_RTFleveltext);
	VDELETE(the_RTFlevelnumbers);
}
Beispiel #8
0
RTFformfield::~RTFformfield()
{
	VDELETE( m_sFflList );
}