Commit 1c811dde 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@58810 954022d7-b5bf-4e40-9824-e11837661b57
parent e870c71a
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
#include "../../Common/Base64.h" #include "../../Common/Base64.h"
#include "../../Common/DocxFormat/Source/Base/Nullable.h" #include "../../Common/DocxFormat/Source/Base/Nullable.h"
#include <map>
namespace NSFontCutter namespace NSFontCutter
{ {
class CEmbeddedFontsManager class CEmbeddedFontsManager
...@@ -70,8 +72,8 @@ namespace NSFontCutter ...@@ -70,8 +72,8 @@ namespace NSFontCutter
} }
}; };
CAtlMap<CString, CEmbeddedFontInfo> m_mapFontsEmbeddded; std::map<CString, CEmbeddedFontInfo> m_mapFontsEmbeddded;
CAtlMap<WCHAR, BOOL> m_CharMap; std::map<WCHAR, BOOL> m_CharMap;
public: public:
CString m_strEmbeddedFontsFolder; CString m_strEmbeddedFontsFolder;
...@@ -84,8 +86,8 @@ namespace NSFontCutter ...@@ -84,8 +86,8 @@ namespace NSFontCutter
void CheckFont(const CString& strName, CFontManager* pManager) void CheckFont(const CString& strName, CFontManager* pManager)
{ {
CAtlMap<CString, CEmbeddedFontInfo>::CPair* pPair = m_mapFontsEmbeddded.Lookup(strName); std::map<CString, CEmbeddedFontInfo>::const_iterator pPair = m_mapFontsEmbeddded.find(strName);
if (NULL != pPair) if (pPair != m_mapFontsEmbeddded.end())
return; return;
CEmbeddedFontInfo oInfo; CEmbeddedFontInfo oInfo;
...@@ -117,7 +119,7 @@ namespace NSFontCutter ...@@ -117,7 +119,7 @@ namespace NSFontCutter
} }
} }
m_mapFontsEmbeddded.SetAt(strName, oInfo); m_mapFontsEmbeddded [strName] = oInfo;
} }
void CheckString(const nullable_string& val) void CheckString(const nullable_string& val)
...@@ -143,8 +145,8 @@ namespace NSFontCutter ...@@ -143,8 +145,8 @@ namespace NSFontCutter
for (int i = 0; i < len; ++i) for (int i = 0; i < len; ++i)
{ {
m_CharMap.SetAt(ch1[i], TRUE); m_CharMap [ch1[i]] = TRUE;
m_CharMap.SetAt(ch2[i], TRUE); m_CharMap [ch2[i]] = TRUE;
} }
RELEASEARRAYOBJECTS(pCBuf1); RELEASEARRAYOBJECTS(pCBuf1);
...@@ -319,17 +321,17 @@ namespace NSFontCutter ...@@ -319,17 +321,17 @@ namespace NSFontCutter
{ {
// . - // . -
CheckString(_T("0123456789")); CheckString(_T("0123456789"));
m_CharMap.SetAt((WCHAR)0x00B0, TRUE); m_CharMap [(WCHAR)0x00B0] = TRUE;
m_CharMap.SetAt((WCHAR)0x00B7, TRUE); m_CharMap [(WCHAR)0x00B7] = TRUE;
m_CharMap.SetAt((WCHAR)0x00B6, TRUE); m_CharMap [(WCHAR)0x00B6] = TRUE;
m_CharMap.SetAt((WCHAR)0x00A4, TRUE); m_CharMap [(WCHAR)0x00A4] = TRUE;
m_CharMap.SetAt((WCHAR)0x00A0, TRUE); m_CharMap [(WCHAR)0x00A0] = TRUE;
m_CharMap.SetAt((WCHAR)0x0022, TRUE); m_CharMap [(WCHAR)0x0022] = TRUE;
m_CharMap.SetAt((WCHAR)0x0032, TRUE); m_CharMap [(WCHAR)0x0032] = TRUE;
m_CharMap.SetAt((WCHAR)0x0038, TRUE); m_CharMap [(WCHAR)0x0038] = TRUE;
m_CharMap.SetAt((WCHAR)0x0097, TRUE); m_CharMap [(WCHAR)0x0097] = TRUE;
ULONG nCount = (ULONG)m_CharMap.GetCount(); ULONG nCount = (ULONG)m_CharMap.size();
SAFEARRAYBOUND rgsab; SAFEARRAYBOUND rgsab;
rgsab.lLbound = 0; rgsab.lLbound = 0;
...@@ -338,11 +340,9 @@ namespace NSFontCutter ...@@ -338,11 +340,9 @@ namespace NSFontCutter
SAFEARRAY* pArray = SafeArrayCreate(VT_UI2, 1, &rgsab); SAFEARRAY* pArray = SafeArrayCreate(VT_UI2, 1, &rgsab);
USHORT* pBuffer = (USHORT*)(pArray->pvData); USHORT* pBuffer = (USHORT*)(pArray->pvData);
POSITION pos = m_CharMap.GetStartPosition(); for (std::map<WCHAR, BOOL>::const_iterator pPair = m_CharMap.begin(); pPair != m_CharMap.end(); ++pPair)
while (NULL != pos)
{ {
CAtlMap<WCHAR, BOOL>::CPair* pPair = m_CharMap.GetNext(pos); *pBuffer = pPair->first;
*pBuffer = pPair->m_key;
++pBuffer; ++pBuffer;
} }
return pArray; return pArray;
......
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