This commit is contained in:
Elena.Subbotina
2023-07-20 17:02:02 +03:00
parent c0ffc1dd0f
commit 57cc43371c
32 changed files with 165 additions and 164 deletions

View File

@ -121,7 +121,7 @@ namespace DocFileFormat
/*========================================================================================================*/
void CharacterPropertiesMapping::convertSprms( std::list<SinglePropertyModifier>* sprms, XMLTools::XMLElement* parent )
void CharacterPropertiesMapping::convertSprms( std::vector<SinglePropertyModifier>* sprms, XMLTools::XMLElement* parent )
{
XMLTools::XMLElement * rFonts = new XMLTools::XMLElement ( L"w:rFonts" );
XMLTools::XMLElement * color = new XMLTools::XMLElement ( L"w:color" );
@ -136,8 +136,8 @@ namespace DocFileFormat
}
if ((sprms) && (!sprms->empty()))
{
std::list<SinglePropertyModifier>::iterator end = sprms->end();
for (std::list<SinglePropertyModifier>::iterator iter = sprms->begin(); iter != end; ++iter)
std::vector<SinglePropertyModifier>::iterator end = sprms->end();
for (std::vector<SinglePropertyModifier>::iterator iter = sprms->begin(); iter != end; ++iter)
{
int nProperty = 0; //for unknown test
@ -640,8 +640,8 @@ namespace DocFileFormat
std::list<CharacterPropertyExceptions*>::const_iterator end = _hierarchy.end();
for (std::list<CharacterPropertyExceptions*>::const_iterator iter = _hierarchy.begin(); iter != end; ++iter)
{
std::list<SinglePropertyModifier>::const_iterator end_grpprl = (*iter)->grpprl->end();
for (std::list<SinglePropertyModifier>::const_iterator grpprlIter = (*iter)->grpprl->begin(); grpprlIter != end_grpprl; ++grpprlIter)
std::vector<SinglePropertyModifier>::const_iterator end_grpprl = (*iter)->grpprl->end();
for (std::vector<SinglePropertyModifier>::const_iterator grpprlIter = (*iter)->grpprl->begin(); grpprlIter != end_grpprl; ++grpprlIter)
{
if (grpprlIter->OpCode == sprm.OpCode)
{

View File

@ -63,7 +63,7 @@ namespace DocFileFormat
bool _webHidden;
bool _isRTL;
private:
void convertSprms( std::list<SinglePropertyModifier>* sprms, XMLTools::XMLElement* parent );
void convertSprms( std::vector<SinglePropertyModifier>* sprms, XMLTools::XMLElement* parent );
std::list<CharacterPropertyExceptions*> buildHierarchy( const StyleSheet* styleSheet, unsigned short istdStart );
bool applyToggleHierachy( const SinglePropertyModifier& sprm );
bool toogleValue( bool currentValue, unsigned char toggle );

View File

@ -45,7 +45,7 @@ namespace DocFileFormat
if (nWordVersion > 1)
{
RELEASEOBJECT( grpprl );
grpprl = new std::list<SinglePropertyModifier>();
grpprl = new std::vector<SinglePropertyModifier>();
MemoryStream oStream(bytes, size);
int pos = 0;

View File

@ -207,10 +207,10 @@ namespace DocFileFormat
// get all CHPX between these boundaries to determine the count of runs
std::list<CharacterPropertyExceptions*>* chpxs = m_document->GetCharacterPropertyExceptions(fc, fcEnd);
std::vector<int>* chpxFcs = m_document->GetFileCharacterPositions(fc, fcEnd);
std::vector<CharacterPropertyExceptions*>* chpxs = m_document->GetCharacterPropertyExceptions(fc, fcEnd);
std::vector<int>* chpxFcs = m_document->GetFileCharacterPositions(fc, fcEnd);
CharacterPropertyExceptions* paraEndChpx = NULL;
CharacterPropertyExceptions* paraEndChpx = NULL;
if (chpxFcs)
{
@ -271,22 +271,18 @@ namespace DocFileFormat
if ((chpxs != NULL) && (chpxFcs != NULL) && !chpxFcs->empty())//? второе
{
int i = 0;
size_t i = 0;
// write a runs for each CHPX
std::list<CharacterPropertyExceptions*>::iterator cpeIter_last = chpxs->end(); cpeIter_last--;
for (std::list<CharacterPropertyExceptions*>::iterator cpeIter = chpxs->begin(); cpeIter != chpxs->end(); ++cpeIter)
for (size_t it = 0; it < chpxs->size(); ++it)
{
//get the FC range for this run
int fcChpxStart = chpxFcs ? chpxFcs->at(i) : fc;
int fcChpxEnd = chpxFcs ? chpxFcs->at(i + 1) : fcEnd;
//? if (lastBad && cpeIter == cpeIter_last)
//? {
//? fcChpxEnd = fcEnd;
//? }
int fcChpxStart = chpxFcs ? chpxFcs->at(i) : fc;
int fcChpxEnd = fcEnd;
if ((chpxFcs) && ( i < chpxFcs->size() - 1))
fcChpxEnd = chpxFcs->at(i + 1);
//it's the first chpx and it starts before the paragraph
@ -309,14 +305,14 @@ namespace DocFileFormat
std::vector<int> annot = searchAnnotation(chpxChars, cp);
if (false == annot.empty())
{
std::list<std::vector<wchar_t>>* runs = splitCharList(chpxChars, &annot);
std::vector<std::vector<wchar_t>>* runs = splitCharList(chpxChars, &annot);
if (runs)
{
for (std::list<std::vector<wchar_t> >::iterator iter = runs->begin(); iter != runs->end(); ++iter)
for (std::vector<std::vector<wchar_t> >::iterator iter = runs->begin(); iter != runs->end(); ++iter)
{
if (writeAnnotations(cp))
{
cp = writeRun(&(*iter), *cpeIter, cp);
cp = writeRun(&(*iter), chpxs->at(it), cp);
}
}
@ -329,14 +325,14 @@ namespace DocFileFormat
if (false == bookmarks.empty())
{
std::list<std::vector<wchar_t>>* runs = splitCharList(chpxChars, &bookmarks);
std::vector<std::vector<wchar_t>>* runs = splitCharList(chpxChars, &bookmarks);
if (runs)
{
for (std::list<std::vector<wchar_t> >::iterator iter = runs->begin(); iter != runs->end(); ++iter)
for (std::vector<std::vector<wchar_t> >::iterator iter = runs->begin(); iter != runs->end(); ++iter)
{
if (writeBookmarks(cp))
{
cp = writeRun(&(*iter), *cpeIter, cp);
cp = writeRun(&(*iter), chpxs->at(it), cp);
}
}
@ -349,14 +345,14 @@ namespace DocFileFormat
if (false == permissions.empty())
{
std::list<std::vector<wchar_t>>* runs = splitCharList(chpxChars, &permissions);
std::vector<std::vector<wchar_t>>* runs = splitCharList(chpxChars, &permissions);
if (runs)
{
for (std::list<std::vector<wchar_t> >::iterator iter = runs->begin(); iter != runs->end(); ++iter)
for (std::vector<std::vector<wchar_t> >::iterator iter = runs->begin(); iter != runs->end(); ++iter)
{
if (writePermissions(cp))
{
cp = writeRun(&(*iter), *cpeIter, cp);
cp = writeRun(&(*iter), chpxs->at(it), cp);
}
}
@ -365,7 +361,7 @@ namespace DocFileFormat
}
else
{
cp = writeRun(chpxChars, *cpeIter, cp);
cp = writeRun(chpxChars, chpxs->at(it), cp);
}
}
}
@ -396,7 +392,7 @@ namespace DocFileFormat
{
if (papx)
{
for (std::list<SinglePropertyModifier>::const_iterator iter = papx->grpprl->begin(); iter != papx->grpprl->end(); ++iter)
for (std::vector<SinglePropertyModifier>::const_iterator iter = papx->grpprl->begin(); iter != papx->grpprl->end(); ++iter)
{
// rsid for paragraph property enditing (write to parent element)
@ -597,7 +593,7 @@ namespace DocFileFormat
if (cpPic < cpFieldEnd)
{
int fcPic = m_document->FindFileCharPos( cpPic );
std::list<CharacterPropertyExceptions*>* chpxs = m_document->GetCharacterPropertyExceptions(fcPic, fcPic + 1);
std::vector<CharacterPropertyExceptions*>* chpxs = m_document->GetCharacterPropertyExceptions(fcPic, fcPic + 1);
if (chpxs)
{
@ -680,7 +676,7 @@ namespace DocFileFormat
if (cpPic < cpFieldEnd)
{
int fcPic = m_document->FindFileCharPos( cpPic );
std::list<CharacterPropertyExceptions*>* chpxs = m_document->GetCharacterPropertyExceptions(fcPic, fcPic + 1);
std::vector<CharacterPropertyExceptions*>* chpxs = m_document->GetCharacterPropertyExceptions(fcPic, fcPic + 1);
CharacterPropertyExceptions* chpxObj = chpxs->front();
@ -733,7 +729,7 @@ namespace DocFileFormat
int fcFieldSep = m_document->m_PieceTable->FileCharacterPositions->operator []( cpFieldSep );
int fcFieldSep1 = m_document->FindFileCharPos( cpFieldSep );
std::list<CharacterPropertyExceptions*>* chpxs = m_document->GetCharacterPropertyExceptions( fcFieldSep, ( fcFieldSep + 1 ) );
std::vector<CharacterPropertyExceptions*>* chpxs = m_document->GetCharacterPropertyExceptions( fcFieldSep, ( fcFieldSep + 1 ) );
CharacterPropertyExceptions* chpxSep = chpxs->front();
OleObject ole ( chpxSep, m_document);
@ -1227,7 +1223,7 @@ namespace DocFileFormat
{
if ((m_document->BookmarkStartPlex->IsCpExists(cp)) || (m_document->BookmarkEndPlex->IsCpExists(cp)))
{
ret.push_back(i);
ret.push_back((int)i);
}
++cp;
@ -1250,7 +1246,7 @@ namespace DocFileFormat
{
if ((m_document->AnnotStartPlex->IsCpExists(cp)) || (m_document->AnnotEndPlex->IsCpExists(cp)))
{
ret.push_back(i);
ret.push_back((int)i);
}
++cp;
@ -1273,7 +1269,7 @@ namespace DocFileFormat
{
if ((m_document->BookmarkProtStartPlex->IsCpExists(cp)) || (m_document->BookmarkProtEndPlex->IsCpExists(cp)))
{
ret.push_back(i);
ret.push_back((int)i);
}
++cp;
}
@ -1314,10 +1310,10 @@ namespace DocFileFormat
return ret;
}
std::list<std::vector<wchar_t> >* DocumentMapping::splitCharList(std::vector<wchar_t>* chars, std::vector<int>* splitIndices)
std::vector<std::vector<wchar_t> >* DocumentMapping::splitCharList(std::vector<wchar_t>* chars, std::vector<int>* splitIndices)
{
std::list<std::vector<wchar_t> >* ret = new std::list<std::vector<wchar_t> >();
std::vector<wchar_t> wcharVector;
std::vector<std::vector<wchar_t> >* ret = new std::vector<std::vector<wchar_t> >();
std::vector<wchar_t> wcharVector;
int startIndex = 0;
@ -1436,7 +1432,7 @@ namespace DocFileFormat
{
fEndNestingLevel = false;
for ( std::list<SinglePropertyModifier>::iterator iter = papx->grpprl->begin(); !fEndNestingLevel && iter != papx->grpprl->end(); iter++ )
for ( std::vector<SinglePropertyModifier>::iterator iter = papx->grpprl->begin(); !fEndNestingLevel && iter != papx->grpprl->end(); iter++ )
{
DWORD code = iter->OpCode;
@ -1460,7 +1456,8 @@ namespace DocFileFormat
if (nestingLevel == iTap_current)
{
bool bPresent = false; //118854.doc
for ( std::list<SinglePropertyModifier>::reverse_iterator iter = papx->grpprl->rbegin(); !bPresent && iter != papx->grpprl->rend(); iter++ )
for ( std::vector<SinglePropertyModifier>::reverse_iterator iter = papx->grpprl->rbegin(); !bPresent && iter != papx->grpprl->rend(); iter++ )
{
//find the tDef SPRM
DWORD code = iter->OpCode;
@ -1684,7 +1681,7 @@ namespace DocFileFormat
int fcRowEnd = findRowEndFc( cp, nestingLevel );
TablePropertyExceptions tapx( findValidPapx( fcRowEnd ), m_document->DataStream, m_document->nWordVersion);
std::list<CharacterPropertyExceptions*>* chpxs = m_document->GetCharacterPropertyExceptions( fcRowEnd, fcRowEnd + 1 );
std::vector<CharacterPropertyExceptions*>* chpxs = m_document->GetCharacterPropertyExceptions( fcRowEnd, fcRowEnd + 1 );
TableRowPropertiesMapping* trpMapping = new TableRowPropertiesMapping( m_pXmlWriter, *(chpxs->begin()) );
tapx.Convert( trpMapping );
@ -2076,7 +2073,7 @@ namespace DocFileFormat
if (!chpx) return false;
if (!chpx->grpprl) return false;
for (std::list<SinglePropertyModifier>::iterator iter = chpx->grpprl->begin(); iter != chpx->grpprl->end(); ++iter)
for (std::vector<SinglePropertyModifier>::iterator iter = chpx->grpprl->begin(); iter != chpx->grpprl->end(); ++iter)
{
if ((sprmCPicLocation == iter->OpCode) || (sprmCHsp == iter->OpCode)) // PICTURE
{
@ -2101,7 +2098,7 @@ namespace DocFileFormat
{
Symbol ret;
for (std::list<SinglePropertyModifier>::const_iterator iter = chpx->grpprl->begin(); iter != chpx->grpprl->end(); ++iter)
for (std::vector<SinglePropertyModifier>::const_iterator iter = chpx->grpprl->begin(); iter != chpx->grpprl->end(); ++iter)
{
if (DocFileFormat::sprmCSymbol == iter->OpCode)
{

View File

@ -97,7 +97,7 @@ namespace DocFileFormat
void writeField (const std::wstring& sFieldString, int cpFieldStart, int cpFieldEnd);
ParagraphPropertyExceptions* findValidPapx( int fc );
std::list<std::vector<wchar_t> >* splitCharList( std::vector<wchar_t>* chars, std::vector<int>* splitIndices );
std::vector<std::vector<wchar_t> >* splitCharList( std::vector<wchar_t>* chars, std::vector<int>* splitIndices );
int writeTable ( int initialCp, unsigned int nestingLevel );
bool buildTableGrid( int initialCp, unsigned int nestingLevel, std::vector<short>& grid);
int findRowEndFc ( int initialCp, int& rowEndCp, unsigned int nestingLevel );

View File

@ -118,7 +118,7 @@ FormFieldData::FormFieldData( int type, const CharacterPropertyExceptions* chpx,
int fc = -1;
bool bNilPICFAndBinData = false;
for ( std::list<SinglePropertyModifier>::iterator iter = chpx->grpprl->begin(); iter != chpx->grpprl->end(); iter++ )
for ( std::vector<SinglePropertyModifier>::iterator iter = chpx->grpprl->begin(); iter != chpx->grpprl->end(); iter++ )
{
switch ( iter->OpCode)
{

View File

@ -123,9 +123,9 @@ namespace DocFileFormat
/*========================================================================================================*/
/// Parses the 0Table (or 1Table) for FKP _entries containing CHPX
std::list<FormattedDiskPageCHPX*>* FormattedDiskPageCHPX::GetAllCHPXFKPs( FileInformationBlock* fib, POLE::Stream* wordStream, POLE::Stream* tableStream )
std::vector<FormattedDiskPageCHPX*>* FormattedDiskPageCHPX::GetAllCHPXFKPs( FileInformationBlock* fib, POLE::Stream* wordStream, POLE::Stream* tableStream )
{
std::list<FormattedDiskPageCHPX*>* CHPXlist = new std::list<FormattedDiskPageCHPX*>();
std::vector<FormattedDiskPageCHPX*>* CHPXlist = new std::vector<FormattedDiskPageCHPX*>();
//get bintable for CHPX
unsigned char* binTableChpx = new unsigned char[fib->m_FibWord97.lcbPlcfBteChpx];

View File

@ -52,6 +52,6 @@ namespace DocFileFormat
virtual ~FormattedDiskPageCHPX();
FormattedDiskPageCHPX( POLE::Stream* wordStream, int offset, int nWordVersion );
/// Parses the 0Table (or 1Table) for FKP _entries containing CHPX
static std::list<FormattedDiskPageCHPX*>* GetAllCHPXFKPs( FileInformationBlock* fib, POLE::Stream* wordStream, POLE::Stream* tableStream );
static std::vector<FormattedDiskPageCHPX*>* GetAllCHPXFKPs( FileInformationBlock* fib, POLE::Stream* wordStream, POLE::Stream* tableStream );
};
}

View File

@ -162,9 +162,9 @@ namespace DocFileFormat
/*========================================================================================================*/
/// Parses the 0Table (or 1Table) for FKP _entries containing PAPX
std::list<FormattedDiskPagePAPX*>* FormattedDiskPagePAPX::GetAllPAPXFKPs( FileInformationBlock* fib, POLE::Stream* wordStream, POLE::Stream* tableStream, POLE::Stream* dataStream)
std::vector<FormattedDiskPagePAPX*>* FormattedDiskPagePAPX::GetAllPAPXFKPs( FileInformationBlock* fib, POLE::Stream* wordStream, POLE::Stream* tableStream, POLE::Stream* dataStream)
{
std::list<FormattedDiskPagePAPX*>* PAPXlist = new std::list<FormattedDiskPagePAPX*>();
std::vector<FormattedDiskPagePAPX*>* PAPXlist = new std::vector<FormattedDiskPagePAPX*>();
//get bintable for PAPX
unsigned char* binTablePapx = new unsigned char[fib->m_FibWord97.lcbPlcfBtePapx];
@ -237,7 +237,7 @@ namespace DocFileFormat
/*========================================================================================================*/
/// Returns a list of all PAPX FCs between they given boundaries.
std::list<int>* FormattedDiskPagePAPX::GetFileCharacterPositions
std::vector<int>* FormattedDiskPagePAPX::GetFileCharacterPositions
(
int fcMin,
int fcMax,
@ -247,25 +247,25 @@ namespace DocFileFormat
POLE::Stream* dataStream
)
{
std::list<int>* cpList = new std::list<int>();
std::list<FormattedDiskPagePAPX*> *fkps = FormattedDiskPagePAPX::GetAllPAPXFKPs( fib, wordStream, tableStream, dataStream );
std::vector<int>* cpList = new std::vector<int>();
std::vector<FormattedDiskPagePAPX*> *fkps = FormattedDiskPagePAPX::GetAllPAPXFKPs( fib, wordStream, tableStream, dataStream );
unsigned int i = 0;
FormattedDiskPagePAPX* fkp = NULL;
for ( std::list<FormattedDiskPagePAPX*>::iterator iter = fkps->begin(); iter != fkps->end(); iter++ )
for (size_t i = 0; i < fkps->size(); ++i )
{
fkp = (*iter);
fkp = fkps->at(i);
//the last entry of each is always the same as the first entry of the next FKP
//so, ignore all last _entries except for the last FKP.
int max = fkp->rgfcSize;
int max_ = fkp->rgfcSize;
if ( i++ < fkps->size() - 1 )
{
max--;
max_--;
}
for ( int j = 0; j < max; j++ )
for ( int j = 0; j < max_; j++ )
{
if( ( fkp->rgfc[j] >= fcMin ) && ( fkp->rgfc[j] < fcMax ) )
{
@ -286,7 +286,7 @@ namespace DocFileFormat
/// Returnes a list of all ParagraphPropertyExceptions which correspond to text
/// between the given offsets.
std::list<ParagraphPropertyExceptions*>* FormattedDiskPagePAPX::GetParagraphPropertyExceptions
std::vector<ParagraphPropertyExceptions*>* FormattedDiskPagePAPX::GetParagraphPropertyExceptions
(
int fcMin,
int fcMax,
@ -296,28 +296,26 @@ namespace DocFileFormat
POLE::Stream* dataStream
)
{
std::list<ParagraphPropertyExceptions*>* ppxList = new std::list<ParagraphPropertyExceptions*>();
std::list<FormattedDiskPagePAPX*>* fkps = FormattedDiskPagePAPX::GetAllPAPXFKPs( fib, wordStream, tableStream, dataStream );
FormattedDiskPagePAPX *fkp = NULL;
std::vector<ParagraphPropertyExceptions*>* ppxList = new std::vector<ParagraphPropertyExceptions*>();
std::vector<FormattedDiskPagePAPX*>* fkps = FormattedDiskPagePAPX::GetAllPAPXFKPs( fib, wordStream, tableStream, dataStream );
for ( std::list<FormattedDiskPagePAPX*>::iterator iter = fkps->begin(); iter != fkps->end(); iter++ )
{
fkp = (*iter);
for (size_t i = 0; i < fkps->size(); ++i)
{
FormattedDiskPagePAPX* fkp = fkps->at(i);
for ( unsigned int j = 0; j < fkp->grppapxSize; j++ )
{
if ( ( fkp->rgfc[j] >= fcMin ) && ( fkp->rgfc[j] < fcMax ) )
for (unsigned int j = 0; j < fkp->grppapxSize; j++)
{
ppxList->push_back( fkp->grppapx[j] );
}
}
if ((fkp->rgfc[j] >= fcMin) && (fkp->rgfc[j] < fcMax))
{
ppxList->push_back(fkp->grppapx[j]);
}
}
RELEASEOBJECT( fkp );
fkps->clear();
RELEASEOBJECT( fkps );
}
RELEASEOBJECT(fkp);
fkps->clear();
RELEASEOBJECT(fkps);
}
return ppxList;
}
}

View File

@ -65,12 +65,12 @@ namespace DocFileFormat
virtual ~FormattedDiskPagePAPX();
FormattedDiskPagePAPX( POLE::Stream* wordStream, int offset, POLE::Stream* dataStream, int nWordVersion, bool fComplex);
/// Parses the 0Table (or 1Table) for FKP _entries containing PAPX
static std::list<FormattedDiskPagePAPX*>* GetAllPAPXFKPs( FileInformationBlock* fib, POLE::Stream* wordStream, POLE::Stream* tableStream, POLE::Stream* dataStream);
static std::vector<FormattedDiskPagePAPX*>* GetAllPAPXFKPs( FileInformationBlock* fib, POLE::Stream* wordStream, POLE::Stream* tableStream, POLE::Stream* dataStream);
/// Returns a list of all PAPX FCs between they given boundaries.
static std::list<int>* GetFileCharacterPositions( int fcMin, int fcMax, FileInformationBlock* fib, POLE::Stream* wordStream, POLE::Stream* tableStream, POLE::Stream* dataStream );
static std::vector<int>* GetFileCharacterPositions( int fcMin, int fcMax, FileInformationBlock* fib, POLE::Stream* wordStream, POLE::Stream* tableStream, POLE::Stream* dataStream );
/// Returnes a list of all ParagraphPropertyExceptions which correspond to text
/// between the given offsets.
static std::list<ParagraphPropertyExceptions*>* GetParagraphPropertyExceptions( int fcMin, int fcMax, FileInformationBlock* fib, POLE::Stream* wordStream, POLE::Stream* tableStream, POLE::Stream* dataStream );
static std::vector<ParagraphPropertyExceptions*>* GetParagraphPropertyExceptions( int fcMin, int fcMax, FileInformationBlock* fib, POLE::Stream* wordStream, POLE::Stream* tableStream, POLE::Stream* dataStream );
};
}

View File

@ -646,7 +646,7 @@ namespace DocFileFormat
if (fc < 0 || fcEnd < 0 ) break;
std::list<CharacterPropertyExceptions*>* chpxs = m_document->GetCharacterPropertyExceptions(fc, fcEnd);
std::vector<CharacterPropertyExceptions*>* chpxs = m_document->GetCharacterPropertyExceptions(fc, fcEnd);
if ((chpxs != NULL) && (!chpxs->empty()))
{
@ -690,7 +690,7 @@ namespace DocFileFormat
unsigned int index = 0;
bool isPictureBullet = false;
for (std::list<SinglePropertyModifier>::const_iterator iter = grpprlChpx->grpprl->begin(); iter != grpprlChpx->grpprl->end(); ++iter)
for (std::vector<SinglePropertyModifier>::const_iterator iter = grpprlChpx->grpprl->begin(); iter != grpprlChpx->grpprl->end(); ++iter)
{
switch(iter->OpCode)
{

View File

@ -404,7 +404,7 @@ std::wstring OleObject::getOleEntryName( const CharacterPropertyExceptions* chpx
if ( chpx != NULL )
{
for ( std::list<SinglePropertyModifier>::const_iterator iter = chpx->grpprl->begin(); iter != chpx->grpprl->end(); iter++ )
for ( std::vector<SinglePropertyModifier>::const_iterator iter = chpx->grpprl->begin(); iter != chpx->grpprl->end(); iter++ )
{
if ( iter->OpCode == sprmCPicLocation || iter->OpCode == sprmOldCPicLocation)
{

View File

@ -131,8 +131,8 @@ namespace DocFileFormat
bool bNumPr = false;
std::list<SinglePropertyModifier>::iterator end = papx->grpprl->end();
for (std::list<SinglePropertyModifier>::iterator iter = papx->grpprl->begin(); iter != end; ++iter)
std::vector<SinglePropertyModifier>::iterator end = papx->grpprl->end();
for (std::vector<SinglePropertyModifier>::iterator iter = papx->grpprl->begin(); iter != end; ++iter)
{
int nProperty = 0; //for unknown test

View File

@ -37,7 +37,7 @@ namespace DocFileFormat
ParagraphPropertyExceptions::ParagraphPropertyExceptions() : PropertyExceptions(), istd(0)
{
}
ParagraphPropertyExceptions::ParagraphPropertyExceptions( const std::list<SinglePropertyModifier>& grpprl ):
ParagraphPropertyExceptions::ParagraphPropertyExceptions( const std::vector<SinglePropertyModifier>& grpprl ):
PropertyExceptions( grpprl ), istd(0)
{
}
@ -238,13 +238,11 @@ namespace DocFileFormat
//There is a SPRM that points to an offset in the data stream,
//where a list of SPRM is saved.
for ( std::list<SinglePropertyModifier>::iterator iter = grpprl->begin(); iter != grpprl->end(); iter++ )
for ( std::vector<SinglePropertyModifier>::iterator iter = grpprl->begin(); iter != grpprl->end(); iter++ )
{
SinglePropertyModifier sprm( *iter );
if( ( sprm.OpCode == sprmPHugePapx ) || ( (int)sprm.OpCode == 0x6646 ) )
if( (iter->OpCode == sprmPHugePapx ) || ( (int)iter->OpCode == 0x6646 ) )
{
unsigned int fc = FormatUtils::BytesToUInt32( sprm.Arguments, 0, sprm.argumentsSize );
unsigned int fc = FormatUtils::BytesToUInt32(iter->Arguments, 0, iter->argumentsSize );
reader = new VirtualStreamReader( dataStream, (int)fc, nWordVersion);
//parse the size of the external grpprl
@ -261,14 +259,20 @@ namespace DocFileFormat
//assign the external grpprl
RELEASEOBJECT( grpprl );
grpprl = new std::list<SinglePropertyModifier>( *(externalPx.grpprl) );
grpprl = new std::vector<SinglePropertyModifier>( *(externalPx.grpprl) );
RELEASEARRAYOBJECTS(grpprlBytes);
RELEASEOBJECT(reader)
//remove the sprmPHugePapx
grpprl->remove( sprm );
RELEASEARRAYOBJECTS( grpprlBytes );
RELEASEOBJECT( reader )
for (std::vector<SinglePropertyModifier>::iterator iter2 = grpprl->begin(); iter2 != grpprl->end(); iter2++)
{
if ((iter2->OpCode == sprmPHugePapx) || ((int)iter2->OpCode == 0x6646))
{
grpprl->erase(iter2);
break;
}
}
break;
}
}

View File

@ -46,7 +46,7 @@ namespace DocFileFormat
/// The grpprl list is empty
ParagraphPropertyExceptions();
ParagraphPropertyExceptions( const std::list<SinglePropertyModifier>& grpprl );
ParagraphPropertyExceptions( const std::vector<SinglePropertyModifier>& grpprl );
virtual ~ParagraphPropertyExceptions();
/// Parses the bytes to retrieve a PAPX

View File

@ -341,7 +341,7 @@ namespace DocFileFormat
{
int ret = -1, ret1 = -1;
for ( std::list<SinglePropertyModifier>::const_iterator iter = chpx->grpprl->begin(); iter != chpx->grpprl->end(); iter++ )
for ( std::vector<SinglePropertyModifier>::const_iterator iter = chpx->grpprl->begin(); iter != chpx->grpprl->end(); iter++ )
{
switch ( iter->OpCode )
{

View File

@ -43,12 +43,12 @@ namespace DocFileFormat
PropertyExceptions::PropertyExceptions() : grpprl(NULL)
{
grpprl = new std::list<SinglePropertyModifier>();
grpprl = new std::vector<SinglePropertyModifier>();
}
PropertyExceptions::PropertyExceptions( const std::list<SinglePropertyModifier>& _grpprl ) : grpprl(NULL)
PropertyExceptions::PropertyExceptions( const std::vector<SinglePropertyModifier>& _grpprl ) : grpprl(NULL)
{
grpprl = new std::list<SinglePropertyModifier>( _grpprl );
grpprl = new std::vector<SinglePropertyModifier>( _grpprl );
}
PropertyExceptions::PropertyExceptions( unsigned char* bytes, int size, int nWordVersion ) : grpprl(NULL)
@ -62,7 +62,7 @@ namespace DocFileFormat
{
RELEASEOBJECT( grpprl );
grpprl = new std::list<SinglePropertyModifier>();
grpprl = new std::vector<SinglePropertyModifier>();
if ( ( bytes == NULL ) || ( size == 0 ) ) return;

View File

@ -42,13 +42,12 @@ namespace DocFileFormat
class PropertyExceptions: public IVisitable
{
public:
/// A list of the sprms that encode the differences between
/// CHP for a character and the PAP for the paragraph style used.
std::list<SinglePropertyModifier> *grpprl;
std::vector<SinglePropertyModifier> *grpprl;
virtual ~PropertyExceptions();
PropertyExceptions();
PropertyExceptions( const std::list<SinglePropertyModifier>& grpprl );
PropertyExceptions( const std::vector<SinglePropertyModifier>& grpprl );
PropertyExceptions( unsigned char* bytes, int size, int nWordVersion );
void ReadExceptions( unsigned char* bytes, int size, int nWordVersion );

View File

@ -43,7 +43,7 @@ namespace DocFileFormat
RevisionData::RevisionData():
Dttm(), Isbt(0), Type(NoRevision), Changes(NULL), RsidDel(0), RsidProp(0), Rsid(0)
{
this->Changes = new std::list<SinglePropertyModifier>();
this->Changes = new std::vector<SinglePropertyModifier>();
}
RevisionData::RevisionData( CharacterPropertyExceptions* chpx ) : Dttm(), Isbt(0), Type(NoRevision), Changes(NULL), RsidDel(0), RsidProp(0), Rsid(0)
@ -54,9 +54,9 @@ namespace DocFileFormat
bool collectRevisionData = true;
Changes = new std::list<SinglePropertyModifier>();
Changes = new std::vector<SinglePropertyModifier>();
for ( std::list<SinglePropertyModifier>::iterator iter = chpx->grpprl->begin(); iter != chpx->grpprl->end(); iter++ )
for ( std::vector<SinglePropertyModifier>::iterator iter = chpx->grpprl->begin(); iter != chpx->grpprl->end(); iter++ )
{
switch ( iter->OpCode)
{

View File

@ -62,7 +62,7 @@ namespace DocFileFormat
DateAndTime Dttm;
short Isbt;
RevisionType Type;
std::list<SinglePropertyModifier>* Changes;
std::vector<SinglePropertyModifier>* Changes;
int RsidDel;
int RsidProp;
int Rsid;

View File

@ -103,7 +103,7 @@ namespace DocFileFormat
if (pTable)
{
unsigned char fHF = _ctx->_doc->nWordVersion == 0 ? 255 : 0; //all headers & footers
for (std::list<SinglePropertyModifier>::iterator iter = sepx->grpprl->begin(); iter != sepx->grpprl->end(); ++iter)
for (std::vector<SinglePropertyModifier>::iterator iter = sepx->grpprl->begin(); iter != sepx->grpprl->end(); ++iter)
{
switch (iter->OpCode)
{
@ -164,7 +164,7 @@ namespace DocFileFormat
std::wstring wsSprmSPgnStart;
int nProperty = 0; // for unknown
for (std::list<SinglePropertyModifier>::iterator iter = sepx->grpprl->begin(); iter != sepx->grpprl->end(); ++iter)
for (std::vector<SinglePropertyModifier>::iterator iter = sepx->grpprl->begin(); iter != sepx->grpprl->end(); ++iter)
{
switch (iter->OpCode)
{

View File

@ -41,7 +41,7 @@ namespace DocFileFormat
{
ReadExceptions(bytes, size, nWordVersion);
}
for ( std::list<SinglePropertyModifier>::iterator iter = grpprl->begin(); iter != grpprl->end(); iter++ )
for ( std::vector<SinglePropertyModifier>::iterator iter = grpprl->begin(); iter != grpprl->end(); iter++ )
{
SinglePropertyModifier sprm( *iter );

View File

@ -78,7 +78,7 @@ namespace DocFileFormat
unsigned int iTap_current = 1;
for ( std::list<SinglePropertyModifier>::iterator iter = tapx->grpprl->begin(); iter != tapx->grpprl->end(); iter++ )
for ( std::vector<SinglePropertyModifier>::iterator iter = tapx->grpprl->begin(); iter != tapx->grpprl->end(); iter++ )
{
DWORD code = iter->OpCode;
@ -94,7 +94,7 @@ namespace DocFileFormat
}
bool bPresentDefTable = false;
for (std::list<SinglePropertyModifier>::reverse_iterator iter = tapx->grpprl->rbegin(); iter != tapx->grpprl->rend(); ++iter)
for (std::vector<SinglePropertyModifier>::reverse_iterator iter = tapx->grpprl->rbegin(); iter != tapx->grpprl->rend(); ++iter)
{
switch (iter->OpCode)
{
@ -453,12 +453,12 @@ namespace DocFileFormat
}
}
bool TableCellPropertiesMapping::IsTableBordersDefined (const std::list<SinglePropertyModifier>* grpprl) const
bool TableCellPropertiesMapping::IsTableBordersDefined (const std::vector<SinglePropertyModifier>* grpprl) const
{
if (grpprl)
{
std::list<SinglePropertyModifier>::const_iterator end = grpprl->end();
for (std::list<SinglePropertyModifier>::const_iterator iter = grpprl->begin(); iter != end; ++iter)
std::vector<SinglePropertyModifier>::const_iterator end = grpprl->end();
for (std::vector<SinglePropertyModifier>::const_iterator iter = grpprl->begin(); iter != end; ++iter)
{
if ((iter->OpCode == sprmTTableBorders) || (iter->OpCode == sprmTTableBorders80) || (iter->OpCode == sprmTSetBrc))
return true;
@ -468,12 +468,12 @@ namespace DocFileFormat
return false;
}
bool TableCellPropertiesMapping::IsTableCellWidthDefined (const std::list<SinglePropertyModifier>* grpprl) const
bool TableCellPropertiesMapping::IsTableCellWidthDefined (const std::vector<SinglePropertyModifier>* grpprl) const
{
if (grpprl)
{
std::list<SinglePropertyModifier>::const_iterator end = grpprl->end();
for (std::list<SinglePropertyModifier>::const_iterator iter = grpprl->begin(); iter != end; ++iter)
std::vector<SinglePropertyModifier>::const_iterator end = grpprl->end();
for (std::vector<SinglePropertyModifier>::const_iterator iter = grpprl->begin(); iter != end; ++iter)
{
if ( iter->OpCode == sprmTCellWidth )
{

View File

@ -74,8 +74,8 @@ namespace DocFileFormat
private:
void apppendCellShading (unsigned char* sprmArg, int size, int cellIndex);
bool IsTableBordersDefined (const std::list<SinglePropertyModifier>* grpprl) const;
bool IsTableCellWidthDefined (const std::list<SinglePropertyModifier>* grpprl) const;
bool IsTableBordersDefined (const std::vector<SinglePropertyModifier>* grpprl) const;
bool IsTableCellWidthDefined (const std::vector<SinglePropertyModifier>* grpprl) const;
int _gridIndex;
int _cellIndex;

View File

@ -39,7 +39,7 @@ namespace DocFileFormat
{
if ( papx != NULL )
{
for ( std::list<SinglePropertyModifier>::iterator iter = papx->grpprl->begin(); iter != papx->grpprl->end(); iter++ )
for ( std::vector<SinglePropertyModifier>::iterator iter = papx->grpprl->begin(); iter != papx->grpprl->end(); iter++ )
{
switch(iter->OpCode)
{

View File

@ -41,9 +41,9 @@ namespace DocFileFormat
TableCell::TableCell( const TableCell& _tableCell ) : cp(_tableCell.cp), depth(_tableCell.depth), documentMapping(_tableCell.documentMapping)
{
for ( std::list<ITableCellElementPtr>::const_iterator iter = _tableCell.cellElements.begin(); iter != _tableCell.cellElements.end(); iter++ )
for ( size_t i = 0; i < _tableCell.cellElements.size(); ++i)
{
AddItem( **iter );
AddItem(*_tableCell.cellElements[i]);
}
}
@ -59,9 +59,9 @@ namespace DocFileFormat
depth = _tableCell.depth;
cellElements.clear();
for ( std::list<ITableCellElementPtr>::const_iterator iter = _tableCell.cellElements.begin(); iter != _tableCell.cellElements.end(); iter++ )
for ( size_t i = 0; i < _tableCell.cellElements.size(); ++i)
{
AddItem( **iter );
AddItem( *_tableCell.cellElements[i]);
}
documentMapping = _tableCell.documentMapping;
@ -142,9 +142,9 @@ namespace DocFileFormat
documentMapping->_lastValidPapx = papxBackup;
documentMapping->_lastValidSepx = sepxBackup;
for (std::list<ITableCellElementPtr>::iterator iter = cellElements.begin(); iter != cellElements.end(); ++iter)
for ( size_t i = 0; i < cellElements.size(); ++i)
{
(*iter)->Convert( mapping );
cellElements[i]->Convert( mapping );
}
//end w:tc
@ -223,7 +223,7 @@ namespace DocFileFormat
documentMapping->m_document->DataStream,
documentMapping->m_document->nWordVersion);
std::list<CharacterPropertyExceptions*>* chpxs = documentMapping->m_document->GetCharacterPropertyExceptions( fcRowEnd, fcRowEnd + 1 );
std::vector<CharacterPropertyExceptions*>* chpxs = documentMapping->m_document->GetCharacterPropertyExceptions( fcRowEnd, fcRowEnd + 1 );
if (chpxs)
{
TableRowPropertiesMapping trpMapping( documentMapping->GetXMLWriter(), *(chpxs->begin()) );
@ -241,9 +241,9 @@ namespace DocFileFormat
}
else
{
for ( std::list<TableCell>::iterator iter = cells.begin(); iter != cells.end(); iter++ )
for ( size_t i = 0; i < cells.size(); ++i)
{
iter->Convert( mapping, &tapx, grid, gridIndex, nCellIndex++);
cells[i].Convert( mapping, &tapx, grid, gridIndex, nCellIndex++);
}
}
@ -620,9 +620,9 @@ namespace DocFileFormat
documentMapping->_lastValidPapx = papxBackup;
documentMapping->_lastValidSepx = sepxBackup;
for ( std::list<TableRow>::iterator iter = rows.begin(); iter != rows.end(); iter++ )
for ( size_t i = 0; i < rows.size(); ++i)
{
iter->Convert( mapping, &grid );
rows[i].Convert( mapping, &grid );
}
//close w:tbl

View File

@ -69,7 +69,7 @@ namespace DocFileFormat
int cp;
unsigned int depth;
std::list<ITableCellElementPtr> cellElements;
std::vector<ITableCellElementPtr> cellElements;
DocumentMapping* documentMapping;
};
@ -92,7 +92,7 @@ namespace DocFileFormat
int cp;
unsigned int depth;
std::list<TableCell> cells;
std::vector<TableCell> cells;
DocumentMapping* documentMapping;
};
@ -154,7 +154,7 @@ namespace DocFileFormat
int cpStart;
int cpEnd;
unsigned int depth;
std::list<TableRow> rows;
std::vector<TableRow> rows;
DocumentMapping* documentMapping;
};

View File

@ -70,7 +70,7 @@ void TablePropertiesMapping::Apply(IVisitable* visited)
bool bTableW = false;
for (std::list<SinglePropertyModifier>::iterator iter = tapx->grpprl->begin(); iter != tapx->grpprl->end(); iter++)
for (std::vector<SinglePropertyModifier>::iterator iter = tapx->grpprl->begin(); iter != tapx->grpprl->end(); iter++)
{
switch (iter->OpCode)
{

View File

@ -53,7 +53,7 @@ namespace DocFileFormat
m_bSkipShading97 = FALSE;
for (std::list<SinglePropertyModifier>::iterator oSpmIter = papx->grpprl->begin(); oSpmIter != papx->grpprl->end(); ++oSpmIter)
for (std::vector<SinglePropertyModifier>::iterator oSpmIter = papx->grpprl->begin(); oSpmIter != papx->grpprl->end(); ++oSpmIter)
{
if (oSpmIter->OpCode == sprmTDefTableShd ||
oSpmIter->OpCode == sprmTDefTableShd2nd ||
@ -82,7 +82,7 @@ namespace DocFileFormat
//parse the grpprl
PropertyExceptions externalPx(grpprlBytes, grpprlSize, nWordVersion);
for (std::list<SinglePropertyModifier>::iterator oIter = externalPx.grpprl->begin(); oIter != externalPx.grpprl->end(); ++oIter)
for (std::vector<SinglePropertyModifier>::iterator oIter = externalPx.grpprl->begin(); oIter != externalPx.grpprl->end(); ++oIter)
{
if (oIter->Type == TAP)
{

View File

@ -70,7 +70,7 @@ namespace DocFileFormat
}
XMLTools::XMLElement rowHeight(L"w:trHeight");
for ( std::list<SinglePropertyModifier>::iterator iter = tapx->grpprl->begin(); iter != tapx->grpprl->end(); iter++ )
for ( std::vector<SinglePropertyModifier>::iterator iter = tapx->grpprl->begin(); iter != tapx->grpprl->end(); iter++ )
{
switch ( iter->OpCode )
{

View File

@ -529,12 +529,13 @@ namespace DocFileFormat
AllPapx = new std::map<int, ParagraphPropertyExceptions*>();
AllPapxVector = new std::vector<int>();
for (std::list<FormattedDiskPagePAPX*>::iterator iter = AllPapxFkps->begin(); iter != AllPapxFkps->end(); ++iter)
for (size_t i = 0; i < AllPapxFkps->size(); ++i)
{
for (unsigned int j = 0; j < (*iter)->grppapxSize; ++j)
FormattedDiskPagePAPX*& iter = AllPapxFkps->at(i);
for (unsigned int j = 0; j < (iter)->grppapxSize; ++j)
{
int nVal = (*iter)->rgfc[j];
AllPapx->insert( std::pair<int, ParagraphPropertyExceptions*>( nVal, (*iter)->grppapx[j] ) );
int nVal = (iter)->rgfc[j];
AllPapx->insert( std::pair<int, ParagraphPropertyExceptions*>( nVal, (iter)->grppapx[j] ) );
AllPapxVector->push_back(nVal);
}
}
@ -809,9 +810,10 @@ namespace DocFileFormat
if (AllPapxFkps)
{
for (std::list<FormattedDiskPagePAPX*>::iterator iter = AllPapxFkps->begin(); iter != AllPapxFkps->end(); ++iter)
for (size_t i = 0; i < AllPapxFkps->size(); ++i)
{
RELEASEOBJECT(*iter);
FormattedDiskPagePAPX*& iter = AllPapxFkps->at(i);
RELEASEOBJECT(iter);
}
RELEASEOBJECT(AllPapxFkps);
@ -819,9 +821,10 @@ namespace DocFileFormat
if (AllChpxFkps)
{
for (std::list<FormattedDiskPageCHPX*>::iterator iter = AllChpxFkps->begin(); iter != AllChpxFkps->end(); ++iter)
for (size_t i = 0; i < AllChpxFkps->size(); ++i)
{
RELEASEOBJECT(*iter);
FormattedDiskPageCHPX*& iter = AllChpxFkps->at(i);
RELEASEOBJECT(iter);
}
RELEASEOBJECT(AllChpxFkps);
@ -904,9 +907,9 @@ namespace DocFileFormat
int i = 0;
for (std::list<FormattedDiskPageCHPX*>::iterator iter = AllChpxFkps->begin(); iter != AllChpxFkps->end(); ++iter)
for (size_t it = 0; it < AllChpxFkps->size(); ++it)
{
FormattedDiskPageCHPX *fkp = (*iter);
FormattedDiskPageCHPX *fkp = AllChpxFkps->at(it);
//if the last fc of this fkp is smaller the fcMin
//this fkp is before the requested range
@ -923,16 +926,16 @@ namespace DocFileFormat
}
//don't add the duplicated values of the FKP boundaries (Length-1)
int max = fkp->rgfcSize - 1;
int max_ = fkp->rgfcSize - 1;
//last fkp?
//use full table
if ( i++ == ( AllChpxFkps->size() - 1 ) )
{
max = fkp->rgfcSize;
max_ = fkp->rgfcSize;
}
for (int j = 0; j < max; ++j)
for (int j = 0; j < max_; ++j)
{
if ( ( fkp->rgfc[j] < fcMin ) && ( fkp->rgfc[j + 1] > fcMin ) )
{
@ -957,13 +960,13 @@ namespace DocFileFormat
// Returnes a list of all CharacterPropertyExceptions which correspond to text
std::list<CharacterPropertyExceptions*>* WordDocument::GetCharacterPropertyExceptions(int fcMin, int fcMax)
std::vector<CharacterPropertyExceptions*>* WordDocument::GetCharacterPropertyExceptions(int fcMin, int fcMax)
{
std::list<CharacterPropertyExceptions*>* cpeList = new std::list<CharacterPropertyExceptions*>();
std::vector<CharacterPropertyExceptions*>* cpeList = new std::vector<CharacterPropertyExceptions*>();
for (std::list<FormattedDiskPageCHPX*>::iterator iter = AllChpxFkps->begin(); iter != AllChpxFkps->end(); ++iter)
for (size_t i = 0; i < AllChpxFkps->size(); ++i)
{
FormattedDiskPageCHPX *fkp = (*iter);
FormattedDiskPageCHPX *fkp = AllChpxFkps->at(i);
// get the CHPX
for (unsigned int j = 0; j < fkp->grpchpxSize; ++j)

View File

@ -144,7 +144,7 @@ namespace DocFileFormat
std::vector<wchar_t>* GetChars (int fcStart, int fcEnd, int cp);
std::vector<int>* GetFileCharacterPositions ( int fcMin, int fcMax );
std::list<CharacterPropertyExceptions*>* GetCharacterPropertyExceptions ( int fcMin, int fcMax );
std::vector<CharacterPropertyExceptions*>* GetCharacterPropertyExceptions ( int fcMin, int fcMax );
void Clear();
@ -162,8 +162,8 @@ namespace DocFileFormat
StructuredStorageReader * m_pStorage; //POLE::Storage* Storage
std::vector<wchar_t> * Text; // All text of the Word document
std::list<FormattedDiskPagePAPX*> * AllPapxFkps; // A list of all FKPs that contain PAPX
std::list<FormattedDiskPageCHPX*> * AllChpxFkps; // A list of all FKPs that contain CHPX
std::vector<FormattedDiskPagePAPX*> * AllPapxFkps; // A list of all FKPs that contain PAPX
std::vector<FormattedDiskPageCHPX*> * AllChpxFkps; // A list of all FKPs that contain CHPX
std::map<int, ParagraphPropertyExceptions*> * AllPapx; // The value is the PAPX that formats the paragraph.
std::map<int, SectionPropertyExceptions*> * AllSepx; // The value is the SEPX that formats the section.