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