Commit 41bda87c authored by Sergey.Konovalov's avatar Sergey.Konovalov Committed by Alexander Trofimov

CAtlArray->std::vector

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@58044 954022d7-b5bf-4e40-9824-e11837661b57
parent 504b6bd7
......@@ -12,7 +12,7 @@ namespace Writers
CString filename;
int index;
};
CSimpleArray<ChartElem*> m_aCharts;
std::vector<ChartElem*> m_aCharts;
ContentTypesWriter& m_oContentTypesWriter;
int nChartCount;
public:
......@@ -24,14 +24,14 @@ namespace Writers
}
~ChartWriter()
{
for(int i = 0, length = m_aCharts.GetSize(); i < length; ++i)
for(int i = 0, length = m_aCharts.size(); i < length; ++i)
{
delete m_aCharts[i];
}
}
bool IsEmpty()
{
return 0 == m_aCharts.GetSize();
return 0 == m_aCharts.size();
}
void Write()
{
......@@ -39,7 +39,7 @@ namespace Writers
{
CString sChartDir = m_sDir + _T("/word/charts");
CreateDirectory(sChartDir, NULL);
for(int i = 0, length = m_aCharts.GetSize(); i < length; ++i)
for(int i = 0, length = m_aCharts.size(); i < length; ++i)
{
ChartElem* elem = m_aCharts[i];
CString sRelPath = _T("/word/charts/") + elem->filename;
......@@ -66,7 +66,7 @@ namespace Writers
sFileName = pChartElem->filename;
index = pChartElem->index;
m_aCharts.Add(pChartElem);
m_aCharts.push_back(pChartElem);
}
int getChartCount()
{
......
......@@ -8,7 +8,7 @@ namespace Writers
XmlUtils::CStringWriter m_oWriter;
CString m_sDir;
int m_nRid;
CAtlArray<CString> m_aRels;
std::vector<CString> m_aRels;
bool bDocumentRels;
public:
DocumentRelsWriter(CString sDir, bool bDocumentRels, int nRid = 1):m_sDir(sDir),bDocumentRels(bDocumentRels)
......@@ -32,7 +32,7 @@ namespace Writers
if(m_nRid > 1)
{
m_oWriter.WriteString(s_dr_Start);
for(int i = 0, length = m_aRels.GetCount(); i < length; ++i)
for(int i = 0, length = m_aRels.size(); i < length; ++i)
{
m_oWriter.WriteString(m_aRels[i]);
}
......@@ -55,7 +55,7 @@ namespace Writers
else
sRels.Format(_T("<Relationship Id=\"%s\" Type=\"%s\" Target=\"%s\"/>"), srId, sType, sTarget);
m_nRid++;
m_aRels.Add(sRels);
m_aRels.push_back(sRels);
return srId;
}
};
......
......@@ -32,7 +32,7 @@ namespace Writers
if(g_nCurFormatVersion < 5)
{
bool bTitlePage = false;
for(int i = 0, length = m_oHeaderFooterWriter.m_aHeaders.GetCount(); i < length; ++i)
for(int i = 0, length = m_oHeaderFooterWriter.m_aHeaders.size(); i < length; ++i)
{
HdrFtrItem* pHeader = m_oHeaderFooterWriter.m_aHeaders[i];
if(false == pHeader->rId.IsEmpty())
......@@ -52,7 +52,7 @@ namespace Writers
}
}
}
for(int i = 0, length = m_oHeaderFooterWriter.m_aFooters.GetCount(); i < length; ++i)
for(int i = 0, length = m_oHeaderFooterWriter.m_aFooters.size(); i < length; ++i)
{
HdrFtrItem* pFooter = m_oHeaderFooterWriter.m_aFooters[i];
if(false == pFooter->rId.IsEmpty())
......
......@@ -36,24 +36,24 @@ namespace Writers
CString m_sDir;
ContentTypesWriter& m_oContentTypesWriter;
public:
CAtlArray<HdrFtrItem*> m_aHeaders;
CAtlArray<HdrFtrItem*> m_aFooters;
std::vector<HdrFtrItem*> m_aHeaders;
std::vector<HdrFtrItem*> m_aFooters;
public:
HeaderFooterWriter(CString sDir, ContentTypesWriter& oContentTypesWriter):m_sDir(sDir),m_oContentTypesWriter(oContentTypesWriter)
{
}
~HeaderFooterWriter()
{
for(int i = 0, length = m_aHeaders.GetCount(); i < length; ++i)
for(int i = 0, length = m_aHeaders.size(); i < length; ++i)
delete m_aHeaders[i];
m_aHeaders.RemoveAll();
for(int i = 0, length = m_aFooters.GetCount(); i < length; ++i)
m_aHeaders.clear();
for(int i = 0, length = m_aFooters.size(); i < length; ++i)
delete m_aFooters[i];
m_aFooters.RemoveAll();
m_aFooters.clear();
}
void Write()
{
for(int i = 0, length = m_aHeaders.GetCount(); i < length; ++i)
for(int i = 0, length = m_aHeaders.size(); i < length; ++i)
{
HdrFtrItem* pHeader = m_aHeaders[i];
if(false == pHeader->IsEmpty())
......@@ -61,7 +61,7 @@ namespace Writers
WriteItem(_T("header"), pHeader->m_sFilename, pHeader->Header, true);
}
}
for(int i = 0, length = m_aFooters.GetCount(); i < length; ++i)
for(int i = 0, length = m_aFooters.size(); i < length; ++i)
{
HdrFtrItem* pFooter = m_aFooters[i];
if(false == pFooter->IsEmpty())
......
......@@ -9,7 +9,7 @@ namespace Writers
CString m_sDir;
CString m_sMediaDir;
public:
CAtlArray<CString> m_aImageNames;
std::vector<CString> m_aImageNames;
long nImageCount;
public:
MediaWriter(CString sDir):m_sDir(sDir)
......@@ -31,7 +31,7 @@ namespace Writers
sNewImg += _T("\\") + sNewImgName;
CopyFile(sImg, sNewImg, FALSE);
m_aImageNames.Add(sNewImgName);
m_aImageNames.push_back(sNewImgName);
//CString sNewImgRel;sNewImgRel = _T("media\\") + sNewImgName;
//CorrectString(sNewImgRel);
......
......@@ -268,7 +268,7 @@ public:
class Tabs
{
public:
CAtlArray<Tab> m_aTabs;
std::vector<Tab> m_aTabs;
};
class rPr
{
......@@ -663,7 +663,7 @@ public:
CString TablePr;
CString RowPr;
CString CellPr;
CAtlArray<CString> TblStylePr;
std::vector<CString> TblStylePr;
bool bqFormat;
bool buiPriority;
......@@ -772,7 +772,7 @@ public:
pCStringWriter->WriteString(CellPr);
pCStringWriter->WriteString(CString(_T("</w:tcPr>")));
}
for(int i = 0, length = TblStylePr.GetCount(); i < length; ++i)
for(int i = 0, length = TblStylePr.size(); i < length; ++i)
{
pCStringWriter->WriteString(TblStylePr[i]);
}
......@@ -1103,7 +1103,7 @@ class docLvl
public:
long Format;
BYTE Jc;
CAtlArray<docLvlText*> Text;
std::vector<docLvlText*> Text;
long Restart;
long Start;
BYTE Suff;
......@@ -1134,7 +1134,7 @@ public:
}
~docLvl()
{
for(int i = 0,length = Text.GetCount(); i < length; i++)
for(int i = 0,length = Text.size(); i < length; i++)
{
delete Text[i];
}
......@@ -1184,7 +1184,7 @@ public:
if(bText)
{
CString sText;
for(int i = 0, length = Text.GetCount(); i < length; ++i)
for(int i = 0, length = Text.size(); i < length; ++i)
{
docLvlText* item = Text[i];
if(item->bText)
......@@ -1233,7 +1233,7 @@ public:
long Id;
CString NumStyleLink;
CString StyleLink;
CAtlArray<docLvl*> Lvls;
std::vector<docLvl*> Lvls;
bool bId;
docANum()
......@@ -1242,7 +1242,7 @@ public:
}
~docANum()
{
for(int i = 0, length = Lvls.GetCount(); i < length; i++)
for(int i = 0, length = Lvls.size(); i < length; i++)
{
delete Lvls[i];
}
......@@ -1267,7 +1267,7 @@ public:
CString sXml;sXml.Format(_T("<w:numStyleLink w:val=\"%s\"/>"), sCorrectNumStyleLink);
oWriterANum.WriteString(sXml);
}
for(int i = 0, length = Lvls.GetCount(); i < length; ++i)
for(int i = 0, length = Lvls.size(); i < length; ++i)
{
Lvls[i]->Write(oWriterANum, i);
}
......@@ -1338,7 +1338,7 @@ public:
bool bNextLink = false;
bool bNextTooltip = false;
// ,
CAtlArray<CString> aItems;
std::vector<CString> aItems;
CString sCurItem;
bool bDQuot = false;
for(int i = 0, length = fld.GetLength(); i < length; ++i)
......@@ -1355,7 +1355,7 @@ public:
{
if(sCurItem.GetLength() > 0)
{
aItems.Add(sCurItem);
aItems.push_back(sCurItem);
sCurItem = _T("");
}
}
......@@ -1363,8 +1363,8 @@ public:
sCurItem += sCurLetter;
}
if(sCurItem.GetLength() > 0)
aItems.Add(sCurItem);
for(int i = 0, length = aItems.GetCount(); i < length; ++i)
aItems.push_back(sCurItem);
for(int i = 0, length = aItems.size(); i < length; ++i)
{
CString item = aItems[i];
if(bNextLink)
......@@ -1455,7 +1455,7 @@ public:
CString Text;
CString m_sParaId;
CString m_sParaIdParent;
CAtlArray<CComment*> replies;
std::vector<CComment*> replies;
bool bIdOpen;
bool bIdFormat;
......@@ -1469,21 +1469,21 @@ public:
}
~CComment()
{
for(int i = 0, length = replies.GetCount(); i < length; ++i)
for(int i = 0, length = replies.size(); i < length; ++i)
{
delete replies[i];
}
replies.RemoveAll();
replies.clear();
}
int getCount()
{
return replies.GetCount() + 1;
return replies.size() + 1;
}
void setFormatStart(int IdFormatStart)
{
bIdFormat = true;
IdFormat = IdFormatStart;
for(int i = 0, length = replies.GetCount(); i < length; ++i)
for(int i = 0, length = replies.size(); i < length; ++i)
{
CComment* pComment = replies[i];
pComment->bIdFormat = true;
......@@ -1494,7 +1494,7 @@ public:
{
CString sRes;
sRes.Append(writeRef(this, sBefore, sRef, sAfter));
for(int i = 0, length = replies.GetCount(); i < length; ++i)
for(int i = 0, length = replies.size(); i < length; ++i)
sRes.Append(writeRef(replies[i], sBefore, sRef, sAfter));
return sRes;
}
......@@ -1502,7 +1502,7 @@ public:
{
CString sRes;
sRes.Append(fReadFunction(this));
for(int i = 0, length = replies.GetCount(); i < length; ++i)
for(int i = 0, length = replies.size(); i < length; ++i)
sRes.Append(fReadFunction(replies[i]));
return sRes;
}
......@@ -1607,7 +1607,7 @@ public:
else
sRes.AppendFormat(_T("<w15:commentEx w15:paraId=\"%s\" w15:done=\"%s\"/>"), pComment->m_sParaId, sDone);
// paraIdParent
for(int i = 0, length = pComment->replies.GetCount(); i < length; i++)
for(int i = 0, length = pComment->replies.size(); i < length; i++)
pComment->replies[i]->m_sParaIdParent = pComment->m_sParaId;
}
return sRes;
......@@ -1653,7 +1653,7 @@ public:
{
m_mapComments[pComment->IdOpen] = pComment;
addAuthor(pComment);
for(int i = 0, length = pComment->replies.GetCount(); i < length; i++)
for(int i = 0, length = pComment->replies.size(); i < length; i++)
addAuthor(pComment->replies[i]);
}
}
......@@ -1814,7 +1814,7 @@ public:
BYTE WrappingType;
bool Edited;
CDrawingPropertyWrapPoint Start;
CAtlArray<CDrawingPropertyWrapPoint*> Points;
std::vector<CDrawingPropertyWrapPoint*> Points;
bool bWrappingType;
bool bEdited;
......@@ -1828,9 +1828,9 @@ public:
}
~CDrawingPropertyWrap()
{
for(int i = 0, length = Points.GetCount(); i < length; ++i)
for(int i = 0, length = Points.size(); i < length; ++i)
delete Points[i];
Points.RemoveAll();
Points.clear();
}
};
class CDrawingProperty
......@@ -2072,7 +2072,7 @@ public:
case c_oSerImageType2::WrapTight:sTagName = _T("wrapTight");break;
case c_oSerImageType2::WrapTopAndBottom:sTagName = _T("wrapTopAndBottom");break;
}
if(DrawingPropertyWrap.bStart || DrawingPropertyWrap.Points.GetCount() > 0)
if(DrawingPropertyWrap.bStart || DrawingPropertyWrap.Points.size() > 0)
{
if(c_oSerImageType2::WrapSquare == DrawingPropertyWrap.WrappingType || c_oSerImageType2::WrapThrough == DrawingPropertyWrap.WrappingType || c_oSerImageType2::WrapTight == DrawingPropertyWrap.WrappingType)
sXml.AppendFormat(_T("<wp:%s wrapText=\"bothSides\">"), sTagName);
......@@ -2089,7 +2089,7 @@ public:
__int64 emuY = (__int64)(g_dKoef_mm_to_emu * DrawingPropertyWrap.Start.Y);
sXml.AppendFormat(_T("<wp:start x=\"%I64d\" y=\"%I64d\"/>"), emuX, emuY);
}
for(int i = 0, length = DrawingPropertyWrap.Points.GetCount(); i < length; ++i)
for(int i = 0, length = DrawingPropertyWrap.Points.size(); i < length; ++i)
{
CDrawingPropertyWrapPoint* pWrapPoint = DrawingPropertyWrap.Points[i];
if(pWrapPoint->bX && pWrapPoint->bY)
......
This diff is collapsed.
......@@ -37,13 +37,13 @@ namespace Writers
if(g_nCurFormatVersion < 5)
{
bool bevenAndOddHeaders = false;
for(int i = 0, length = m_oHeaderFooterWriter.m_aHeaders.GetCount(); i < length; ++i)
for(int i = 0, length = m_oHeaderFooterWriter.m_aHeaders.size(); i < length; ++i)
{
HdrFtrItem* pHeader = m_oHeaderFooterWriter.m_aHeaders[i];
if(SimpleTypes::hdrftrEven == pHeader->eType)
bevenAndOddHeaders = true;
}
for(int i = 0, length = m_oHeaderFooterWriter.m_aFooters.GetCount(); i < length; ++i)
for(int i = 0, length = m_oHeaderFooterWriter.m_aFooters.size(); i < length; ++i)
{
HdrFtrItem* pFooter = m_oHeaderFooterWriter.m_aFooters[i];
if(SimpleTypes::hdrftrEven == pFooter->eType)
......
......@@ -401,16 +401,16 @@ namespace BinDocxRW
PPTXFile::IAVSOfficeDrawingConverter* m_pOfficeDrawingConverter;
public:
OOX::IFileContainer* m_oDocumentRels;
CAtlArray<OOX::CHdrFtr*> m_aHeaders;
CAtlArray<SimpleTypes::EHdrFtr> m_aHeaderTypes;
CAtlArray<OOX::Logic::CSectionProperty*> m_aHeaderSectPrs;
CAtlArray<OOX::CHdrFtr*> m_aFooters;
CAtlArray<SimpleTypes::EHdrFtr> m_aFooterTypes;
CAtlArray<OOX::Logic::CSectionProperty*> m_aFooterSectPrs;
std::vector<OOX::CHdrFtr*> m_aHeaders;
std::vector<SimpleTypes::EHdrFtr> m_aHeaderTypes;
std::vector<OOX::Logic::CSectionProperty*> m_aHeaderSectPrs;
std::vector<OOX::CHdrFtr*> m_aFooters;
std::vector<SimpleTypes::EHdrFtr> m_aFooterTypes;
std::vector<OOX::Logic::CSectionProperty*> m_aFooterSectPrs;
public:
BinaryHeaderFooterTableWriter(ParamsWriter& oParamsWriter, OOX::IFileContainer* oDocumentRels);
void Write();
void WriteHdrFtrContent(CAtlArray<OOX::CHdrFtr*>& aHdrFtrs, CAtlArray<SimpleTypes::EHdrFtr>& aHdrFtrTypes, CAtlArray<OOX::Logic::CSectionProperty*>& aHdrSectPrs, bool bHdr);
void WriteHdrFtrContent(std::vector<OOX::CHdrFtr*>& aHdrFtrs, std::vector<SimpleTypes::EHdrFtr>& aHdrFtrTypes, std::vector<OOX::Logic::CSectionProperty*>& aHdrSectPrs, bool bHdr);
void WriteHdrFtrItem(OOX::Logic::CSectionProperty* pSectPr, OOX::CHdrFtr* pHdrFtr, bool bHdr);
};
class BinarySigTableWriter
......@@ -1317,17 +1317,17 @@ namespace BinDocxRW
OOX::CHdrFtr* pHdrFtr = (OOX::CHdrFtr*)oFile.operator->();
if(bHdr)
{
nIndex = m_oBinaryHeaderFooterTableWriter->m_aHeaders.GetCount();
m_oBinaryHeaderFooterTableWriter->m_aHeaders.Add(pHdrFtr);
m_oBinaryHeaderFooterTableWriter->m_aHeaderTypes.Add(oRef.m_oType->GetValue());
m_oBinaryHeaderFooterTableWriter->m_aHeaderSectPrs.Add(pSectPr);
nIndex = m_oBinaryHeaderFooterTableWriter->m_aHeaders.size();
m_oBinaryHeaderFooterTableWriter->m_aHeaders.push_back(pHdrFtr);
m_oBinaryHeaderFooterTableWriter->m_aHeaderTypes.push_back(oRef.m_oType->GetValue());
m_oBinaryHeaderFooterTableWriter->m_aHeaderSectPrs.push_back(pSectPr);
}
else
{
nIndex = m_oBinaryHeaderFooterTableWriter->m_aFooters.GetCount();
m_oBinaryHeaderFooterTableWriter->m_aFooters.Add(pHdrFtr);
m_oBinaryHeaderFooterTableWriter->m_aFooterTypes.Add(oRef.m_oType->GetValue());
m_oBinaryHeaderFooterTableWriter->m_aFooterSectPrs.Add(pSectPr);
nIndex = m_oBinaryHeaderFooterTableWriter->m_aFooters.size();
m_oBinaryHeaderFooterTableWriter->m_aFooters.push_back(pHdrFtr);
m_oBinaryHeaderFooterTableWriter->m_aFooterTypes.push_back(oRef.m_oType->GetValue());
m_oBinaryHeaderFooterTableWriter->m_aFooterSectPrs.push_back(pSectPr);
}
nCurPos = m_oBcw.WriteItemStart(c_oSerProp_secPrType::hdrftrelem);
m_oBcw.m_oStream.WriteLong(nIndex);
......@@ -2422,7 +2422,7 @@ namespace BinDocxRW
// fldChar
//todo fldchartypeEnd, .
CSimpleArray<FldStruct*> m_aFldChars;
std::vector<FldStruct*> m_aFldChars;
int m_nSkipFldChar;
CString m_sFldChar;
SimpleTypes::EFldCharType m_eFldState;
......@@ -2443,7 +2443,7 @@ namespace BinDocxRW
};
~BinaryDocumentTableWriter()
{
for(int i = 0, length = m_aFldChars.GetSize(); i < length; ++i)
for(int i = 0, length = m_aFldChars.size(); i < length; ++i)
{
RELEASEOBJECT(m_aFldChars[i]);
}
......@@ -4369,7 +4369,7 @@ namespace BinDocxRW
if(false == bHyperlink)
{
// Hyperlink field
for(int i = 0, length = m_aFldChars.GetSize(); i < length; ++i)
for(int i = 0, length = m_aFldChars.size(); i < length; ++i)
if(fieldstruct_hyperlink == m_aFldChars[i]->GetType() || fieldstruct_locallink == m_aFldChars[i]->GetType())
{
bHyperlink = true;
......@@ -4379,7 +4379,7 @@ namespace BinDocxRW
if(bHyperlink)
{
bool bInTOC = false;
for(int i = 0, length = m_aFldChars.GetSize(); i < length; ++i)
for(int i = 0, length = m_aFldChars.size(); i < length; ++i)
{
if(fieldstruct_toc == m_aFldChars[i]->GetType())
{
......@@ -4491,9 +4491,9 @@ namespace BinDocxRW
m_eFldState = SimpleTypes::fldchartypeEnd;
if(m_nSkipFldChar > 0)
m_nSkipFldChar--;
if(m_aFldChars.GetSize() > 0)
if(m_aFldChars.size() > 0)
{
int nIndex = m_aFldChars.GetSize() - 1;
int nIndex = m_aFldChars.size() - 1;
FldStruct* pFldStruct = m_aFldChars[nIndex];
if( fieldstruct_hyperlink == pFldStruct->GetType())
{
......@@ -4501,7 +4501,7 @@ namespace BinDocxRW
m_oBcw.m_oStream.WriteLong(c_oSerPropLenType::Null);
}
RELEASEOBJECT(pFldStruct);
m_aFldChars.RemoveAt(nIndex);
m_aFldChars.erase(m_aFldChars.begin() + nIndex);
}
}
else if(SimpleTypes::fldchartypeSeparate == pFldChar->m_oFldCharType.get().GetValue())
......@@ -4510,7 +4510,7 @@ namespace BinDocxRW
FldStruct* pFldStruct = NULL;
if(WriteField(m_sFldChar, &pFldStruct, false) )
m_nSkipFldChar++;
m_aFldChars.Add(pFldStruct);
m_aFldChars.push_back(pFldStruct);
}
}
}
......@@ -5525,14 +5525,14 @@ namespace BinDocxRW
int nStart = m_oBcw.WriteItemWithLengthStart();
int nCurPos = 0;
//Header
if(m_aHeaders.GetCount() > 0)
if(m_aHeaders.size() > 0)
{
nCurPos = m_oBcw.WriteItemStart(c_oSerHdrFtrTypes::Header);
WriteHdrFtrContent(m_aHeaders, m_aHeaderTypes, m_aHeaderSectPrs, true);
m_oBcw.WriteItemEnd(nCurPos);
}
//Footer
if(m_aFooters.GetCount() > 0)
if(m_aFooters.size() > 0)
{
nCurPos = m_oBcw.WriteItemStart(c_oSerHdrFtrTypes::Footer);
WriteHdrFtrContent(m_aFooters, m_aFooterTypes, m_aFooterSectPrs, false);
......@@ -5540,10 +5540,10 @@ namespace BinDocxRW
}
m_oBcw.WriteItemWithLengthEnd(nStart);
};
void BinaryHeaderFooterTableWriter::WriteHdrFtrContent(CAtlArray<OOX::CHdrFtr*>& aHdrFtrs, CAtlArray<SimpleTypes::EHdrFtr>& aHdrFtrTypes, CAtlArray<OOX::Logic::CSectionProperty*>& aHdrSectPrs, bool bHdr)
void BinaryHeaderFooterTableWriter::WriteHdrFtrContent(std::vector<OOX::CHdrFtr*>& aHdrFtrs, std::vector<SimpleTypes::EHdrFtr>& aHdrFtrTypes, std::vector<OOX::Logic::CSectionProperty*>& aHdrSectPrs, bool bHdr)
{
int nCurPos = 0;
for(int i = 0, length = aHdrFtrs.GetCount(); i < length; ++i)
for(int i = 0, length = aHdrFtrs.size(); i < length; ++i)
{
OOX::CHdrFtr* pHdrFtr = aHdrFtrs[i];
SimpleTypes::EHdrFtr eType = aHdrFtrTypes[i];
......@@ -5581,7 +5581,7 @@ namespace BinDocxRW
OOX::CComment* pComment;
nullable<bool> bDone;
nullable<CString> sUserId;
CAtlArray<CCommentWriteTemp*> aReplies;
std::vector<CCommentWriteTemp*> aReplies;
};
BinaryCommonWriter m_oBcw;
public:
......@@ -5599,7 +5599,7 @@ namespace BinDocxRW
CAtlMap<CString, CString> mapAuthorToUserId;
CAtlMap<int, CCommentWriteTemp*> mapParaIdToComment;
CAtlMap<int, bool> mapCommentsIgnore;
CAtlArray<CCommentWriteTemp*> aCommentsToWrite;
std::vector<CCommentWriteTemp*> aCommentsToWrite;
//map author -> userId
if(NULL != pPeople)
{
......@@ -5632,7 +5632,7 @@ namespace BinDocxRW
mapParaIdToComment[pParagraph->m_oParaId->GetValue()] = pNewCommentWriteTemp;
}
}
aCommentsToWrite.Add(pNewCommentWriteTemp);
aCommentsToWrite.push_back(pNewCommentWriteTemp);
}
// reply done
if(NULL != pCommentsExt)
......@@ -5656,7 +5656,7 @@ namespace BinDocxRW
if(NULL != pPairParent)
{
CCommentWriteTemp* pCommentWriteTempParent = pPairParent->m_value;
pCommentWriteTempParent->aReplies.Add(pCommentWriteTemp);
pCommentWriteTempParent->aReplies.push_back(pCommentWriteTemp);
if(NULL != pComment && pComment->m_oId.IsInit())
mapIgnoreComments[pComment->m_oId->GetValue()] = true;
}
......@@ -5667,7 +5667,7 @@ namespace BinDocxRW
}
int nCurPos = 0;
for(int i = 0, length = aCommentsToWrite.GetCount(); i < length; ++i)
for(int i = 0, length = aCommentsToWrite.size(); i < length; ++i)
{
CCommentWriteTemp* pCommentWriteTemp = aCommentsToWrite[i];
if(NULL != pCommentWriteTemp && NULL != pCommentWriteTemp->pComment && pCommentWriteTemp->pComment->m_oId.IsInit() && NULL == mapIgnoreComments.Lookup(pCommentWriteTemp->pComment->m_oId->GetValue()))
......@@ -5678,7 +5678,7 @@ namespace BinDocxRW
}
}
for(int i = 0, length = aCommentsToWrite.GetCount(); i < length; ++i)
for(int i = 0, length = aCommentsToWrite.size(); i < length; ++i)
delete aCommentsToWrite[i];
};
void WriteComment(CCommentWriteTemp& oComment)
......@@ -5722,7 +5722,7 @@ namespace BinDocxRW
m_oBcw.m_oStream.WriteBool(oComment.bDone.get2());
m_oBcw.WriteItemEnd(nCurPos);
}
if(oComment.aReplies.GetCount() > 0)
if(oComment.aReplies.size() > 0)
{
nCurPos = m_oBcw.WriteItemStart(c_oSer_CommentsType::Replies);
WriteReplies(oComment.aReplies);
......@@ -5731,10 +5731,10 @@ namespace BinDocxRW
}
};
void WriteReplies(CAtlArray<CCommentWriteTemp*>& aCommentWriteTemp)
void WriteReplies(std::vector<CCommentWriteTemp*>& aCommentWriteTemp)
{
int nCurPos = 0;
for(int i = 0, length = aCommentWriteTemp.GetCount(); i < length; i++)
for(int i = 0, length = aCommentWriteTemp.size(); i < length; i++)
{
nCurPos = m_oBcw.WriteItemStart(c_oSer_CommentsType::Comment);
WriteComment(*aCommentWriteTemp[i]);
......
......@@ -108,7 +108,7 @@ namespace SerializeCommon
bool bSolved;
bool bDocument;
CAtlArray<CommentData*> aReplies;
std::vector<CommentData*> aReplies;
CommentData()
{
bSolved = false;
......@@ -116,9 +116,9 @@ namespace SerializeCommon
}
~CommentData()
{
for(int i = 0, length = aReplies.GetCount(); i < length; ++i)
for(int i = 0, length = aReplies.size(); i < length; ++i)
delete aReplies[i];
aReplies.RemoveAll();
aReplies.clear();
}
};
void ReadFileType(CString& sXMLOptions, BYTE& result, UINT& nCodePage, WCHAR& wcDelimiter)
......
......@@ -2483,22 +2483,22 @@ namespace BinXlsxRW {
if(pPair->m_value->IsValid())
{
OOX::Spreadsheet::CCommentItem& oComment = *pPair->m_value;
CAtlArray<SerializeCommon::CommentData*> aCommentDatas;
std::vector<SerializeCommon::CommentData*> aCommentDatas;
getSavedComment(oComment, aCommentDatas);
nCurPos = m_oBcw.WriteItemStart(c_oSerWorksheetsTypes::Comment);
// , , , Excel
WriteComment(oComment, aCommentDatas, oComment.m_oText);
m_oBcw.WriteItemEnd(nCurPos);
for(int i = 0, length = aCommentDatas.GetCount(); i < length; ++i)
for(int i = 0, length = aCommentDatas.size(); i < length; ++i)
{
RELEASEOBJECT(aCommentDatas[i]);
}
aCommentDatas.RemoveAll();
aCommentDatas.clear();
}
}
};
void getSavedComment(OOX::Spreadsheet::CCommentItem& oComment, CAtlArray<SerializeCommon::CommentData*>& aDatas)
void getSavedComment(OOX::Spreadsheet::CCommentItem& oComment, std::vector<SerializeCommon::CommentData*>& aDatas)
{
if(oComment.m_sGfxdata.IsInit())
{
......@@ -2529,7 +2529,7 @@ namespace BinXlsxRW {
}
}
}
void WriteComment(OOX::Spreadsheet::CCommentItem& oComment, CAtlArray<SerializeCommon::CommentData*>& aCommentDatas, nullable<OOX::Spreadsheet::CSi>& oCommentText)
void WriteComment(OOX::Spreadsheet::CCommentItem& oComment, std::vector<SerializeCommon::CommentData*>& aCommentDatas, nullable<OOX::Spreadsheet::CSi>& oCommentText)
{
int nCurPos = 0;
int nRow = 0;
......@@ -2639,12 +2639,12 @@ namespace BinXlsxRW {
m_oBcw.m_oStream.WriteBool(oComment.m_bSize.get());
}
}
void WriteCommentData(OOX::Spreadsheet::CCommentItem& oComment, CAtlArray<SerializeCommon::CommentData*>& aCommentDatas, nullable<OOX::Spreadsheet::CSi>& oCommentText)
void WriteCommentData(OOX::Spreadsheet::CCommentItem& oComment, std::vector<SerializeCommon::CommentData*>& aCommentDatas, nullable<OOX::Spreadsheet::CSi>& oCommentText)
{
int nCurPos = 0;
if(aCommentDatas.GetCount() > 0)
if(aCommentDatas.size() > 0)
{
for(int i = 0, length = aCommentDatas.GetCount(); i < length; ++i)
for(int i = 0, length = aCommentDatas.size(); i < length; ++i)
{
nCurPos = m_oBcw.WriteItemStart(c_oSer_Comments::CommentData);
if(0 == i)
......@@ -2714,7 +2714,7 @@ namespace BinXlsxRW {
m_oBcw.m_oStream.WriteBool(pCommentData->Document);
m_oBcw.WriteItemEnd(nCurPos);
}
if(pCommentData->aReplies.GetCount() > 0)
if(pCommentData->aReplies.size() > 0)
{
nCurPos = m_oBcw.WriteItemStart(c_oSer_CommentData::Replies);
WriteCommentReplies(pCommentData->aReplies);
......@@ -2730,10 +2730,10 @@ namespace BinXlsxRW {
}
}
}
void WriteCommentReplies(CAtlArray<SerializeCommon::CommentData*>& aReplies)
void WriteCommentReplies(std::vector<SerializeCommon::CommentData*>& aReplies)
{
int nCurPos = 0;
for(int i = 0, length = aReplies.GetCount(); i < length; i++)
for(int i = 0, length = aReplies.size(); i < length; i++)
{
SerializeCommon::CommentData* pReply = aReplies[i];
nCurPos = m_oBcw.WriteItemStart(c_oSer_CommentData::Reply);
......
......@@ -1531,12 +1531,12 @@ namespace BinXlsxRW {
int ReadCommentDatasExternal(BYTE type, long length, void* poResult)
{
int res = c_oSerConstants::ReadOk;
CAtlArray<SerializeCommon::CommentData*>* pCommentDatas = static_cast<CAtlArray<SerializeCommon::CommentData*>*>(poResult);
std::vector<SerializeCommon::CommentData*>* pCommentDatas = static_cast<std::vector<SerializeCommon::CommentData*>*>(poResult);
if ( c_oSer_Comments::CommentData == type )
{
SerializeCommon::CommentData* oCommentData = new SerializeCommon::CommentData();
res = Read1(length, &BinaryCommentReader::ReadCommentData, this, oCommentData);
pCommentDatas->Add(oCommentData);
pCommentDatas->push_back(oCommentData);
}
else
res = c_oSerConstants::ReadUnknown;
......@@ -1697,12 +1697,12 @@ namespace BinXlsxRW {
int ReadCommentReplies(BYTE type, long length, void* poResult)
{
int res = c_oSerConstants::ReadOk;
CAtlArray<SerializeCommon::CommentData*>* pComments = static_cast<CAtlArray<SerializeCommon::CommentData*>*>(poResult);
std::vector<SerializeCommon::CommentData*>* pComments = static_cast<std::vector<SerializeCommon::CommentData*>*>(poResult);
if ( c_oSer_CommentData::Reply == type )
{
SerializeCommon::CommentData* pCommentData = new SerializeCommon::CommentData();
res = Read1(length, &BinaryCommentReader::ReadCommentData, this, pCommentData);
pComments->Add(pCommentData);
pComments->push_back(pCommentData);
}
else
res = c_oSerConstants::ReadUnknown;
......@@ -1912,7 +1912,7 @@ namespace BinXlsxRW {
{
const CString& sAuthor = pCommentItem->m_sAuthor.get();
CAtlMap<CString, unsigned int>::CPair* pair = mapAuthors.Lookup(sAuthor);
unsigned int nAuthorId;
int nAuthorId;
if(NULL != pair)
nAuthorId = pair->m_value;
else
......@@ -2826,7 +2826,7 @@ namespace BinXlsxRW {
class BinaryOtherTableReader : public Binary_CommonReader<BinaryOtherTableReader>
{
CAtlMap<long, ImageObject*>& m_mapMedia;
CSimpleArray<CString>& m_aDeleteFiles;
std::vector<CString>& m_aDeleteFiles;
CString& m_sFileInDir;
long m_nCurId;
CString m_sCurSrc;
......@@ -2835,7 +2835,7 @@ namespace BinXlsxRW {
LPSAFEARRAY m_pArray;
PPTXFile::IAVSOfficeDrawingConverter* m_pOfficeDrawingConverter;
public:
BinaryOtherTableReader(Streams::CBufferedStream& oBufferedStream, CAtlMap<long, ImageObject*>& mapMedia, CString& sFileInDir, CSimpleArray<CString>& aDeleteFiles, SaveParams& oSaveParams, LPSAFEARRAY pArray, PPTXFile::IAVSOfficeDrawingConverter* pOfficeDrawingConverter):Binary_CommonReader(oBufferedStream), m_mapMedia(mapMedia),m_aDeleteFiles(aDeleteFiles),m_sFileInDir(sFileInDir),m_oSaveParams(oSaveParams),m_pArray(pArray),m_pOfficeDrawingConverter(pOfficeDrawingConverter)
BinaryOtherTableReader(Streams::CBufferedStream& oBufferedStream, CAtlMap<long, ImageObject*>& mapMedia, CString& sFileInDir, std::vector<CString>& aDeleteFiles, SaveParams& oSaveParams, LPSAFEARRAY pArray, PPTXFile::IAVSOfficeDrawingConverter* pOfficeDrawingConverter):Binary_CommonReader(oBufferedStream), m_mapMedia(mapMedia),m_aDeleteFiles(aDeleteFiles),m_sFileInDir(sFileInDir),m_oSaveParams(oSaveParams),m_pArray(pArray),m_pOfficeDrawingConverter(pOfficeDrawingConverter)
{
m_nCurId = 0;
m_sCurSrc = _T("");
......@@ -2930,7 +2930,7 @@ namespace BinXlsxRW {
{
m_sCurSrc = sImageSrc;
if(bAddToDelete)
m_aDeleteFiles.Add(sImageSrc);
m_aDeleteFiles.push_back(sImageSrc);
}
}
else if(c_oSer_OtherType::MediaId == type)
......@@ -3032,7 +3032,7 @@ namespace BinXlsxRW {
sDstPath += _T("Temp");
OOX::Spreadsheet::CXlsx oXlsx;
CSimpleArray<CString> aDeleteFiles;
std::vector<CString> aDeleteFiles;
SaveParams oSaveParams(sDstPath + _T("\\") + OOX::Spreadsheet::FileTypes::Workbook.DefaultDirectory().GetPath() + _T("\\") + OOX::FileTypes::Theme.DefaultDirectory().GetPath());
ReadMainTable(oXlsx, oBufferedStream, OOX::CPath(sSrcFileName).GetDirectory(), sDstPath, aDeleteFiles, oSaveParams, pArray, pOfficeDrawingConverter);
CString sAdditionalContentTypes = oSaveParams.sAdditionalContentTypes;
......@@ -3057,7 +3057,7 @@ namespace BinXlsxRW {
}
//
for(int i = 0, length = aDeleteFiles.GetSize(); i < length; ++i)
for(int i = 0, length = aDeleteFiles.size(); i < length; ++i)
DeleteFile(aDeleteFiles[i]);
bResultOk = true;
}
......@@ -3067,7 +3067,7 @@ namespace BinXlsxRW {
}
return S_OK;
}
int ReadMainTable(OOX::Spreadsheet::CXlsx& oXlsx, Streams::CBufferedStream& oBufferedStream, CString& sFileInDir, CString& sOutDir, CSimpleArray<CString>& aDeleteFiles, SaveParams& oSaveParams, LPSAFEARRAY pArray, PPTXFile::IAVSOfficeDrawingConverter* pOfficeDrawingConverter)
int ReadMainTable(OOX::Spreadsheet::CXlsx& oXlsx, Streams::CBufferedStream& oBufferedStream, CString& sFileInDir, CString& sOutDir, std::vector<CString>& aDeleteFiles, SaveParams& oSaveParams, LPSAFEARRAY pArray, PPTXFile::IAVSOfficeDrawingConverter* pOfficeDrawingConverter)
{
long res = c_oSerConstants::ReadOk;
//mtLen
......@@ -3075,8 +3075,8 @@ namespace BinXlsxRW {
if(c_oSerConstants::ReadOk != res)
return res;
long nOtherOffset = -1;
CAtlArray<BYTE> aTypes;
CAtlArray<long> aOffBits;
std::vector<BYTE> aTypes;
std::vector<long> aOffBits;
long nOtherOffBits = -1;
long nSharedStringsOffBits = -1;
BYTE mtLen = oBufferedStream.ReadByte();
......@@ -3094,8 +3094,8 @@ namespace BinXlsxRW {
nSharedStringsOffBits = mtiOffBits;
else
{
aTypes.Add(mtiType);
aOffBits.Add(mtiOffBits);
aTypes.push_back(mtiType);
aOffBits.push_back(mtiOffBits);
}
}
CAtlMap<long, ImageObject*> mapMedia;
......@@ -3117,7 +3117,7 @@ namespace BinXlsxRW {
}
OOX::Spreadsheet::CWorkbook* pWorkbook = oXlsx.CreateWorkbook();
for(int i = 0, length = aTypes.GetCount(); i < length; ++i)
for(int i = 0, length = aTypes.size(); i < length; ++i)
{
BYTE mtiType = aTypes[i];
long mtiOffBits = aOffBits[i];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment