mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
CAtlMap -> std::map
git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@58805 954022d7-b5bf-4e40-9824-e11837661b57
This commit is contained in:
committed by
Alexander Trofimov
parent
05c580cda0
commit
b7d2066669
@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <atlbase.h>
|
||||
#include <atlcom.h>
|
||||
#include <atlwin.h>
|
||||
@ -7,8 +8,13 @@
|
||||
#include <atlctl.h>
|
||||
#include <atlhost.h>
|
||||
#include <atlcoll.h>
|
||||
#else
|
||||
#include "../../Common/DocxFormat/Source/Base/ASCString.h"
|
||||
#include "../../DesktopEditor/common/Types.h"
|
||||
#endif
|
||||
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
#define MAX_STACK_SIZE 1024
|
||||
|
||||
@ -55,22 +61,22 @@ namespace NSBinPptxRW
|
||||
LONG m_lThemeIndex;
|
||||
CStringA m_strImageBase64;
|
||||
|
||||
CAtlArray<LONG> m_arLayoutIndexes;
|
||||
CAtlArray<CStringA> m_arLayoutImagesBase64;
|
||||
std::vector<LONG> m_arLayoutIndexes;
|
||||
std::vector<CStringA> m_arLayoutImagesBase64;
|
||||
};
|
||||
|
||||
class CCommonWriter
|
||||
{
|
||||
public:
|
||||
CAtlMap<size_t, LONG> themes;
|
||||
CAtlMap<size_t, LONG> slideMasters;
|
||||
CAtlMap<size_t, LONG> slides;
|
||||
CAtlMap<size_t, LONG> layouts;
|
||||
CAtlMap<size_t, LONG> notes;
|
||||
CAtlMap<size_t, LONG> notesMasters;
|
||||
std::map<size_t, LONG> themes;
|
||||
std::map<size_t, LONG> slideMasters;
|
||||
std::map<size_t, LONG> slides;
|
||||
std::map<size_t, LONG> layouts;
|
||||
std::map<size_t, LONG> notes;
|
||||
std::map<size_t, LONG> notesMasters;
|
||||
|
||||
CAtlArray<CMasterSlideInfo> m_oRels;
|
||||
CAtlArray<LONG> m_oSlide_Layout_Rels;
|
||||
std::vector<CMasterSlideInfo> m_oRels;
|
||||
std::vector<LONG> m_oSlide_Layout_Rels;
|
||||
|
||||
NSShapeImageGen::CImageManager* m_pImageManager;
|
||||
|
||||
@ -92,7 +98,7 @@ namespace NSBinPptxRW
|
||||
class CImageManager2
|
||||
{
|
||||
private:
|
||||
CAtlMap<CString, CString> m_mapImages;
|
||||
std::map<CString, CString> m_mapImages;
|
||||
LONG m_lIndexNextImage;
|
||||
CString m_strDstMedia;
|
||||
|
||||
@ -114,17 +120,14 @@ namespace NSBinPptxRW
|
||||
pWriter->WriteINT(m_lIndexNextImage);
|
||||
pWriter->WriteString(m_strDstMedia);
|
||||
|
||||
int lCount = (int)m_mapImages.GetCount();
|
||||
int lCount = (int)m_mapImages.size();
|
||||
pWriter->WriteINT(lCount);
|
||||
|
||||
POSITION pos = m_mapImages.GetStartPosition();
|
||||
while (NULL != pos)
|
||||
{
|
||||
CAtlMap<CString, CString>::CPair* pPair = m_mapImages.GetNext(pos);
|
||||
|
||||
pWriter->WriteString(pPair->m_key);
|
||||
pWriter->WriteString(pPair->m_value);
|
||||
}
|
||||
for (std::map<CString, CString>::const_iterator pPair = m_mapImages.begin(); pPair != m_mapImages.end(); ++pPair)
|
||||
{
|
||||
pWriter->WriteString(pPairfirst);
|
||||
pWriter->WriteString(pPair->second);
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
@ -470,4 +473,4 @@ namespace NSBinPptxRW
|
||||
void Deserialize(NSBinPptxRW::CImageManager2* pManager, LPSAFEARRAY pArray);
|
||||
void Deserialize(NSShapeImageGen::CImageManager* pManager, LPSAFEARRAY pArray);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#pragma once
|
||||
#include "../stdafx.h"
|
||||
//#include "../stdafx.h"
|
||||
#include "../../Common/DocxFormat/Source/SystemUtility/File.h"
|
||||
#include "BinReaderWriterDefines.h"
|
||||
#include "FontCutter.h"
|
||||
@ -164,4 +164,4 @@ public:
|
||||
{
|
||||
return &m_oPicker.m_oEmbeddedFonts;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
#include "DocxFormat/ContentTypes/File.h"
|
||||
#include "DocxFormat/FileType.h"
|
||||
#include "DocxFormat/FileTypes.h"
|
||||
#include "DocxFormat/External/Hyperlink.h"
|
||||
#include "DocxFormat/External/HyperLink.h"
|
||||
#include "WrapperFile.h"
|
||||
|
||||
#include <map>
|
||||
@ -43,7 +43,7 @@ namespace PPTX
|
||||
const PPTX::Rels::RelationShip* pRelation = &(rels.Relations.m_items[i]);
|
||||
OOX::CPath normPath = path / pRelation->target();
|
||||
|
||||
CAtlMap<CString, smart_ptr<PPTX::File>>::CPair* pPair = map.find(normPath);
|
||||
std::map<CString, smart_ptr<PPTX::File>>::const_iterator pPair = map.find(normPath);
|
||||
|
||||
if (bIsSlide && (pRelation->type() == PPTX::FileTypes::Slide))
|
||||
{
|
||||
@ -62,9 +62,9 @@ namespace PPTX
|
||||
}
|
||||
else
|
||||
{
|
||||
if (NULL != pPair)
|
||||
if (pPair != map.m_map.end())
|
||||
{
|
||||
add(pRelation->rId(), pPair->m_value);
|
||||
add(pRelation->rId(), pPair->second);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -191,4 +191,4 @@ namespace PPTX
|
||||
OOX::CPath path = filename.GetDirectory();
|
||||
_read(rels, path);
|
||||
}
|
||||
} // namespace PPTX
|
||||
} // namespace PPTX
|
||||
|
||||
@ -3,6 +3,9 @@
|
||||
#define PPTX_FILEMAP_INCLUDE_H_
|
||||
|
||||
#include "DocxFormat/File.h"
|
||||
|
||||
#include <map>
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
class FileMap
|
||||
@ -16,23 +19,24 @@ namespace PPTX
|
||||
{
|
||||
}
|
||||
public:
|
||||
CAtlMap<CString, smart_ptr<PPTX::File>> m_map;
|
||||
|
||||
std::map<CString, smart_ptr<PPTX::File>> m_map;
|
||||
|
||||
public:
|
||||
|
||||
AVSINLINE CAtlMap<CString, smart_ptr<PPTX::File>>::CPair* find(const OOX::CPath& path)
|
||||
AVSINLINE std::map<CString, smart_ptr<PPTX::File>>::const_iterator find(const OOX::CPath& path)
|
||||
{
|
||||
return m_map.Lookup(path.m_strFilename);
|
||||
return m_map.find(path.m_strFilename);
|
||||
}
|
||||
|
||||
AVSINLINE void add(const OOX::CPath& key, const smart_ptr<PPTX::File>& value)
|
||||
{
|
||||
m_map.SetAt(key.m_strFilename, value);
|
||||
m_map[key.m_strFilename] = value;
|
||||
}
|
||||
|
||||
AVSINLINE bool empty() const {return m_map.IsEmpty();}
|
||||
AVSINLINE size_t size() const {return m_map.GetCount();}
|
||||
AVSINLINE bool empty() const {return m_map.empty();}
|
||||
AVSINLINE size_t size() const {return m_map.size();}
|
||||
};
|
||||
} // namespace PPTX
|
||||
|
||||
#endif // PPTX_FILEMAP_INCLUDE_H_
|
||||
#endif // PPTX_FILEMAP_INCLUDE_H_
|
||||
|
||||
@ -11,6 +11,8 @@
|
||||
#include "Slide.h"
|
||||
#include "NotesMaster.h"
|
||||
|
||||
#include <map>
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
Folder::Folder()
|
||||
@ -41,75 +43,68 @@ namespace PPTX
|
||||
_presentation->commentAuthors = _presentation->get(PPTX::FileTypes::CommentAuthors).smart_dynamic_cast<PPTX::Authors>();
|
||||
}
|
||||
|
||||
pos = map.m_map.GetStartPosition();
|
||||
while (NULL != pos)
|
||||
{
|
||||
CAtlMap<CString, smart_ptr<PPTX::File>>::CPair* pPair = map.m_map.GetNext(pos);
|
||||
const PPTX::FileType& curType = pPair->m_value->type();
|
||||
for (std::map<CString, smart_ptr<PPTX::File>>::const_iterator pPair = map.m_map.begin(); pPair != map.m_map.end(); ++pPair)
|
||||
{
|
||||
const PPTX::FileType& curType = pPair->second->type();
|
||||
|
||||
if (PPTX::FileTypes::ThemePPTX == curType)
|
||||
{
|
||||
smart_ptr<PPTX::Theme> pTheme = pPair->m_value.smart_dynamic_cast<PPTX::Theme>();
|
||||
if (pTheme.IsInit())
|
||||
pTheme->Presentation = _presentation;
|
||||
}
|
||||
}
|
||||
if (PPTX::FileTypes::ThemePPTX == curType)
|
||||
{
|
||||
smart_ptr<PPTX::Theme> pTheme = pPair->second.smart_dynamic_cast<PPTX::Theme>();
|
||||
if (pTheme.IsInit())
|
||||
pTheme->Presentation = _presentation;
|
||||
}
|
||||
}
|
||||
|
||||
pos = map.m_map.GetStartPosition();
|
||||
while (NULL != pos)
|
||||
{
|
||||
CAtlMap<CString, smart_ptr<PPTX::File>>::CPair* pPair = map.m_map.GetNext(pos);
|
||||
const PPTX::FileType& curType = pPair->m_value->type();
|
||||
for (std::map<CString, smart_ptr<PPTX::File>>::const_iterator pPair = map.m_map.begin(); pPair != map.m_map.end(); ++pPair)
|
||||
{
|
||||
const PPTX::FileType& curType = pPair->second->type();
|
||||
|
||||
if (PPTX::FileTypes::SlideMaster == curType)
|
||||
{
|
||||
smart_ptr<PPTX::SlideMaster> pointer = pPair->m_value.smart_dynamic_cast<PPTX::SlideMaster>();
|
||||
if (pointer.is_init())
|
||||
pointer->ApplyRels();
|
||||
}
|
||||
}
|
||||
if (PPTX::FileTypes::SlideMaster == curType)
|
||||
{
|
||||
smart_ptr<PPTX::SlideMaster> pointer = pPair->second.smart_dynamic_cast<PPTX::SlideMaster>();
|
||||
if (pointer.is_init())
|
||||
pointer->ApplyRels();
|
||||
}
|
||||
|
||||
pos = map.m_map.GetStartPosition();
|
||||
while (NULL != pos)
|
||||
{
|
||||
CAtlMap<CString, smart_ptr<PPTX::File>>::CPair* pPair = map.m_map.GetNext(pos);
|
||||
const PPTX::FileType& curType = pPair->m_value->type();
|
||||
}
|
||||
|
||||
if (PPTX::FileTypes::SlideLayout == curType)
|
||||
{
|
||||
smart_ptr<PPTX::SlideLayout> pointer = pPair->m_value.smart_dynamic_cast<PPTX::SlideLayout>();
|
||||
if (pointer.is_init())
|
||||
pointer->ApplyRels();
|
||||
}
|
||||
}
|
||||
|
||||
pos = map.m_map.GetStartPosition();
|
||||
while (NULL != pos)
|
||||
{
|
||||
CAtlMap<CString, smart_ptr<PPTX::File>>::CPair* pPair = map.m_map.GetNext(pos);
|
||||
const PPTX::FileType& curType = pPair->m_value->type();
|
||||
for (std::map<CString, smart_ptr<PPTX::File>>::const_iterator pPair = map.m_map.begin(); pPair != map.m_map.end(); ++pPair)
|
||||
{
|
||||
const PPTX::FileType& curType = pPair->second->type();
|
||||
|
||||
if (PPTX::FileTypes::Slide == curType)
|
||||
{
|
||||
smart_ptr<PPTX::Slide> pointer = pPair->m_value.smart_dynamic_cast<PPTX::Slide>();
|
||||
if (pointer.is_init())
|
||||
pointer->ApplyRels();
|
||||
}
|
||||
}
|
||||
if (PPTX::FileTypes::SlideLayout == curType)
|
||||
{
|
||||
smart_ptr<PPTX::SlideLayout> pointer = pPair->second.smart_dynamic_cast<PPTX::SlideLayout>();
|
||||
if (pointer.is_init())
|
||||
pointer->ApplyRels();
|
||||
}
|
||||
|
||||
pos = map.m_map.GetStartPosition();
|
||||
while (NULL != pos)
|
||||
{
|
||||
CAtlMap<CString, smart_ptr<PPTX::File>>::CPair* pPair = map.m_map.GetNext(pos);
|
||||
const PPTX::FileType& curType = pPair->m_value->type();
|
||||
}
|
||||
|
||||
if (PPTX::FileTypes::NotesMaster == curType)
|
||||
{
|
||||
smart_ptr<PPTX::NotesMaster> pointer = pPair->m_value.smart_dynamic_cast<PPTX::NotesMaster>();
|
||||
if (pointer.is_init())
|
||||
pointer->ApplyRels();
|
||||
}
|
||||
}
|
||||
for (std::map<CString, smart_ptr<PPTX::File>>::const_iterator pPair = map.m_map.begin(); pPair != map.m_map.end(); ++pPair)
|
||||
{
|
||||
const PPTX::FileType& curType = pPair->second->type();
|
||||
|
||||
if (PPTX::FileTypes::Slide == curType)
|
||||
{
|
||||
smart_ptr<PPTX::Slide> pointer = pPair->second.smart_dynamic_cast<PPTX::Slide>();
|
||||
if (pointer.is_init())
|
||||
pointer->ApplyRels();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (std::map<CString, smart_ptr<PPTX::File>>::const_iterator pPair = map.m_map.begin(); pPair != map.m_map.end(); ++pPair)
|
||||
{
|
||||
const PPTX::FileType& curType = pPair->second->type();
|
||||
if (PPTX::FileTypes::NotesMaster == curType)
|
||||
{
|
||||
smart_ptr<PPTX::NotesMaster> pointer = pPair->second.smart_dynamic_cast<PPTX::NotesMaster>();
|
||||
if (pointer.is_init())
|
||||
pointer->ApplyRels();
|
||||
}
|
||||
}
|
||||
|
||||
Event->Progress(0, 1000000);
|
||||
}
|
||||
@ -155,4 +150,4 @@ namespace PPTX
|
||||
{
|
||||
return OOX::CSystemUtility::GetFilesCount(path.GetDirectory(), true);
|
||||
}
|
||||
} // namespace PPTX
|
||||
} // namespace PPTX
|
||||
|
||||
@ -4,6 +4,10 @@
|
||||
|
||||
#include "../../../Common/DocxFormat/Source/Base/Base.h"
|
||||
|
||||
#ifndef _WIN32
|
||||
#include "../../../DesktopEditor/common/Types.h"
|
||||
#endif
|
||||
|
||||
#define _USE_STRING_OPERATOR \
|
||||
virtual void operator=(const CString& value) \
|
||||
{ \
|
||||
@ -71,4 +75,4 @@ namespace PPTX
|
||||
} // namespace Limit
|
||||
} // namespace PPTX
|
||||
|
||||
#endif // PPTX_LIMIT_BASE_INCLUDE_H_
|
||||
#endif // PPTX_LIMIT_BASE_INCLUDE_H_
|
||||
|
||||
@ -3,6 +3,9 @@
|
||||
#define PPTX_LIMIT_SCHEMECLRVAL_INCLUDE_H_
|
||||
|
||||
#include "BaseLimit.h"
|
||||
#ifndef _WIN32
|
||||
#include "../../../DesktopEditor/common/Types.h"
|
||||
#endif
|
||||
|
||||
|
||||
namespace PPTX
|
||||
@ -90,4 +93,4 @@ namespace PPTX
|
||||
} // namespace Limit
|
||||
} // namespace PPTX
|
||||
|
||||
#endif // PPTX_LIMIT_SCHEMECLRVAL_INCLUDE_H_
|
||||
#endif // PPTX_LIMIT_SCHEMECLRVAL_INCLUDE_H_
|
||||
|
||||
@ -3,14 +3,14 @@
|
||||
#define PPTX_LOGIC_EFFECTLST_INCLUDE_H_
|
||||
|
||||
#include "./../WrapperWritingElement.h"
|
||||
#include "Effects\Blur.h"
|
||||
#include "Effects\Glow.h"
|
||||
#include "Effects\OuterShdw.h"
|
||||
#include "Effects\PrstShdw.h"
|
||||
#include "Effects\InnerShdw.h"
|
||||
#include "Effects\Reflection.h"
|
||||
#include "Effects\SoftEdge.h"
|
||||
#include "Effects\FillOverlay.h"
|
||||
#include "Effects/Blur.h"
|
||||
#include "Effects/Glow.h"
|
||||
#include "Effects/OuterShdw.h"
|
||||
#include "Effects/PrstShdw.h"
|
||||
#include "Effects/InnerShdw.h"
|
||||
#include "Effects/Reflection.h"
|
||||
#include "Effects/SoftEdge.h"
|
||||
#include "Effects/FillOverlay.h"
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
@ -120,4 +120,4 @@ namespace PPTX
|
||||
} // namespace Logic
|
||||
} // namespace PPTX
|
||||
|
||||
#endif // PPTX_LOGIC_EFFECTLST_INCLUDE_H_
|
||||
#endif // PPTX_LOGIC_EFFECTLST_INCLUDE_H_
|
||||
|
||||
@ -15,6 +15,9 @@ DEFINES += UNICODE _UNICODE _USE_LIBXML2_READER_ _LINUX_QT _USE_XMLLITE_READER_
|
||||
INCLUDEPATH += \
|
||||
/usr/include/libxml2
|
||||
|
||||
INCLUDEPATH += \
|
||||
../../../../DesktopEditor/freetype-2.5.2/include
|
||||
|
||||
SOURCES += pptxformatlib.cpp \
|
||||
../../../PPTXFormat/DocxFormat/IFileContainer.cpp \
|
||||
../../../PPTXFormat/Logic/Colors/SchemeClr.cpp \
|
||||
@ -52,7 +55,9 @@ SOURCES += pptxformatlib.cpp \
|
||||
../../../PPTXFormat/FileContainer.cpp \
|
||||
../../../PPTXFormat/FileFactory.cpp \
|
||||
../../../PPTXFormat/FileMap.cpp \
|
||||
../../../PPTXFormat/Folder.cpp
|
||||
../../../PPTXFormat/Folder.cpp \
|
||||
../../../Editor/BinaryFileReaderWriter.cpp \
|
||||
../../../Editor/FontPicker.cpp
|
||||
|
||||
HEADERS += pptxformatlib.h \
|
||||
../../../PPTXFormat/DocxFormat/ContentTypes/Default.h \
|
||||
@ -453,7 +458,18 @@ HEADERS += pptxformatlib.h \
|
||||
../../../PPTXFormat/ViewProps.h \
|
||||
../../../PPTXFormat/VmlDrawing.h \
|
||||
../../../PPTXFormat/WrapperFile.h \
|
||||
../../../PPTXFormat/WrapperWritingElement.h
|
||||
../../../PPTXFormat/WrapperWritingElement.h \
|
||||
../../../Editor/BinaryFileReaderWriter.h \
|
||||
../../../Editor/BinReaderWriterDefines.h \
|
||||
../../../Editor/BinWriters.h \
|
||||
../../../Editor/CalculatorCRC32.h \
|
||||
../../../Editor/Converter.h \
|
||||
../../../Editor/FontCutter.h \
|
||||
../../../Editor/FontPicker.h \
|
||||
../../../Editor/imagemanager.h \
|
||||
../../../Editor/PPTXWriter.h \
|
||||
../../../Editor/WMFToImageConverter.h \
|
||||
../../../Editor/XmlWriter.h
|
||||
unix {
|
||||
target.path = /usr/lib
|
||||
INSTALLS += target
|
||||
|
||||
@ -36,6 +36,7 @@
|
||||
// turns off ATL's hiding of some common and often safely ignored warning messages
|
||||
#define _ATL_ALL_WARNINGS
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <atlbase.h>
|
||||
#include <atlcom.h>
|
||||
#include <atlwin.h>
|
||||
@ -45,9 +46,13 @@
|
||||
#include <atlcoll.h>
|
||||
#include "../Common/atldefine.h"
|
||||
|
||||
|
||||
#include <wingdi.h>
|
||||
|
||||
|
||||
|
||||
//#define _USE_MATH_DEFINES
|
||||
#include <math.h>
|
||||
#include <wingdi.h>
|
||||
|
||||
//#define NODOCX
|
||||
//#define PPTX_DEF
|
||||
@ -64,6 +69,8 @@ using namespace ATL;
|
||||
//#import "../Redist/ASCOfficeDocxFile2.dll" named_guids raw_interfaces_only rename_namespace("DocxFile2")
|
||||
//#import "../Redist/XlsxSerializerCom.dll" named_guids raw_interfaces_only rename_namespace("XlsxCom"), exclude("_IAVSOfficeFileTemplateEvents"), exclude("_IAVSOfficeFileTemplateEvents2")
|
||||
|
||||
|
||||
|
||||
#ifdef BUILD_CONFIG_OPENSOURCE_VERSION
|
||||
|
||||
#import "../Redist/OfficeCore.dll" named_guids raw_interfaces_only rename_namespace("OfficeCore")
|
||||
@ -93,4 +100,6 @@ namespace ASCGraphics
|
||||
//#import "../Redist/ASCGraphics.dll" named_guids raw_interfaces_only rename_namespace("ASCGraphics")
|
||||
#import "../Redist/ASCFontConverter.dll" named_guids raw_interfaces_only rename_namespace("Fonts")
|
||||
|
||||
#endif
|
||||
#endif // #ifdef _WIN32
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user