Commit 64738338 authored by Sergey.Konovalov's avatar Sergey.Konovalov Committed by Alexander Trofimov

логика переместилась из описания com интерфейса в DocxSerializer, уход от "pragma once"

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@58088 954022d7-b5bf-4e40-9824-e11837661b57
parent cfe14287
......@@ -7,6 +7,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ASCOfficeDocxFile2", "ASCOf
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DocxFormat", "..\Common\DocxFormat\Projects\DocxFormat2005.vcproj", "{A100103A-353E-45E8-A9B8-90B87CC5C0B0}"
ProjectSection(ProjectDependencies) = postProject
{21663823-DE45-479B-91D0-B4FEF4916EF0} = {21663823-DE45-479B-91D0-B4FEF4916EF0}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libxml2", "..\Common\DocxFormat\Source\XML\libxml2\win_build\libxml2.vcproj", "{21663823-DE45-479B-91D0-B4FEF4916EF0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
......@@ -32,6 +37,14 @@ Global
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.ReleaseASC|Win32.Build.0 = Release|Win32
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.ReleaseOpenSource|Win32.ActiveCfg = ReleaseOpenSource|Win32
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.ReleaseOpenSource|Win32.Build.0 = ReleaseOpenSource|Win32
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Debug|Win32.ActiveCfg = Debug|Win32
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Debug|Win32.Build.0 = Debug|Win32
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Release|Win32.ActiveCfg = Release|Win32
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Release|Win32.Build.0 = Release|Win32
{21663823-DE45-479B-91D0-B4FEF4916EF0}.ReleaseASC|Win32.ActiveCfg = Release|Win32
{21663823-DE45-479B-91D0-B4FEF4916EF0}.ReleaseASC|Win32.Build.0 = Release|Win32
{21663823-DE45-479B-91D0-B4FEF4916EF0}.ReleaseOpenSource|Win32.ActiveCfg = Release|Win32
{21663823-DE45-479B-91D0-B4FEF4916EF0}.ReleaseOpenSource|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......
......@@ -54,11 +54,11 @@
AdditionalOptions="/Zm1000"
Optimization="0"
AdditionalIncludeDirectories=""$(SolutionDir)/../Common/DocxFormat/Source/XML/libxml2/XML/include";"$(SolutionDir)";"$(SolutionDir)/../../AVSImageStudio3/AVSGraphics/Objects";"$(SolutionDir)/../../AVSImageStudio3/AVSGraphics/Objects/Font/FreeType";"$(SolutionDir)/../Common/DocxFormat/Source/DocxFormat""
PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_USRDLL;_ATL_ATTRIBUTES;_USE_XMLLITE_READER_;USE_LITE_READER;USE_ATL_CSTRING;USE_AVSOFFICESTUDIO_XMLUTILS;SOLUTION_ASCOFFICEDOCXFILE2"
PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_USRDLL;_ATL_ATTRIBUTES;_USE_XMLLITE_READER_;USE_LITE_READER;USE_ATL_CSTRING;USE_AVSOFFICESTUDIO_XMLUTILS;SOLUTION_ASCOFFICEDOCXFILE2;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
......@@ -529,6 +529,14 @@
<Filter
Name="DocWrapper"
>
<File
RelativePath=".\DocWrapper\DocxSeializer.cpp"
>
</File>
<File
RelativePath=".\DocWrapper\DocxSerializer.h"
>
</File>
<File
RelativePath=".\DocWrapper\FontProcessor.cpp"
>
......
#pragma once
#ifndef CHART_WRITER
#define CHART_WRITER
#include "Common.h"
namespace Writers
......@@ -77,4 +79,5 @@ namespace Writers
nChartCount = val;
}
};
}
\ No newline at end of file
}
#endif // #ifndef CHART_WRITER
\ No newline at end of file
#pragma once
#ifndef COMMENTS_WRITER
#define COMMENTS_WRITER
#include "Common.h"
namespace Writers
......@@ -71,4 +73,5 @@ namespace Writers
}
}
};
}
\ No newline at end of file
}
#endif // #ifndef COMMENTS_WRITER
\ No newline at end of file
#pragma once
#ifndef BINREADER_COMMON
#define BINREADER_COMMON
......
#pragma once
#ifndef CONTENT_TYPES_WRITER
#define CONTENT_TYPES_WRITER
#include "Common.h"
namespace Writers
......@@ -40,4 +42,5 @@ namespace Writers
m_oAdditional.WriteString(sXml);
}
};
}
\ No newline at end of file
}
#endif // #ifndef CONTENT_TYPES_WRITER
\ No newline at end of file
#pragma once
#ifndef DOCUMENT_RELS_WRITER
#define DOCUMENT_RELS_WRITER
#include "Common.h"
namespace Writers
......@@ -59,4 +61,5 @@ namespace Writers
return srId;
}
};
}
\ No newline at end of file
}
#endif // #ifndef DOCUMENT_RELS_WRITER
\ No newline at end of file
#pragma once
#ifndef DOCUMENT_WRITER
#define DOCUMENT_WRITER
#include "Common.h"
#include "../BinWriter/BinReaderWriterDefines.h";
namespace Writers
......@@ -78,4 +80,5 @@ namespace Writers
return sResult;
}
};
}
\ No newline at end of file
}
#endif // #ifndef DOCUMENT_WRITER
\ No newline at end of file
#pragma once
#ifndef FILE_WRITER
#define FILE_WRITER
#include "NumberingWriter.h"
#include "FontTableWriter.h"
#include "HeaderFooterWriter.h"
......@@ -16,7 +18,7 @@ namespace Writers
public:
PPTXFile::IAVSOfficeDrawingConverter* m_pDrawingConverter;
LPSAFEARRAY m_pArray;
CString& m_sThemePath;
CString m_sThemePath;
bool m_bSaveChartAsImg;
ContentTypesWriter m_oContentTypesWriter;
FontTableWriter m_oFontTableWriter;
......@@ -30,7 +32,7 @@ namespace Writers
ChartWriter m_oChartWriter;
int m_nDocPrIndex;
public:
FileWriter(CString sDirOutput,CString sFontDir, int nVersion, bool bSaveChartAsImg, PPTXFile::IAVSOfficeDrawingConverter* pDrawingConverter, LPSAFEARRAY pArray, CString& sThemePath):
FileWriter(CString sDirOutput,CString sFontDir, int nVersion, bool bSaveChartAsImg, PPTXFile::IAVSOfficeDrawingConverter* pDrawingConverter, LPSAFEARRAY pArray, CString sThemePath):
m_pDrawingConverter(pDrawingConverter),m_pArray(pArray),m_sThemePath(sThemePath),m_bSaveChartAsImg(bSaveChartAsImg),
m_oContentTypesWriter(sDirOutput), m_oFontTableWriter(sDirOutput, sFontDir),
m_oHeaderFooterWriter(sDirOutput, m_oContentTypesWriter),
......@@ -50,4 +52,5 @@ namespace Writers
return m_nDocPrIndex;
}
};
}
\ No newline at end of file
}
#endif // #ifndef FILE_WRITER
\ No newline at end of file
#pragma once
#ifndef HEADER_FOOTER_WRITER
#define HEADER_FOOTER_WRITER
#include "Common.h"
namespace Writers
......@@ -92,4 +94,5 @@ namespace Writers
//return m_oDocumentRelsWriter.AddRels(_T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/") + sHeader, sFilename);
}
};
}
\ No newline at end of file
}
#endif // #ifndef HEADER_FOOTER_WRITER
\ No newline at end of file
#pragma once
#ifndef MEDIA_WRITER
#define MEDIA_WRITER
#include "Common.h"
namespace Writers
......@@ -39,4 +41,5 @@ namespace Writers
nImageCount++;
}
};
}
\ No newline at end of file
}
#endif // #ifndef MEDIA_WRITER
\ No newline at end of file
#pragma once
#ifndef NUMBERING_WRITER
#define NUMBERING_WRITER
#include "ContentTypesWriter.h"
#include "DocumentRelsWriter.h"
......@@ -44,4 +46,5 @@ namespace Writers
}
}
};
}
\ No newline at end of file
}
#endif // #ifndef NUMBERING_WRITER
\ No newline at end of file
#pragma once
#ifndef READER_CLASSES
#define READER_CLASSES
namespace BinDocxRW {
......@@ -2406,4 +2407,5 @@ public:
}
}
};
}
\ No newline at end of file
}
#endif // #ifndef READER_CLASSES
\ No newline at end of file
#pragma once
#ifndef READERS
#define READERS
#include "../BinWriter/StreamUtils.h"
#include "FileWriter.h"
#include "../BinWriter/BinReaderWriterDefines.h"
......@@ -6174,4 +6176,5 @@ public: BinaryFileReader(CString& sFileInDir, Streams::CBufferedStream& oBuffere
return res;
}
};
}
\ No newline at end of file
}
#endif // #ifndef READERS
\ No newline at end of file
#pragma once
#ifndef SETTING_WRITER
#define SETTING_WRITER
#include "Common.h"
namespace Writers
......@@ -54,4 +56,5 @@ namespace Writers
}
}
};
}
\ No newline at end of file
}
#endif // #ifndef SETTING_WRITER
\ No newline at end of file
#pragma once
#ifndef STYLES_WRITER
#define STYLES_WRITER
#include "Common.h"
namespace Writers
......@@ -52,4 +54,5 @@ namespace Writers
oFile.CloseFile();
}
};
}
\ No newline at end of file
}
#endif // #ifndef STYLES_WRITER
\ No newline at end of file
#pragma once
#ifndef FONT_TABLE_WRITER
#define FONT_TABLE_WRITER
#include "Common.h"
namespace Writers
......@@ -117,4 +119,5 @@ namespace Writers
m_oWriter.WriteString(CString(_T("</w:font>")));
}
};
}
\ No newline at end of file
}
#endif // #ifndef FONT_TABLE_WRITER
\ No newline at end of file
#pragma once
#ifndef BIN_READER_WRITER_DEFINES
#define BIN_READER_WRITER_DEFINES
extern int g_nCurFormatVersion;
namespace BinDocxRW
{
......@@ -799,3 +801,5 @@ const int g_nFormatVersion = 5;
Shade = 3
};}
}
#endif // #ifndef BIN_READER_WRITER_DEFINES
\ No newline at end of file
#pragma once
#ifndef BIN_WRITERS
#define BIN_WRITERS
#include "StreamUtils.h"
#include "BinReaderWriterDefines.h"
#include "../DocWrapper/FontProcessor.h"
......@@ -6268,4 +6270,5 @@ namespace BinDocxRW
}
};
}
\ No newline at end of file
}
#endif // #ifndef BIN_WRITERS
\ No newline at end of file
This diff is collapsed.
#ifndef DOCX_SERIALIZER
#define DOCX_SERIALIZER
//todo
#include <atlbase.h>
#include <atlstr.h>
#include <string>
namespace BinDocxRW{
class BinaryFileWriter;
}
namespace Writers{
class FileWriter;
}
namespace BinDocxRW {
class CDocxSerializer{
private:
std::wstring m_sFontDir;
std::wstring m_sEmbeddedFontsDir;
bool m_bIsNoBase64Save;
bool m_bSaveChartAsImg;
BinDocxRW::BinaryFileWriter* m_oBinaryFileWriter;
Writers::FileWriter* m_pCurFileWriter;
public:
CDocxSerializer();
bool loadFromFile(std::wstring& sSrcFileName, std::wstring& sDstPath, std::wstring& sXMLOptions, std::wstring& sThemePath, std::wstring& sMediaPath);
bool saveToFile(std::wstring& sSrcFileName, std::wstring& sDstPath, std::wstring& sXMLOptions);
bool GetXmlContent(unsigned char* pBinaryObj, long lSize, long lStart, long lLength, std::wstring& sOutputXml);
bool GetBinaryContent(std::wstring& bsTxContent, unsigned char** ppBinary, long& lDataSize);
void setFontDir(std::wstring& sFontDir);
void setEmbeddedFontsDir(std::wstring& sEmbeddedFontsDir);
void setIsNoBase64Save(bool bIsNoBase64Save);
void setSaveChartAsImg(bool bSaveChartAsImg);
//todo
#ifdef _WIN32
IUnknown* m_pInterface;
void setComInterface(IUnknown* pInterface);
#endif
};
}
#endif // #ifndef DOCX_SERIALIZER
\ No newline at end of file
This diff is collapsed.
......@@ -45,6 +45,14 @@ namespace NSDirectory
return oArray;
}
static void CreateDirectory(std::wstring& strDirectory)
{
#ifdef WIN32
::CreateDirectoryW(strDirectory.c_str(), NULL);
#elif LINUX
#elif MAC
#endif
}
}
#endif //_BUILD_DIRECTORY_CROSSPLATFORM_H_
\ No newline at end of file
......@@ -499,6 +499,17 @@ namespace NSFile
size_t nCountWrite = fwrite((void*)pData, 1, nBytesCount, m_pFile);
return true;
}
void WriteStringUTF8(std::wstring& strXml, bool bIsBOM = false)
{
BYTE* pData = NULL;
LONG lLen = 0;
CUtf8Converter::GetUtf8StringFromUnicode(strXml.c_str(), strXml.size(), pData, lLen, bIsBOM);
WriteFile(pData, lLen);
RELEASEARRAYOBJECTS(pData);
}
};
}
......
#pragma once
#ifndef BINARY_WRITER
#define BINARY_WRITER
#include "../../ASCOfficePPTXFile/Editor/BinReaderWriterDefines.h"
#include "../../Common/DocxFormat/Source/SystemUtility/SystemUtility.h"
......@@ -3701,4 +3703,6 @@ namespace BinXlsxRW {
RELEASEARRAYOBJECTS(pbBase64Buffer);
}
#endif
}
\ No newline at end of file
}
#endif // #ifndef BINARY_WRITER
\ No newline at end of file
//Generated code
#pragma once
#ifndef CHART_FROM_TO_BINARY
#define CHART_FROM_TO_BINARY
#include "CommonWriter.h"
#include "..\..\Common\DocxFormat\Source\XlsxFormat\Chart\ChartSerialize.h"
#include "..\Writer\BinaryCommonReader.h"
......@@ -314,4 +316,5 @@ namespace BinXlsxRW {
public: void WriteAlternateContentChoice(AlternateContentChoice& oVal);
public: void WriteAlternateContentFallback(AlternateContentFallback& oVal);
};
}
\ No newline at end of file
}
#endif // #ifndef CHART_FROM_TO_BINARY
\ No newline at end of file
#pragma once
#ifndef COMMON_WRITER
#define COMMON_WRITER
#include "../../ASCOfficeDocxFile2/BinWriter/StreamUtils.h"
#include "../../Common/DocxFormat/Source/XlsxFormat/Xlsx.h"
......@@ -15,4 +17,5 @@ namespace BinXlsxRW {
void WriteColor(const OOX::Spreadsheet::CColor& color, OOX::Spreadsheet::CIndexedColors* pIndexedColors, OOX::CTheme* theme);
void WriteSafeArray(SAFEARRAY* pBinaryObj);
};
}
\ No newline at end of file
}
#endif // #ifndef COMMON_WRITER
\ No newline at end of file
#pragma once
#ifndef BINARY_COMMON_READER
#define BINARY_COMMON_READER
#include "../../ASCOfficeDocxFile2/BinWriter/StreamUtils.h"
namespace BinXlsxRW {
......@@ -85,4 +87,5 @@ namespace BinXlsxRW {
return res;
}
};
}
\ No newline at end of file
}
#endif // #ifndef BINARY_COMMON_READER
\ No newline at end of file
#pragma once
#ifndef BINARY_READER
#define BINARY_READER
#include "../../Common/FileWriter.h"
#include "../../Common/MappingFile.h"
#include "../../Common/Base64.h"
......@@ -3159,4 +3161,5 @@ namespace BinXlsxRW {
}
};
};
\ No newline at end of file
};
#endif // #ifndef BINARY_READER
\ No newline at end of file
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