void DocXDocumentStore::GetDocumentTexts(const CStdString& sFileName, std::vector<std::string>& vDocumentTexts) const { vDocumentTexts.clear(); CZipArchive zipArchive; zipArchive.Open(sFileName, CZipArchive::zipOpenReadOnly); if( !zipArchive.IsClosed() ) { CZipWordArray ar; zipArchive.FindMatches( L"word\\\\*.xml", ar ); for( int uIndex = 0; uIndex < ar.GetSize(); uIndex++ ) { CZipFileHeader fhInfo; if( zipArchive.GetFileInfo( fhInfo, ar[uIndex] ) ) { const CZipString fileName( fhInfo.GetFileName() ); if( fileName.find_first_of( '\\' ) == fileName.find_last_of( '\\' ) ) { C2007DocFile mf; zipArchive.ExtractFile( ar[uIndex], mf ); const CStdStringA sDocText = mf.GetWTInnerText(); if( sDocText.size() > 0 ) vDocumentTexts.push_back( sDocText ); } } } zipArchive.Flush(); zipArchive.Close(); } }