Commit e76c55ba authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

ПОЛНОЕ отсутствие CSimpleArray.

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@58053 954022d7-b5bf-4e40-9824-e11837661b57
parent 4f9856dd
......@@ -50,7 +50,7 @@ void OoxConverter::convert(OOX::Spreadsheet::CRichText* rich)
odf_context()->chart_context()->start_text();
OoxConverter::convert(rich->m_oBodyPr.GetPointer());
for (unsigned int i=0 ; i < rich->m_arrItems.GetSize();i++)
for (unsigned int i=0 ; i < rich->m_arrItems.size();i++)
{
OoxConverter::convert(rich->m_arrItems[i]);
}
......@@ -63,7 +63,7 @@ void OoxConverter::convert(OOX::Spreadsheet::CTextProperties* txPr)
odf_context()->chart_context()->start_text();
OoxConverter::convert(txPr->m_oBodyPr.GetPointer());
for (unsigned int i=0 ; i < txPr->m_arrItems.GetSize();i++)
for (unsigned int i=0 ; i < txPr->m_arrItems.size();i++)
{
OoxConverter::convert(txPr->m_arrItems[i]);
}
......
......@@ -136,7 +136,7 @@ void XlsxConverter::convert_sheets()
if(Workbook->m_oSheets.IsInit())
{
for(int i = 0, length = Workbook->m_oSheets->m_arrItems.GetSize(); i < length; ++i)
for(unsigned int i = 0, length = Workbook->m_oSheets->m_arrItems.size(); i < length; ++i)
{
OOX::Spreadsheet::CSheet* pSheet = Workbook->m_oSheets->m_arrItems[i];
......@@ -161,7 +161,7 @@ void XlsxConverter::convert_sheets()
}
if (Workbook->m_oDefinedNames.IsInit())
{
for (int i = 0; i < Workbook->m_oDefinedNames->m_arrItems.GetSize(); i++)
for (unsigned int i = 0; i < Workbook->m_oDefinedNames->m_arrItems.size(); i++)
{
convert(Workbook->m_oDefinedNames->m_arrItems[i]);
}
......@@ -202,7 +202,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CWorksheet *oox_sheet)
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//
for (unsigned int hyp = 0; oox_sheet->m_oHyperlinks.IsInit() && hyp < oox_sheet->m_oHyperlinks->m_arrItems.GetSize(); hyp++)
for (unsigned int hyp = 0; oox_sheet->m_oHyperlinks.IsInit() && hyp < oox_sheet->m_oHyperlinks->m_arrItems.size(); hyp++)
{
convert(oox_sheet->m_oHyperlinks->m_arrItems[hyp],oox_sheet);
}
......@@ -220,7 +220,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CWorksheet *oox_sheet)
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
ods_context->start_columns();
for (unsigned int col = 0 ; oox_sheet->m_oCols.IsInit() && col < oox_sheet->m_oCols->m_arrItems.GetSize(); col++)
for (unsigned int col = 0 ; oox_sheet->m_oCols.IsInit() && col < oox_sheet->m_oCols->m_arrItems.size(); col++)
{
convert(oox_sheet->m_oCols->m_arrItems[col]);
}
......@@ -230,7 +230,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CWorksheet *oox_sheet)
if (oox_sheet->m_oSheetData.IsInit() )
{
ods_context->start_rows();
for (unsigned int row = 0 ; row < oox_sheet->m_oSheetData->m_arrItems.GetSize(); row++)
for (unsigned int row = 0 ; row < oox_sheet->m_oSheetData->m_arrItems.size(); row++)
{
convert(oox_sheet->m_oSheetData->m_arrItems[row]);
......@@ -244,7 +244,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CWorksheet *oox_sheet)
}
//
for (unsigned int mrg = 0 ; oox_sheet->m_oMergeCells.IsInit() && mrg < oox_sheet->m_oMergeCells->m_arrItems.GetSize(); mrg++)
for (unsigned int mrg = 0 ; oox_sheet->m_oMergeCells.IsInit() && mrg < oox_sheet->m_oMergeCells->m_arrItems.size(); mrg++)
{
if (oox_sheet->m_oMergeCells->m_arrItems[mrg]->m_oRef.IsInit())
ods_context->add_merge_cells(string2std_string(oox_sheet->m_oMergeCells->m_arrItems[mrg]->m_oRef.get()));
......@@ -267,10 +267,10 @@ void XlsxConverter::convert(OOX::Spreadsheet::CWorksheet *oox_sheet)
convert(oox_sheet->m_oAutofilter.GetPointer());
//
if (oox_sheet->m_arrConditionalFormatting.GetCount() >0)
if (oox_sheet->m_arrConditionalFormatting.size() >0)
{
ods_context->start_conditional_formats();
for (unsigned int fmt =0; fmt < oox_sheet->m_arrConditionalFormatting.GetCount(); fmt++)
for (unsigned int fmt =0; fmt < oox_sheet->m_arrConditionalFormatting.size(); fmt++)
{
convert(oox_sheet->m_arrConditionalFormatting[fmt]);
}
......@@ -298,7 +298,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CCommentItem * oox_comment)
if (oox_comment->m_oText.IsInit())
{
for(int i = 0; i < oox_comment->m_oText->m_arrItems.GetSize(); ++i)
for(unsigned int i = 0; i < oox_comment->m_oText->m_arrItems.size(); ++i)
{
convert(oox_comment->m_oText->m_arrItems[i]);
}
......@@ -378,7 +378,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CRow *oox_row)
}else
ods_context->current_table().set_row_optimal_height(true);
for (unsigned int cell = 0 ; cell < oox_row->m_arrItems.GetSize();cell++)
for (unsigned int cell = 0 ; cell < oox_row->m_arrItems.size();cell++)
{
convert(oox_row->m_arrItems[cell]);
}
......@@ -441,7 +441,7 @@ void XlsxConverter::convert_sharing_string(int number)
ods_context->start_cell_text();
for(int i = 0; i < pSi->m_arrItems.GetSize(); ++i)
for(int i = 0; i < pSi->m_arrItems.size(); ++i)
{
convert(pSi->m_arrItems[i]);
}
......@@ -496,7 +496,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CRun *oox_text_run)
convert(oox_text_run->m_oRPr.GetPointer());
ods_context->text_context()->start_span(oox_text_run->m_oRPr.GetPointer() ? true : false);
for(int i = 0; i < oox_text_run->m_arrItems.GetSize(); ++i)
for(unsigned int i = 0; i < oox_text_run->m_arrItems.size(); ++i)
{
convert(oox_text_run->m_arrItems[i]);
}
......@@ -727,7 +727,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CSheetViews *oox_sheet_views)
{
if (!oox_sheet_views)return;
for (long i =0; i < oox_sheet_views->m_arrItems.GetSize(); i++)
for (unsigned long i =0; i < oox_sheet_views->m_arrItems.size(); i++)
{
if (oox_sheet_views->m_arrItems[i])
{
......@@ -1267,7 +1267,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CColor *color, _CP_OPT(odf::color)
int ind = color->m_oIndexed->GetValue();
if(xlsx_styles->m_oColors.IsInit() && xlsx_styles->m_oColors->m_oIndexedColors.IsInit() &&
ind < xlsx_styles->m_oColors->m_oIndexedColors->m_arrItems.GetSize())
ind < xlsx_styles->m_oColors->m_oIndexedColors->m_arrItems.size())
{
if ((xlsx_styles->m_oColors->m_oIndexedColors->m_arrItems[ind]) &&
(xlsx_styles->m_oColors->m_oIndexedColors->m_arrItems[ind]->m_oRgb.IsInit()))
......@@ -1472,7 +1472,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CDrawing *oox_drawing)
if (!oox_drawing)return;
xlsx_current_drawing = oox_drawing;
for (unsigned int dr = 0 ; dr < oox_drawing->m_arrItems.GetSize(); dr++)
for (unsigned int dr = 0 ; dr < oox_drawing->m_arrItems.size(); dr++)
{
ods_context->start_drawings();
convert(oox_drawing->m_arrItems[dr]);
......@@ -1496,7 +1496,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CFromTo* oox_from_to, oox_table_po
void XlsxConverter::convert(OOX::Spreadsheet::CGroupShape* oox_group_shape)
{
if (!oox_group_shape)return;
if (oox_group_shape->m_arrItems.GetSize() < 1) return;
if (oox_group_shape->m_arrItems.size() < 1) return;
ods_context->drawing_context()->start_group();
......@@ -1513,7 +1513,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CGroupShape* oox_group_shape)
OoxConverter::convert(oox_group_shape->m_oGroupSpPr.GetPointer());
for (unsigned int i=0; i < oox_group_shape->m_arrItems.GetSize(); i++)
for (unsigned int i=0; i < oox_group_shape->m_arrItems.size(); i++)
{
switch(oox_group_shape->m_arrItems[i]->getType())
{
......@@ -1594,7 +1594,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CShape* oox_shape)
ods_context->start_text_context();
OoxConverter::convert(oox_shape->m_oTxBody->m_oBodyPr.GetPointer());
for (unsigned int i=0 ; i < oox_shape->m_oTxBody->m_arrItems.GetSize();i++)
for (unsigned int i=0 ; i < oox_shape->m_oTxBody->m_arrItems.size();i++)
{
OoxConverter::convert(oox_shape->m_oTxBody->m_arrItems[i]);
}
......@@ -1788,7 +1788,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CConditionalFormatting *oox_cond_f
{
ods_context->current_table().start_conditional_format(string2std_string(oox_cond_fmt->m_oSqRef->GetValue()));
for (int i=0; i< oox_cond_fmt->m_arrItems.GetSize(); i++)
for (unsigned int i=0; i< oox_cond_fmt->m_arrItems.size(); i++)
convert(oox_cond_fmt->m_arrItems[i]);//rule
ods_context->current_table().end_conditional_format();
......@@ -1811,7 +1811,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CConditionalFormattingRule *oox_co
if (oox_cond_rule->m_oOperator.IsInit())
ods_context->current_table().set_conditional_operator(oox_cond_rule->m_oOperator->GetValue());
for (unsigned int i=0; i< oox_cond_rule->m_arrItems.GetSize(); i++)
for (unsigned int i=0; i< oox_cond_rule->m_arrItems.size(); i++)
convert(oox_cond_rule->m_arrItems[i]);
}
ods_context->current_table().end_conditional_rule();
......@@ -1828,14 +1828,14 @@ void XlsxConverter::convert(OOX::Spreadsheet::CDataBar *oox_cond_databar)
//nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oMaxLength;
//nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oMinLength;
//nullable<SimpleTypes::COnOff<>> m_oShowValue;
for (unsigned int i=0; i< oox_cond_databar->m_arrItems.GetSize(); i++)
for (unsigned int i=0; i< oox_cond_databar->m_arrItems.size(); i++)
convert(oox_cond_databar->m_arrItems[i]);
}
void XlsxConverter::convert(OOX::Spreadsheet::CColorScale *oox_cond_colorscale)
{
if (!oox_cond_colorscale)return;
for (unsigned int i=0; i< oox_cond_colorscale->m_arrItems.GetSize(); i++)
for (unsigned int i=0; i< oox_cond_colorscale->m_arrItems.size(); i++)
{
if (!oox_cond_colorscale->m_arrItems[i])continue;
......@@ -1861,7 +1861,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CIconSet *oox_cond_iconset)
//nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oMaxLength;
//nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oMinLength;
//nullable<SimpleTypes::COnOff<>> m_oShowValue;
for (unsigned int i=0; i< oox_cond_iconset->m_arrItems.GetSize(); i++)
for (unsigned int i=0; i< oox_cond_iconset->m_arrItems.size(); i++)
convert(oox_cond_iconset->m_arrItems[i]);
}
void XlsxConverter::convert(OOX::Spreadsheet::CConditionalFormatValueObject *oox_cond_value)
......@@ -1911,7 +1911,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CAutofilter *oox_filter)
ods_context->start_autofilter(ref);//target
{
for (unsigned int i=0; i < oox_filter->m_arrItems.GetSize(); i++)//set items todooo
for (unsigned int i=0; i < oox_filter->m_arrItems.size(); i++)//set items todooo
{
}
}
......
......@@ -227,6 +227,12 @@ namespace OOX
}
virtual ~CAutoCaptions()
{
for ( unsigned int nIndex = 0; nIndex < m_arrAutoCaption.size(); nIndex++ )
{
if (m_arrAutoCaption[nIndex] ) delete m_arrAutoCaption[nIndex];
m_arrAutoCaption[nIndex] = NULL;
}
m_arrAutoCaption.clear();
}
public:
......@@ -247,8 +253,8 @@ namespace OOX
if ( _T("w:autoCaption") == sName )
{
OOX::Settings::CAutoCaption oAC = oReader;
m_arrAutoCaption.Add( oAC );
OOX::Settings::CAutoCaption *oAC = new OOX::Settings::CAutoCaption(oReader);
if (oAC) m_arrAutoCaption.push_back( oAC );
}
}
}
......@@ -256,8 +262,11 @@ namespace OOX
{
CString sResult = _T("<w:autoCaptions>");
for ( int nIndex = 0; nIndex < m_arrAutoCaption.GetSize(); nIndex++ )
sResult += m_arrAutoCaption[nIndex].toXML();
for ( unsigned int nIndex = 0; nIndex < m_arrAutoCaption.size(); nIndex++ )
{
if (m_arrAutoCaption[nIndex])
sResult += m_arrAutoCaption[nIndex]->toXML();
}
sResult += _T("</w:autoCaptions>");
......@@ -272,7 +281,7 @@ namespace OOX
public:
// Childs
CSimpleArray<OOX::Settings::CAutoCaption> m_arrAutoCaption;
std::vector<OOX::Settings::CAutoCaption*> m_arrAutoCaption;
};
//--------------------------------------------------------------------------------
// CCaption 17.15.1.16 (Part 1)
......@@ -398,6 +407,12 @@ namespace OOX
}
virtual ~CCaptions()
{
for ( unsigned int nIndex = 0; nIndex < m_arrCaption.size(); nIndex++ )
{
if ( m_arrCaption[nIndex] ) delete m_arrCaption[nIndex];
m_arrCaption[nIndex] = NULL;
}
m_arrCaption.clear();
}
public:
......@@ -418,8 +433,8 @@ namespace OOX
if ( _T("w:caption") == sName )
{
OOX::Settings::CCaption oC = oReader;
m_arrCaption.Add( oC );
OOX::Settings::CCaption *oC = new OOX::Settings::CCaption(oReader);
if (oC) m_arrCaption.push_back( oC );
}
else if ( _T("w:autoCaptions") == sName )
m_oAutoCaptions = oReader;
......@@ -429,8 +444,11 @@ namespace OOX
{
CString sResult = _T("<w:captions>");
for ( int nIndex = 0; nIndex < m_arrCaption.GetSize(); nIndex++ )
sResult += m_arrCaption[nIndex].toXML();
for ( unsigned int nIndex = 0; nIndex < m_arrCaption.size(); nIndex++ )
{
if (m_arrCaption[nIndex])
sResult += m_arrCaption[nIndex]->toXML();
}
if ( m_oAutoCaptions.IsInit() )
sResult += m_oAutoCaptions->toXML();
......@@ -448,7 +466,7 @@ namespace OOX
public:
// Childs
CSimpleArray<OOX::Settings::CCaption> m_arrCaption;
std::vector<OOX::Settings::CCaption*> m_arrCaption;
nullable<OOX::Settings::CAutoCaptions> m_oAutoCaptions;
};
......@@ -765,6 +783,12 @@ namespace OOX
}
virtual ~CCompat()
{
for ( unsigned int nIndex = 0; nIndex < m_arrCompatSettings.size(); nIndex++ )
{
if ( m_arrCompatSettings[nIndex] ) delete m_arrCompatSettings[nIndex];
m_arrCompatSettings[nIndex] = NULL;
}
m_arrCompatSettings.clear();
}
public:
......@@ -791,8 +815,8 @@ namespace OOX
m_oBalanceSingleByDoubleWidth = oReader;
else if ( _T("w:compatSetting") == sName )
{
OOX::Settings::CCompatSetting oCS = oReader;
m_arrCompatSettings.Add( oCS );
OOX::Settings::CCompatSetting *oCS = new OOX::Settings::CCompatSetting(oReader);
if (oCS)m_arrCompatSettings.push_back( oCS );
}
else if ( _T("w:doNotExpandShiftReturn") == sName )
m_oDoNotExpandShiftReturn = oReader;
......@@ -857,8 +881,11 @@ namespace OOX
sResult += _T("/>");
}
for ( int nIndex = 0; nIndex < m_arrCompatSettings.GetSize(); nIndex++ )
sResult += m_arrCompatSettings[nIndex].toXML();
for ( unsigned int nIndex = 0; nIndex < m_arrCompatSettings.size(); nIndex++ )
{
if (m_arrCompatSettings[nIndex])
sResult += m_arrCompatSettings[nIndex]->toXML();
}
sResult += _T("</w:compat>");
......@@ -878,7 +905,7 @@ namespace OOX
nullable<ComplexTypes::Word::COnOff2<SimpleTypes::onoffTrue>> m_oAdjustLineHeightInTable;
nullable<ComplexTypes::Word::COnOff2<SimpleTypes::onoffTrue>> m_oApplyBreakingRules;
nullable<ComplexTypes::Word::COnOff2<SimpleTypes::onoffTrue>> m_oBalanceSingleByDoubleWidth;
CSimpleArray<OOX::Settings::CCompatSetting> m_arrCompatSettings;
std::vector<OOX::Settings::CCompatSetting*> m_arrCompatSettings;
nullable<ComplexTypes::Word::COnOff2<SimpleTypes::onoffTrue>> m_oDoNotExpandShiftReturn;
nullable<ComplexTypes::Word::COnOff2<SimpleTypes::onoffTrue>> m_oDoNotLeaveBackslaskAlone;
nullable<ComplexTypes::Word::COnOff2<SimpleTypes::onoffTrue>> m_oSpaceForUL;
......@@ -1173,6 +1200,12 @@ namespace OOX
}
virtual ~CDocVars()
{
for ( unsigned int nIndex = 0; nIndex < m_arrDocVar.size(); nIndex++ )
{
if ( m_arrDocVar[nIndex] ) delete m_arrDocVar[nIndex];
m_arrDocVar[nIndex] = NULL;
}
m_arrDocVar.clear();
}
public:
......@@ -1193,8 +1226,8 @@ namespace OOX
if ( _T("w:docVar") == sName )
{
OOX::Settings::CDocVar oDV = oReader;
m_arrDocVar.Add( oDV );
OOX::Settings::CDocVar *oDV = new OOX::Settings::CDocVar(oReader);
if (oDV) m_arrDocVar.push_back( oDV );
}
}
}
......@@ -1202,8 +1235,11 @@ namespace OOX
{
CString sResult = _T("<w:docVars>");
for ( int nIndex = 0; nIndex < m_arrDocVar.GetSize(); nIndex++ )
sResult += m_arrDocVar[nIndex].toXML();
for (unsigned int nIndex = 0; nIndex < m_arrDocVar.size(); nIndex++ )
{
if (m_arrDocVar[nIndex])
sResult += m_arrDocVar[nIndex]->toXML();
}
sResult += _T("</w:docVars>");
......@@ -1218,7 +1254,7 @@ namespace OOX
public:
// Childs
CSimpleArray<OOX::Settings::CDocVar> m_arrDocVar;
std::vector<OOX::Settings::CDocVar*> m_arrDocVar;
};
//--------------------------------------------------------------------------------
// CKinsoku 17.15.1.58 (Part 1)
......@@ -1624,6 +1660,12 @@ namespace OOX
}
virtual ~CDocRsids()
{
for ( unsigned int nIndex = 0; nIndex < m_arrRsid.size(); nIndex++ )
{
if ( m_arrRsid[nIndex] ) delete m_arrRsid[nIndex];
m_arrRsid[nIndex] = NULL;
}
m_arrRsid.clear();
}
public:
......@@ -1644,8 +1686,8 @@ namespace OOX
if ( _T("w:rsid") == sName )
{
ComplexTypes::Word::CLongHexNumber oRsid = oReader;
m_arrRsid.Add( oRsid );
ComplexTypes::Word::CLongHexNumber *oRsid = new ComplexTypes::Word::CLongHexNumber(oReader);
if (oRsid) m_arrRsid.push_back( oRsid );
}
else if ( _T("w:rsidRoot") == sName )
m_oRsidRoot = oReader;
......@@ -1662,10 +1704,11 @@ namespace OOX
sResult += _T("/>");
}
for ( int nIndex = 0; nIndex < m_arrRsid.GetSize(); nIndex++ )
for ( unsigned int nIndex = 0; nIndex < m_arrRsid.size(); nIndex++ )
{
sResult += _T("<w:rsid ");
sResult += m_arrRsid[nIndex].ToString();
if (m_arrRsid[nIndex])
sResult += m_arrRsid[nIndex]->ToString();
sResult += _T("/>");
}
......@@ -1683,7 +1726,7 @@ namespace OOX
// Childs
nullable<ComplexTypes::Word::CLongHexNumber> m_oRsidRoot;
CSimpleArray<ComplexTypes::Word::CLongHexNumber> m_arrRsid;
std::vector<ComplexTypes::Word::CLongHexNumber*> m_arrRsid;
};
//--------------------------------------------------------------------------------
// CSaveThroughXslt 17.15.1.76 (Part 1)
......@@ -2325,6 +2368,12 @@ namespace OOX
}
virtual ~CEdnDocProps()
{
for ( unsigned int nIndex = 0; nIndex < m_arrEndnote.size(); nIndex++ )
{
if ( m_arrEndnote[nIndex] ) delete m_arrEndnote[nIndex];
m_arrEndnote[nIndex] = NULL;
}
m_arrEndnote.clear();
}
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
......@@ -2351,8 +2400,8 @@ namespace OOX
m_oPos = oReader;
else if ( _T("w:endnote") == sName )
{
OOX::CFtnEdnSepRef oFE = oReader;
m_arrEndnote.Add( oFE );
OOX::CFtnEdnSepRef *oFE = new OOX::CFtnEdnSepRef(oReader);
if (oFE) m_arrEndnote.push_back( oFE );
}
}
}
......@@ -2360,8 +2409,11 @@ namespace OOX
{
CString sResult = _T("<w:endnotePr>");
for ( int nIndex = 0; nIndex < m_arrEndnote.GetSize(); nIndex++ )
sResult += m_arrEndnote[nIndex].toXML();
for ( unsigned int nIndex = 0; nIndex < m_arrEndnote.size(); nIndex++ )
{
if (m_arrEndnote[nIndex])
sResult += m_arrEndnote[nIndex]->toXML();
}
if ( m_oNumFmt.IsInit() )
{
......@@ -2402,7 +2454,7 @@ namespace OOX
}
public:
CSimpleArray<OOX::CFtnEdnSepRef > m_arrEndnote;
std::vector<OOX::CFtnEdnSepRef* > m_arrEndnote;
nullable<ComplexTypes::Word::CNumFmt > m_oNumFmt;
nullable<ComplexTypes::Word::CNumRestart > m_oNumRestart;
nullable<ComplexTypes::Word::CDecimalNumber > m_oNumStart;
......@@ -2420,6 +2472,12 @@ namespace OOX
}
virtual ~CFtnDocProps()
{
for ( unsigned int nIndex = 0; nIndex < m_arrFootnote.size(); nIndex++ )
{
if ( m_arrFootnote[nIndex] ) delete m_arrFootnote[nIndex];
m_arrFootnote[nIndex] = NULL;
}
m_arrFootnote.clear();
}
public:
......@@ -2447,8 +2505,8 @@ namespace OOX
m_oPos = oReader;
else if ( _T("w:footnote") == sName )
{
OOX::CFtnEdnSepRef oFE = oReader;
m_arrFootnote.Add( oFE );
OOX::CFtnEdnSepRef *oFE = new OOX::CFtnEdnSepRef(oReader);
if (oFE) m_arrFootnote.push_back( oFE );
}
}
}
......@@ -2456,8 +2514,11 @@ namespace OOX
{
CString sResult = _T("<w:footnotePr>");
for ( int nIndex = 0; nIndex < m_arrFootnote.GetSize(); nIndex++ )
sResult += m_arrFootnote[nIndex].toXML();
for ( unsigned int nIndex = 0; nIndex < m_arrFootnote.size(); nIndex++ )
{
if (m_arrFootnote[nIndex])
sResult += m_arrFootnote[nIndex]->toXML();
}
if ( m_oNumFmt.IsInit() )
{
......@@ -2498,7 +2559,7 @@ namespace OOX
}
public:
CSimpleArray<OOX::CFtnEdnSepRef > m_arrFootnote;
std::vector<OOX::CFtnEdnSepRef* > m_arrFootnote;
nullable<ComplexTypes::Word::CNumFmt > m_oNumFmt;
nullable<ComplexTypes::Word::CNumRestart > m_oNumRestart;
nullable<ComplexTypes::Word::CDecimalNumber > m_oNumStart;
......@@ -2603,6 +2664,12 @@ namespace OOX
}
virtual ~CSchemaLibrary()
{
for ( unsigned int nIndex = 0; nIndex < m_arrSchema.size(); nIndex++ )
{
if ( m_arrSchema[nIndex] ) delete m_arrSchema[nIndex];
m_arrSchema[nIndex] = NULL;
}
m_arrSchema.clear();
}
public:
......@@ -2623,8 +2690,8 @@ namespace OOX
if ( _T("sl:schema") == sName )
{
OOX::Settings::CSchema oSchema = oReader;
m_arrSchema.Add( oSchema );
OOX::Settings::CSchema *oSchema = new OOX::Settings::CSchema(oReader);
if (oSchema) m_arrSchema.push_back( oSchema );
}
}
}
......@@ -2632,8 +2699,11 @@ namespace OOX
{
CString sResult = _T("<sl:schemaLibrary>");
for ( int nIndex = 0; nIndex < m_arrSchema.GetSize(); nIndex++ )
sResult += m_arrSchema[nIndex].toXML();
for ( unsigned int nIndex = 0; nIndex < m_arrSchema.size(); nIndex++ )
{
if (m_arrSchema[nIndex])
sResult += m_arrSchema[nIndex]->toXML();
}
sResult += _T("</sl:schemaLibrary>");
......@@ -2648,7 +2718,7 @@ namespace OOX
public:
// Childs
CSimpleArray<OOX::Settings::CSchema> m_arrSchema;
std::vector<OOX::Settings::CSchema*> m_arrSchema;
};
} // Settings
} // OOX
......@@ -2855,6 +2925,13 @@ namespace OOX
}
virtual ~CSettings()
{
for ( unsigned int nIndex = 0; nIndex < m_arrSmartTagType.size(); nIndex++ )
{
if ( m_arrSmartTagType[nIndex] )delete m_arrSmartTagType[nIndex];
m_arrSmartTagType[nIndex] = NULL;
}
m_arrSmartTagType.clear();
}
public:
......@@ -2996,8 +3073,8 @@ namespace OOX
else if ( _T("w:showXMLTags") == sName ) m_oShowXMLTags = oReader;
else if ( _T("w:smartTagType") == sName )
{
OOX::Settings::CSmartTagType oSTT = oReader;
m_arrSmartTagType.Add( oSTT );
OOX::Settings::CSmartTagType *oSTT = new OOX::Settings::CSmartTagType(oReader);
if (oSTT) m_arrSmartTagType.push_back( oSTT );
}
else if ( _T("w:strictFirstAndLastChars") == sName ) m_oStrictFirstAndLastChars = oReader;
else if ( _T("w:styleLockQFSet") == sName ) m_oStyleLockQFSet = oReader;
......@@ -3420,8 +3497,11 @@ namespace OOX
sXml += m_oReadModeInkLockDown->toXML();
// 94
for ( int nIndex = 0; nIndex < m_arrSmartTagType.GetSize(); nIndex++ )
sXml += m_arrSmartTagType[nIndex].toXML();
for ( unsigned int nIndex = 0; nIndex < m_arrSmartTagType.size(); nIndex++ )
{
if (m_arrSmartTagType[nIndex])
sXml += m_arrSmartTagType[nIndex]->toXML();
}
// 95
if ( m_oSchemaLibrary.IsInit() )
......@@ -3550,7 +3630,7 @@ namespace OOX
nullable<OOX::Settings::CShapeDefaults> m_oShapeDefaults;
nullable<ComplexTypes::Word::COnOff2<SimpleTypes::onoffTrue>> m_oShowEnvelope;
nullable<ComplexTypes::Word::COnOff2<SimpleTypes::onoffTrue>> m_oShowXMLTags;
CSimpleArray<OOX::Settings::CSmartTagType> m_arrSmartTagType;
std::vector<OOX::Settings::CSmartTagType*> m_arrSmartTagType;
nullable<ComplexTypes::Word::COnOff2<SimpleTypes::onoffTrue>> m_oStrictFirstAndLastChars;
nullable<ComplexTypes::Word::COnOff2<SimpleTypes::onoffTrue>> m_oStyleLockQFSet;
nullable<ComplexTypes::Word::COnOff2<SimpleTypes::onoffTrue>> m_oStyleLockTheme;
......
......@@ -107,7 +107,7 @@ namespace OOX
sName = oReader.GetName();
if ( _T("c") == sName )
m_arrItems.Add(new CCalcCell(oReader));
m_arrItems.push_back(new CCalcCell(oReader));
}
}
}
......@@ -136,7 +136,7 @@ namespace OOX
CPath m_oReadPath;
void ClearItems()
{
for ( int nIndex = 0; nIndex < m_arrItems.GetSize(); nIndex++ )
for ( unsigned int nIndex = 0; nIndex < m_arrItems.size(); nIndex++ )
{
if ( m_arrItems[nIndex] )
delete m_arrItems[nIndex];
......@@ -144,14 +144,14 @@ namespace OOX
m_arrItems[nIndex] = NULL;
}
m_arrItems.RemoveAll();
m_arrItems.clear();
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
}
public:
CSimpleArray<CCalcCell *> m_arrItems;
std::vector<CCalcCell *> m_arrItems;
};
} //Spreadsheet
} // namespace OOX
......
......@@ -930,7 +930,7 @@ namespace OOX{
if ( _T("a:bodyPr") == sName )
m_oBodyPr = oReader;
else if ( _T("a:p") == sName )
m_arrItems.Add( new Drawing::CParagraph( oReader ));
m_arrItems.push_back( new Drawing::CParagraph( oReader ));
}
}
......@@ -986,7 +986,7 @@ namespace OOX{
if ( _T("a:bodyPr") == sName )
m_oBodyPr = oReader;
else if ( _T("a:p") == sName )
m_arrItems.Add( new Drawing::CParagraph( oReader ));
m_arrItems.push_back( new Drawing::CParagraph( oReader ));
}
}
......
......@@ -59,7 +59,7 @@ namespace OOX
virtual void toXML(XmlUtils::CStringWriter& writer) const
{
writer.WriteString(CString("<authors>"));
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
for(unsigned int i = 0, length = m_arrItems.size(); i < length; ++i)
{
CString sAuthor;sAuthor.Format(_T("<author>%s</author>"), XmlUtils::EncodeXmlString(*m_arrItems[i]));
writer.WriteString(sAuthor);
......@@ -79,7 +79,7 @@ namespace OOX
CWCharWrapper sName = oReader.GetName();
if ( _T("author") == sName )
m_arrItems.Add(new CString(oReader.GetText2()));
m_arrItems.push_back(new CString(oReader.GetText2()));
}
}
......@@ -190,7 +190,7 @@ namespace OOX
virtual void toXML(XmlUtils::CStringWriter& writer) const
{
writer.WriteString(CString("<commentList>"));
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
for(unsigned int i = 0, length = m_arrItems.size(); i < length; ++i)
{
m_arrItems[i]->toXML(writer);
}
......@@ -209,7 +209,7 @@ namespace OOX
CWCharWrapper sName = oReader.GetName();
if ( _T("comment") == sName )
m_arrItems.Add(new CComment(oReader));
m_arrItems.push_back(new CComment(oReader));
}
}
......@@ -411,7 +411,7 @@ namespace OOX
pItem = new OOX::Vml::CShape( oReader );
if ( pItem )
m_arrItems.Add( pItem );
m_arrItems.push_back( pItem );
}
}
}
......@@ -507,7 +507,7 @@ namespace OOX
}
void ClearItems()
{
for ( int nIndex = 0; nIndex < m_arrItems.GetSize(); nIndex++ )
for ( unsigned int nIndex = 0; nIndex < m_arrItems.size(); nIndex++ )
{
if ( m_arrItems[nIndex] )
delete m_arrItems[nIndex];
......@@ -515,11 +515,11 @@ namespace OOX
m_arrItems[nIndex] = NULL;
}
m_arrItems.RemoveAll();
m_arrItems.clear();
}
public:
CSimpleArray<OOX::Vml::CShape *> m_arrItems;
std::vector<OOX::Vml::CShape *> m_arrItems;
CAtlMap<CString, OOX::Spreadsheet::CCommentItem*>* m_mapComments;
};
} //Spreadsheet
......
......@@ -123,7 +123,7 @@ namespace OOX
}
if ( pItem )
m_arrItems.Add( pItem );
m_arrItems.push_back( pItem );
}
}
}
......@@ -132,7 +132,7 @@ namespace OOX
{
XmlUtils::CStringWriter sXml;
sXml.WriteString(_T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><xdr:wsDr xmlns:xdr=\"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing\" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\">"));
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
for(unsigned int i = 0, length = m_arrItems.size(); i < length; ++i)
m_arrItems[i]->toXML(sXml);
sXml.WriteString(_T("</xdr:wsDr>"));
......@@ -169,7 +169,7 @@ namespace OOX
}
void ClearItems()
{
for ( int nIndex = 0; nIndex < m_arrItems.GetSize(); nIndex++ )
for ( unsigned int nIndex = 0; nIndex < m_arrItems.size(); nIndex++ )
{
if ( m_arrItems[nIndex] )
delete m_arrItems[nIndex];
......@@ -177,11 +177,11 @@ namespace OOX
m_arrItems[nIndex] = NULL;
}
m_arrItems.RemoveAll();
m_arrItems.clear();
}
public:
CSimpleArray<CCellAnchor *> m_arrItems;
std::vector<CCellAnchor *> m_arrItems;
};
} //Spreadsheet
} // namespace OOX
......
......@@ -47,7 +47,7 @@ namespace OOX
//if ( _T("a:lstStyle") == sName )
// m_oLstStyle = oReader;
else if ( _T("a:p") == sName )
m_arrItems.Add( new Drawing::CParagraph( oReader ));
m_arrItems.push_back( new Drawing::CParagraph( oReader ));
}
}
......@@ -584,15 +584,15 @@ namespace OOX
m_oGroupSpPr = oReader;
else if ( _T("xdr:sp") == sName )
m_arrItems.Add( new OOX::Spreadsheet::CShape( oReader ));
m_arrItems.push_back( new OOX::Spreadsheet::CShape( oReader ));
else if ( _T("xdr:cxnSp") == sName )
m_arrItems.Add( new OOX::Spreadsheet::CConnShape( oReader ));
m_arrItems.push_back( new OOX::Spreadsheet::CConnShape( oReader ));
else if ( _T("xdr:graphicFrame") == sName )
m_arrItems.Add( new OOX::Spreadsheet::CGraphicFrame( oReader ));
m_arrItems.push_back( new OOX::Spreadsheet::CGraphicFrame( oReader ));
else if ( _T("xdr:pic") == sName )
m_arrItems.Add( new OOX::Spreadsheet::CPic( oReader ));
m_arrItems.push_back( new OOX::Spreadsheet::CPic( oReader ));
else if ( _T("xdr:grpSp") == sName )
m_arrItems.Add( new OOX::Spreadsheet::CGroupShape( oReader ));
m_arrItems.push_back( new OOX::Spreadsheet::CGroupShape( oReader ));
}
}
......
......@@ -92,7 +92,7 @@ namespace OOX
CWCharWrapper sName = oReader.GetName();
if ( _T("t") == sName )
m_arrItems.Add( new CText( oReader ));
m_arrItems.push_back( new CText( oReader ));
}
}
......
......@@ -33,7 +33,7 @@ namespace OOX
writer.WriteString(_T("<r>"));
if(m_oRPr.IsInit())
m_oRPr->toXML(writer);
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
for(unsigned int i = 0, length = m_arrItems.size(); i < length; ++i)
m_arrItems[i]->toXML(writer);
writer.WriteString(_T("</r>"));
}
......@@ -52,7 +52,7 @@ namespace OOX
if ( _T("rPr") == sName )
m_oRPr = oReader;
else if ( _T("t") == sName )
m_arrItems.Add( new CText( oReader ));
m_arrItems.push_back( new CText( oReader ));
}
}
......
......@@ -58,7 +58,7 @@ namespace OOX
pItem = new CSi( oReader );
if ( pItem )
m_arrItems.Add( pItem );
m_arrItems.push_back( pItem );
}
}
}
......@@ -79,7 +79,7 @@ namespace OOX
}
sXml.WriteString(_T(">"));
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
for(unsigned int i = 0, length = m_arrItems.size(); i < length; ++i)
m_arrItems[i]->toXML(sXml);
sXml.WriteString(_T("</sst>"));
......@@ -105,23 +105,21 @@ namespace OOX
}
const int AddSi(CSi* pSi)
{
int nIndex = m_arrItems.GetSize();
m_arrItems.Add( pSi );
int nIndex = m_arrItems.size();
m_arrItems.push_back( pSi );
return nIndex;
}
private:
CPath m_oReadPath;
void ClearItems()
{
for ( int nIndex = 0; nIndex < m_arrItems.GetSize(); nIndex++ )
for ( unsigned int nIndex = 0; nIndex < m_arrItems.size(); nIndex++ )
{
if ( m_arrItems[nIndex] )
delete m_arrItems[nIndex];
if ( m_arrItems[nIndex] )delete m_arrItems[nIndex];
m_arrItems[nIndex] = NULL;
}
m_arrItems.RemoveAll();
m_arrItems.clear();
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
......@@ -138,7 +136,7 @@ namespace OOX
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oCount;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oUniqueCount;
CSimpleArray<WritingElement *> m_arrItems;
std::vector<WritingElement *> m_arrItems;
};
} //Spreadsheet
......
......@@ -32,25 +32,25 @@ namespace OOX
virtual void toXML(XmlUtils::CStringWriter& writer) const
{
writer.WriteString(_T("<si>"));
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
for(unsigned int i = 0, length = m_arrItems.size(); i < length; ++i)
m_arrItems[i]->toXML(writer);
writer.WriteString(_T("</si>"));
}
virtual void toXML2(XmlUtils::CStringWriter& writer) const
{
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
for(unsigned int i = 0, length = m_arrItems.size(); i < length; ++i)
m_arrItems[i]->toXML(writer);
}
CString ToString()
{
CString sRes;
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
for(unsigned int i = 0, length = m_arrItems.size(); i < length; ++i)
{
WritingElement* we = m_arrItems[i];
if(OOX::Spreadsheet::et_r == we->getType())
{
CRun* pRun = static_cast<CRun*>(we);
for(int j = 0, length2 = pRun->m_arrItems.GetSize(); j < length2; ++j)
for(unsigned int j = 0, length2 = pRun->m_arrItems.size(); j < length2; ++j)
{
CText* pText = pRun->m_arrItems[j];
sRes.Append(pText->ToString());
......@@ -87,7 +87,7 @@ namespace OOX
pItem = new CText( oReader );
if ( NULL != pItem )
m_arrItems.Add( pItem );
m_arrItems.push_back( pItem );
}
}
......
......@@ -227,7 +227,7 @@ namespace OOX
writer.WriteString(sVal);
}
writer.WriteString(_T(">"));
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
for(unsigned int i = 0, length = m_arrItems.size(); i < length; ++i)
m_arrItems[i]->toXML(writer);
writer.WriteString(_T("</borders>"));
}
......@@ -244,7 +244,7 @@ namespace OOX
CWCharWrapper sName = oReader.GetName();
if ( _T("border") == sName )
m_arrItems.Add( new CBorder( oReader ));
m_arrItems.push_back( new CBorder( oReader ));
}
}
......
......@@ -108,7 +108,7 @@ namespace OOX
writer.WriteString(sVal);
}
writer.WriteString(_T(">"));
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
for(unsigned int i = 0, length = m_arrItems.size(); i < length; ++i)
m_arrItems[i]->toXML(writer);
writer.WriteString(_T("</cellStyles>"));
}
......@@ -125,7 +125,7 @@ namespace OOX
CWCharWrapper sName = oReader.GetName();
if ( _T("cellStyle") == sName )
m_arrItems.Add( new CCellStyle( oReader ));
m_arrItems.push_back( new CCellStyle( oReader ));
}
}
......
......@@ -184,7 +184,7 @@ namespace OOX
CWCharWrapper sName = oReader.GetName();
if ( _T("stop") == sName )
m_arrItems.Add( new CGradientStop( oReader ));
m_arrItems.push_back( new CGradientStop( oReader ));
}
}
......@@ -296,7 +296,7 @@ namespace OOX
writer.WriteString(sVal);
}
writer.WriteString(_T(">"));
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
for(unsigned int i = 0, length = m_arrItems.size(); i < length; ++i)
m_arrItems[i]->toXML(writer);
writer.WriteString(_T("</fills>"));
}
......@@ -313,7 +313,7 @@ namespace OOX
CWCharWrapper sName = oReader.GetName();
if ( _T("fill") == sName )
m_arrItems.Add( new CFill( oReader ));
m_arrItems.push_back( new CFill( oReader ));
}
}
......
......@@ -217,7 +217,7 @@ namespace OOX
writer.WriteString(sVal);
}
writer.WriteString(_T(">"));
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
for(unsigned int i = 0, length = m_arrItems.size(); i < length; ++i)
m_arrItems[i]->toXML(writer);
writer.WriteString(_T("</fonts>"));
}
......@@ -234,7 +234,7 @@ namespace OOX
CWCharWrapper sName = oReader.GetName();
if ( _T("font") == sName )
m_arrItems.Add( new CFont( oReader ));
m_arrItems.push_back( new CFont( oReader ));
}
}
......@@ -244,10 +244,10 @@ namespace OOX
}
void AddFont (CFont* pFont)
{
m_arrItems.Add(pFont);
m_arrItems.push_back(pFont);
if(false == m_oCount.IsInit())
m_oCount.Init();
m_oCount->SetValue(m_arrItems.GetSize());
m_oCount->SetValue(m_arrItems.size());
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
......
......@@ -99,7 +99,7 @@ namespace OOX
}
virtual void toXML(XmlUtils::CStringWriter& writer) const
{
if(m_arrItems.GetSize() > 0 )
if(m_arrItems.size() > 0 )
{
writer.WriteString(_T("<numFmts"));
if(m_oCount.IsInit())
......@@ -108,7 +108,7 @@ namespace OOX
writer.WriteString(sVal);
}
writer.WriteString(_T(">"));
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
for(unsigned int i = 0, length = m_arrItems.size(); i < length; ++i)
m_arrItems[i]->toXML(writer);
writer.WriteString(_T("</numFmts>"));
}
......@@ -126,7 +126,7 @@ namespace OOX
CWCharWrapper sName = oReader.GetName();
if ( _T("numFmt") == sName )
m_arrItems.Add( new CNumFmt( oReader ));
m_arrItems.push_back( new CNumFmt( oReader ));
}
}
......
......@@ -123,7 +123,7 @@ namespace OOX
//cellXfs
if(m_oCellXfs.IsInit())
{
for(int i = 0, length = m_oCellXfs->m_arrItems.GetSize(); i < length; ++i)
for(unsigned int i = 0, length = m_oCellXfs->m_arrItems.size(); i < length; ++i)
{
OOX::Spreadsheet::CXfs* xfs = m_oCellXfs->m_arrItems[i];
if (false == xfs->m_oXfId.IsInit())
......@@ -141,15 +141,15 @@ namespace OOX
m_oCellStyles->m_oCount.Init();
m_oCellStyles->m_oCount->SetValue(1);
}
if(0 == m_oCellStyles->m_arrItems.GetSize())
if(0 == m_oCellStyles->m_arrItems.size())
{
CCellStyle* pCellStyle = new CCellStyle();
pCellStyle->m_oName = _T("Normal");
pCellStyle->m_oXfId.Init();
pCellStyle->m_oXfId->SetValue(0);
pCellStyle->m_oBuiltinId.Init();
pCellStyle->m_oBuiltinId->SetValue(0);
m_oCellStyles->m_arrItems.Add(pCellStyle);
pCellStyle->m_oName = _T("Normal");
pCellStyle->m_oXfId.Init();
pCellStyle->m_oXfId->SetValue(0);
pCellStyle->m_oBuiltinId.Init();
pCellStyle->m_oBuiltinId->SetValue(0);
m_oCellStyles->m_arrItems.push_back(pCellStyle);
}
//cellStyleXfs
if(false == m_oCellStyleXfs.IsInit())
......@@ -159,18 +159,18 @@ namespace OOX
m_oCellStyleXfs->m_oCount.Init();
m_oCellStyleXfs->m_oCount->SetValue(1);
}
if(0 == m_oCellStyleXfs->m_arrItems.GetSize())
if(0 == m_oCellStyleXfs->m_arrItems.size())
{
CXfs* pXfs = new CXfs();
pXfs->m_oNumFmtId.Init();
pXfs->m_oNumFmtId->SetValue(0);
pXfs->m_oFontId.Init();
pXfs->m_oFontId->SetValue(0);
pXfs->m_oFillId.Init();
pXfs->m_oFillId->SetValue(0);
pXfs->m_oBorderId.Init();
pXfs->m_oBorderId->SetValue(0);
m_oCellStyleXfs->m_arrItems.Add(pXfs);
pXfs->m_oNumFmtId.Init();
pXfs->m_oNumFmtId->SetValue(0);
pXfs->m_oFontId.Init();
pXfs->m_oFontId->SetValue(0);
pXfs->m_oFillId.Init();
pXfs->m_oFillId->SetValue(0);
pXfs->m_oBorderId.Init();
pXfs->m_oBorderId->SetValue(0);
m_oCellStyleXfs->m_arrItems.push_back(pXfs);
}
//dxfs
if(false == m_oDxfs.IsInit())
......
......@@ -86,7 +86,7 @@ namespace OOX
}
virtual void toXML(XmlUtils::CStringWriter& writer) const
{
if(m_oName.IsInit() && m_arrItems.GetSize() > 0)
if(m_oName.IsInit() && m_arrItems.size() > 0)
{
writer.WriteString(_T("<tableStyle"));
if(m_oName.IsInit())
......@@ -106,7 +106,7 @@ namespace OOX
writer.WriteString(sCount);
}
writer.WriteString(_T(">"));
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
for(unsigned int i = 0, length = m_arrItems.size(); i < length; ++i)
m_arrItems[i]->toXML(writer);
writer.WriteString(_T("</tableStyle>"));
}
......@@ -125,7 +125,7 @@ namespace OOX
CWCharWrapper sName = oReader.GetName();
if ( _T("tableStyleElement") == sName )
m_arrItems.Add( new CTableStyleElement( oReader ));
m_arrItems.push_back( new CTableStyleElement( oReader ));
}
}
......@@ -189,10 +189,10 @@ namespace OOX
CString sVal;sVal.Format(_T(" defaultPivotStyle=\"%s\""), XmlUtils::EncodeXmlString(m_oDefaultPivotStyle.get()));
writer.WriteString(sVal);
}
if(m_arrItems.GetSize() > 0)
if(m_arrItems.size() > 0)
{
writer.WriteString(_T(">"));
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
for(unsigned int i = 0, length = m_arrItems.size(); i < length; ++i)
m_arrItems[i]->toXML(writer);
writer.WriteString(_T("</tableStyles>"));
}
......@@ -212,7 +212,7 @@ namespace OOX
CWCharWrapper sName = oReader.GetName();
if ( _T("tableStyle") == sName )
m_arrItems.Add( new CTableStyle( oReader ));
m_arrItems.push_back( new CTableStyle( oReader ));
}
}
......
......@@ -343,7 +343,7 @@ namespace OOX
writer.WriteString(sVal);
}
writer.WriteString(_T(">"));
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
for(unsigned int i = 0, length = m_arrItems.size(); i < length; ++i)
m_arrItems[i]->toXML(writer);
writer.WriteString(_T("</cellXfs>"));
}
......@@ -360,7 +360,7 @@ namespace OOX
CWCharWrapper sName = oReader.GetName();
if ( _T("xf") == sName )
m_arrItems.Add( new CXfs( oReader ));
m_arrItems.push_back( new CXfs( oReader ));
}
}
......@@ -407,7 +407,7 @@ namespace OOX
writer.WriteString(sVal);
}
writer.WriteString(_T(">"));
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
for(unsigned int i = 0, length = m_arrItems.size(); i < length; ++i)
m_arrItems[i]->toXML(writer);
writer.WriteString(_T("</cellStyleXfs>"));
}
......@@ -424,7 +424,7 @@ namespace OOX
CWCharWrapper sName = oReader.GetName();
if ( _T("xf") == sName )
m_arrItems.Add( new CXfs( oReader ));
m_arrItems.push_back( new CXfs( oReader ));
}
}
......
......@@ -115,7 +115,7 @@ namespace OOX
writer.WriteString(sVal);
}
writer.WriteString(_T(">"));
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
for(unsigned int i = 0, length = m_arrItems.size(); i < length; ++i)
m_arrItems[i]->toXML(writer);
writer.WriteString(_T("</dxfs>"));
}
......@@ -132,7 +132,7 @@ namespace OOX
CWCharWrapper sName = oReader.GetName();
if ( _T("dxf") == sName )
m_arrItems.Add( new CDxf(oReader));
m_arrItems.push_back( new CDxf(oReader));
}
}
......
......@@ -84,7 +84,7 @@ namespace OOX
CWCharWrapper sName = oReader.GetName();
if ( _T("rgbColor") == sName )
m_arrItems.Add( new CRgbColor( oReader ));
m_arrItems.push_back( new CRgbColor( oReader ));
}
}
......@@ -450,7 +450,7 @@ namespace OOX
CWCharWrapper sName = oReader.GetName();
if ( _T("color") == sName )
m_arrItems.Add( new CColor( oReader ));
m_arrItems.push_back( new CColor( oReader ));
}
}
......
......@@ -107,7 +107,7 @@ namespace OOX
}
virtual void toXML(XmlUtils::CStringWriter& writer) const
{
if(m_oRef.IsInit() && m_arrItems.GetSize() > 0)
if(m_oRef.IsInit() && m_arrItems.size() > 0)
{
CString sXml;
sXml.Format(_T("<sortState ref=\"%s\""), XmlUtils::EncodeXmlString(m_oRef->GetValue()));
......@@ -116,7 +116,7 @@ namespace OOX
sXml.Append(_T(">"));
writer.WriteString(sXml);
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
for(unsigned int i = 0, length = m_arrItems.size(); i < length; ++i)
m_arrItems[i]->toXML(writer);
writer.WriteString(CString(_T("</sortState>")));
......@@ -135,7 +135,7 @@ namespace OOX
CWCharWrapper sName = oReader.GetName();
if ( _T("sortCondition") == sName )
m_arrItems.Add(new CSortCondition(oReader));
m_arrItems.push_back(new CSortCondition(oReader));
}
}
......@@ -356,13 +356,13 @@ namespace OOX
}
virtual void toXML(XmlUtils::CStringWriter& writer) const
{
if(m_arrItems.GetSize() > 0)
if(m_arrItems.size() > 0)
{
writer.WriteString(CString(_T("<customFilters")));
if(m_oAnd.IsInit() && true == m_oAnd->ToBool())
writer.WriteString(CString(_T(" and=\"1\"")));
writer.WriteString(CString(_T(">")));
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
for(unsigned int i = 0, length = m_arrItems.size(); i < length; ++i)
m_arrItems[i]->toXML(writer);
writer.WriteString(CString(_T("</customFilters>")));
}
......@@ -380,7 +380,7 @@ namespace OOX
CWCharWrapper sName = oReader.GetName();
if ( _T("customFilter") == sName )
m_arrItems.Add( new CCustomFilter(oReader));
m_arrItems.push_back( new CCustomFilter(oReader));
}
}
......@@ -575,7 +575,7 @@ namespace OOX
}
virtual void toXML(XmlUtils::CStringWriter& writer) const
{
if(m_arrItems.GetSize() > 0)
if(m_arrItems.size() > 0)
{
writer.WriteString(_T("<filters"));
if(m_oBlank.IsInit())
......@@ -586,7 +586,7 @@ namespace OOX
}
writer.WriteString(_T(">"));
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
for(unsigned int i = 0, length = m_arrItems.size(); i < length; ++i)
m_arrItems[i]->toXML(writer);
writer.WriteString(_T("</filters>"));
......@@ -605,9 +605,9 @@ namespace OOX
CWCharWrapper sName = oReader.GetName();
if ( _T("dateGroupItem") == sName )
m_arrItems.Add( new CDateGroupItem(oReader));
m_arrItems.push_back( new CDateGroupItem(oReader));
if ( _T("filter") == sName )
m_arrItems.Add( new CFilter(oReader));
m_arrItems.push_back( new CFilter(oReader));
}
}
......@@ -822,7 +822,7 @@ namespace OOX
CString sXml;
sXml.Format(_T("<autoFilter ref=\"%s\">"), XmlUtils::EncodeXmlString(m_oRef->GetValue()));
writer.WriteString(sXml);
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
for(unsigned int i = 0, length = m_arrItems.size(); i < length; ++i)
m_arrItems[i]->toXML(writer);
if(m_oSortState.IsInit())
m_oSortState->toXML(writer);
......@@ -842,7 +842,7 @@ namespace OOX
CWCharWrapper sName = oReader.GetName();
if ( _T("filterColumn") == sName )
m_arrItems.Add(new CFilterColumn(oReader));
m_arrItems.push_back(new CFilterColumn(oReader));
else if ( _T("sortState") == sName )
m_oSortState = oReader;
}
......
......@@ -222,12 +222,12 @@ namespace OOX
}
virtual void toXML(XmlUtils::CStringWriter& writer) const
{
if(m_arrItems.GetSize() > 0)
if(m_arrItems.size() > 0)
{
CString sRoot;
sRoot.Format(_T("<tableColumns count=\"%d\">"), m_arrItems.GetSize());
sRoot.Format(_T("<tableColumns count=\"%d\">"), m_arrItems.size());
writer.WriteString(sRoot);
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
for(unsigned int i = 0, length = m_arrItems.size(); i < length; ++i)
m_arrItems[i]->toXML(writer);
writer.WriteString(CString(_T("</tableColumns>")));
}
......@@ -245,7 +245,7 @@ namespace OOX
CWCharWrapper sName = oReader.GetName();
if ( _T("tableColumn") == sName )
m_arrItems.Add(new CTableColumn(oReader));
m_arrItems.push_back(new CTableColumn(oReader));
}
}
......@@ -434,12 +434,12 @@ namespace OOX
}
virtual void toXML(XmlUtils::CStringWriter& writer) const
{
if(m_arrItems.GetSize() > 0)
if(m_arrItems.size() > 0)
{
CString sXml;
sXml.Format(_T("<tableParts count=\"%d\">"), m_arrItems.GetSize());
sXml.Format(_T("<tableParts count=\"%d\">"), m_arrItems.size());
writer.WriteString(sXml);
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
for(unsigned int i = 0, length = m_arrItems.size(); i < length; ++i)
m_arrItems[i]->toXML(writer);
writer.WriteString(CString(_T("</tableParts>")));
}
......@@ -457,7 +457,7 @@ namespace OOX
CWCharWrapper sName = oReader.GetName();
if ( _T("tablePart") == sName )
m_arrItems.Add(new CTablePart(oReader));
m_arrItems.push_back(new CTablePart(oReader));
}
}
......
......@@ -64,7 +64,7 @@ namespace OOX
public:
CSimpleArray<WritingElement *> m_arrItems;
std::vector<WritingElement *> m_arrItems;
};
} //Spreadsheet
......
......@@ -129,7 +129,7 @@ namespace OOX
virtual void toXML(XmlUtils::CStringWriter& writer) const
{
writer.WriteString(_T("<bookViews>"));
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
for(unsigned int i = 0, length = m_arrItems.size(); i < length; ++i)
m_arrItems[i]->toXML(writer);
writer.WriteString(_T("</bookViews>"));
}
......@@ -146,7 +146,7 @@ namespace OOX
CWCharWrapper sName = oReader.GetName();
if ( _T("workbookView") == sName )
m_arrItems.Add( new CWorkbookView( oReader ));
m_arrItems.push_back( new CWorkbookView( oReader ));
}
}
......
......@@ -125,10 +125,10 @@ namespace OOX
}
virtual void toXML(XmlUtils::CStringWriter& writer) const
{
if(m_arrItems.GetSize() > 0)
if(m_arrItems.size() > 0)
{
writer.WriteString(_T("<definedNames>"));
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
for(unsigned int i = 0, length = m_arrItems.size(); i < length; ++i)
m_arrItems[i]->toXML(writer);
writer.WriteString(_T("</definedNames>"));
}
......@@ -146,7 +146,7 @@ namespace OOX
CWCharWrapper sName = oReader.GetName();
if ( _T("definedName") == sName )
m_arrItems.Add( new CDefinedName( oReader ));
m_arrItems.push_back( new CDefinedName( oReader ));
}
}
......
......@@ -107,7 +107,7 @@ namespace OOX
virtual void toXML(XmlUtils::CStringWriter& writer) const
{
writer.WriteString(_T("<sheets>"));
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
for(unsigned int i = 0, length = m_arrItems.size(); i < length; ++i)
m_arrItems[i]->toXML(writer);
writer.WriteString(_T("</sheets>"));
}
......@@ -124,7 +124,7 @@ namespace OOX
CWCharWrapper sName = oReader.GetName();
if ( _T("sheet") == sName )
m_arrItems.Add( new CSheet( oReader ));
m_arrItems.push_back( new CSheet( oReader ));
}
}
......
......@@ -132,8 +132,8 @@ namespace OOX
//BookViews
if(false == m_oBookViews.IsInit())
m_oBookViews.Init();
if(0 == m_oBookViews->m_arrItems.GetSize())
m_oBookViews->m_arrItems.Add(new OOX::Spreadsheet::CWorkbookView());
if(0 == m_oBookViews->m_arrItems.size())
m_oBookViews->m_arrItems.push_back(new OOX::Spreadsheet::CWorkbookView());
OOX::Spreadsheet::CWorkbookView* pWorkbookView = m_oBookViews->m_arrItems[0];
if(false == pWorkbookView->m_oXWindow.IsInit())
{
......
......@@ -147,10 +147,10 @@ namespace OOX
}
virtual void toXML(XmlUtils::CStringWriter& writer) const
{
if(m_arrItems.GetSize() > 0)
if(m_arrItems.size() > 0)
{
writer.WriteString(_T("<cols>"));
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
for(unsigned int i = 0, length = m_arrItems.size(); i < length; ++i)
m_arrItems[i]->toXML(writer);
writer.WriteString(_T("</cols>"));
}
......@@ -168,7 +168,7 @@ namespace OOX
CWCharWrapper sName = oReader.GetName();
if ( _T("col") == sName )
m_arrItems.Add( new CCol( oReader ));
m_arrItems.push_back( new CCol( oReader ));
}
}
......
......@@ -95,12 +95,12 @@ namespace OOX
}
virtual void toXML(XmlUtils::CStringWriter& writer) const
{
if (3 < m_arrItems.GetSize()) // min 2 + 2
if (3 < m_arrItems.size()) // min 2 + 2
{
CString sValue;
writer.WriteString(_T("<colorScale>"));
for (int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
for (unsigned int i = 0, length = m_arrItems.size(); i < length; ++i)
m_arrItems[i]->toXML(writer);
writer.WriteString(_T("</colorScale>"));
......@@ -116,9 +116,9 @@ namespace OOX
{
CWCharWrapper sName = oReader.GetName();
if (_T("cfvo") == sName)
m_arrItems.Add(new CConditionalFormatValueObject(oReader));
m_arrItems.push_back(new CConditionalFormatValueObject(oReader));
else if (_T("color") == sName)
m_arrItems.Add(new CColor(oReader));
m_arrItems.push_back(new CColor(oReader));
}
}
......@@ -148,7 +148,7 @@ namespace OOX
}
virtual void toXML(XmlUtils::CStringWriter& writer) const
{
if (2 == m_arrItems.GetSize() && m_oColor.IsInit())
if (2 == m_arrItems.size() && m_oColor.IsInit())
{
CString sValue;
writer.WriteString(_T("<dataBar"));
......@@ -169,7 +169,7 @@ namespace OOX
writer.WriteString(_T(">"));
for (int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
for (unsigned int i = 0, length = m_arrItems.size(); i < length; ++i)
m_arrItems[i]->toXML(writer);
m_oColor->toXML2(writer, _T("color"));
......@@ -189,7 +189,7 @@ namespace OOX
{
CWCharWrapper sName = oReader.GetName();
if (_T("cfvo") == sName)
m_arrItems.Add(new CConditionalFormatValueObject(oReader));
m_arrItems.push_back(new CConditionalFormatValueObject(oReader));
else if (_T("color") == sName)
m_oColor = oReader;
}
......@@ -279,7 +279,7 @@ namespace OOX
}
virtual void toXML(XmlUtils::CStringWriter& writer) const
{
if (1 < m_arrItems.GetSize()) // min value = 2
if (1 < m_arrItems.size()) // min value = 2
{
CString sValue;
writer.WriteString(_T("<iconSet"));
......@@ -303,7 +303,7 @@ namespace OOX
writer.WriteString(_T(">"));
for (int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
for (unsigned int i = 0, length = m_arrItems.size(); i < length; ++i)
m_arrItems[i]->toXML(writer);
writer.WriteString(_T("</iconSet>"));
......@@ -321,7 +321,7 @@ namespace OOX
{
CWCharWrapper sName = oReader.GetName();
if (_T("cfvo") == sName)
m_arrItems.Add(new CConditionalFormatValueObject(oReader));
m_arrItems.push_back(new CConditionalFormatValueObject(oReader));
}
}
......@@ -372,7 +372,7 @@ namespace OOX
}
virtual void toXML(XmlUtils::CStringWriter& writer) const
{
if (m_oType.IsInit() && m_oPriority.IsInit() && 0 < m_arrItems.GetSize())
if (m_oType.IsInit() && m_oPriority.IsInit() && 0 < m_arrItems.size())
{
CString sValue;
CString sRoot;
......@@ -421,7 +421,7 @@ namespace OOX
writer.WriteString(_T(">"));
for (int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
for (unsigned int i = 0, length = m_arrItems.size(); i < length; ++i)
m_arrItems[i]->toXML(writer);
writer.WriteString(_T("</cfRule>"));
......@@ -439,13 +439,13 @@ namespace OOX
{
CWCharWrapper sName = oReader.GetName();
if (_T("colorScale") == sName)
m_arrItems.Add(new CColorScale(oReader));
m_arrItems.push_back(new CColorScale(oReader));
else if (_T("dataBar") == sName)
m_arrItems.Add(new CDataBar(oReader));
m_arrItems.push_back(new CDataBar(oReader));
else if (_T("formula") == sName)
m_arrItems.Add(new CFormulaCF(oReader));
m_arrItems.push_back(new CFormulaCF(oReader));
else if (_T("iconSet") == sName)
m_arrItems.Add(new CIconSet(oReader));
m_arrItems.push_back(new CIconSet(oReader));
}
}
......@@ -514,7 +514,7 @@ namespace OOX
}
virtual void toXML(XmlUtils::CStringWriter& writer) const
{
if (m_oSqRef.IsInit() && 0 < m_arrItems.GetSize())
if (m_oSqRef.IsInit() && 0 < m_arrItems.size())
{
CString sRoot;
sRoot.Format(_T("<conditionalFormatting sqref=\"%s\""), m_oSqRef->GetValue());
......@@ -527,7 +527,7 @@ namespace OOX
writer.WriteString(_T(">"));
for (int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
for (unsigned int i = 0, length = m_arrItems.size(); i < length; ++i)
m_arrItems[i]->toXML(writer);
writer.WriteString(_T("</conditionalFormatting>"));
......@@ -546,7 +546,7 @@ namespace OOX
CWCharWrapper sName = oReader.GetName();
if (_T("cfRule") == sName)
m_arrItems.Add(new CConditionalFormattingRule(oReader));
m_arrItems.push_back(new CConditionalFormattingRule(oReader));
}
}
......
......@@ -112,10 +112,10 @@ namespace OOX
}
virtual void toXML(XmlUtils::CStringWriter& writer) const
{
if(m_arrItems.GetSize() > 0)
if(m_arrItems.size() > 0)
{
writer.WriteString(_T("<hyperlinks>"));
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
for(unsigned int i = 0, length = m_arrItems.size(); i < length; ++i)
m_arrItems[i]->toXML(writer);
writer.WriteString(_T("</hyperlinks>"));
}
......@@ -133,7 +133,7 @@ namespace OOX
CWCharWrapper sName = oReader.GetName();
if ( _T("hyperlink") == sName )
m_arrItems.Add( new CHyperlink( oReader ));
m_arrItems.push_back( new CHyperlink( oReader ));
}
}
......
......@@ -84,7 +84,7 @@ namespace OOX
}
virtual void toXML(XmlUtils::CStringWriter& writer) const
{
if(m_arrItems.GetSize() > 0)
if(m_arrItems.size() > 0)
{
writer.WriteString(_T("<mergeCells"));
if(m_oCount.IsInit())
......@@ -93,7 +93,7 @@ namespace OOX
writer.WriteString(sVal);
}
writer.WriteString(_T(">"));
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
for(unsigned int i = 0, length = m_arrItems.size(); i < length; ++i)
m_arrItems[i]->toXML(writer);
writer.WriteString(_T("</mergeCells>"));
}
......@@ -111,7 +111,7 @@ namespace OOX
CWCharWrapper sName = oReader.GetName();
if ( _T("mergeCell") == sName )
m_arrItems.Add( new CMergeCell( oReader ));
m_arrItems.push_back( new CMergeCell( oReader ));
}
}
......
......@@ -345,7 +345,7 @@ namespace OOX
writer.WriteString(sVal);
}
writer.WriteString(_T(">"));
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
for(unsigned int i = 0, length = m_arrItems.size(); i < length; ++i)
m_arrItems[i]->toXML(writer);
writer.WriteString(_T("</row>"));
}
......@@ -362,7 +362,7 @@ namespace OOX
CWCharWrapper sName = oReader.GetName();
if ( _T("c") == sName )
m_arrItems.Add( new CCell( oReader ));
m_arrItems.push_back( new CCell( oReader ));
}
}
......@@ -429,7 +429,7 @@ namespace OOX
virtual void toXML(XmlUtils::CStringWriter& writer) const
{
writer.WriteString(_T("<sheetData>"));
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
for(unsigned int i = 0, length = m_arrItems.size(); i < length; ++i)
m_arrItems[i]->toXML(writer);
writer.WriteString(_T("</sheetData>"));
}
......@@ -446,7 +446,7 @@ namespace OOX
CWCharWrapper sName = oReader.GetName();
if ( _T("row") == sName )
m_arrItems.Add(new CRow( oReader ));
m_arrItems.push_back(new CRow( oReader ));
}
}
......
......@@ -103,7 +103,7 @@ namespace OOX
else if ( _T("sheetData") == sName )
m_oSheetData = oReader;
else if (_T("conditionalFormatting") == sName)
m_arrConditionalFormatting.Add(new CConditionalFormatting(oReader));
m_arrConditionalFormatting.push_back(new CConditionalFormatting(oReader));
else if ( _T("sheetFormatPr") == sName )
m_oSheetFormatPr = oReader;
else if ( _T("sheetViews") == sName )
......@@ -134,11 +134,11 @@ namespace OOX
}
void PrepareComments(OOX::Spreadsheet::CComments* pComments, OOX::Spreadsheet::CLegacyDrawing* pLegacyDrawing)
{
CSimpleArray<CString*> aAuthors = pComments->m_oAuthors->m_arrItems;
std::vector<CString*> & aAuthors = pComments->m_oAuthors->m_arrItems;
if(pComments->m_oCommentList.IsInit())
{
CSimpleArray<OOX::Spreadsheet::CComment*> aComments = pComments->m_oCommentList->m_arrItems;
for(int i = 0, length = aComments.GetSize(); i < length; ++i)
std::vector<OOX::Spreadsheet::CComment*> & aComments = pComments->m_oCommentList->m_arrItems;
for(unsigned int i = 0, length = aComments.size(); i < length; ++i)
{
OOX::Spreadsheet::CComment* pComment = aComments[i];
if(pComment->m_oRef.IsInit() && pComment->m_oAuthorId.IsInit())
......@@ -151,7 +151,7 @@ namespace OOX
pCommentItem->m_nCol = nCol - 1;
unsigned int nAuthorId = pComment->m_oAuthorId->GetValue();
if(nAuthorId < (unsigned int)aAuthors.GetSize())
if(nAuthorId < aAuthors.size())
pCommentItem->m_sAuthor = *aAuthors[nAuthorId];
OOX::Spreadsheet::CSi* pSi = pComment->m_oText.GetPointerEmptyNullable();
......@@ -163,10 +163,12 @@ namespace OOX
}
}
}
for(int i = 0, length = pLegacyDrawing->m_arrItems.GetSize(); i < length; ++i)
for(unsigned int i = 0, length = pLegacyDrawing->m_arrItems.size(); i < length; ++i)
{
OOX::Vml::CShape* pShape = pLegacyDrawing->m_arrItems[i];
for(int j = 0, length2 = pShape->m_arrItems.size(); j < length2; ++j)
if (pShape == NULL) continue;
for(unsigned int j = 0, length2 = pShape->m_arrItems.size(); j < length2; ++j)
{
OOX::WritingElement* pElem = pShape->m_arrItems[j];
if( OOX::et_v_ClientData == pElem->getType())
......@@ -186,16 +188,16 @@ namespace OOX
if(pClientData->m_oAnchor.IsInit())
{
const CString& sAnchor = pClientData->m_oAnchor.get();
CSimpleArray<int> m_aAnchor;
std::vector<int> m_aAnchor;
int nTokenPos = 0;
CString strToken = sAnchor.Tokenize(_T(","), nTokenPos);
while (!strToken.IsEmpty())
{
strToken.Trim();
m_aAnchor.Add(_wtoi(strToken));
m_aAnchor.push_back(_wtoi(strToken));
strToken = sAnchor.Tokenize(_T(","), nTokenPos);
}
if(8 == m_aAnchor.GetSize())
if(8 == m_aAnchor.size())
{
pCommentItem->m_nLeft = m_aAnchor[0];
pCommentItem->m_nLeftOffset = m_aAnchor[1];
......@@ -213,7 +215,7 @@ namespace OOX
if(pClientData->m_oSizeWithCells.IsInit())
pCommentItem->m_bSize = pClientData->m_oSizeWithCells->ToBool();
for(int k = 0 ,length3 = pShape->m_oStyle->m_arrProperties.size(); k < length3; ++k)
for(unsigned int k = 0 ,length3 = pShape->m_oStyle->m_arrProperties.size(); k < length3; ++k)
{
if (pShape->m_oStyle->m_arrProperties[k] == NULL) continue;
......@@ -276,8 +278,8 @@ namespace OOX
}
if(false == m_oSheetViews.IsInit())
m_oSheetViews.Init();
if(0 == m_oSheetViews->m_arrItems.GetSize())
m_oSheetViews->m_arrItems.Add(new CSheetView());
if(0 == m_oSheetViews->m_arrItems.size())
m_oSheetViews->m_arrItems.push_back(new CSheetView());
CSheetView* pSheetView = m_oSheetViews->m_arrItems[0];
if(false == pSheetView->m_oWorkbookViewId.IsInit())
{
......@@ -299,7 +301,7 @@ namespace OOX
m_oCols->toXML(sXml);
if(m_oSheetData.IsInit())
m_oSheetData->toXML(sXml);
for (int nIndex = 0, nLength = (int)m_arrConditionalFormatting.GetCount(); nIndex < nLength; ++nIndex)
for (unsigned int nIndex = 0, nLength = m_arrConditionalFormatting.size(); nIndex < nLength; ++nIndex)
m_arrConditionalFormatting[nIndex]->toXML();
if(m_oAutofilter.IsInit())
m_oAutofilter->toXML(sXml);
......@@ -414,7 +416,7 @@ namespace OOX
m_mapComments.RemoveAll();
// delete Conditional Formatting
m_arrConditionalFormatting.FreeAll();
m_arrConditionalFormatting.clear();
}
private:
CPath m_oReadPath;
......@@ -435,7 +437,7 @@ namespace OOX
nullable<OOX::Spreadsheet::CTableParts> m_oTableParts;
nullable<OOX::Spreadsheet::CLegacyDrawingWorksheet> m_oLegacyDrawingWorksheet;
CAtlMap<CString, CCommentItem*> m_mapComments;
CPtrAtlArray<OOX::Spreadsheet::CConditionalFormatting*> m_arrConditionalFormatting;
std::vector<OOX::Spreadsheet::CConditionalFormatting*> m_arrConditionalFormatting;
nullable<OOX::Spreadsheet::CSheetPr> m_oSheetPr;
};
} //Spreadsheet
......
......@@ -706,10 +706,10 @@ namespace OOX
}
virtual void toXML(XmlUtils::CStringWriter& writer) const
{
if(m_arrItems.GetSize() > 0)
if(m_arrItems.size() > 0)
{
writer.WriteString(_T("<sheetViews>"));
for(int i = 0, length = m_arrItems.GetSize(); i< length; ++i)
for( unsigned int i = 0, length = m_arrItems.size(); i< length; ++i)
m_arrItems[i]->toXML(writer);
writer.WriteString(_T("</sheetViews>"));
}
......@@ -727,7 +727,7 @@ namespace OOX
CWCharWrapper sName = oReader.GetName();
if ( _T("sheetView") == sName )
m_arrItems.Add( new CSheetView( oReader ));
m_arrItems.push_back( new CSheetView( oReader ));
}
}
......
......@@ -344,17 +344,15 @@ namespace Spreadsheet
virtual ~WritingElementWithChilds() {ClearItems();}
virtual void ClearItems()
{
for ( int nIndex = 0; nIndex < m_arrItems.GetSize(); nIndex++ )
for ( unsigned int nIndex = 0; nIndex < m_arrItems.size(); nIndex++ )
{
if ( m_arrItems[nIndex] )
delete m_arrItems[nIndex];
if ( m_arrItems[nIndex] )delete m_arrItems[nIndex];
m_arrItems[nIndex] = NULL;
}
m_arrItems.RemoveAll();
m_arrItems.clear();
}
CSimpleArray<ElemType *> m_arrItems;
std::vector<ElemType *> m_arrItems;
};
}
}
......@@ -142,7 +142,7 @@ namespace OOX
pApp->SetHyperlinksChanged(false);
smart_ptr<OOX::File> pAppFile(pApp);
const OOX::RId oAppRId = Add(pAppFile);
const OOX::RId oAppRId = Add(pAppFile);
//CCore
OOX::CCore* pCore = new OOX::CCore();
pCore->SetCreator(_T(""));
......@@ -181,7 +181,7 @@ namespace OOX
smart_ptr<OOX::File> pThemeFile(pTheme);
m_pWorkbook->Add(pThemeFile);
//SharedStrings
if(NULL != m_pSharedStrings && m_pSharedStrings->m_arrItems.GetSize() > 0)
if(NULL != m_pSharedStrings && m_pSharedStrings->m_arrItems.size() > 0)
{
smart_ptr<OOX::File> pSharedStringsFile(m_pSharedStrings);
bDeleteSharedStrings = false;
......@@ -282,7 +282,7 @@ namespace OOX
pWorkbookView->m_oWindowWidth->SetValue(27795);
pWorkbookView->m_oWindowHeight.Init();
pWorkbookView->m_oWindowHeight->SetValue(12585);
m_pWorkbook->m_oBookViews->m_arrItems.Add(pWorkbookView);
m_pWorkbook->m_oBookViews->m_arrItems.push_back(pWorkbookView);
}
// sheet,
if(0 == m_aWorksheets.GetCount())
......@@ -297,7 +297,7 @@ namespace OOX
pSheetView->m_oTabSelected->FromBool(true);
pSheetView->m_oWorkbookViewId.Init();
pSheetView->m_oWorkbookViewId->SetValue(0);
pWorksheet->m_oSheetViews->m_arrItems.Add(pSheetView);
pWorksheet->m_oSheetViews->m_arrItems.push_back(pSheetView);
pWorksheet->m_oSheetFormatPr.Init();
pWorksheet->m_oSheetFormatPr->m_oDefaultRowHeight.Init();
pWorksheet->m_oSheetFormatPr->m_oDefaultRowHeight->SetValue(15);
......@@ -325,7 +325,7 @@ namespace OOX
pSheet->m_oSheetId->SetValue(1);
pSheet->m_oRid.Init();
pSheet->m_oRid->SetValue(oRId.ToString());
m_pWorkbook->m_oSheets->m_arrItems.Add(pSheet);
m_pWorkbook->m_oSheets->m_arrItems.push_back(pSheet);
}
// font
if(NULL != m_pStyles )
......@@ -333,7 +333,7 @@ namespace OOX
//Fonts
if(false == m_pStyles->m_oFonts.IsInit())
m_pStyles->m_oFonts.Init();
if(m_pStyles->m_oFonts->m_arrItems.GetSize() == 0)
if(m_pStyles->m_oFonts->m_arrItems.size() == 0)
m_pStyles->m_oFonts->AddFont(new OOX::Spreadsheet::CFont());
OOX::Spreadsheet::CFont* pFont = m_pStyles->m_oFonts->m_arrItems[0];
if(false == pFont->m_oRFont.IsInit())
......@@ -350,8 +350,8 @@ namespace OOX
//Fills
if(false == m_pStyles->m_oFills.IsInit())
m_pStyles->m_oFills.Init();
if(m_pStyles->m_oFills->m_arrItems.GetSize() == 0)
m_pStyles->m_oFills->m_arrItems.Add(new OOX::Spreadsheet::CFill());
if(m_pStyles->m_oFills->m_arrItems.size() == 0)
m_pStyles->m_oFills->m_arrItems.push_back(new OOX::Spreadsheet::CFill());
OOX::Spreadsheet::CFill* pFill = m_pStyles->m_oFills->m_arrItems[0];
if(false == pFill->m_oGradientFill.IsInit())
{
......@@ -363,14 +363,14 @@ namespace OOX
}
if(false == m_pStyles->m_oBorders.IsInit())
m_pStyles->m_oBorders.Init();
if(m_pStyles->m_oBorders->m_arrItems.GetSize() == 0)
m_pStyles->m_oBorders->m_arrItems.Add(new OOX::Spreadsheet::CBorder());
if(m_pStyles->m_oBorders->m_arrItems.size() == 0)
m_pStyles->m_oBorders->m_arrItems.push_back(new OOX::Spreadsheet::CBorder());
//Xfs
if(false == m_pStyles->m_oCellXfs.IsInit())
m_pStyles->m_oCellXfs.Init();
if(m_pStyles->m_oCellXfs->m_arrItems.GetSize() == 0)
m_pStyles->m_oCellXfs->m_arrItems.Add(new OOX::Spreadsheet::CXfs());
if(m_pStyles->m_oCellXfs->m_arrItems.size() == 0)
m_pStyles->m_oCellXfs->m_arrItems.push_back(new OOX::Spreadsheet::CXfs());
OOX::Spreadsheet::CXfs* pXfs = m_pStyles->m_oCellXfs->m_arrItems[0];
if(false == pXfs->m_oBorderId.IsInit())
......@@ -408,12 +408,12 @@ namespace OOX
{
if(pWorksheet->m_oSheetData.IsInit())
{
CSimpleArray<OOX::Spreadsheet::CRow*>& aRows = pWorksheet->m_oSheetData->m_arrItems;
for(int i = 0, length = aRows.GetSize(); i < length; ++i)
std::vector<OOX::Spreadsheet::CRow*>& aRows = pWorksheet->m_oSheetData->m_arrItems;
for(unsigned int i = 0, length = aRows.size(); i < length; ++i)
{
OOX::Spreadsheet::CRow* pRow = aRows[i];
CSimpleArray<OOX::Spreadsheet::CCell*>& aCells = pRow->m_arrItems;
for(int j = 0, length2 = aCells.GetSize(); j < length2; ++j)
std::vector<OOX::Spreadsheet::CCell*> & aCells = pRow->m_arrItems;
for(unsigned int j = 0, length2 = aCells.size(); j < length2; ++j)
{
OOX::Spreadsheet::CCell* pCell = aCells[j];
if(pCell->m_oType.IsInit())
......@@ -447,7 +447,7 @@ namespace OOX
CSi* pSi = new CSi();
CText* pText = new CText();
pText->m_sText = sValue;
pSi->m_arrItems.Add(pText);
pSi->m_arrItems.push_back(pText);
int nIndex = pSharedStrings->AddSi(pSi);
//
pCell->m_oValue.Init();
......
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