Commit 8e9e2d4f authored by Ivan.Shulga's avatar Ivan.Shulga Committed by Alexander Trofimov

CAtlMap -> std::map

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@58343 954022d7-b5bf-4e40-9824-e11837661b57
parent 801427a7
...@@ -1705,15 +1705,14 @@ namespace BinXlsxRW { ...@@ -1705,15 +1705,14 @@ namespace BinXlsxRW {
m_oBcw.WriteItemWithLengthEnd(nCurPos); m_oBcw.WriteItemWithLengthEnd(nCurPos);
} }
//Comments //Comments
if(oWorksheet.m_mapComments.GetCount() > 0) if(oWorksheet.m_mapComments.size() > 0)
{ {
bool bIsEmpty = true; bool bIsEmpty = true;
int nCurPos = 0; int nCurPos = 0;
POSITION pos = oWorksheet.m_mapComments.GetStartPosition();
while ( NULL != pos ) for (std::map<CString, OOX::Spreadsheet::CCommentItem*>::const_iterator it = oWorksheet.m_mapComments.begin(); it != oWorksheet.m_mapComments.end(); ++it)
{ {
CAtlMap<CString, OOX::Spreadsheet::CCommentItem*>::CPair* pPair = oWorksheet.m_mapComments.GetNext( pos ); if(it->second->IsValid())
if(pPair->m_value->IsValid())
{ {
bIsEmpty = false; bIsEmpty = false;
break; break;
...@@ -2475,16 +2474,15 @@ namespace BinXlsxRW { ...@@ -2475,16 +2474,15 @@ namespace BinXlsxRW {
} }
} }
}; };
void WriteComments(CAtlMap<CString, OOX::Spreadsheet::CCommentItem*>& mapComments) void WriteComments(std::map<CString, OOX::Spreadsheet::CCommentItem*>& mapComments)
{ {
int nCurPos = 0; int nCurPos = 0;
POSITION pos = mapComments.GetStartPosition();
while ( NULL != pos ) for (std::map<CString, OOX::Spreadsheet::CCommentItem*>::const_iterator it = mapComments.begin(); it != mapComments.end(); ++it)
{ {
CAtlMap<CString, OOX::Spreadsheet::CCommentItem*>::CPair* pPair = mapComments.GetNext( pos ); if(it->second->IsValid())
if(pPair->m_value->IsValid())
{ {
OOX::Spreadsheet::CCommentItem& oComment = *pPair->m_value; OOX::Spreadsheet::CCommentItem& oComment = *it->second;
std::vector<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);
......
...@@ -1555,7 +1555,7 @@ namespace BinXlsxRW { ...@@ -1555,7 +1555,7 @@ namespace BinXlsxRW {
if(NULL != m_pCurWorksheet && pNewComment->IsValid()) if(NULL != m_pCurWorksheet && pNewComment->IsValid())
{ {
CString sId;sId.Format(_T("%d-%d"), pNewComment->m_nRow.get(), pNewComment->m_nCol.get()); CString sId;sId.Format(_T("%d-%d"), pNewComment->m_nRow.get(), pNewComment->m_nCol.get());
m_pCurWorksheet->m_mapComments.SetAt(sId, pNewComment); m_pCurWorksheet->m_mapComments [sId] = pNewComment;
} }
else else
RELEASEOBJECT(pNewComment); RELEASEOBJECT(pNewComment);
...@@ -1879,7 +1879,7 @@ namespace BinXlsxRW { ...@@ -1879,7 +1879,7 @@ namespace BinXlsxRW {
{ {
BinaryCommentReader oBinaryCommentReader(m_oBufferedStream, m_pCurWorksheet); BinaryCommentReader oBinaryCommentReader(m_oBufferedStream, m_pCurWorksheet);
oBinaryCommentReader.Read(length, poResult); oBinaryCommentReader.Read(length, poResult);
if(m_pCurWorksheet->m_mapComments.GetCount() > 0) if(m_pCurWorksheet->m_mapComments.size() > 0)
{ {
OOX::Spreadsheet::CLegacyDrawing* pLegacyDrawing = new OOX::Spreadsheet::CLegacyDrawing(); OOX::Spreadsheet::CLegacyDrawing* pLegacyDrawing = new OOX::Spreadsheet::CLegacyDrawing();
pLegacyDrawing->m_mapComments = &m_pCurWorksheet->m_mapComments; pLegacyDrawing->m_mapComments = &m_pCurWorksheet->m_mapComments;
...@@ -1896,13 +1896,11 @@ namespace BinXlsxRW { ...@@ -1896,13 +1896,11 @@ namespace BinXlsxRW {
pComments->m_oAuthors.Init(); pComments->m_oAuthors.Init();
std::vector<CString*>& aAuthors = pComments->m_oAuthors->m_arrItems; std::vector<CString*>& aAuthors = pComments->m_oAuthors->m_arrItems;
POSITION pos = m_pCurWorksheet->m_mapComments.GetStartPosition(); for (std::map<CString, OOX::Spreadsheet::CCommentItem*>::const_iterator it = m_pCurWorksheet->m_mapComments.begin(); it != m_pCurWorksheet->m_mapComments.end(); ++it)
while ( NULL != pos )
{ {
CAtlMap<CString, OOX::Spreadsheet::CCommentItem*>::CPair* pPair = m_pCurWorksheet->m_mapComments.GetNext( pos ); if(it->second->IsValid())
if(pPair->m_value->IsValid())
{ {
OOX::Spreadsheet::CCommentItem* pCommentItem = pPair->m_value; OOX::Spreadsheet::CCommentItem* pCommentItem = it->second;
OOX::Spreadsheet::CComment* pNewComment = new OOX::Spreadsheet::CComment(); OOX::Spreadsheet::CComment* pNewComment = new OOX::Spreadsheet::CComment();
if(pCommentItem->m_nRow.IsInit() && pCommentItem->m_nCol.IsInit()) if(pCommentItem->m_nRow.IsInit() && pCommentItem->m_nCol.IsInit())
{ {
......
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