mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-03-05 18:31:47 +08:00
Compare commits
28 Commits
core-linux
...
core-win-3
| Author | SHA1 | Date | |
|---|---|---|---|
| e26f836da7 | |||
| 69d2b12f53 | |||
| f2260748c8 | |||
| b59f84b262 | |||
| 3e5fed8482 | |||
| 538e477818 | |||
| b212e878c6 | |||
| 05694d13f3 | |||
| 1dd72c99a2 | |||
| 4b73e58693 | |||
| bee4f57dd3 | |||
| dd40e3e53c | |||
| d657ece017 | |||
| b21b1b8aaf | |||
| 09fb980060 | |||
| 142f9f57a3 | |||
| 28346c4571 | |||
| 9810087ee1 | |||
| 2b8e1456c2 | |||
| 274c000ce7 | |||
| 9e6dd1fbb1 | |||
| 49723e648a | |||
| b0a2104b21 | |||
| e4986f4202 | |||
| de51052f6a | |||
| bd1dc5a7b6 | |||
| 2c8efcb183 | |||
| 9c2a717870 |
@ -61,7 +61,7 @@ namespace DocFileFormat
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
long Converter::Convert(WordDocument* doc, WordprocessingDocument* docx, const ProgressCallback* progress)
|
||||
_UINT32 Converter::Convert(WordDocument* doc, WordprocessingDocument* docx, const ProgressCallback* progress)
|
||||
{
|
||||
if (!doc || !docx) return S_FALSE;
|
||||
|
||||
@ -202,20 +202,18 @@ namespace DocFileFormat
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
long Converter::LoadAndConvert(const std::wstring& strSrcFile, const std::wstring& strDstDirectory, const std::wstring& password, const ProgressCallback* progress, bool &bMacros)
|
||||
_UINT32 Converter::LoadAndConvert(const std::wstring& strSrcFile, const std::wstring& strDstDirectory, const std::wstring& password, const ProgressCallback* progress, bool &bMacros)
|
||||
{
|
||||
long result = S_FALSE;
|
||||
|
||||
WordDocument doc(progress, m_sTempFolder);
|
||||
WordprocessingDocument docx(strDstDirectory, &doc);
|
||||
|
||||
result = doc.LoadDocument(strSrcFile, password);
|
||||
_UINT32 result = doc.LoadDocument(strSrcFile, password);
|
||||
|
||||
if (result == S_OK)
|
||||
if (result == 0)
|
||||
{
|
||||
result = Convert(&doc, &docx, progress);
|
||||
|
||||
if (result == S_OK)
|
||||
if (result == 0)
|
||||
{
|
||||
docx.SaveDocument(bMacros);
|
||||
|
||||
|
||||
@ -32,6 +32,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include "../../Common/DocxFormat/Source/Base/Types_32.h"
|
||||
|
||||
struct ProgressCallback;
|
||||
|
||||
@ -48,9 +49,9 @@ namespace DocFileFormat
|
||||
|
||||
std::wstring m_sTempFolder;
|
||||
|
||||
long LoadAndConvert(const std::wstring & strSrcFile, const std::wstring & strDstDirectory, const std::wstring & password, const ProgressCallback* progress, bool &bMacros);
|
||||
_UINT32 LoadAndConvert(const std::wstring & strSrcFile, const std::wstring & strDstDirectory, const std::wstring & password, const ProgressCallback* progress, bool &bMacros);
|
||||
|
||||
private:
|
||||
long Convert(WordDocument* doc, WordprocessingDocument* docx, const ProgressCallback* progress);
|
||||
_UINT32 Convert(WordDocument* doc, WordprocessingDocument* docx, const ProgressCallback* progress);
|
||||
};
|
||||
}
|
||||
|
||||
@ -117,7 +117,7 @@ namespace DocFileFormat
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
int WordDocument::LoadDocument(const std::wstring & fileName, const std::wstring & password)
|
||||
_UINT32 WordDocument::LoadDocument(const std::wstring & fileName, const std::wstring & password)
|
||||
{
|
||||
m_sFileName = fileName;
|
||||
m_sPassword = password;
|
||||
|
||||
@ -94,7 +94,7 @@ namespace DocFileFormat
|
||||
WordDocument (const ProgressCallback* pCallFunc, const std::wstring & tempFolder );
|
||||
virtual ~WordDocument();
|
||||
|
||||
int LoadDocument(const std::wstring & fileName, const std::wstring & password);
|
||||
_UINT32 LoadDocument(const std::wstring & fileName, const std::wstring & password);
|
||||
|
||||
int nWordVersion;
|
||||
int nDocumentCodePage;
|
||||
|
||||
@ -34,9 +34,9 @@
|
||||
#include "../DocDocxConverter/Converter.h"
|
||||
#include "../../OfficeUtils/src/OfficeUtils.h"
|
||||
|
||||
HRESULT COfficeDocFile::LoadFromFile(const std::wstring & docFile, const std::wstring & docxDirectory, const std::wstring & password, bool &bMacros, ProgressCallback *ffCallBack)
|
||||
_UINT32 COfficeDocFile::LoadFromFile(const std::wstring & docFile, const std::wstring & docxDirectory, const std::wstring & password, bool &bMacros, ProgressCallback *ffCallBack)
|
||||
{
|
||||
HRESULT hr = S_FALSE;
|
||||
_UINT32 hr = 0;
|
||||
|
||||
DocFileFormat::Converter docToDocx;
|
||||
docToDocx.m_sTempFolder = m_sTempFolder;
|
||||
@ -46,7 +46,7 @@ HRESULT COfficeDocFile::LoadFromFile(const std::wstring & docFile, const std::w
|
||||
return hr;
|
||||
}
|
||||
|
||||
HRESULT COfficeDocFile::SaveToFile (const std::wstring & sDstFileName, const std::wstring & sSrcFileName, ProgressCallback *ffCallBack )
|
||||
_UINT32 COfficeDocFile::SaveToFile (const std::wstring & sDstFileName, const std::wstring & sSrcFileName, ProgressCallback *ffCallBack )
|
||||
{
|
||||
return S_OK;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -53,8 +53,8 @@ public:
|
||||
|
||||
std::wstring m_sTempFolder;
|
||||
|
||||
HRESULT LoadFromFile(const std::wstring & sSrcFileName, const std::wstring & sDstFileName, const std::wstring & password, bool &bMacros, ProgressCallback *ffCallBack = NULL);
|
||||
HRESULT SaveToFile(const std::wstring & sDstFileName, const std::wstring & sSrcFileName, ProgressCallback *ffCallBack = NULL);
|
||||
_UINT32 LoadFromFile(const std::wstring & sSrcFileName, const std::wstring & sDstFileName, const std::wstring & password, bool &bMacros, ProgressCallback *ffCallBack = NULL);
|
||||
_UINT32 SaveToFile(const std::wstring & sDstFileName, const std::wstring & sSrcFileName, ProgressCallback *ffCallBack = NULL);
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -85,7 +85,7 @@ namespace BinXlsxRW{
|
||||
sMediaPath = pathMediaDir.GetPath();
|
||||
sEmbedPath = pathEmbedDir.GetPath();
|
||||
}
|
||||
int CXlsxSerializer::loadFromFile(const std::wstring& sSrcFileName, const std::wstring& sDstPath, const std::wstring& sXMLOptions, const std::wstring& sMediaDir, const std::wstring& sEmbedDir)
|
||||
_UINT32 CXlsxSerializer::loadFromFile(const std::wstring& sSrcFileName, const std::wstring& sDstPath, const std::wstring& sXMLOptions, const std::wstring& sMediaDir, const std::wstring& sEmbedDir)
|
||||
{
|
||||
std::wstring strFileInDir = NSSystemPath::GetDirectoryName(sSrcFileName);
|
||||
|
||||
@ -100,7 +100,7 @@ namespace BinXlsxRW{
|
||||
BinXlsxRW::BinaryFileReader oBinaryFileReader;
|
||||
return oBinaryFileReader.ReadFile(sSrcFileName, sDstPath, &oDrawingConverter, sXMLOptions);
|
||||
}
|
||||
int CXlsxSerializer::saveToFile(const std::wstring& sDstFileName, const std::wstring& sSrcPath, const std::wstring& sXMLOptions)
|
||||
_UINT32 CXlsxSerializer::saveToFile(const std::wstring& sDstFileName, const std::wstring& sSrcPath, const std::wstring& sXMLOptions)
|
||||
{
|
||||
COfficeFontPicker* pFontPicker = new COfficeFontPicker();
|
||||
pFontPicker->Init(m_sFontDir);
|
||||
@ -136,7 +136,7 @@ namespace BinXlsxRW{
|
||||
oOfficeDrawingConverter.SetFontPicker(pFontPicker);
|
||||
|
||||
BinXlsxRW::BinaryFileWriter oBinaryFileWriter(fp);
|
||||
int result = oBinaryFileWriter.Open(sSrcPath, sDstFileName, pEmbeddedFontsManager, &oOfficeDrawingConverter, sXMLOptions, m_bIsNoBase64);
|
||||
_UINT32 result = oBinaryFileWriter.Open(sSrcPath, sDstFileName, pEmbeddedFontsManager, &oOfficeDrawingConverter, sXMLOptions, m_bIsNoBase64);
|
||||
|
||||
RELEASEOBJECT(pFontPicker);
|
||||
return result;
|
||||
|
||||
@ -33,6 +33,7 @@
|
||||
#define XLSX_SERIALIZER
|
||||
|
||||
#include <string>
|
||||
#include "../../Common/DocxFormat/Source/Base/Types_32.h"
|
||||
|
||||
namespace OOX
|
||||
{
|
||||
@ -62,8 +63,8 @@ namespace BinXlsxRW {
|
||||
|
||||
static void CreateXlsxFolders (const std::wstring& sXmlOptions, const std::wstring& sDstPath, std::wstring& sMediaPath, std::wstring& sEmbedPath);
|
||||
|
||||
int loadFromFile (const std::wstring& sSrcFileName, const std::wstring& sDstPath, const std::wstring& sXMLOptions, const std::wstring& sMediaDir, const std::wstring& sEmbedPath);
|
||||
int saveToFile (const std::wstring& sSrcFileName, const std::wstring& sDstPath, const std::wstring& sXMLOptions);
|
||||
_UINT32 loadFromFile (const std::wstring& sSrcFileName, const std::wstring& sDstPath, const std::wstring& sXMLOptions, const std::wstring& sMediaDir, const std::wstring& sEmbedPath);
|
||||
_UINT32 saveToFile (const std::wstring& sSrcFileName, const std::wstring& sDstPath, const std::wstring& sXMLOptions);
|
||||
|
||||
bool saveChart (NSBinPptxRW::CBinaryFileReader* pReader, long lLength, const std::wstring& sFilename, const long& lChartNumber);
|
||||
|
||||
|
||||
@ -105,7 +105,7 @@ HRESULT convert_single(std::wstring srcFileName)
|
||||
}
|
||||
_CP_LOG << L"[info] " << srcFileName << std::endl;
|
||||
|
||||
nResult = ConvertODF2OOXml(srcTempPath, dstTempPath, L"C:\\Windows\\Fonts", srcTempPath2, L"password", NULL);
|
||||
nResult = ConvertODF2OOXml(srcTempPath, dstTempPath, L"C:\\Windows\\Fonts", srcTempPath2, L"", NULL);
|
||||
|
||||
if (srcTempPath != srcFileName)
|
||||
{
|
||||
|
||||
@ -310,6 +310,7 @@ typedef xml::writer::element<wchar_t> xml_element;
|
||||
#define CP_XML_WRITER(STRM) if (bool _b_ = false) {} else for (xml_writer _xml_wr_((STRM));!_b_;_b_=true)
|
||||
#define CP_XML_NODE(NAME) if (bool _b_ = false) {} else for (xml_element _xml_node_(_xml_wr_, (NAME));!_b_;_b_=true)
|
||||
#define CP_XML_ATTR(NAME, VAL) _xml_node_.attr((NAME),(VAL))
|
||||
#define CP_XML_ATTR2(NAME, VAL) _xml_node_.attr((std::wstring(NAME).c_str()),(VAL))
|
||||
#define CP_XML_CONTENT(VAL) _xml_node_.contents((VAL))
|
||||
#define CP_XML_STREAM() _xml_node_.stream()
|
||||
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
|
||||
#include "../include/odf/odf_document.h"
|
||||
|
||||
int ConvertOds2Xlsx(cpdoccore::odf_reader::odf_document & inputOdf, const std::wstring & dstPath, const std::wstring & fontsPath)
|
||||
_UINT32 ConvertOds2Xlsx(cpdoccore::odf_reader::odf_document & inputOdf, const std::wstring & dstPath, const std::wstring & fontsPath)
|
||||
{
|
||||
cpdoccore::oox::package::xlsx_document outputXlsx;
|
||||
cpdoccore::oox::xlsx_conversion_context conversionContext( &inputOdf);
|
||||
@ -56,7 +56,7 @@ int ConvertOds2Xlsx(cpdoccore::odf_reader::odf_document & inputOdf, const std::w
|
||||
outputXlsx.write(dstPath);
|
||||
return 0;
|
||||
}
|
||||
int ConvertOdt2Docx(cpdoccore::odf_reader::odf_document & inputOdf, const std::wstring & dstPath, const std::wstring & fontsPath)
|
||||
_UINT32 ConvertOdt2Docx(cpdoccore::odf_reader::odf_document & inputOdf, const std::wstring & dstPath, const std::wstring & fontsPath)
|
||||
{
|
||||
cpdoccore::oox::package::docx_document outputDocx;
|
||||
cpdoccore::oox::docx_conversion_context conversionContext(&inputOdf);
|
||||
@ -70,7 +70,7 @@ int ConvertOdt2Docx(cpdoccore::odf_reader::odf_document & inputOdf, const std::w
|
||||
|
||||
return 0;
|
||||
}
|
||||
int ConvertOdp2Pptx(cpdoccore::odf_reader::odf_document & inputOdf, const std::wstring & dstPath, const std::wstring & fontsPath)
|
||||
_UINT32 ConvertOdp2Pptx(cpdoccore::odf_reader::odf_document & inputOdf, const std::wstring & dstPath, const std::wstring & fontsPath)
|
||||
{
|
||||
cpdoccore::oox::package::pptx_document outputPptx;
|
||||
cpdoccore::oox::pptx_conversion_context conversionContext(&inputOdf);
|
||||
@ -83,9 +83,9 @@ int ConvertOdp2Pptx(cpdoccore::odf_reader::odf_document & inputOdf, const std::w
|
||||
|
||||
return 0;
|
||||
}
|
||||
int ConvertODF2OOXml(const std::wstring & srcPath, const std::wstring & dstPath, const std::wstring & fontsPath, const std::wstring & tempPath, const std::wstring & password, const ProgressCallback* CallBack)
|
||||
_UINT32 ConvertODF2OOXml(const std::wstring & srcPath, const std::wstring & dstPath, const std::wstring & fontsPath, const std::wstring & tempPath, const std::wstring & password, const ProgressCallback* CallBack)
|
||||
{
|
||||
int nResult = 0;
|
||||
_UINT32 nResult = 0;
|
||||
|
||||
try
|
||||
{
|
||||
@ -134,9 +134,9 @@ int ConvertODF2OOXml(const std::wstring & srcPath, const std::wstring & dstPath,
|
||||
|
||||
}
|
||||
|
||||
int ConvertOTF2ODF(const std::wstring & srcPath)
|
||||
_UINT32 ConvertOTF2ODF(const std::wstring & srcPath)
|
||||
{
|
||||
int nResult = 0;
|
||||
_UINT32 nResult = 0;
|
||||
|
||||
std::wstring manifest_xml = srcPath + FILE_SEPARATOR_STR + L"META-INF" + FILE_SEPARATOR_STR + L"manifest.xml";
|
||||
std::wstring mimetype_xml = srcPath + FILE_SEPARATOR_STR + L"mimetype";
|
||||
|
||||
@ -31,10 +31,11 @@
|
||||
*/
|
||||
|
||||
#include "../../DesktopEditor/common/Types.h"
|
||||
#include "../../Common/DocxFormat/Source/Base/Types_32.h"
|
||||
#include <string>
|
||||
|
||||
struct ProgressCallback;
|
||||
|
||||
int ConvertODF2OOXml(const std::wstring & srcPath, const std::wstring & dstPath, const std::wstring & fontsPath, const std::wstring & tempPath, const std::wstring & password, const ProgressCallback* CallBack);
|
||||
_UINT32 ConvertODF2OOXml(const std::wstring & srcPath, const std::wstring & dstPath, const std::wstring & fontsPath, const std::wstring & tempPath, const std::wstring & password, const ProgressCallback* CallBack);
|
||||
|
||||
int ConvertOTF2ODF(const std::wstring & otfPath);
|
||||
_UINT32 ConvertOTF2ODF(const std::wstring & otfPath);
|
||||
|
||||
@ -589,12 +589,17 @@ void docx_conversion_context::reset_context_state()
|
||||
state_.in_run_ = false;
|
||||
state_.is_paragraph_keep_ = false;
|
||||
|
||||
state_.drawing_text_props_.clear();
|
||||
state_.text_properties_stack_.clear();
|
||||
|
||||
get_styles_context().text_style_ext().clear();
|
||||
}
|
||||
void docx_conversion_context::back_context_state()
|
||||
{
|
||||
state_ = keep_state_.back();
|
||||
keep_state_.pop_back();
|
||||
|
||||
get_styles_context().text_style_ext().clear();
|
||||
}
|
||||
|
||||
void docx_conversion_context::add_new_run(std::wstring parentStyleId)
|
||||
@ -1756,6 +1761,11 @@ void docx_conversion_context::serialize_list_properties(std::wostream & strm)
|
||||
}
|
||||
}
|
||||
|
||||
void docx_conversion_context::set_drawing_text_props (const std::wstring &props)
|
||||
{
|
||||
get_styles_context().text_style_ext() = props;
|
||||
}
|
||||
|
||||
void docx_conversion_context::add_delayed_element(odf_reader::office_element * Elm)
|
||||
{
|
||||
delayed_elements_.push_back(Elm);
|
||||
|
||||
@ -900,6 +900,8 @@ public:
|
||||
|
||||
table_content_context & get_table_content_context() { return table_content_context_;}
|
||||
|
||||
void set_drawing_text_props (const std::wstring &props);
|
||||
|
||||
void docx_convert_delayed ();
|
||||
void add_delayed_element (odf_reader::office_element * Elm);
|
||||
|
||||
@ -940,10 +942,10 @@ public:
|
||||
void add_alphabetical_index_text (odf_reader::office_element_ptr & elem);
|
||||
|
||||
void set_process_headers_footers(bool Val) { process_headers_footers_ = Val; }
|
||||
headers_footers & get_headers_footers() { return headers_footers_; }
|
||||
|
||||
headers_footers & get_headers_footers() { return headers_footers_; }
|
||||
header_footer_context & get_header_footer_context() { return header_footer_context_; }
|
||||
|
||||
drop_cap_context & get_drop_cap_context(){return drop_cap_context_;}
|
||||
drop_cap_context & get_drop_cap_context() {return drop_cap_context_;}
|
||||
|
||||
styles_map styles_map_;
|
||||
bool process_headers_footers_;
|
||||
@ -962,6 +964,8 @@ private:
|
||||
bool in_run_ = false;
|
||||
bool is_paragraph_keep_ = false;
|
||||
|
||||
std::wstring drawing_text_props_;
|
||||
|
||||
std::vector< const odf_reader::style_text_properties*> text_properties_stack_;
|
||||
}state_;
|
||||
std::vector<_context_state> keep_state_;
|
||||
|
||||
@ -231,7 +231,7 @@ void docx_serialize_image_child(std::wostream & strm, _docx_drawing & val)
|
||||
CP_XML_NODE(L"a:avLst");
|
||||
}
|
||||
|
||||
oox_serialize_ln(CP_XML_STREAM(),val.additional);
|
||||
oox_serialize_ln(CP_XML_STREAM(), val.additional);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -171,7 +171,7 @@ void oox_axis_content::oox_serialize_content(std::wostream & _Wostream)
|
||||
if (content_.dimension_ == L"y")
|
||||
CP_XML_ATTR(L"val",L"l");// "b" | "l" | "r" | "t"// == bottom left right top
|
||||
}
|
||||
//oox_serialize_ln(_Wostream,content_.graphic_properties_);
|
||||
//oox_serialize_ln(_Wostream, content_.graphic_properties_);
|
||||
|
||||
odf_reader::GetProperty(content_.properties_, L"num_format", strVal);
|
||||
odf_reader::GetProperty(content_.properties_, L"link-data-style-to-source", boolVal);
|
||||
|
||||
@ -198,7 +198,9 @@ std::wstringstream & styles_context::list_style()
|
||||
|
||||
void styles_context::docx_serialize_text_style(std::wostream & strm, std::wstring parenStyleId, std::wstring & strChange)
|
||||
{
|
||||
if (!text_style_.str().empty())
|
||||
const std::wstring & text_style_str = text_style_.str();
|
||||
|
||||
if (!text_style_str.empty() || !text_style_ext_.empty())
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
@ -208,14 +210,17 @@ void styles_context::docx_serialize_text_style(std::wostream & strm, std::wstrin
|
||||
{
|
||||
CP_XML_STREAM() << L"<w:rStyle w:val=\"" << parenStyleId << L"\" />";
|
||||
}
|
||||
const std::wstring & test_str = text_style_.str();
|
||||
CP_XML_STREAM() << test_str;
|
||||
CP_XML_STREAM() << text_style_str;
|
||||
|
||||
if (!strChange.empty())//rPrChange
|
||||
{
|
||||
CP_XML_STREAM() << strChange;
|
||||
strChange.clear();
|
||||
}
|
||||
if (!text_style_ext_.empty())
|
||||
{
|
||||
CP_XML_STREAM() << text_style_ext_;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -141,6 +141,7 @@ public:
|
||||
|
||||
std::wstring & extern_node(){return extern_node_;}
|
||||
std::wstring & hlinkClick(){return hlinkClick_;}
|
||||
std::wstring & text_style_ext(){return text_style_ext_;}
|
||||
|
||||
const odf_reader::style_instance * get_current_processed_style() const { return current_processed_style_; }
|
||||
|
||||
@ -152,6 +153,7 @@ private:
|
||||
|
||||
std::wstring extern_node_;
|
||||
std::wstring hlinkClick_;
|
||||
std::wstring text_style_ext_;
|
||||
|
||||
std::wstringstream list_style_;
|
||||
std::wstringstream text_style_;
|
||||
|
||||
@ -124,8 +124,14 @@ static const std::wstring _ooxDashStyle[]=
|
||||
L"sysDashDotDot"
|
||||
};
|
||||
|
||||
void oox_serialize_ln(std::wostream & strm, const std::vector<odf_reader::_property> & prop, bool always_draw)
|
||||
void oox_serialize_ln(std::wostream & strm, const std::vector<odf_reader::_property> & prop, bool always_draw, const std::wstring &ns)
|
||||
{
|
||||
std::wstring ns_att = (ns == L"a" ? L"" : ns + L":");
|
||||
std::wstring ns_node = L"a:ln";
|
||||
|
||||
if (ns == L"w14")
|
||||
ns_node = L"w14:textOutline";
|
||||
|
||||
_CP_OPT(std::wstring) strStrokeColor;
|
||||
_CP_OPT(int) iStroke;
|
||||
_CP_OPT(double) dStrokeWidth;
|
||||
@ -143,30 +149,30 @@ void oox_serialize_ln(std::wostream & strm, const std::vector<odf_reader::_prope
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"a:ln")
|
||||
CP_XML_NODE(ns_node)
|
||||
{
|
||||
std::wstring color, dash_style, fill = L"a:solidFill" ;
|
||||
std::wstring color, dash_style, fill = ns + L":solidFill" ;
|
||||
|
||||
if (strStrokeColor) color = *strStrokeColor;
|
||||
|
||||
if (iStroke)
|
||||
{
|
||||
if (iStroke.get() == 0 || bWordArt) fill = L"a:noFill";
|
||||
if (iStroke.get() == 0 || bWordArt) fill = ns + L":noFill";
|
||||
else dash_style = _ooxDashStyle[iStroke.get()];
|
||||
}
|
||||
|
||||
if ((dStrokeWidth) && (*dStrokeWidth >= 0) && fill != L"a:noFill")
|
||||
if ((dStrokeWidth) && (*dStrokeWidth >= 0) && fill != ns + L":noFill")
|
||||
{
|
||||
int val = dStrokeWidth.get() * 12700; //in emu (1 pt = 12700)
|
||||
if (val < 10) val = 12700;
|
||||
|
||||
CP_XML_ATTR(L"w", val);
|
||||
CP_XML_ATTR2(ns_att + L"w", val);
|
||||
if (color.length()<1)color = L"729FCF";
|
||||
}
|
||||
|
||||
CP_XML_NODE(fill)
|
||||
{
|
||||
if (fill != L"a:noFill")
|
||||
if (fill != ns + L":noFill")
|
||||
{
|
||||
if ( color.empty() )
|
||||
{
|
||||
@ -174,47 +180,49 @@ void oox_serialize_ln(std::wostream & strm, const std::vector<odf_reader::_prope
|
||||
else color = L"FFFFFF";
|
||||
}
|
||||
|
||||
CP_XML_NODE(L"a:srgbClr")
|
||||
CP_XML_NODE(ns + L":srgbClr")
|
||||
{
|
||||
CP_XML_ATTR(L"val",color);
|
||||
CP_XML_ATTR2(ns_att + L"val",color);
|
||||
|
||||
if (dStrokeOpacity)
|
||||
{
|
||||
CP_XML_NODE(L"a:alpha")
|
||||
CP_XML_NODE(ns + L":alpha")
|
||||
{
|
||||
CP_XML_ATTR(L"val", (int)(*dStrokeOpacity * 1000));
|
||||
CP_XML_ATTR2(ns_att + L"val", (int)(*dStrokeOpacity * 1000));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (fill != L"a:noFill")
|
||||
if (fill != ns + L":noFill")
|
||||
{
|
||||
_CP_OPT(std::wstring) strVal;
|
||||
|
||||
if (dash_style.length() > 0 && dash_style != L"solid")
|
||||
{
|
||||
CP_XML_NODE(L"a:prstDash"){CP_XML_ATTR(L"val", dash_style);}
|
||||
CP_XML_NODE(ns + L":prstDash"){CP_XML_ATTR2(ns_att + L"val", dash_style);}
|
||||
}
|
||||
odf_reader::GetProperty(prop,L"marker-start", strVal);
|
||||
if (strVal)
|
||||
{
|
||||
CP_XML_NODE(L"a:headEnd"){CP_XML_ATTR(L"type", strVal.get());}
|
||||
CP_XML_NODE(ns + L":headEnd"){CP_XML_ATTR2(ns_att + L"type", strVal.get());}
|
||||
}
|
||||
odf_reader::GetProperty(prop,L"marker-end",strVal);
|
||||
if (strVal)
|
||||
{
|
||||
CP_XML_NODE(L"a:tailEnd"){CP_XML_ATTR(L"type",strVal.get());}
|
||||
CP_XML_NODE(ns + L":tailEnd"){CP_XML_ATTR2(ns_att + L"type",strVal.get());}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
void oox_serialize_aLst(std::wostream & strm, const std::vector<odf_reader::_property> & prop, const std::wstring & shapeGeomPreset)
|
||||
void oox_serialize_aLst(std::wostream & strm, const std::vector<odf_reader::_property> & prop, const std::wstring & shapeGeomPreset, const std::wstring &ns)
|
||||
{
|
||||
std::wstring ns_att = (ns == L"a" ? L"" : ns + L":");
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"a:avLst")
|
||||
CP_XML_NODE(ns + L":avLst")
|
||||
{
|
||||
_CP_OPT(std::wstring) strModifiers;
|
||||
odf_reader::GetProperty(prop, L"oox-draw-modifiers", strModifiers);
|
||||
@ -268,20 +276,20 @@ void oox_serialize_aLst(std::wostream & strm, const std::vector<odf_reader::_pro
|
||||
{
|
||||
if (values[i].empty()) continue;
|
||||
|
||||
CP_XML_NODE(L"a:gd")
|
||||
CP_XML_NODE(ns + L":gd")
|
||||
{
|
||||
if (names.size() > i)
|
||||
{
|
||||
CP_XML_ATTR(L"name", names[i]);
|
||||
CP_XML_ATTR2(ns_att + L"name", names[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (values.size() > 1)
|
||||
CP_XML_ATTR(L"name", L"adj" + std::to_wstring(i + 1));
|
||||
CP_XML_ATTR2(ns_att + L"name", L"adj" + std::to_wstring(i + 1));
|
||||
else
|
||||
CP_XML_ATTR(L"name", L"adj");
|
||||
CP_XML_ATTR2(ns_att + L"name", L"adj");
|
||||
}
|
||||
CP_XML_ATTR(L"fmla", L"val " + values[i]);
|
||||
CP_XML_ATTR2(ns_att + L"fmla", L"val " + values[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -118,8 +118,8 @@ namespace oox {
|
||||
};
|
||||
typedef _CP_PTR(_oox_drawing) oox_drawing_ptr;
|
||||
|
||||
void oox_serialize_ln (std::wostream & strm, const std::vector<odf_reader::_property> & val, bool always_draw = false);
|
||||
void oox_serialize_aLst (std::wostream & strm, const std::vector<odf_reader::_property> & val, const std::wstring & shapeGeomPreset);
|
||||
void oox_serialize_ln (std::wostream & strm, const std::vector<odf_reader::_property> & val, bool always_draw = false, const std::wstring &ns = L"a");
|
||||
void oox_serialize_aLst (std::wostream & strm, const std::vector<odf_reader::_property> & val, const std::wstring & shapeGeomPreset, const std::wstring &ns = L"a");
|
||||
void oox_serialize_action (std::wostream & strm, const _action_desc & val);
|
||||
|
||||
}
|
||||
|
||||
@ -53,55 +53,59 @@ namespace oox {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void oox_serialize_none_fill(std::wostream & strm)
|
||||
void oox_serialize_none_fill(std::wostream & strm, const std::wstring &ns)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"a:noFill");
|
||||
CP_XML_NODE(ns + L":noFill");
|
||||
}
|
||||
}
|
||||
void oox_serialize_srgb(std::wostream & strm,std::wstring color,_CP_OPT(double) opacity)
|
||||
void oox_serialize_srgb(std::wostream & strm, const std::wstring &color,_CP_OPT(double) opacity, const std::wstring &ns)
|
||||
{
|
||||
std::wstring ns_att = (ns == L"a" ? L"" : ns + L":");
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"a:srgbClr")
|
||||
CP_XML_NODE(ns + L":srgbClr")
|
||||
{
|
||||
CP_XML_ATTR(L"val", color);
|
||||
CP_XML_ATTR2(ns_att + L"val", color);
|
||||
if (opacity)
|
||||
{
|
||||
CP_XML_NODE(L"a:alpha")
|
||||
CP_XML_NODE(ns + L":alpha")
|
||||
{
|
||||
CP_XML_ATTR(L"val", std::to_wstring((int)(*opacity)*1000));// + L"%");
|
||||
CP_XML_ATTR2(ns_att + L"val", std::to_wstring((int)(*opacity)*1000));// + L"%");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
void oox_serialize_srgb(std::wostream & strm,std::wstring color,_CP_OPT(odf_types::percent) opacity)
|
||||
void oox_serialize_srgb(std::wostream & strm, const std::wstring &color, _CP_OPT(odf_types::percent) opacity, const std::wstring &ns)
|
||||
{
|
||||
std::wstring ns_att = (ns == L"a" ? L"" : ns + L":");
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"a:srgbClr")
|
||||
CP_XML_NODE(ns + L":srgbClr")
|
||||
{
|
||||
CP_XML_ATTR(L"val",color);
|
||||
CP_XML_ATTR2(ns_att + L"val",color);
|
||||
if (opacity)
|
||||
{
|
||||
CP_XML_NODE(L"a:alpha")
|
||||
CP_XML_NODE(ns + L":alpha")
|
||||
{
|
||||
CP_XML_ATTR(L"val", std::to_wstring((int)opacity->get_value()*1000));// + L"%");
|
||||
CP_XML_ATTR2(ns_att + L"val", std::to_wstring((int)opacity->get_value() * 1000));// + L"%");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
void oox_serialize_solid_fill(std::wostream & strm, const _oox_fill & val)
|
||||
void oox_serialize_solid_fill(std::wostream & strm, const _oox_fill & val, const std::wstring &ns)
|
||||
{
|
||||
if (!val.solid)return;
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"a:solidFill")
|
||||
CP_XML_NODE(ns + L":solidFill")
|
||||
{
|
||||
oox_serialize_srgb(CP_XML_STREAM(), val.solid->color, val.opacity);
|
||||
oox_serialize_srgb(CP_XML_STREAM(), val.solid->color, val.opacity, ns);
|
||||
}
|
||||
|
||||
}
|
||||
@ -151,20 +155,25 @@ void vml_serialize_bitmap_fill(std::wostream & strm, const _oox_fill & val)
|
||||
}
|
||||
}
|
||||
}
|
||||
void oox_serialize_bitmap_fill(std::wostream & strm, const _oox_fill & val)
|
||||
void oox_serialize_bitmap_fill(std::wostream & strm, const _oox_fill & val, const std::wstring &ns)
|
||||
{
|
||||
if (!val.bitmap) return;
|
||||
|
||||
std::wstring ns_att = (ns == L"a" ? L"" : ns + L":");
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(std::wstring(val.bitmap->name_space + L":blipFill"))
|
||||
{
|
||||
//if (val.bitmap->rotate) CP_XML_ATTR(L"a:rotWithShape",*(val.bitmap->rotate));
|
||||
//else CP_XML_ATTR(L"a:rotWithShape",1);
|
||||
//if (val.bitmap->rotate) CP_XML_ATTR(ns + L":rotWithShape",*(val.bitmap->rotate));
|
||||
//else CP_XML_ATTR(ns + L":rotWithShape",1);
|
||||
|
||||
if (val.bitmap->dpi) CP_XML_ATTR(L"a:dpi", *val.bitmap->dpi);
|
||||
if (val.bitmap->dpi)
|
||||
{
|
||||
CP_XML_ATTR2(ns + L":dpi", *val.bitmap->dpi);
|
||||
}
|
||||
|
||||
CP_XML_NODE(L"a:blip")
|
||||
CP_XML_NODE(ns + L":blip")
|
||||
{
|
||||
if (val.bitmap->isInternal)
|
||||
{
|
||||
@ -176,38 +185,38 @@ void oox_serialize_bitmap_fill(std::wostream & strm, const _oox_fill & val)
|
||||
|
||||
if (val.opacity)
|
||||
{
|
||||
CP_XML_NODE(L"a:alphaModFix")
|
||||
CP_XML_NODE(ns + L":alphaModFix")
|
||||
{
|
||||
CP_XML_ATTR(L"amt",(int)(*val.opacity * 1000));
|
||||
CP_XML_ATTR2(ns_att + L"amt", (int)(*val.opacity * 1000));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (val.bitmap->bCrop)
|
||||
{
|
||||
CP_XML_NODE(L"a:srcRect")
|
||||
CP_XML_NODE(ns + L":srcRect")
|
||||
{
|
||||
CP_XML_ATTR(L"l", static_cast<int>(val.bitmap->cropRect[0]*1000));
|
||||
CP_XML_ATTR(L"t", static_cast<int>(val.bitmap->cropRect[1]*1000));
|
||||
CP_XML_ATTR(L"r", static_cast<int>(val.bitmap->cropRect[2]*1000));
|
||||
CP_XML_ATTR(L"b", static_cast<int>(val.bitmap->cropRect[3]*1000));
|
||||
CP_XML_ATTR2(ns_att + L"l", static_cast<int>(val.bitmap->cropRect[0]*1000));
|
||||
CP_XML_ATTR2(ns_att + L"t", static_cast<int>(val.bitmap->cropRect[1]*1000));
|
||||
CP_XML_ATTR2(ns_att + L"r", static_cast<int>(val.bitmap->cropRect[2]*1000));
|
||||
CP_XML_ATTR2(ns_att + L"b", static_cast<int>(val.bitmap->cropRect[3]*1000));
|
||||
}
|
||||
}
|
||||
if (val.bitmap->bTile)
|
||||
{
|
||||
CP_XML_NODE(L"a:tile")
|
||||
CP_XML_NODE(ns + L":tile")
|
||||
{
|
||||
//tx="0" ty="0" sx="100000" sy="100000"
|
||||
CP_XML_ATTR(L"flip", "none");
|
||||
CP_XML_ATTR(L"algn", L"ctr");
|
||||
CP_XML_ATTR2(ns_att + L"flip", "none");
|
||||
CP_XML_ATTR2(ns_att + L"algn", L"ctr");
|
||||
}
|
||||
}
|
||||
else if (val.bitmap->bStretch)
|
||||
{
|
||||
CP_XML_NODE(L"a:stretch")
|
||||
CP_XML_NODE(ns + L":stretch")
|
||||
{
|
||||
if (!val.bitmap->bCrop)
|
||||
{
|
||||
CP_XML_NODE(L"a:fillRect");
|
||||
CP_XML_NODE(ns + L":fillRect");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -269,25 +278,27 @@ void vml_serialize_gradient_fill(std::wostream & strm, const _oox_fill & val)
|
||||
}
|
||||
}
|
||||
}
|
||||
void oox_serialize_gradient_fill(std::wostream & strm, const _oox_fill & val)
|
||||
void oox_serialize_gradient_fill(std::wostream & strm, const _oox_fill & val, const std::wstring &ns)
|
||||
{
|
||||
if (!val.gradient) return;
|
||||
|
||||
std::wstring ns_att = (ns == L"a" ? L"" : ns + L":");
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"a:gradFill")
|
||||
CP_XML_NODE(ns + L":gradFill")
|
||||
{
|
||||
if (val.gradient->colors.size()>0)
|
||||
{
|
||||
CP_XML_NODE(L"a:gsLst")
|
||||
CP_XML_NODE(ns + L":gsLst")
|
||||
{
|
||||
for (int i = 0; i < val.gradient->colors.size(); i++)
|
||||
{
|
||||
oox_gradient_fill::_color_position & col = val.gradient->colors[i];
|
||||
CP_XML_NODE(L"a:gs")
|
||||
CP_XML_NODE(ns + L":gs")
|
||||
{
|
||||
CP_XML_ATTR(L"pos", (int)(col.pos * 1000));//%
|
||||
oox_serialize_srgb(CP_XML_STREAM(), col.color_ref, col.opacity);
|
||||
CP_XML_ATTR2(ns_att + L"pos", (int)(col.pos * 1000));//%
|
||||
oox_serialize_srgb(CP_XML_STREAM(), col.color_ref, col.opacity, ns);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -298,25 +309,25 @@ void oox_serialize_gradient_fill(std::wostream & strm, const _oox_fill & val)
|
||||
switch(val.gradient->style)
|
||||
{
|
||||
case 0:
|
||||
CP_XML_NODE(L"a:lin")
|
||||
CP_XML_NODE(ns + L":lin")
|
||||
{
|
||||
CP_XML_ATTR(L"ang",(int)angle);//gr in rad
|
||||
CP_XML_ATTR2(ns_att + L"ang",(int)angle);//gr in rad
|
||||
}break;
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
CP_XML_NODE(L"a:path")
|
||||
CP_XML_NODE(ns + L":path")
|
||||
{
|
||||
if (val.gradient->style == 1) CP_XML_ATTR(L"path", L"rect");
|
||||
if (val.gradient->style == 2) CP_XML_ATTR(L"path", L"circle");
|
||||
if (val.gradient->style == 3) CP_XML_ATTR(L"path", L"shape");
|
||||
if (val.gradient->style == 1) CP_XML_ATTR2(ns_att + L"path", L"rect");
|
||||
if (val.gradient->style == 2) CP_XML_ATTR2(ns_att + L"path", L"circle");
|
||||
if (val.gradient->style == 3) CP_XML_ATTR2(ns_att + L"path", L"shape");
|
||||
|
||||
CP_XML_NODE(L"a:fillToRect")
|
||||
CP_XML_NODE(ns + L":fillToRect")
|
||||
{
|
||||
CP_XML_ATTR(L"l", (int)(val.gradient->rect[0] * 1000));
|
||||
CP_XML_ATTR(L"t", (int)(val.gradient->rect[1] * 1000));
|
||||
CP_XML_ATTR(L"r", (int)(val.gradient->rect[2] * 1000));
|
||||
CP_XML_ATTR(L"b", (int)(val.gradient->rect[3] * 1000));
|
||||
CP_XML_ATTR2(ns_att + L"l", (int)(val.gradient->rect[0] * 1000));
|
||||
CP_XML_ATTR2(ns_att + L"t", (int)(val.gradient->rect[1] * 1000));
|
||||
CP_XML_ATTR2(ns_att + L"r", (int)(val.gradient->rect[2] * 1000));
|
||||
CP_XML_ATTR2(ns_att + L"b", (int)(val.gradient->rect[3] * 1000));
|
||||
}
|
||||
}break;
|
||||
}
|
||||
@ -324,22 +335,24 @@ void oox_serialize_gradient_fill(std::wostream & strm, const _oox_fill & val)
|
||||
//tileRect (Tile Rectangle) §20.1.8.59
|
||||
}
|
||||
}
|
||||
void oox_serialize_hatch_fill(std::wostream & strm, const _oox_fill & val)
|
||||
void oox_serialize_hatch_fill(std::wostream & strm, const _oox_fill & val, const std::wstring &ns)
|
||||
{
|
||||
if (!val.hatch)return;
|
||||
|
||||
std::wstring ns_att = (ns == L"a" ? L"" : ns + L":");
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"a:pattFill")
|
||||
CP_XML_NODE(ns + L":pattFill")
|
||||
{
|
||||
CP_XML_ATTR(L"prst",val.hatch->preset);
|
||||
CP_XML_NODE(L"a:fgClr")//опять для ms важно что этот цвет перед back
|
||||
CP_XML_ATTR2(ns_att + L"prst", val.hatch->preset);
|
||||
CP_XML_NODE(ns + L":fgClr")//опять для ms важно что этот цвет перед back
|
||||
{
|
||||
oox_serialize_srgb(CP_XML_STREAM(), val.hatch->color_ref, val.opacity);
|
||||
}
|
||||
if (val.hatch->color_back_ref)
|
||||
{
|
||||
CP_XML_NODE(L"a:bgClr")
|
||||
CP_XML_NODE(ns + L":bgClr")
|
||||
{
|
||||
oox_serialize_srgb(CP_XML_STREAM(), *val.hatch->color_back_ref ,val.opacity);
|
||||
}
|
||||
@ -379,23 +392,23 @@ void vml_serialize_background (std::wostream & strm, const _oox_fill & val, cons
|
||||
}
|
||||
}
|
||||
|
||||
void oox_serialize_fill (std::wostream & strm, const _oox_fill & val)
|
||||
void oox_serialize_fill (std::wostream & strm, const _oox_fill & val, const std::wstring &ns)
|
||||
{
|
||||
switch (val.type)
|
||||
{
|
||||
case 0:
|
||||
oox_serialize_none_fill(strm);
|
||||
oox_serialize_none_fill(strm, ns);
|
||||
break;
|
||||
case 1:
|
||||
oox_serialize_solid_fill(strm, val);
|
||||
oox_serialize_solid_fill(strm, val, ns);
|
||||
break;
|
||||
case 2:
|
||||
oox_serialize_bitmap_fill(strm, val);
|
||||
oox_serialize_bitmap_fill(strm, val, ns);
|
||||
break;
|
||||
case 3:
|
||||
oox_serialize_gradient_fill(strm, val);
|
||||
oox_serialize_gradient_fill(strm, val, ns);
|
||||
break;
|
||||
case 4: oox_serialize_hatch_fill(strm, val);
|
||||
case 4: oox_serialize_hatch_fill(strm, val, ns);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -143,10 +143,12 @@ namespace oox {
|
||||
}
|
||||
};
|
||||
|
||||
void vml_serialize_background (std::wostream & strm, const _oox_fill & val, const std::wstring & color, int id);
|
||||
void oox_serialize_fill (std::wostream & strm, const _oox_fill & val);
|
||||
void oox_serialize_srgb (std::wostream & strm,std::wstring color,_CP_OPT(double) opacity);
|
||||
void oox_serialize_srgb (std::wostream & strm,std::wstring color,_CP_OPT(odf_types::percent) opacity);
|
||||
void oox_serialize_bitmap_fill (std::wostream & strm, const _oox_fill & val);
|
||||
void vml_serialize_background (std::wostream & strm, const _oox_fill & val, const std::wstring &color, int id);
|
||||
|
||||
void oox_serialize_srgb (std::wostream & strm, const std::wstring &color, _CP_OPT(double) opacity, const std::wstring &ns = L"a");
|
||||
void oox_serialize_srgb (std::wostream & strm, const std::wstring &color, _CP_OPT(odf_types::percent) opacity, const std::wstring &ns = L"a");
|
||||
void oox_serialize_bitmap_fill (std::wostream & strm, const _oox_fill & val, const std::wstring &ns = L"a");
|
||||
|
||||
void oox_serialize_fill (std::wostream & strm, const _oox_fill & val, const std::wstring &ns = L"a");
|
||||
}
|
||||
}
|
||||
|
||||
@ -274,7 +274,7 @@ void pptx_serialize_chart(std::wostream & strm, _pptx_drawing & val)
|
||||
}
|
||||
val.serialize_xfrm(CP_XML_STREAM(), L"p", true);
|
||||
|
||||
//oox_serialize_ln(CP_XML_STREAM(),val.additional);
|
||||
//oox_serialize_ln(CP_XML_STREAM(), val.additional);
|
||||
|
||||
CP_XML_NODE(L"a:graphic")
|
||||
{
|
||||
@ -311,7 +311,7 @@ void pptx_serialize_table(std::wostream & strm, _pptx_drawing & val)
|
||||
}
|
||||
val.serialize_xfrm(CP_XML_STREAM(), L"p", true);
|
||||
|
||||
//oox_serialize_ln(CP_XML_STREAM(),val.additional);
|
||||
//oox_serialize_ln(CP_XML_STREAM(), val.additional);
|
||||
|
||||
CP_XML_NODE(L"a:graphic")
|
||||
{
|
||||
@ -352,7 +352,7 @@ void pptx_serialize_object(std::wostream & strm, _pptx_drawing & val)
|
||||
}
|
||||
val.serialize_xfrm(CP_XML_STREAM(), L"p", true);
|
||||
|
||||
//oox_serialize_ln(CP_XML_STREAM(),val.additional);
|
||||
//oox_serialize_ln(CP_XML_STREAM(), val.additional);
|
||||
|
||||
CP_XML_NODE(L"a:graphic")
|
||||
{
|
||||
|
||||
@ -252,7 +252,7 @@ void xlsx_serialize_chart(std::wostream & strm, _xlsx_drawing & val)
|
||||
CP_XML_NODE(L"xdr:cNvGraphicFramePr");
|
||||
}
|
||||
val.serialize_xfrm(CP_XML_STREAM(), L"xdr");
|
||||
//oox_serialize_ln(CP_XML_STREAM(),val.additional);
|
||||
//oox_serialize_ln(CP_XML_STREAM(), val.additional);
|
||||
|
||||
CP_XML_NODE(L"a:graphic")
|
||||
{
|
||||
|
||||
@ -284,7 +284,7 @@ void Compute_GradientFill(draw_gradient * image_style,oox::oox_gradient_fill_ptr
|
||||
|
||||
point.pos = 0;
|
||||
if (image_style->draw_start_color_) point.color_ref = image_style->draw_start_color_->get_hex_value();
|
||||
if (image_style->draw_start_intensity_) point.opacity = image_style->draw_start_intensity_->get_value();
|
||||
//if (image_style->draw_start_intensity_) point.opacity = image_style->draw_start_intensity_->get_value();
|
||||
|
||||
fill->colors.push_back(point);
|
||||
|
||||
@ -300,7 +300,7 @@ void Compute_GradientFill(draw_gradient * image_style,oox::oox_gradient_fill_ptr
|
||||
|
||||
point.pos = 0;
|
||||
if (image_style->draw_end_color_) point.color_ref = image_style->draw_end_color_->get_hex_value();
|
||||
if (image_style->draw_end_intensity_) point.opacity = image_style->draw_end_intensity_->get_value();
|
||||
//if (image_style->draw_end_intensity_) point.opacity = image_style->draw_end_intensity_->get_value();
|
||||
|
||||
fill->colors.push_back(point);
|
||||
|
||||
@ -312,7 +312,7 @@ void Compute_GradientFill(draw_gradient * image_style,oox::oox_gradient_fill_ptr
|
||||
|
||||
point.pos = 100;
|
||||
if (image_style->draw_end_color_) point.color_ref = image_style->draw_end_color_->get_hex_value();
|
||||
if (image_style->draw_end_intensity_) point.opacity = image_style->draw_end_intensity_->get_value();
|
||||
//if (image_style->draw_end_intensity_) point.opacity = image_style->draw_end_intensity_->get_value();
|
||||
|
||||
fill->colors.push_back(point);
|
||||
}break;
|
||||
@ -328,13 +328,13 @@ void Compute_GradientFill(draw_gradient * image_style,oox::oox_gradient_fill_ptr
|
||||
|
||||
point.pos = 0;
|
||||
if (image_style->draw_start_color_) point.color_ref = image_style->draw_start_color_->get_hex_value();
|
||||
if (image_style->draw_start_intensity_) point.opacity = image_style->draw_start_intensity_->get_value();
|
||||
//if (image_style->draw_start_intensity_) point.opacity = image_style->draw_start_intensity_->get_value();
|
||||
|
||||
fill->colors.push_back(point);
|
||||
|
||||
point.pos = 100;
|
||||
if (image_style->draw_end_color_) point.color_ref = image_style->draw_end_color_->get_hex_value();
|
||||
if (image_style->draw_end_intensity_) point.opacity = image_style->draw_end_intensity_->get_value();
|
||||
//if (image_style->draw_end_intensity_) point.opacity = image_style->draw_end_intensity_->get_value();
|
||||
|
||||
fill->colors.push_back(point);
|
||||
|
||||
|
||||
@ -855,8 +855,7 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, union_comm
|
||||
}
|
||||
|
||||
if (drawing->styleWrap && drawing->styleWrap->get_type() == style_wrap::RunThrough
|
||||
&& styleRunThrough && styleRunThrough->get_type() == run_through::Background
|
||||
)
|
||||
&& styleRunThrough && styleRunThrough->get_type() == run_through::Background)
|
||||
{
|
||||
drawing-> behindDoc = L"1";
|
||||
}
|
||||
@ -896,7 +895,7 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, union_comm
|
||||
//////////////////////////////////////////
|
||||
bool bTxbx = (drawing->sub_type == 1);
|
||||
|
||||
Compute_GraphicFill(graphicProperties.common_draw_fill_attlist_, graphicProperties.style_background_image_, Context.root()->odf_context().drawStyles() ,drawing->fill, bTxbx);
|
||||
Compute_GraphicFill(graphicProperties.common_draw_fill_attlist_, graphicProperties.style_background_image_, Context.root()->odf_context().drawStyles(),drawing->fill, bTxbx);
|
||||
|
||||
if ((drawing->fill.bitmap) && (drawing->fill.bitmap->rId.empty()))
|
||||
{
|
||||
@ -1040,7 +1039,7 @@ void draw_shape::docx_convert(oox::docx_conversion_context & Context)
|
||||
|
||||
if (drawing.sub_type !=5 )//line
|
||||
{
|
||||
drawing.additional.push_back(_property(L"text-content",Context.get_drawing_context().get_text_stream_shape()));
|
||||
drawing.additional.push_back(_property(L"text-content", Context.get_drawing_context().get_text_stream_shape()));
|
||||
}
|
||||
|
||||
Context.get_drawing_context().clear_stream_shape();
|
||||
@ -1055,7 +1054,7 @@ void draw_shape::docx_convert(oox::docx_conversion_context & Context)
|
||||
bad_shape_ = false;
|
||||
}
|
||||
|
||||
if (drawing.fill.type < 1 && !IsExistProperty(drawing.additional,L"stroke"))//бывает что и не определено ничего
|
||||
if (drawing.fill.type < 1 && !IsExistProperty(drawing.additional, L"stroke"))//бывает что и не определено ничего
|
||||
{
|
||||
drawing.fill.solid = oox::oox_solid_fill::create();
|
||||
drawing.fill.solid->color = L"729FCF";
|
||||
|
||||
@ -69,7 +69,14 @@ void draw_shape_attlist::add_attributes( const xml::attributes_wc_ptr & Attribut
|
||||
|
||||
void draw_shape::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
{
|
||||
CP_CREATE_ELEMENT(content_);
|
||||
if CP_CHECK_NAME(L"draw", L"enhanced-geometry")
|
||||
{
|
||||
CP_CREATE_ELEMENT(enhanced_geometry_);
|
||||
}
|
||||
else
|
||||
{
|
||||
CP_CREATE_ELEMENT(content_);
|
||||
}
|
||||
}
|
||||
void draw_shape::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
|
||||
@ -85,7 +85,8 @@ public:
|
||||
odf_types::common_xlink_attlist xlink_attlist_;
|
||||
_CP_OPT(std::wstring) draw_id_; //используется для анимашек
|
||||
|
||||
office_element_ptr_array content_;
|
||||
office_element_ptr_array content_;
|
||||
office_element_ptr enhanced_geometry_;
|
||||
|
||||
bool bad_shape_;
|
||||
bool word_art_;
|
||||
|
||||
@ -72,34 +72,65 @@ void draw_shape::common_docx_convert(oox::docx_conversion_context & Context)
|
||||
|
||||
Context.get_drawing_context().add_name_object(name.get_value_or(L"Shape"));
|
||||
|
||||
//////////////////////////////на другом контексте
|
||||
//---------------------------сначала элементы графики потом все остальное
|
||||
if (enhanced_geometry_)
|
||||
enhanced_geometry_->docx_convert(Context);
|
||||
|
||||
//---------------------------на другом контексте
|
||||
//тут может быть не только текст , но и таблицы, другие объекты ...
|
||||
oox::StreamsManPtr prev = Context.get_stream_man();
|
||||
|
||||
std::wstringstream temp_stream(Context.get_drawing_context().get_text_stream_shape());
|
||||
Context.set_stream_man( boost::shared_ptr<oox::streams_man>( new oox::streams_man(temp_stream) ));
|
||||
|
||||
//сначала элементы графики потом все остальное
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
ElementType type = content_[i]->get_type();
|
||||
|
||||
if (type == typeDrawCustomShape) // || ....
|
||||
{
|
||||
content_[i]->docx_convert(Context);
|
||||
}
|
||||
}
|
||||
Context.reset_context_state();
|
||||
|
||||
if (word_art_)
|
||||
{
|
||||
const std::wstring styleName = common_draw_attlists_.shape_with_text_and_styles_.
|
||||
common_shape_draw_attlist_.draw_style_name_.get_value_or(L"");
|
||||
|
||||
style_instance* styleInst = Context.root()->odf_context().styleContainer().style_by_name(styleName, odf_types::style_family::Graphic,Context.process_headers_footers_);
|
||||
style_content * content = styleInst ? styleInst->content() : NULL;
|
||||
graphic_format_properties * graphicProp = content ? content->get_graphic_properties() : NULL;
|
||||
|
||||
if (graphicProp)
|
||||
{
|
||||
oox::_oox_fill fill;
|
||||
Compute_GraphicFill(graphicProp->common_draw_fill_attlist_, graphicProp->style_background_image_,
|
||||
Context.root()->odf_context().drawStyles(), fill);
|
||||
if ((fill.bitmap) && (fill.bitmap->rId.empty()))
|
||||
{
|
||||
std::wstring href = fill.bitmap->xlink_href_;
|
||||
fill.bitmap->rId = Context.get_mediaitems().add_or_find(href, oox::typeImage, fill.bitmap->isInternal, href);
|
||||
}
|
||||
|
||||
std::wstringstream strm_fill, strm_ln;
|
||||
oox::oox_serialize_fill(strm_fill, fill, L"w14");
|
||||
std::wstring textFill = strm_fill.str();
|
||||
|
||||
std::vector<_property> props;
|
||||
graphicProp->apply_to(props);
|
||||
|
||||
oox::oox_serialize_ln(strm_ln, props, false, L"w14");
|
||||
std::wstring textLn = strm_ln.str();
|
||||
|
||||
std::wstring text_props;
|
||||
if (!textLn.empty())
|
||||
{
|
||||
text_props += textLn;
|
||||
}
|
||||
if (!textFill.empty())
|
||||
{
|
||||
text_props += L"<w14:textFill>" + textFill + L"</w14:textFill>";
|
||||
}
|
||||
Context.set_drawing_text_props(text_props);
|
||||
}
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
ElementType type = content_[i]->get_type();
|
||||
|
||||
if (type != typeDrawCustomShape)
|
||||
{
|
||||
content_[i]->docx_convert(Context);
|
||||
}
|
||||
content_[i]->docx_convert(Context);
|
||||
}
|
||||
|
||||
Context.back_context_state();
|
||||
|
||||
@ -162,13 +162,22 @@ void draw_shape::common_pptx_convert(oox::pptx_conversion_context & Context)
|
||||
}
|
||||
////////////////////////////////////////////////////////////////////////////////////
|
||||
Context.get_text_context().start_object();
|
||||
|
||||
if (enhanced_geometry_)
|
||||
enhanced_geometry_->pptx_convert(Context);
|
||||
|
||||
if (word_art_)
|
||||
{
|
||||
//set fill & stroke to text
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
content_[i]->pptx_convert(Context);
|
||||
}
|
||||
std::wstring text_content_ = Context.get_text_context().end_object();
|
||||
|
||||
if (text_content_.length()>0)
|
||||
if (!text_content_.empty())
|
||||
{
|
||||
Context.get_slide_context().set_property(_property(L"text-content",text_content_));
|
||||
}
|
||||
|
||||
@ -66,6 +66,9 @@ namespace odf_reader {
|
||||
|
||||
void draw_shape::common_xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
if (enhanced_geometry_)
|
||||
enhanced_geometry_->xlsx_convert(Context);
|
||||
|
||||
common_draw_shape_with_text_and_styles_attlist common_draw_attlist_ = common_draw_attlists_.shape_with_text_and_styles_;
|
||||
|
||||
const int z_index = common_draw_attlist_.common_shape_draw_attlist_.draw_z_index_.get_value_or(0);
|
||||
@ -130,11 +133,17 @@ void draw_shape::common_xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
|
||||
oox::_oox_fill fill;
|
||||
Compute_GraphicFill(properties.common_draw_fill_attlist_, properties.style_background_image_,
|
||||
Context.root()->odf_context().drawStyles() ,fill);
|
||||
Context.root()->odf_context().drawStyles(), fill);
|
||||
Context.get_drawing_context().set_fill(fill);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
Context.get_text_context().start_drawing_content();
|
||||
|
||||
if (word_art_)
|
||||
{
|
||||
//Context.get_text_context().start_drawing_fill(fill);
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
content_[i]->xlsx_convert(Context);
|
||||
@ -143,7 +152,7 @@ void draw_shape::common_xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
|
||||
if (!text_content_.empty())
|
||||
{
|
||||
Context.get_drawing_context().set_property(_property(L"text-content",text_content_));
|
||||
Context.get_drawing_context().set_property(_property(L"text-content", text_content_));
|
||||
}
|
||||
|
||||
Context.get_drawing_context().end_drawing();
|
||||
|
||||
@ -200,7 +200,11 @@ odf_document::Impl::Impl(const std::wstring & srcPath, const std::wstring & temp
|
||||
|
||||
if (false == map_encryptions_.empty())
|
||||
{
|
||||
if (password.empty()) return;
|
||||
if (password.empty())
|
||||
{
|
||||
bError = true;
|
||||
return;
|
||||
}
|
||||
|
||||
//decrypt files
|
||||
tmp_folder_ = NSDirectory::CreateDirectoryWithUniqueName(tempPath);
|
||||
@ -286,17 +290,22 @@ bool odf_document::Impl::decrypt_folder (const std::wstring &password, const std
|
||||
bool result = true;
|
||||
for (size_t i = 0; i < arFiles.size(); ++i)
|
||||
{
|
||||
result = false;
|
||||
std::wstring sFileName = NSFile::GetFileName(arFiles[i]);
|
||||
|
||||
std::map<std::wstring, std::pair<office_element_ptr, int>>::iterator pFind = map_encryptions_.find(arFiles[i]);
|
||||
if ( pFind != map_encryptions_.end() )
|
||||
std::map<std::wstring, std::pair<office_element_ptr, int>>::iterator pFind;
|
||||
if (false == map_encryptions_.empty())
|
||||
{
|
||||
result = decrypt_file(password, arFiles[i], dstPath + FILE_SEPARATOR_STR + sFileName, pFind->second.first, pFind->second.second);
|
||||
|
||||
if (false == result)
|
||||
break;
|
||||
pFind = map_encryptions_.find(arFiles[i]);
|
||||
if ( pFind != map_encryptions_.end() )
|
||||
{
|
||||
result = decrypt_file(password, arFiles[i], dstPath + FILE_SEPARATOR_STR + sFileName, pFind->second.first, pFind->second.second);
|
||||
|
||||
if (false == result)
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (!result && false == map_encryptions_extra_.empty())
|
||||
{
|
||||
pFind = map_encryptions_extra_.find(arFiles[i]);
|
||||
if ( pFind != map_encryptions_.end() )
|
||||
@ -306,10 +315,11 @@ bool odf_document::Impl::decrypt_folder (const std::wstring &password, const std
|
||||
if (false == result)
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
NSFile::CFileBinary::Copy(arFiles[i], dstPath + FILE_SEPARATOR_STR + sFileName);
|
||||
}
|
||||
}
|
||||
if (!result)
|
||||
{
|
||||
NSFile::CFileBinary::Copy(arFiles[i], dstPath + FILE_SEPARATOR_STR + sFileName);
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
for (size_t i = 0; result && i < arDirectories.size(); ++i)
|
||||
|
||||
@ -407,6 +407,7 @@ void draw_enhanced_geometry_attlist::serialize(CP_ATTR_NODE)
|
||||
CP_XML_ATTR_OPT(L"draw:type", draw_type_);
|
||||
CP_XML_ATTR_OPT(L"drawooo:sub-view-size", draw_sub_view_size_);
|
||||
CP_XML_ATTR_OPT(L"draw:text-areas", draw_text_areas_);
|
||||
CP_XML_ATTR_OPT(L"draw:text-rotate-angle", draw_text_rotate_angle_);
|
||||
CP_XML_ATTR_OPT(L"draw:modifiers", draw_modifiers_);
|
||||
CP_XML_ATTR_OPT(L"drawooo:enhanced-path", draw_enhanced_path_);
|
||||
//CP_XML_ATTR_OPT(L"draw:enhanced-path", draw_enhanced_path_);
|
||||
@ -430,7 +431,7 @@ void draw_enhanced_geometry::serialize(std::wostream & _Wostream)
|
||||
CP_XML_NODE_SIMPLE()
|
||||
{
|
||||
CP_XML_ATTR_OPT(L"svg:viewBox", svg_viewbox_);
|
||||
draw_enhanced_geometry_attlist_.serialize(CP_GET_XML_NODE());
|
||||
attlist_.serialize(CP_GET_XML_NODE());
|
||||
|
||||
for (size_t i = 0; i < draw_equation_.size(); i++)
|
||||
{
|
||||
|
||||
@ -331,6 +331,8 @@ public:
|
||||
_CP_OPT(odf_types::Bool) draw_text_path_same_letter_heights_;
|
||||
_CP_OPT(std::wstring) draw_text_path_mode_;
|
||||
_CP_OPT(std::wstring) draw_text_path_scale_;
|
||||
|
||||
_CP_OPT(int) draw_text_rotate_angle_;
|
||||
|
||||
void serialize(CP_ATTR_NODE);
|
||||
};
|
||||
@ -350,7 +352,7 @@ public:
|
||||
|
||||
virtual void serialize(std::wostream & _Wostream);
|
||||
|
||||
draw_enhanced_geometry_attlist draw_enhanced_geometry_attlist_;
|
||||
draw_enhanced_geometry_attlist attlist_;
|
||||
|
||||
_CP_OPT(std::wstring) svg_viewbox_;
|
||||
|
||||
|
||||
@ -186,6 +186,7 @@ struct odf_drawing_state
|
||||
presentation_placeholder_ = boost::none;
|
||||
|
||||
rotateAngle_ = boost::none;
|
||||
text_rotateAngle_ = boost::none;
|
||||
|
||||
path_ = L"";
|
||||
view_box_ = L"";
|
||||
@ -218,6 +219,7 @@ struct odf_drawing_state
|
||||
|
||||
_CP_OPT(double) rotateAngle_;
|
||||
_CP_OPT(unsigned int) fill_color_;
|
||||
_CP_OPT(int) text_rotateAngle_;
|
||||
|
||||
_CP_OPT(presentation_class) presentation_class_;
|
||||
_CP_OPT(std::wstring) presentation_placeholder_;
|
||||
@ -232,6 +234,7 @@ struct odf_drawing_state
|
||||
int oox_shape_preset_;
|
||||
bool in_group_;
|
||||
bool text_box_tableframe_;
|
||||
|
||||
};
|
||||
|
||||
class odf_drawing_context::Impl
|
||||
@ -536,7 +539,7 @@ void odf_drawing_context::end_drawing()
|
||||
if (impl_->current_drawing_state_.rotateAngle_)
|
||||
rotate += *impl_->current_drawing_state_.rotateAngle_;
|
||||
|
||||
if (fabs(rotate)>0.001)impl_->current_drawing_state_.rotateAngle_ = rotate;
|
||||
if (fabs(rotate) > 0.001)impl_->current_drawing_state_.rotateAngle_ = rotate;
|
||||
}
|
||||
double x = impl_->current_drawing_state_.svg_x_ ? impl_->current_drawing_state_.svg_x_->get_value() : 0;
|
||||
double y = impl_->current_drawing_state_.svg_y_ ? impl_->current_drawing_state_.svg_y_->get_value() : 0;
|
||||
@ -615,8 +618,8 @@ void odf_drawing_context::end_drawing()
|
||||
draw_enhanced_geometry* enhan = dynamic_cast<draw_enhanced_geometry*>(custom->draw_enhanced_geometry_.get());
|
||||
if(enhan)
|
||||
{
|
||||
if (impl_->current_drawing_state_.flipV_) enhan->draw_enhanced_geometry_attlist_.draw_mirror_vertical_ = true;
|
||||
if (impl_->current_drawing_state_.flipH_) enhan->draw_enhanced_geometry_attlist_.draw_mirror_horizontal_ = true;
|
||||
if (impl_->current_drawing_state_.flipV_) enhan->attlist_.draw_mirror_vertical_ = true;
|
||||
if (impl_->current_drawing_state_.flipH_) enhan->attlist_.draw_mirror_horizontal_ = true;
|
||||
}
|
||||
}else
|
||||
{
|
||||
@ -986,15 +989,17 @@ void odf_drawing_context::end_shape()
|
||||
{
|
||||
if (text_shape)
|
||||
{
|
||||
enhanced->draw_enhanced_geometry_attlist_.draw_text_path_same_letter_heights_ = false;
|
||||
enhanced->draw_enhanced_geometry_attlist_.draw_text_path_scale_ = L"path" ;
|
||||
enhanced->draw_enhanced_geometry_attlist_.draw_text_path_mode_ = L"shape" ;
|
||||
enhanced->draw_enhanced_geometry_attlist_.draw_text_path_ = true;
|
||||
enhanced->attlist_.draw_text_path_same_letter_heights_ = false;
|
||||
enhanced->attlist_.draw_text_path_scale_ = L"path" ;
|
||||
enhanced->attlist_.draw_text_path_mode_ = L"shape" ;
|
||||
enhanced->attlist_.draw_text_path_ = true;
|
||||
|
||||
enhanced->attlist_.draw_text_rotate_angle_ = impl_->current_drawing_state_.text_rotateAngle_;
|
||||
}
|
||||
|
||||
if (!impl_->current_drawing_state_.path_.empty())
|
||||
{
|
||||
enhanced->draw_enhanced_geometry_attlist_.draw_enhanced_path_ =impl_->current_drawing_state_.path_;
|
||||
enhanced->attlist_.draw_enhanced_path_ =impl_->current_drawing_state_.path_;
|
||||
}
|
||||
if (!impl_->current_drawing_state_.view_box_.empty())
|
||||
{
|
||||
@ -1002,7 +1007,7 @@ void odf_drawing_context::end_shape()
|
||||
}
|
||||
if (!sub_type.empty())
|
||||
{
|
||||
enhanced->draw_enhanced_geometry_attlist_.draw_type_ = sub_type;
|
||||
enhanced->attlist_.draw_type_ = sub_type;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1018,23 +1023,23 @@ void odf_drawing_context::end_shape()
|
||||
else
|
||||
enhanced->svg_viewbox_ = shape_define->view_box;
|
||||
|
||||
enhanced->draw_enhanced_geometry_attlist_.draw_type_ = shape_define->odf_type_name;
|
||||
enhanced->draw_enhanced_geometry_attlist_.draw_text_areas_ = shape_define->text_areas;
|
||||
enhanced->attlist_.draw_type_ = shape_define->odf_type_name;
|
||||
enhanced->attlist_.draw_text_areas_ = shape_define->text_areas;
|
||||
|
||||
enhanced->draw_enhanced_geometry_attlist_.draw_glue_points_ = shape_define->glue_points;
|
||||
enhanced->draw_enhanced_geometry_attlist_.draw_sub_view_size_ = shape_define->sub_view_size;
|
||||
enhanced->attlist_.draw_glue_points_ = shape_define->glue_points;
|
||||
enhanced->attlist_.draw_sub_view_size_ = shape_define->sub_view_size;
|
||||
|
||||
if (impl_->current_drawing_state_.oox_shape_ && !impl_->current_drawing_state_.oox_shape_->modifiers.empty())
|
||||
{
|
||||
enhanced->draw_enhanced_geometry_attlist_.draw_modifiers_ = impl_->current_drawing_state_.oox_shape_->modifiers;
|
||||
enhanced->attlist_.draw_modifiers_ = impl_->current_drawing_state_.oox_shape_->modifiers;
|
||||
}
|
||||
else // обязательно нужны дефолтовые
|
||||
enhanced->draw_enhanced_geometry_attlist_.draw_modifiers_ = shape_define->modifiers;
|
||||
enhanced->attlist_.draw_modifiers_ = shape_define->modifiers;
|
||||
|
||||
if (!shape_define->enhanced_path.empty())
|
||||
enhanced->draw_enhanced_geometry_attlist_.draw_enhanced_path_ = shape_define->enhanced_path;
|
||||
enhanced->attlist_.draw_enhanced_path_ = shape_define->enhanced_path;
|
||||
else
|
||||
enhanced->draw_enhanced_geometry_attlist_.draw_enhanced_path_ = impl_->current_drawing_state_.path_;
|
||||
enhanced->attlist_.draw_enhanced_path_ = impl_->current_drawing_state_.path_;
|
||||
|
||||
for (size_t i = 0; i < shape_define->equations.size(); i++)
|
||||
{
|
||||
@ -1074,6 +1079,18 @@ void odf_drawing_context::end_shape()
|
||||
}
|
||||
end_element();
|
||||
}
|
||||
if (impl_->current_drawing_state_.flipV_)
|
||||
{
|
||||
impl_->current_graphic_properties->style_mirror_ = std::wstring(L"vertical");
|
||||
}
|
||||
if (impl_->current_drawing_state_.flipH_)
|
||||
{
|
||||
if (impl_->current_graphic_properties->style_mirror_)
|
||||
impl_->current_graphic_properties->style_mirror_ = *impl_->current_graphic_properties->style_mirror_ + std::wstring(L" horizontal");
|
||||
else
|
||||
impl_->current_graphic_properties->style_mirror_ = std::wstring(L"horizontal");
|
||||
}
|
||||
|
||||
end_element();
|
||||
}
|
||||
|
||||
@ -1346,7 +1363,7 @@ void odf_drawing_context::set_solid_fill(std::wstring hexColor)
|
||||
switch(impl_->current_drawing_part_)
|
||||
{
|
||||
case Area:
|
||||
impl_->current_graphic_properties->common_draw_fill_attlist_.draw_fill_color_ = hexColor;
|
||||
impl_->current_graphic_properties->common_draw_fill_attlist_.draw_fill_color_ = hexColor;
|
||||
//impl_->current_graphic_properties->common_background_color_attlist_.fo_background_color_ = color(hexColor); - default transparent
|
||||
//последнее нужно - что если будут вводить текст - под текстом будет цвет фона (или он поменяется в полях текста)
|
||||
|
||||
@ -1599,26 +1616,10 @@ void odf_drawing_context::set_viewBox (double W, double H)
|
||||
void odf_drawing_context::set_flip_H(bool bVal)
|
||||
{
|
||||
impl_->current_drawing_state_.flipH_ = bVal;
|
||||
|
||||
if (impl_->current_graphic_properties == NULL) return;
|
||||
if (bVal == false)return;
|
||||
//for image
|
||||
if (impl_->current_graphic_properties->style_mirror_)
|
||||
impl_->current_graphic_properties->style_mirror_ = *impl_->current_graphic_properties->style_mirror_ + std::wstring(L" horizontal");
|
||||
else
|
||||
impl_->current_graphic_properties->style_mirror_ = std::wstring(L"horizontal");
|
||||
}
|
||||
void odf_drawing_context::set_flip_V(bool bVal)
|
||||
{
|
||||
impl_->current_drawing_state_.flipV_ = bVal;
|
||||
|
||||
if (impl_->current_graphic_properties == NULL) return;
|
||||
if (bVal == false)return;
|
||||
//for image
|
||||
if (impl_->current_graphic_properties->style_mirror_)
|
||||
impl_->current_graphic_properties->style_mirror_ = *impl_->current_graphic_properties->style_mirror_ + std::wstring(L" vertical");
|
||||
else
|
||||
impl_->current_graphic_properties->style_mirror_ = std::wstring(L"vertical");
|
||||
}
|
||||
|
||||
void odf_drawing_context::set_rotate(double dVal)
|
||||
@ -2278,6 +2279,33 @@ void odf_drawing_context::set_textarea_writing_mode(int mode)
|
||||
if (mode == 1) return;//незачем
|
||||
if (impl_->current_drawing_state_.elements_.empty())return;
|
||||
|
||||
if (impl_->current_drawing_state_.oox_shape_preset_ > 2000 && impl_->current_drawing_state_.oox_shape_preset_ < 3000)
|
||||
{
|
||||
switch(mode)
|
||||
{
|
||||
case 5://textverticaltypeWordArtVert:
|
||||
case 6://textverticaltypeWordArtVertRtl:
|
||||
case 3://SimpleTypes::textverticaltypeVert:
|
||||
case 2://SimpleTypes::textverticaltypeMongolianVert:
|
||||
case 0://SimpleTypes::textverticaltypeEaVert:
|
||||
impl_->current_drawing_state_.rotateAngle_ = 90. / 180. * 3.14159265358979323846;
|
||||
break;
|
||||
case 4://SimpleTypes::textverticaltypeVert270:
|
||||
impl_->current_drawing_state_.rotateAngle_ = 270. / 180. * 3.14159265358979323846;
|
||||
break;
|
||||
case 1://SimpleTypes::textverticaltypeHorz:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (impl_->current_drawing_state_.flipH_ && impl_->current_drawing_state_.rotateAngle_ )
|
||||
{
|
||||
impl_->current_drawing_state_.rotateAngle_ = - *impl_->current_drawing_state_.rotateAngle_;
|
||||
impl_->current_drawing_state_.flipH_ = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!impl_->current_paragraph_properties)
|
||||
{
|
||||
style* style_ = dynamic_cast<style*>(impl_->current_drawing_state_.elements_[0].style_elm.get());
|
||||
@ -2483,6 +2511,12 @@ void odf_drawing_context::start_text_box()
|
||||
}
|
||||
void odf_drawing_context::set_text_box_min_size(bool val)
|
||||
{
|
||||
if (impl_->current_graphic_properties)
|
||||
{
|
||||
impl_->current_graphic_properties->draw_auto_grow_height_ = true;
|
||||
impl_->current_graphic_properties->draw_auto_grow_width_ = true;
|
||||
}
|
||||
|
||||
if (impl_->current_drawing_state_.elements_.empty()) return;
|
||||
|
||||
draw_text_box* draw = dynamic_cast<draw_text_box*>(impl_->current_drawing_state_.elements_.back().elm.get());
|
||||
@ -2647,7 +2681,13 @@ void odf_drawing_context::end_image()
|
||||
end_shape();
|
||||
return;
|
||||
}
|
||||
|
||||
if (impl_->current_drawing_state_.flipH_)
|
||||
{
|
||||
if (impl_->current_graphic_properties->style_mirror_)
|
||||
impl_->current_graphic_properties->style_mirror_ = *impl_->current_graphic_properties->style_mirror_ + std::wstring(L" horizontal");
|
||||
else
|
||||
impl_->current_graphic_properties->style_mirror_ = std::wstring(L"horizontal");
|
||||
}
|
||||
end_element();
|
||||
end_frame();
|
||||
}
|
||||
@ -2795,7 +2835,8 @@ void odf_drawing_context::set_text(odf_text_context* text_context)
|
||||
}
|
||||
}
|
||||
|
||||
if (impl_->current_graphic_properties)
|
||||
if ((impl_->current_graphic_properties) &&
|
||||
!impl_->current_graphic_properties->draw_auto_grow_height_)
|
||||
{
|
||||
//автоувеличение при добавлении текста
|
||||
impl_->current_graphic_properties->draw_auto_grow_height_ = false;
|
||||
@ -2860,10 +2901,20 @@ void odf_drawing_context::start_gradient_style()
|
||||
if (gradient->draw_start_color_) gradient->draw_start_intensity_ = 100.;
|
||||
|
||||
gradient->draw_border_ = 0;
|
||||
impl_->current_graphic_properties->common_draw_fill_attlist_.draw_fill_gradient_name_ = gradient->draw_name_;
|
||||
impl_->current_graphic_properties->common_draw_fill_attlist_.draw_fill_ = draw_fill(draw_fill::gradient);
|
||||
|
||||
|
||||
switch(impl_->current_drawing_part_)
|
||||
{
|
||||
case Area:
|
||||
impl_->current_graphic_properties->common_draw_fill_attlist_.draw_fill_gradient_name_ = gradient->draw_name_;
|
||||
impl_->current_graphic_properties->common_draw_fill_attlist_.draw_fill_ = draw_fill(draw_fill::gradient);
|
||||
break;
|
||||
case Line:
|
||||
if (!impl_->current_graphic_properties->draw_stroke_)
|
||||
impl_->current_graphic_properties->draw_stroke_ = line_style(line_style::Solid);//default
|
||||
if (!impl_->current_graphic_properties->svg_stroke_width_)
|
||||
impl_->current_graphic_properties->svg_stroke_width_ = length(length(1, length::pt).get_value_unit(length::cm), length::cm);//default
|
||||
break;
|
||||
}
|
||||
}
|
||||
void odf_drawing_context::set_gradient_type(gradient_style::type style)
|
||||
{
|
||||
@ -2882,6 +2933,11 @@ void odf_drawing_context::set_gradient_start(std::wstring hexColor, _CP_OPT(doub
|
||||
|
||||
gradient->draw_start_color_ = hexColor;
|
||||
gradient->draw_start_intensity_ = 100.;
|
||||
|
||||
if (impl_->current_drawing_part_ == Line)
|
||||
{
|
||||
impl_->current_graphic_properties->svg_stroke_color_ = hexColor;
|
||||
}
|
||||
}
|
||||
void odf_drawing_context::set_gradient_end (std::wstring hexColor, _CP_OPT(double) & intensiv)
|
||||
{
|
||||
|
||||
@ -593,7 +593,7 @@ void OoxConverter::convert(PPTX::Logic::Shape *oox_shape)
|
||||
if (oox_shape->txBody.IsInit()) bodyPr = oox_shape->txBody->bodyPr.GetPointer();
|
||||
else bodyPr = oox_shape->oTextBoxBodyPr.GetPointer();
|
||||
|
||||
if (bodyPr && bodyPr->fromWordArt.get_value_or(false))
|
||||
if ((bodyPr) && (bodyPr->prstTxWarp.IsInit()))
|
||||
{
|
||||
int wordart_type = convert(bodyPr->prstTxWarp.GetPointer());
|
||||
if (wordart_type > 0) type = wordart_type;
|
||||
@ -782,9 +782,16 @@ void OoxConverter::convert(PPTX::Logic::UniFill *oox_fill, DWORD nARGB)
|
||||
int OoxConverter::convert(PPTX::Logic::PrstTxWarp *oox_text_preset)
|
||||
{
|
||||
if (oox_text_preset == NULL) return -1;
|
||||
if (oox_text_preset->prst.GetBYTECode() == SimpleTypes::textshapetypeTextNoShape) return 2000;
|
||||
|
||||
return 2001 + oox_text_preset->prst.GetBYTECode();
|
||||
|
||||
if (oox_text_preset->prst.GetBYTECode() == SimpleTypes::textshapetypeTextNoShape ||
|
||||
oox_text_preset->prst.GetBYTECode() == SimpleTypes::textshapetypeTextPlain) // в зависимости от других настроек
|
||||
{
|
||||
return 2000;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 2001 + oox_text_preset->prst.GetBYTECode();
|
||||
}
|
||||
}
|
||||
void OoxConverter::convert(PPTX::Logic::PrstGeom *oox_geom)
|
||||
{
|
||||
@ -1067,8 +1074,13 @@ void OoxConverter::convert(PPTX::Logic::GradFill *oox_grad_fill, DWORD nARGB)
|
||||
std::wstring hexColorStart, hexColorEnd;
|
||||
_CP_OPT(double) opacityStart, opacityEnd;
|
||||
|
||||
convert(&oox_grad_fill->GsLst[0].color,hexColorEnd, opacityEnd, nARGB);
|
||||
convert(&oox_grad_fill->GsLst[oox_grad_fill->GsLst.size()-1].color,hexColorStart, opacityStart, nARGB);
|
||||
convert(&oox_grad_fill->GsLst[0].color, hexColorEnd, opacityEnd, nARGB);
|
||||
convert(&oox_grad_fill->GsLst[oox_grad_fill->GsLst.size() - 1].color, hexColorStart, opacityStart, nARGB);
|
||||
|
||||
if (hexColorEnd == hexColorStart && opacityEnd == opacityStart && oox_grad_fill->GsLst.size() > 2)
|
||||
{
|
||||
convert(&oox_grad_fill->GsLst[oox_grad_fill->GsLst.size() / 2].color, hexColorStart, opacityStart, nARGB);
|
||||
}
|
||||
|
||||
odf_context()->drawing_context()->set_gradient_start(hexColorStart, opacityStart);
|
||||
odf_context()->drawing_context()->set_gradient_end (hexColorEnd, opacityEnd);
|
||||
@ -1253,6 +1265,16 @@ void OoxConverter::convert(PPTX::Logic::BodyPr *oox_bodyPr)
|
||||
{
|
||||
if (!oox_bodyPr) return;
|
||||
|
||||
if ((oox_bodyPr->fromWordArt.IsInit() && (*oox_bodyPr->fromWordArt)) && oox_bodyPr->prstTxWarp.IsInit())
|
||||
{
|
||||
for (size_t i = 0; i < oox_bodyPr->prstTxWarp->avLst.size(); i++)
|
||||
{
|
||||
if (oox_bodyPr->prstTxWarp->avLst[i].fmla.IsInit())
|
||||
{
|
||||
odf_context()->drawing_context()->add_modifier(oox_bodyPr->prstTxWarp->avLst[i].fmla.get());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (oox_bodyPr->vert.IsInit())
|
||||
{
|
||||
odf_context()->drawing_context()->set_textarea_writing_mode (oox_bodyPr->vert->GetBYTECode());
|
||||
@ -1287,7 +1309,7 @@ void OoxConverter::convert(PPTX::Logic::BodyPr *oox_bodyPr)
|
||||
switch(oox_bodyPr->Fit.type)
|
||||
{
|
||||
case PPTX::Logic::TextFit::FitSpAuto:
|
||||
{//изменяемы размеры
|
||||
{//изменяемы размеры шейпа под текст
|
||||
odf_context()->drawing_context()->set_text_box_min_size(true);//уже выставленые в min
|
||||
}break;
|
||||
case PPTX::Logic::TextFit::FitNo:
|
||||
@ -1300,17 +1322,6 @@ void OoxConverter::convert(PPTX::Logic::BodyPr *oox_bodyPr)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
if ((oox_bodyPr->fromWordArt.IsInit() && (*oox_bodyPr->fromWordArt)) && oox_bodyPr->prstTxWarp.IsInit())
|
||||
{
|
||||
for (size_t i = 0; i < oox_bodyPr->prstTxWarp->avLst.size(); i++)
|
||||
{
|
||||
if (oox_bodyPr->prstTxWarp->avLst[i].fmla.IsInit())
|
||||
{
|
||||
odf_context()->drawing_context()->add_modifier(oox_bodyPr->prstTxWarp->avLst[i].fmla.get());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
void OoxConverter::convert(PPTX::Logic::NvSpPr *oox_nvSpPr)
|
||||
{
|
||||
|
||||
@ -254,7 +254,7 @@ void DocxConverter::convert_document()
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------
|
||||
|
||||
convert(docx_document->m_pDocument->m_oSectPr.GetPointer(), false, L"Standard");
|
||||
convert(docx_document->m_pDocument->m_oSectPr.GetPointer(), false, L"Standard", true);
|
||||
|
||||
odt_context->text_context()->clear_params();
|
||||
|
||||
@ -1507,7 +1507,7 @@ void DocxConverter::apply_HF_from(OOX::Logic::CSectionProperty *props, OOX::Logi
|
||||
}
|
||||
}
|
||||
}
|
||||
void DocxConverter::convert(OOX::Logic::CSectionProperty *oox_section_pr, bool bSection, const std::wstring & master_name)
|
||||
void DocxConverter::convert(OOX::Logic::CSectionProperty *oox_section_pr, bool bSection, const std::wstring & master_name, bool bAlways)
|
||||
{
|
||||
if (oox_section_pr == NULL) return;
|
||||
current_section_properties = NULL;
|
||||
@ -1684,7 +1684,7 @@ void DocxConverter::convert(OOX::Logic::CSectionProperty *oox_section_pr, bool b
|
||||
//nullable<SimpleTypes::CDecimalNumber<> > m_oChapStyle;
|
||||
}
|
||||
|
||||
if (continuous == false || oox_section_pr->m_oTitlePg.IsInit())
|
||||
if (continuous == false || oox_section_pr->m_oTitlePg.IsInit() || bAlways)
|
||||
{
|
||||
OOX::Logic::CSectionProperty* s = last_section_properties ? last_section_properties : oox_section_pr;
|
||||
|
||||
@ -2244,51 +2244,95 @@ void DocxConverter::convert(OOX::Logic::CRunProperty *oox_run_pr, odf_writer::st
|
||||
text_properties->content_.fo_font_weight_ = odf_types::font_weight(odf_types::font_weight::WNormal);
|
||||
}
|
||||
|
||||
bool set_color = false;
|
||||
if (oox_run_pr->m_oTextFill.getType() == OOX::et_a_gradFill || oox_run_pr->m_oTextOutline.IsInit())
|
||||
{
|
||||
odf_writer::odf_drawing_context *drawing_context = odf_context()->drawing_context();
|
||||
if (drawing_context)
|
||||
{
|
||||
if (odf_context()->drawing_context()->change_text_box_2_wordart())
|
||||
{
|
||||
NSCommon::smart_ptr<PPTX::Logic::GradFill> gradFill = oox_run_pr->m_oTextFill.Fill.smart_dynamic_cast<PPTX::Logic::GradFill>();
|
||||
NSCommon::smart_ptr<PPTX::Logic::SolidFill> solidFill = oox_run_pr->m_oTextFill.Fill.smart_dynamic_cast<PPTX::Logic::SolidFill>();
|
||||
|
||||
odf_context()->drawing_context()->start_area_properties(true);
|
||||
if(gradFill.IsInit())
|
||||
{
|
||||
OoxConverter::convert(gradFill.operator->());
|
||||
}
|
||||
else if (solidFill.IsInit())
|
||||
{
|
||||
OoxConverter::convert(solidFill.operator->());
|
||||
}
|
||||
else
|
||||
{
|
||||
odf_context()->drawing_context()->set_no_fill();
|
||||
}
|
||||
odf_context()->drawing_context()->end_area_properties();
|
||||
|
||||
if (oox_run_pr->m_oTextOutline.IsInit())
|
||||
{
|
||||
odf_context()->drawing_context()->start_line_properties(true);
|
||||
OoxConverter::convert(oox_run_pr->m_oTextOutline.operator->());
|
||||
odf_context()->drawing_context()->end_line_properties();
|
||||
}
|
||||
|
||||
set_color = true;
|
||||
}
|
||||
}
|
||||
else{} //обычный текст .. градиент по телу абзаца (
|
||||
}
|
||||
odf_writer::odf_drawing_context *drawing_context = odf_context()->drawing_context();
|
||||
|
||||
if (!set_color && oox_run_pr->m_oColor.IsInit())
|
||||
bool set_word_art = drawing_context ? drawing_context->is_wordart() : false;
|
||||
|
||||
NSCommon::smart_ptr<PPTX::Logic::GradFill> gradFill = oox_run_pr->m_oTextFill.Fill.smart_dynamic_cast<PPTX::Logic::GradFill>();
|
||||
NSCommon::smart_ptr<PPTX::Logic::SolidFill> solidFill = oox_run_pr->m_oTextFill.Fill.smart_dynamic_cast<PPTX::Logic::SolidFill>();
|
||||
|
||||
bool bFillText = (oox_run_pr->m_oTextFill.m_type != PPTX::Logic::UniFill::notInit) &&
|
||||
(oox_run_pr->m_oTextFill.m_type != PPTX::Logic::UniFill::noFill);
|
||||
|
||||
bool bOutlineText = ((oox_run_pr->m_oTextOutline.is_init()) &&
|
||||
(oox_run_pr->m_oTextOutline->Fill.m_type != PPTX::Logic::UniFill::notInit) &&
|
||||
(oox_run_pr->m_oTextOutline->Fill.m_type != PPTX::Logic::UniFill::noFill));
|
||||
|
||||
bool bOutline = oox_run_pr->m_oOutline.IsInit();
|
||||
bool bColorText = !bOutline && (oox_run_pr->m_oColor.IsInit() && (oox_run_pr->m_oColor->m_oVal.IsInit() && oox_run_pr->m_oColor->m_oVal->GetValue() == SimpleTypes::hexcolorRGB));
|
||||
|
||||
_CP_OPT(odf_types::color) color;
|
||||
|
||||
if (oox_run_pr->m_oColor.IsInit())
|
||||
{
|
||||
if(oox_run_pr->m_oColor->m_oVal.IsInit() && oox_run_pr->m_oColor->m_oVal->GetValue() == SimpleTypes::hexcolorAuto)
|
||||
text_properties->content_.fo_color_ = odf_types::color(L"#000000");
|
||||
color = odf_types::color(L"#000000");
|
||||
else
|
||||
convert(oox_run_pr->m_oColor.GetPointer(),text_properties->content_.fo_color_);
|
||||
convert(oox_run_pr->m_oColor.GetPointer(), color);
|
||||
|
||||
text_properties->content_.fo_color_ = color;
|
||||
}
|
||||
if (gradFill.is_init() || (bOutlineText && (bFillText || bColorText)))
|
||||
{
|
||||
set_word_art = true;
|
||||
}
|
||||
|
||||
if (drawing_context && set_word_art)
|
||||
{
|
||||
if (drawing_context->change_text_box_2_wordart())
|
||||
{
|
||||
drawing_context->start_area_properties(true);
|
||||
if(gradFill.IsInit())
|
||||
{
|
||||
OoxConverter::convert(gradFill.operator->());
|
||||
}
|
||||
else if (solidFill.IsInit())
|
||||
{
|
||||
OoxConverter::convert(solidFill.operator->());
|
||||
}
|
||||
else if (color)
|
||||
{
|
||||
drawing_context->set_solid_fill(color->get_hex_value());
|
||||
}
|
||||
else
|
||||
{
|
||||
drawing_context->set_no_fill();
|
||||
}
|
||||
drawing_context->end_area_properties();
|
||||
|
||||
if (oox_run_pr->m_oTextOutline.IsInit())
|
||||
{
|
||||
drawing_context->start_line_properties(true);
|
||||
OoxConverter::convert(oox_run_pr->m_oTextOutline.operator->());
|
||||
drawing_context->end_line_properties();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
set_word_art = false;
|
||||
}
|
||||
}
|
||||
|
||||
std::wstring hexString;
|
||||
_CP_OPT(double) opacity;
|
||||
if (bOutlineText)
|
||||
{
|
||||
text_properties->content_.style_text_outline_ = true;
|
||||
|
||||
gradFill = oox_run_pr->m_oTextOutline->Fill.Fill.smart_dynamic_cast<PPTX::Logic::GradFill>();
|
||||
solidFill = oox_run_pr->m_oTextOutline->Fill.Fill.smart_dynamic_cast<PPTX::Logic::SolidFill>();
|
||||
}
|
||||
if (solidFill.is_init())
|
||||
{
|
||||
OoxConverter::convert(&solidFill->Color, hexString, opacity);
|
||||
}
|
||||
else if ((gradFill.is_init()) && (false == gradFill->GsLst.empty()))
|
||||
{
|
||||
OoxConverter::convert(&gradFill->GsLst[0].color, hexString, opacity);
|
||||
}
|
||||
if (!hexString.empty())
|
||||
{
|
||||
text_properties->content_.fo_color_ = hexString;
|
||||
}
|
||||
|
||||
//text_properties->content_.style_text_underline_type_= odf_types::line_type(odf_types::line_type::None); //нельзя..если будет выше наследуемого то подчеркивания не будет
|
||||
|
||||
@ -183,7 +183,7 @@ namespace Oox2Odf
|
||||
|
||||
void convert(OOX::Logic::CBackground *oox_background, int type);
|
||||
void convert(OOX::Logic::CSdt *oox_sdt);
|
||||
void convert(OOX::Logic::CSectionProperty *oox_section_pr, bool bSection, const std::wstring & master_name = L"");
|
||||
void convert(OOX::Logic::CSectionProperty *oox_section_pr, bool bSection, const std::wstring & master_name = L"", bool bAlways = false);
|
||||
void convert(OOX::Logic::CParagraph *oox_paragraph);
|
||||
void convert(OOX::Logic::CRun *oox_run);
|
||||
void convert(OOX::Logic::CParagraphProperty *oox_para_prop, odf_writer::style_paragraph_properties *paragraph_properties);
|
||||
|
||||
@ -52,7 +52,7 @@ COfficePPTFile::~COfficePPTFile()
|
||||
CloseFile();
|
||||
}
|
||||
|
||||
long COfficePPTFile::OpenFile(const std::wstring & sFileName, const std::wstring & password, bool &bMacros)
|
||||
_UINT32 COfficePPTFile::OpenFile(const std::wstring & sFileName, const std::wstring & password, bool &bMacros)
|
||||
{
|
||||
CloseFile();
|
||||
|
||||
@ -103,14 +103,14 @@ bool COfficePPTFile::CloseFile()
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT COfficePPTFile::LoadFromFile(std::wstring sSrcFileName, std::wstring sDstPath, std::wstring password, bool &bMacros)
|
||||
_UINT32 COfficePPTFile::LoadFromFile(std::wstring sSrcFileName, std::wstring sDstPath, std::wstring password, bool &bMacros)
|
||||
{
|
||||
if (m_strTempDirectory.empty())
|
||||
{
|
||||
m_strTempDirectory = NSDirectory::GetTempPath();
|
||||
}
|
||||
|
||||
long nResult = OpenFile(sSrcFileName, password, bMacros);
|
||||
_UINT32 nResult = OpenFile(sSrcFileName, password, bMacros);
|
||||
if (nResult != S_OK)
|
||||
{
|
||||
CloseFile();
|
||||
|
||||
@ -66,9 +66,9 @@ public:
|
||||
return m_strTempDirectory;
|
||||
}
|
||||
|
||||
HRESULT LoadFromFile(std::wstring sSrcFileName, std::wstring sDstPath, std::wstring password, bool &bMacros);
|
||||
_UINT32 LoadFromFile(std::wstring sSrcFileName, std::wstring sDstPath, std::wstring password, bool &bMacros);
|
||||
|
||||
long OpenFile(const std::wstring & fileName, const std::wstring & password, bool &bMacros);
|
||||
_UINT32 OpenFile(const std::wstring & fileName, const std::wstring & password, bool &bMacros);
|
||||
bool CloseFile();
|
||||
private:
|
||||
|
||||
|
||||
@ -74,9 +74,9 @@ public:
|
||||
|
||||
~CPPTXFile();
|
||||
|
||||
HRESULT LoadFromFile(std::wstring sSrcFileName, std::wstring sDstPath, std::wstring sXMLOptions);
|
||||
_UINT32 LoadFromFile(std::wstring sSrcFileName, std::wstring sDstPath, std::wstring sXMLOptions);
|
||||
|
||||
HRESULT SaveToFile(std::wstring sDstFileName, std::wstring sSrcPath, std::wstring sXMLOptions);
|
||||
_UINT32 SaveToFile(std::wstring sDstFileName, std::wstring sSrcPath, std::wstring sXMLOptions);
|
||||
|
||||
HRESULT get_TempDirectory(std::wstring* pVal);
|
||||
HRESULT put_TempDirectory(std::wstring newVal);
|
||||
@ -96,8 +96,9 @@ public:
|
||||
HRESULT SetThemesDir (std::wstring bsDir);
|
||||
HRESULT SetUseSystemFonts (bool useSystemFonts);
|
||||
void SetIsNoBase64 (bool bIsNoBase64);
|
||||
HRESULT OpenFileToPPTY (std::wstring bsInput, std::wstring bsOutput);
|
||||
HRESULT OpenDirectoryToPPTY (std::wstring bsInput, std::wstring bsOutput);
|
||||
HRESULT ConvertPPTYToPPTX (std::wstring bsInput, std::wstring bsOutput, std::wstring bsThemesFolder);
|
||||
|
||||
_UINT32 OpenFileToPPTY (std::wstring bsInput, std::wstring bsOutput);
|
||||
_UINT32 OpenDirectoryToPPTY (std::wstring bsInput, std::wstring bsOutput);
|
||||
_UINT32 ConvertPPTYToPPTX (std::wstring bsInput, std::wstring bsOutput, std::wstring bsThemesFolder);
|
||||
};
|
||||
#endif //ASC_OFFICE_PPTX_FILE
|
||||
|
||||
@ -47,6 +47,7 @@
|
||||
#include "Editor/PPTXWriter.h"
|
||||
|
||||
#include "PPTXFormat/PPTXEvent.h"
|
||||
#include "../Common/OfficeFileErrorDescription.h"
|
||||
|
||||
CPPTXFile::CPPTXFile(extract_to_directory fCallbackExtract, compress_from_directory fCallbackCompress, progress_operation fCallbackProgress, void* pCallbackArg)
|
||||
{
|
||||
@ -82,20 +83,20 @@ CPPTXFile::~CPPTXFile()
|
||||
{
|
||||
RELEASEOBJECT(m_pPptxDocument);
|
||||
}
|
||||
HRESULT CPPTXFile::LoadFromFile(std::wstring sSrcFileName, std::wstring sDstPath, std::wstring sXMLOptions)
|
||||
_UINT32 CPPTXFile::LoadFromFile(std::wstring sSrcFileName, std::wstring sDstPath, std::wstring sXMLOptions)
|
||||
{
|
||||
std::wstring localTempDir(sDstPath);
|
||||
if(!localTempDir.empty())
|
||||
{
|
||||
bool res = NSDirectory::CreateDirectory(localTempDir);
|
||||
if (res == false) return S_FALSE;
|
||||
if (res == false) return AVS_FILEUTILS_ERROR_CONVERT;
|
||||
|
||||
put_TempDirectory(sDstPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
bool res = NSDirectory::CreateDirectory(m_strTempDir);
|
||||
if (res == false) return S_FALSE;
|
||||
if (res == false) return AVS_FILEUTILS_ERROR_CONVERT;
|
||||
}
|
||||
localTempDir = m_strTempDir;
|
||||
|
||||
@ -103,7 +104,7 @@ HRESULT CPPTXFile::LoadFromFile(std::wstring sSrcFileName, std::wstring sDstPath
|
||||
if (m_pCallbackArg)
|
||||
{
|
||||
if(!m_fCallbackExtract(m_pCallbackArg, srcFileName , localTempDir))
|
||||
return S_FALSE;
|
||||
return AVS_FILEUTILS_ERROR_CONVERT;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -116,19 +117,19 @@ HRESULT CPPTXFile::LoadFromFile(std::wstring sSrcFileName, std::wstring sDstPath
|
||||
if(!m_pPptxDocument->isValid(localTempDir))
|
||||
{
|
||||
RELEASEOBJECT(m_pPptxDocument);
|
||||
return S_FALSE;
|
||||
return AVS_FILEUTILS_ERROR_CONVERT;
|
||||
}
|
||||
m_pPptxDocument->read(localTempDir, (PPTX::IPPTXEvent*)this);
|
||||
if(GetPercent() < 1000000)
|
||||
{
|
||||
RELEASEOBJECT(m_pPptxDocument);
|
||||
return S_FALSE;
|
||||
return AVS_FILEUTILS_ERROR_CONVERT;
|
||||
}
|
||||
smart_ptr<PPTX::Presentation> presentation = m_pPptxDocument->Get(OOX::Presentation::FileTypes::Presentation).smart_dynamic_cast<PPTX::Presentation>();
|
||||
if (!presentation.is_init())
|
||||
{
|
||||
NSDirectory::DeleteDirectory(m_strTempDir, false);
|
||||
return S_FALSE;
|
||||
return AVS_FILEUTILS_ERROR_CONVERT;
|
||||
}
|
||||
|
||||
m_strDirectory = sSrcFileName;
|
||||
@ -136,12 +137,12 @@ HRESULT CPPTXFile::LoadFromFile(std::wstring sSrcFileName, std::wstring sDstPath
|
||||
if (-1 != nIndex)
|
||||
m_strDirectory = m_strDirectory.substr(0, nIndex);
|
||||
|
||||
return S_OK;
|
||||
return 0;
|
||||
}
|
||||
HRESULT CPPTXFile::SaveToFile(std::wstring sDstFileName, std::wstring sSrcPath, std::wstring sXMLOptions)
|
||||
_UINT32 CPPTXFile::SaveToFile(std::wstring sDstFileName, std::wstring sSrcPath, std::wstring sXMLOptions)
|
||||
{
|
||||
if (NULL == m_pPptxDocument)
|
||||
return S_FALSE;
|
||||
return AVS_FILEUTILS_ERROR_CONVERT;
|
||||
|
||||
OOX::CPath oPath;
|
||||
oPath.m_strFilename = std::wstring(sSrcPath);
|
||||
@ -149,7 +150,7 @@ HRESULT CPPTXFile::SaveToFile(std::wstring sDstFileName, std::wstring sSrcPath,
|
||||
|
||||
std::wstring srcFilePath = sSrcPath;
|
||||
std::wstring dstFileName = sDstFileName;
|
||||
return m_fCallbackCompress ? (m_fCallbackCompress(m_pCallbackArg, srcFilePath, dstFileName) ? S_OK : S_FALSE) : S_OK;
|
||||
return m_fCallbackCompress ? (m_fCallbackCompress(m_pCallbackArg, srcFilePath, dstFileName) ? 0 : AVS_FILEUTILS_ERROR_CONVERT) : 0;
|
||||
}
|
||||
HRESULT CPPTXFile::get_TempDirectory(std::wstring* pVal)
|
||||
{
|
||||
@ -237,7 +238,7 @@ void CPPTXFile::SetIsNoBase64(bool bIsNoBase64)
|
||||
{
|
||||
m_bIsNoBase64 = bIsNoBase64;
|
||||
}
|
||||
HRESULT CPPTXFile::OpenFileToPPTY(std::wstring bsInput, std::wstring bsOutput)
|
||||
_UINT32 CPPTXFile::OpenFileToPPTY(std::wstring bsInput, std::wstring bsOutput)
|
||||
{
|
||||
if (m_strTempDir.empty())
|
||||
{
|
||||
@ -268,14 +269,14 @@ HRESULT CPPTXFile::OpenFileToPPTY(std::wstring bsInput, std::wstring bsOutput)
|
||||
}
|
||||
std::wstring bsLocalInputTemp= pathLocalInputTemp.GetPath();
|
||||
|
||||
HRESULT hr = OpenDirectoryToPPTY(bsLocalInputTemp, bsOutput);
|
||||
_UINT32 hr = OpenDirectoryToPPTY(bsLocalInputTemp, bsOutput);
|
||||
|
||||
if (notDeleteInput == false)
|
||||
NSDirectory::DeleteDirectory(pathLocalInputTemp.GetPath());
|
||||
|
||||
return hr;
|
||||
}
|
||||
HRESULT CPPTXFile::OpenDirectoryToPPTY(std::wstring bsInput, std::wstring bsOutput)
|
||||
_UINT32 CPPTXFile::OpenDirectoryToPPTY(std::wstring bsInput, std::wstring bsOutput)
|
||||
{
|
||||
OOX::CPath pathInputDirectory = bsInput;
|
||||
|
||||
@ -285,20 +286,20 @@ HRESULT CPPTXFile::OpenDirectoryToPPTY(std::wstring bsInput, std::wstring bsOutp
|
||||
if (!m_pPptxDocument->isValid(pathInputDirectory.GetPath())) // true ???
|
||||
{
|
||||
RELEASEOBJECT(m_pPptxDocument);
|
||||
return S_FALSE;
|
||||
return AVS_FILEUTILS_ERROR_CONVERT;
|
||||
}
|
||||
|
||||
m_pPptxDocument->read(pathInputDirectory.GetPath() + FILE_SEPARATOR_STR, (PPTX::IPPTXEvent*)this);
|
||||
if(GetPercent() < 1000000)
|
||||
{
|
||||
RELEASEOBJECT(m_pPptxDocument);
|
||||
return S_FALSE;
|
||||
return AVS_FILEUTILS_ERROR_CONVERT;
|
||||
}
|
||||
smart_ptr<PPTX::Presentation> presentation = m_pPptxDocument->Get(OOX::Presentation::FileTypes::Presentation).smart_dynamic_cast<PPTX::Presentation>();
|
||||
if (!presentation.is_init())
|
||||
{
|
||||
NSDirectory::DeleteDirectory(m_strTempDir, false);
|
||||
return S_FALSE;
|
||||
return AVS_FILEUTILS_ERROR_CONVERT;
|
||||
}
|
||||
|
||||
m_strDirectory = pathInputDirectory.GetDirectory();
|
||||
@ -335,7 +336,7 @@ HRESULT CPPTXFile::OpenDirectoryToPPTY(std::wstring bsInput, std::wstring bsOutp
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CPPTXFile::ConvertPPTYToPPTX(std::wstring bsInput, std::wstring bsOutput, std::wstring bsThemesFolder)//bsOutput и файл и директория может быть
|
||||
_UINT32 CPPTXFile::ConvertPPTYToPPTX(std::wstring bsInput, std::wstring bsOutput, std::wstring bsThemesFolder)//bsOutput и файл и директория может быть
|
||||
{
|
||||
OOX::CPath pathLocalTempDirectory;
|
||||
|
||||
@ -368,14 +369,15 @@ HRESULT CPPTXFile::ConvertPPTYToPPTX(std::wstring bsInput, std::wstring bsOutput
|
||||
oWriter.OpenPPTY(pSrcBuffer, lFileSize, srcFolder, bsThemesFolder);
|
||||
|
||||
RELEASEARRAYOBJECTS(pSrcBuffer);
|
||||
HRESULT hRes = S_OK;
|
||||
|
||||
_UINT32 hRes = 0;
|
||||
|
||||
if (m_fCallbackCompress)
|
||||
{
|
||||
std::wstring strOutput = bsOutput;
|
||||
std::wstring strInput = pathLocalTempDirectory.GetPath();
|
||||
|
||||
hRes = m_fCallbackCompress(m_pCallbackArg, strInput, strOutput) ? S_OK : S_FALSE;
|
||||
hRes = m_fCallbackCompress(m_pCallbackArg, strInput, strOutput) ? 0 : AVS_FILEUTILS_ERROR_CONVERT;
|
||||
|
||||
NSDirectory::DeleteDirectory(strInput);
|
||||
}
|
||||
|
||||
@ -218,9 +218,11 @@ namespace NSBinPptxRW
|
||||
}
|
||||
|
||||
std::wstring strExts = _T(".jpg");
|
||||
int nIndexExt = (int)strInput.rfind(wchar_t('.'));
|
||||
//use GetFileName to avoid defining '.' in the directory as extension
|
||||
std::wstring strFileName = NSFile::GetFileName(strInput);
|
||||
int nIndexExt = (int)strFileName.rfind(wchar_t('.'));
|
||||
if (-1 != nIndexExt)
|
||||
strExts = strInput.substr(nIndexExt);
|
||||
strExts = strFileName.substr(nIndexExt);
|
||||
|
||||
int typeAdditional = 0;
|
||||
std::wstring strAdditional;
|
||||
|
||||
@ -39,6 +39,8 @@
|
||||
#include "Writer/OOXWriter.h"
|
||||
#include "Reader/OOXReader.h"
|
||||
|
||||
#include "../../../Common/OfficeFileErrorDescription.h"
|
||||
|
||||
const double g_cdMaxReadRtfPercent = 0.70;
|
||||
const double g_cdMaxWriteRtfPercent = 0.30;
|
||||
const double g_cdMaxReadOoxPercent = 0.70;
|
||||
@ -50,7 +52,7 @@ const double g_cdMaxWriteOoxPercent = 0.30;
|
||||
#pragma comment(lib, "Gdi32.lib")
|
||||
#endif
|
||||
|
||||
HRESULT RtfConvertationManager::ConvertRtfToOOX( std::wstring sSrcFileName, std::wstring sDstPath )
|
||||
_UINT32 RtfConvertationManager::ConvertRtfToOOX( std::wstring sSrcFileName, std::wstring sDstPath )
|
||||
{
|
||||
m_bParseFirstItem = true;
|
||||
|
||||
@ -91,11 +93,11 @@ HRESULT RtfConvertationManager::ConvertRtfToOOX( std::wstring sSrcFileName, std:
|
||||
NSDirectory::DeleteDirectory(oWriter.m_sTempFolder);
|
||||
|
||||
if( true == succes )
|
||||
return S_OK;
|
||||
return 0;
|
||||
else
|
||||
return S_FALSE;
|
||||
return AVS_FILEUTILS_ERROR_CONVERT;
|
||||
}
|
||||
HRESULT RtfConvertationManager::ConvertOOXToRtf( std::wstring sDstFileName, std::wstring sSrcPath )
|
||||
_UINT32 RtfConvertationManager::ConvertOOXToRtf( std::wstring sDstFileName, std::wstring sSrcPath )
|
||||
{
|
||||
m_bParseFirstItem = true;
|
||||
|
||||
@ -127,8 +129,8 @@ HRESULT RtfConvertationManager::ConvertOOXToRtf( std::wstring sDstFileName, std:
|
||||
NSDirectory::DeleteDirectory(oReader.m_sTempFolder);
|
||||
NSDirectory::DeleteDirectory(oWriter.m_sTempFolder);
|
||||
|
||||
if( true == succes) return S_OK;
|
||||
return S_FALSE;
|
||||
if( true == succes) return 0;
|
||||
return AVS_FILEUTILS_ERROR_CONVERT;
|
||||
}
|
||||
void RtfConvertationManager::OnCompleteItemRtf()
|
||||
{
|
||||
|
||||
@ -32,6 +32,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include "../../../Common/DocxFormat/Source/Base/Types_32.h"
|
||||
|
||||
class OOXWriter;
|
||||
class OOXReader;
|
||||
@ -54,9 +55,9 @@ public:
|
||||
m_poRtfReader = NULL;
|
||||
}
|
||||
|
||||
long ConvertRtfToOOX( std::wstring sSrcFileName, std::wstring sDstPath);
|
||||
_UINT32 ConvertRtfToOOX( std::wstring sSrcFileName, std::wstring sDstPath);
|
||||
|
||||
long ConvertOOXToRtf( std::wstring sDstFileName, std::wstring sSrcPath);
|
||||
_UINT32 ConvertOOXToRtf( std::wstring sDstFileName, std::wstring sSrcPath);
|
||||
|
||||
void OnCompleteItemRtf();
|
||||
void OnCompleteItemOOX();
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
#include "../../../Common/DocxFormat/Source/DocxFormat/App.h"
|
||||
#include "../../../Common/DocxFormat/Source/DocxFormat/Core.h"
|
||||
#include "../../../DesktopEditor/common/SystemUtils.h"
|
||||
|
||||
#include "../../../Common/OfficeFileErrorDescription.h"
|
||||
namespace NSBinPptxRW
|
||||
{
|
||||
class CDrawingConverter;
|
||||
@ -106,10 +106,10 @@ static int ParseTxtOptions(const std::wstring & sXmlOptions)
|
||||
}
|
||||
|
||||
|
||||
HRESULT CTxtXmlFile::txt_LoadFromFile(const std::wstring & sSrcFileName, const std::wstring & sDstPath, const std::wstring & sXMLOptions)
|
||||
_UINT32 CTxtXmlFile::txt_LoadFromFile(const std::wstring & sSrcFileName, const std::wstring & sDstPath, const std::wstring & sXMLOptions)
|
||||
{
|
||||
Writers::FileWriter *pDocxWriter = new Writers::FileWriter(sDstPath, L"", true, 1, false, NULL, L"");
|
||||
if (pDocxWriter == NULL) return S_FALSE;
|
||||
if (pDocxWriter == NULL) return AVS_FILEUTILS_ERROR_CONVERT;
|
||||
|
||||
CreateDocxEmpty(sDstPath, pDocxWriter);
|
||||
|
||||
@ -127,7 +127,7 @@ HRESULT CTxtXmlFile::txt_LoadFromFile(const std::wstring & sSrcFileName, const s
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
return S_FALSE;
|
||||
return AVS_FILEUTILS_ERROR_CONVERT;
|
||||
}
|
||||
|
||||
pDocxWriter->m_oDocumentWriter.Write(); //overwrite document.xml
|
||||
@ -135,11 +135,11 @@ HRESULT CTxtXmlFile::txt_LoadFromFile(const std::wstring & sSrcFileName, const s
|
||||
delete pDocxWriter;
|
||||
pDocxWriter = NULL;
|
||||
|
||||
return S_OK;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
HRESULT CTxtXmlFile::txt_SaveToFile(const std::wstring & sDstFileName, const std::wstring & sSrcPath, const std::wstring & sXMLOptions)
|
||||
_UINT32 CTxtXmlFile::txt_SaveToFile(const std::wstring & sDstFileName, const std::wstring & sSrcPath, const std::wstring & sXMLOptions)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -170,10 +170,10 @@ HRESULT CTxtXmlFile::txt_SaveToFile(const std::wstring & sDstFileName, const std
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
return S_FALSE;
|
||||
return AVS_FILEUTILS_ERROR_CONVERT;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -51,8 +51,8 @@ class CTxtXmlFile : public TxtXml::ITxtXmlEvent
|
||||
public:
|
||||
virtual bool Progress(long ID, long Percent);
|
||||
|
||||
HRESULT txt_LoadFromFile(const std::wstring & sSrcFileName, const std::wstring & sDstPath, const std::wstring & sXMLOptions);
|
||||
HRESULT txt_SaveToFile (const std::wstring & sDstFileName, const std::wstring & sSrcPath, const std::wstring & sXMLOptions);
|
||||
_UINT32 txt_LoadFromFile(const std::wstring & sSrcFileName, const std::wstring & sDstPath, const std::wstring & sXMLOptions);
|
||||
_UINT32 txt_SaveToFile (const std::wstring & sDstFileName, const std::wstring & sSrcPath, const std::wstring & sXMLOptions);
|
||||
|
||||
CTxtXmlFile();
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@
|
||||
#include "../../../Common/OfficeFileErrorDescription.h"
|
||||
|
||||
|
||||
long ConvertXls2Xlsx(const std::wstring & srcFile, const std::wstring & dstPath, const std::wstring & password, const std::wstring & fontsPath, const std::wstring & tempPath, const ProgressCallback* pCallBack, bool &bMacros)
|
||||
_UINT32 ConvertXls2Xlsx(const std::wstring & srcFile, const std::wstring & dstPath, const std::wstring & password, const std::wstring & fontsPath, const std::wstring & tempPath, const ProgressCallback* pCallBack, bool &bMacros)
|
||||
{
|
||||
XlsConverter converter(srcFile, dstPath, password, fontsPath, tempPath, pCallBack, bMacros);
|
||||
|
||||
|
||||
@ -30,7 +30,8 @@
|
||||
*
|
||||
*/
|
||||
#include <string>
|
||||
#include "../../../Common/DocxFormat/Source/Base/Types_32.h"
|
||||
|
||||
struct ProgressCallback;
|
||||
|
||||
long ConvertXls2Xlsx(const std::wstring & srcFile, const std::wstring & dstPath, const std::wstring & password, const std::wstring& fontsPath, const std::wstring & tempPath, const ProgressCallback* CallBack, bool & bMacros);
|
||||
_UINT32 ConvertXls2Xlsx(const std::wstring & srcFile, const std::wstring & dstPath, const std::wstring & password, const std::wstring& fontsPath, const std::wstring & tempPath, const ProgressCallback* CallBack, bool & bMacros);
|
||||
@ -64,6 +64,7 @@ namespace OOX
|
||||
m_mTable.insert( std::make_pair( _T("emf"), _T("image/x-emf")));
|
||||
m_mTable.insert( std::make_pair( _T("emz"), _T("image/x-emz")));
|
||||
m_mTable.insert( std::make_pair( _T("wmf"), _T("image/x-wmf")));
|
||||
m_mTable.insert( std::make_pair( _T("svg"), _T("image/svg+xml")));
|
||||
m_mTable.insert( std::make_pair( _T("svm"), _T("image/svm")));
|
||||
m_mTable.insert( std::make_pair( _T("wav"), _T("audio/wav")));
|
||||
m_mTable.insert( std::make_pair( _T("wma"), _T("audio/x-wma")));
|
||||
|
||||
@ -102,3 +102,16 @@ void CFileDownloader::CheckSuspend()
|
||||
{
|
||||
return m_pInternal->CheckSuspend();
|
||||
}
|
||||
|
||||
#ifdef _MAC
|
||||
bool CFileDownloader::m_bIsARCEnabled = false;
|
||||
|
||||
void CFileDownloader::SetARCEnabled(const bool& enabled)
|
||||
{
|
||||
m_bIsARCEnabled = enabled;
|
||||
}
|
||||
bool CFileDownloader::GetARCEnabled()
|
||||
{
|
||||
return m_bIsARCEnabled;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -41,6 +41,10 @@ protected:
|
||||
// создаем в зависимости от платформы
|
||||
CFileDownloader_private* m_pInternal;
|
||||
|
||||
#ifdef _MAC
|
||||
static bool m_bIsARCEnabled;
|
||||
#endif
|
||||
|
||||
public:
|
||||
CFileDownloader(std::wstring sFileUrl, bool bDelete = true);
|
||||
virtual ~CFileDownloader();
|
||||
@ -63,4 +67,9 @@ public:
|
||||
int GetPriority();
|
||||
|
||||
void CheckSuspend();
|
||||
|
||||
#ifdef _MAC
|
||||
static void SetARCEnabled(const bool& enabled);
|
||||
static bool GetARCEnabled();
|
||||
#endif
|
||||
};
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
#include "FileDownloader_private.h"
|
||||
#include "FileDownloader.h"
|
||||
|
||||
#if _IOS
|
||||
#import <Foundation/Foundation.h>
|
||||
@ -27,12 +28,12 @@ public :
|
||||
}
|
||||
|
||||
virtual int DownloadFile()
|
||||
{
|
||||
{
|
||||
if (m_sFilePath.empty())
|
||||
{
|
||||
{
|
||||
m_sFilePath = NSFile::CFileBinary::CreateTempFileWithUniqueName(NSFile::CFileBinary::GetTempPath(), L"DWD");
|
||||
if (NSFile::CFileBinary::Exists(m_sFilePath))
|
||||
NSFile::CFileBinary::Remove(m_sFilePath);
|
||||
NSFile::CFileBinary::Remove(m_sFilePath);
|
||||
}
|
||||
|
||||
NSString* stringURL = StringWToNSString(m_sFileUrl);
|
||||
@ -50,9 +51,12 @@ public :
|
||||
return 0;
|
||||
#else
|
||||
#ifndef _ASC_USE_ARC_
|
||||
[stringURL release];
|
||||
[url release];
|
||||
[urlData release];
|
||||
if (!CFileDownloader::GetARCEnabled())
|
||||
{
|
||||
[stringURL release];
|
||||
[url release];
|
||||
[urlData release];
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
return 0;
|
||||
@ -62,8 +66,11 @@ public :
|
||||
return 1;
|
||||
#else
|
||||
#ifndef _ASC_USE_ARC_
|
||||
[stringURL release];
|
||||
[url release];
|
||||
if (!CFileDownloader::GetARCEnabled())
|
||||
{
|
||||
[stringURL release];
|
||||
[url release];
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
return 1;
|
||||
|
||||
@ -34,9 +34,9 @@
|
||||
#include "../DesktopEditor/common/File.h"
|
||||
#include "../OfficeUtils/src/OfficeUtils.h"
|
||||
|
||||
#if defined FILE_FORMAT_CHECKER_WITH_MACRO
|
||||
#include "../ASCOfficePPTFile/PPTFormatLib/PPTFormatLib.h"
|
||||
#endif
|
||||
//#if defined FILE_FORMAT_CHECKER_WITH_MACRO
|
||||
// #include "../ASCOfficePPTFile/PPTFormatLib/PPTFormatLib.h"
|
||||
//#endif
|
||||
|
||||
#include "3dParty/pole/pole.h"
|
||||
#include <algorithm>
|
||||
@ -362,17 +362,17 @@ bool COfficeFileFormatChecker::isOfficeFile(const std::wstring & _fileName)
|
||||
}
|
||||
else if ( isPptFormatFile(&storage) )
|
||||
{
|
||||
#if defined FILE_FORMAT_CHECKER_WITH_MACRO
|
||||
COfficePPTFile pptFile;
|
||||
|
||||
bMacroEnabled = true;
|
||||
long nResult = pptFile.OpenFile(fileName, L"", bMacroEnabled);
|
||||
if (nResult != S_OK)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
pptFile.CloseFile();
|
||||
#endif
|
||||
//#if defined FILE_FORMAT_CHECKER_WITH_MACRO
|
||||
// COfficePPTFile pptFile;
|
||||
//
|
||||
// bMacroEnabled = true;
|
||||
// long nResult = pptFile.OpenFile(fileName, L"", bMacroEnabled);
|
||||
// if (nResult != S_OK)
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
// pptFile.CloseFile();
|
||||
//#endif
|
||||
nFileType = AVS_OFFICESTUDIO_FILE_PRESENTATION_PPT;
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -35,6 +35,10 @@
|
||||
#include "../common/Types.h"
|
||||
#include "../common/File.h"
|
||||
|
||||
#ifdef GetCharWidth
|
||||
#undef GetCharWidth
|
||||
#endif
|
||||
|
||||
#ifndef max
|
||||
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
||||
#endif
|
||||
@ -914,6 +918,25 @@ TFontCacheSizes CFontFile::GetChar(LONG lUnicode)
|
||||
return oSizes;
|
||||
}
|
||||
|
||||
double CFontFile::GetCharWidth(int gid)
|
||||
{
|
||||
if (!m_pFace)
|
||||
return 0;
|
||||
|
||||
if (0 != FT_Load_Glyph(m_pFace, gid, 40970))
|
||||
return 0;
|
||||
|
||||
FT_Glyph pGlyph = NULL;
|
||||
if (0 != FT_Get_Glyph(m_pFace->glyph, &pGlyph))
|
||||
return 0;
|
||||
|
||||
double dRet = (double)(m_pFace->glyph->linearHoriAdvance * m_dUnitsKoef / m_pFace->units_per_EM);
|
||||
|
||||
FT_Done_Glyph(pGlyph);
|
||||
|
||||
return dRet;
|
||||
}
|
||||
|
||||
INT CFontFile::GetString(CGlyphString& oString)
|
||||
{
|
||||
int nCountGlyph = oString.GetLength();
|
||||
|
||||
@ -239,6 +239,8 @@ public:
|
||||
int SetCMapForCharCode(long lUnicode, int *pnCMapIndex);
|
||||
int SetCMapForCharCode2(long lUnicode);
|
||||
|
||||
double GetCharWidth(int gid);
|
||||
|
||||
int GetKerning(FT_UInt unPrevGID, FT_UInt unGID);
|
||||
void SetStringGID(const INT& bGID);
|
||||
INT GetStringGID();
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
@ -256,7 +256,7 @@ namespace NSCommon
|
||||
int nCount = 1;
|
||||
++tmp;
|
||||
|
||||
while (nMask == *tmp && tmp < tmpLast)
|
||||
while (tmp < tmpLast && nMask == *tmp)
|
||||
{
|
||||
++tmp;
|
||||
nCount++;
|
||||
@ -537,12 +537,13 @@ namespace NSCommon
|
||||
pRenderer->put_FontFaceIndex(lFaceIndex);
|
||||
pManager->LoadFontFromFile(strFontPath, lFaceIndex, 14, dDpi, dDpi);
|
||||
|
||||
bool bIsSymbol = FALSE;
|
||||
bool bIsSymbol = false;
|
||||
NSFonts::IFontFile* pFile = pManager->GetFile();
|
||||
|
||||
if (pManager->GetFile())
|
||||
{
|
||||
bIsSymbol = pManager->GetFile()->IsSymbolic(false);
|
||||
}
|
||||
if (pFile)
|
||||
bIsSymbol = pFile->IsSymbolic(false);
|
||||
|
||||
std::wstring sFontName = pPair->second.m_sName;
|
||||
|
||||
if (bIsSymbol)
|
||||
{
|
||||
@ -557,6 +558,45 @@ namespace NSCommon
|
||||
pRenderer->put_FontPath(pInfoCur->m_wsFontPath);
|
||||
pRenderer->put_FontFaceIndex(0);
|
||||
}
|
||||
else if (pFile)
|
||||
{
|
||||
int nFontNameLen = (int)sFontName.length();
|
||||
bool bIsPresentAll = true;
|
||||
|
||||
for (int nC = 0; nC < nFontNameLen; nC++)
|
||||
{
|
||||
int nCMapIndex = 0;
|
||||
int nGid = pFile->SetCMapForCharCode(sFontName.at(nC), &nCMapIndex);
|
||||
if (0 >= nGid)
|
||||
{
|
||||
bIsPresentAll = false;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
double offsetG = pFile->GetCharWidth(nGid);
|
||||
if (offsetG < 0.0001)
|
||||
{
|
||||
bIsPresentAll = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!bIsPresentAll)
|
||||
{
|
||||
NSFonts::CFontSelectFormat oSelectFormat;
|
||||
oSelectFormat.wsName = new std::wstring(L"Arial");
|
||||
NSFonts::CFontInfo* pInfoCur = pManager->GetFontInfoByParams(oSelectFormat);
|
||||
|
||||
if (NULL != pInfoCur)
|
||||
{
|
||||
pManager->LoadFontFromFile(pInfoCur->m_wsFontPath, 0, 14, dDpi, dDpi);
|
||||
}
|
||||
pRenderer->put_FontPath(pInfoCur->m_wsFontPath);
|
||||
pRenderer->put_FontFaceIndex(0);
|
||||
}
|
||||
}
|
||||
|
||||
pRenderer->PathCommandStart();
|
||||
pRenderer->BeginCommand(c_nClipType);
|
||||
@ -568,7 +608,7 @@ namespace NSCommon
|
||||
pRenderer->put_FontCharSpace(0);
|
||||
pRenderer->put_FontSize(14);
|
||||
|
||||
pRenderer->CommandDrawText(pPair->second.m_sName, 5, 25.4 * (index * lH1_px + lH1_px) / dDpi - 2, 0, 0);
|
||||
pRenderer->CommandDrawText(sFontName, 5, 25.4 * (index * lH1_px + lH1_px) / dDpi - 2, 0, 0);
|
||||
|
||||
pRenderer->BeginCommand(c_nResetClipType);
|
||||
pRenderer->EndCommand(c_nResetClipType);
|
||||
|
||||
@ -488,6 +488,7 @@ namespace NSFonts
|
||||
virtual void SetFontMatrix(const double& fA, const double& fB, const double& fC, const double fD, double fE, double fF) = 0;
|
||||
|
||||
virtual int SetCMapForCharCode(long lUnicode, int *pnCMapIndex) = 0;
|
||||
virtual double GetCharWidth(int gid) = 0;
|
||||
};
|
||||
|
||||
namespace NSFontFile
|
||||
|
||||
@ -172,15 +172,24 @@ namespace PdfReader
|
||||
|
||||
if (pEncryptDict->DictLookup("OE", &oOwnerEncryptionKey))
|
||||
{
|
||||
m_seOwnerEncryptionKey = oOwnerEncryptionKey.GetString()->Copy();
|
||||
if (oOwnerEncryptionKey.IsString())
|
||||
{
|
||||
m_seOwnerEncryptionKey = oOwnerEncryptionKey.GetString()->Copy();
|
||||
}
|
||||
}
|
||||
if (pEncryptDict->DictLookup("UE", &oUserEncryptionKey))
|
||||
{
|
||||
m_seUserEncryptionKey = oUserEncryptionKey.GetString()->Copy();
|
||||
if (oUserEncryptionKey.IsString())
|
||||
{
|
||||
m_seUserEncryptionKey = oUserEncryptionKey.GetString()->Copy();
|
||||
}
|
||||
}
|
||||
if (pEncryptDict->DictLookup("Perms", &oPermsValue))
|
||||
{
|
||||
m_sePermsValue = oPermsValue.GetString()->Copy();
|
||||
if (oPermsValue.IsString())
|
||||
{
|
||||
m_sePermsValue = oPermsValue.GetString()->Copy();
|
||||
}
|
||||
}
|
||||
|
||||
if (oFileID.IsArray())
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -40,6 +40,7 @@
|
||||
#endif
|
||||
|
||||
#include <string>
|
||||
#include "../../Common/DocxFormat/Source/Base/Types_32.h"
|
||||
|
||||
namespace NExtractTools
|
||||
{
|
||||
@ -48,160 +49,160 @@ class InputParamsMailMerge;
|
||||
}
|
||||
namespace NExtractTools
|
||||
{
|
||||
int docx2doct_bin (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int docx_dir2doct_bin (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
|
||||
int docx2doct (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int doct_bin2docx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, bool bFromChanges, const std::wstring &sThemeDir, InputParams& params);
|
||||
int doct_bin2docx_dir (const std::wstring &sFrom, const std::wstring &sToResult, const std::wstring &sTo, bool bFromChanges, const std::wstring &sThemeDir, InputParams& params);
|
||||
int doct2docx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, bool bFromChanges, const std::wstring &sThemeDir, InputParams& params);
|
||||
_UINT32 docx2doct_bin (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 docx_dir2doct_bin (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
|
||||
_UINT32 docx2doct (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 doct_bin2docx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, bool bFromChanges, const std::wstring &sThemeDir, InputParams& params);
|
||||
_UINT32 doct_bin2docx_dir (const std::wstring &sFrom, const std::wstring &sToResult, const std::wstring &sTo, bool bFromChanges, const std::wstring &sThemeDir, InputParams& params);
|
||||
_UINT32 doct2docx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, bool bFromChanges, const std::wstring &sThemeDir, InputParams& params);
|
||||
|
||||
int dotm2docm (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int dotm2docm_dir (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
|
||||
int dotx2docx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int dotx2docx_dir (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
|
||||
int docm2docx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int docm2docx_dir (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
|
||||
int dotm2docx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int dotm2docx_dir (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
|
||||
_UINT32 dotm2docm (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 dotm2docm_dir (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
|
||||
_UINT32 dotx2docx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 dotx2docx_dir (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
|
||||
_UINT32 docm2docx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 docm2docx_dir (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
|
||||
_UINT32 dotm2docx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 dotm2docx_dir (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
|
||||
|
||||
int xlsx2xlst_bin (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int xlsx_dir2xlst_bin (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params, bool bXmlOptions, const std::wstring &sXlsxFile);
|
||||
int xlsx2xlst (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int xlst_bin2xlsx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, bool bFromChanges, const std::wstring &sThemeDir, InputParams& params);
|
||||
int xlst_bin2xlsx_dir (const std::wstring &sFrom, const std::wstring &sToResult, const std::wstring &sTo, bool bFromChanges, const std::wstring &sThemeDir, InputParams& params);
|
||||
int xlst2xlsx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, bool bFromChanges, const std::wstring &sThemeDir, InputParams& params);
|
||||
_UINT32 xlsx2xlst_bin (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 xlsx_dir2xlst_bin (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params, bool bXmlOptions, const std::wstring &sXlsxFile);
|
||||
_UINT32 xlsx2xlst (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 xlst_bin2xlsx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, bool bFromChanges, const std::wstring &sThemeDir, InputParams& params);
|
||||
_UINT32 xlst_bin2xlsx_dir (const std::wstring &sFrom, const std::wstring &sToResult, const std::wstring &sTo, bool bFromChanges, const std::wstring &sThemeDir, InputParams& params);
|
||||
_UINT32 xlst2xlsx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, bool bFromChanges, const std::wstring &sThemeDir, InputParams& params);
|
||||
|
||||
int xltx2xlsx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int xltx2xlsx_dir (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
|
||||
int xltm2xlsm (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int xltm2xlsm_dir (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
|
||||
int xlsm2xlsx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int xlsm2xlsx_dir (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
|
||||
int xltm2xlsx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int xltm2xlsx_dir (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
|
||||
_UINT32 xltx2xlsx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 xltx2xlsx_dir (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
|
||||
_UINT32 xltm2xlsm (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 xltm2xlsm_dir (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
|
||||
_UINT32 xlsm2xlsx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 xlsm2xlsx_dir (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
|
||||
_UINT32 xltm2xlsx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 xltm2xlsx_dir (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
|
||||
|
||||
int pptx2pptt_bin (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int pptx_dir2pptt_bin (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int pptx2pptt (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int pptt_bin2pptx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, bool bFromChanges, const std::wstring &sThemeDir, InputParams& params);
|
||||
int pptt_bin2pptx_dir (const std::wstring &sFrom, const std::wstring &sToResult, const std::wstring &sTo, bool bFromChanges, const std::wstring &sThemeDir, InputParams& params);
|
||||
int pptt2pptx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, bool bFromChanges, const std::wstring &sThemeDir, InputParams& params);
|
||||
_UINT32 pptx2pptt_bin (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 pptx_dir2pptt_bin (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 pptx2pptt (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 pptt_bin2pptx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, bool bFromChanges, const std::wstring &sThemeDir, InputParams& params);
|
||||
_UINT32 pptt_bin2pptx_dir (const std::wstring &sFrom, const std::wstring &sToResult, const std::wstring &sTo, bool bFromChanges, const std::wstring &sThemeDir, InputParams& params);
|
||||
_UINT32 pptt2pptx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, bool bFromChanges, const std::wstring &sThemeDir, InputParams& params);
|
||||
|
||||
int csv2xlst (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int csv2xlsx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int csv2xlst_bin (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
|
||||
int xlst2csv (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int xlsx2csv (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int xlst_bin2csv (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 csv2xlst (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 csv2xlsx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 csv2xlst_bin (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
|
||||
_UINT32 xlst2csv (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 xlsx2csv (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 xlst_bin2csv (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
|
||||
int bin2pdf (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, bool bPaid, const std::wstring &sThemeDir, InputParams& params);
|
||||
_UINT32 bin2pdf (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, bool bPaid, const std::wstring &sThemeDir, InputParams& params);
|
||||
|
||||
int ppsx2pptx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int ppsx2pptx_dir (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
|
||||
int potx2pptx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int potx2pptx_dir (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
|
||||
int ppsm2pptx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int ppsm2pptx_dir (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
|
||||
int potm2pptm (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int potm2pptm_dir (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
|
||||
int ppsm2pptm (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int ppsm2pptm_dir (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
|
||||
int pptm2pptx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int pptm2pptx_dir (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
|
||||
int potm2pptx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int potm2pptx_dir (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
|
||||
_UINT32 ppsx2pptx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 ppsx2pptx_dir (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
|
||||
_UINT32 potx2pptx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 potx2pptx_dir (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
|
||||
_UINT32 ppsm2pptx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 ppsm2pptx_dir (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
|
||||
_UINT32 potm2pptm (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 potm2pptm_dir (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
|
||||
_UINT32 ppsm2pptm (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 ppsm2pptm_dir (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
|
||||
_UINT32 pptm2pptx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 pptm2pptx_dir (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
|
||||
_UINT32 potm2pptx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 potm2pptx_dir (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params);
|
||||
|
||||
int ppt2pptx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int ppt2pptx_dir (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int ppt2pptt_bin (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int ppt2pptt (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int ppt2pptm (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int ppt2pptm_dir (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 ppt2pptx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 ppt2pptx_dir (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 ppt2pptt_bin (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 ppt2pptt (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 ppt2pptm (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 ppt2pptm_dir (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
|
||||
int rtf2docx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int rtf2docx_dir (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int rtf2doct (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int rtf2doct_bin (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int docx2rtf (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int docx_dir2rtf (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int doct2rtf (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, bool bFromChanges, const std::wstring &sThemeDir, InputParams& params);
|
||||
int doct_bin2rtf (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, bool bFromChanges, const std::wstring &sThemeDir, InputParams& params);
|
||||
_UINT32 rtf2docx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 rtf2docx_dir (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 rtf2doct (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 rtf2doct_bin (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 docx2rtf (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 docx_dir2rtf (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 doct2rtf (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, bool bFromChanges, const std::wstring &sThemeDir, InputParams& params);
|
||||
_UINT32 doct_bin2rtf (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, bool bFromChanges, const std::wstring &sThemeDir, InputParams& params);
|
||||
|
||||
int doc2docx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int doc2docx_dir (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int doc2doct (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int doc2doct_bin (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int docx_dir2doc (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int doc2docm (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int doc2docm_dir (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 doc2docx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 doc2docx_dir (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 doc2doct (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 doc2doct_bin (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 docx_dir2doc (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 doc2docm (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 doc2docm_dir (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
|
||||
int xls2xlsx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int xls2xlsx_dir (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int xls2xlst (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int xls2xlst_bin (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int xls2xlsm (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int xls2xlsm_dir (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 xls2xlsx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 xls2xlsx_dir (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 xls2xlst (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 xls2xlst_bin (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 xls2xlsm (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 xls2xlsm_dir (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
|
||||
int txt2docx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int txt2docx_dir (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int txt2doct (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int txt2doct_bin (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
int docx_dir2txt (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 txt2docx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 txt2docx_dir (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 txt2doct (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 txt2doct_bin (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 docx_dir2txt (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params);
|
||||
|
||||
int odf2oox (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
int odf2oox_dir (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
int odf2oot (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
int odf2oot_bin (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
_UINT32 odf2oox (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
_UINT32 odf2oox_dir (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
_UINT32 odf2oot (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
_UINT32 odf2oot_bin (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
|
||||
int odf_flat2oox (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
int odf_flat2oox_dir(const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
int odf_flat2oot (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
int odf_flat2oot_bin(const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
_UINT32 odf_flat2oox (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
_UINT32 odf_flat2oox_dir(const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
_UINT32 odf_flat2oot (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
_UINT32 odf_flat2oot_bin(const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
|
||||
int docx2odt (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
int docx_dir2odt (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
int xlsx2ods (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
int xlsx_dir2ods (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
int pptx2odp (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
int pptx_dir2odp (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
_UINT32 docx2odt (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
_UINT32 docx_dir2odt (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
_UINT32 xlsx2ods (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
_UINT32 xlsx_dir2ods (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
_UINT32 pptx2odp (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
_UINT32 pptx_dir2odp (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
|
||||
int fromMscrypt (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
int mscrypt2oox (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
int mscrypt2oot (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
int mscrypt2oot_bin (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
_UINT32 fromMscrypt (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
_UINT32 mscrypt2oox (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
_UINT32 mscrypt2oot (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
_UINT32 mscrypt2oot_bin (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
|
||||
int oox2mscrypt (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
_UINT32 oox2mscrypt (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
|
||||
int html2doct_bin (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
int html2doct (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
int html2docx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
_UINT32 html2doct_bin (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
_UINT32 html2doct (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
_UINT32 html2docx (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring & sTemp, InputParams& params);
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
int dir2zip (const std::wstring &sFrom, const std::wstring &sTo);
|
||||
int zip2dir (const std::wstring &sFrom, const std::wstring &sTo);
|
||||
_UINT32 dir2zip (const std::wstring &sFrom, const std::wstring &sTo);
|
||||
_UINT32 zip2dir (const std::wstring &sFrom, const std::wstring &sTo);
|
||||
|
||||
int convertmailmerge (const InputParamsMailMerge& oMailMergeSend,const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, bool bPaid, const std::wstring &sThemeDir, InputParams& params);
|
||||
_UINT32 convertmailmerge (const InputParamsMailMerge& oMailMergeSend,const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, bool bPaid, const std::wstring &sThemeDir, InputParams& params);
|
||||
|
||||
int fromDocxDir (const std::wstring &sFrom, const std::wstring &sTo, int nFormatTo, const std::wstring &sTemp, const std::wstring &sThemeDir, bool bFromChanges, bool bPaid, InputParams& params);
|
||||
int fromDoctBin (const std::wstring &sFrom, const std::wstring &sTo, int nFormatTo, const std::wstring &sTemp, const std::wstring &sThemeDir, bool bFromChanges, bool bPaid, InputParams& params);
|
||||
int fromDocument (const std::wstring &sFrom, int nFormatFrom, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 fromDocxDir (const std::wstring &sFrom, const std::wstring &sTo, int nFormatTo, const std::wstring &sTemp, const std::wstring &sThemeDir, bool bFromChanges, bool bPaid, InputParams& params);
|
||||
_UINT32 fromDoctBin (const std::wstring &sFrom, const std::wstring &sTo, int nFormatTo, const std::wstring &sTemp, const std::wstring &sThemeDir, bool bFromChanges, bool bPaid, InputParams& params);
|
||||
_UINT32 fromDocument (const std::wstring &sFrom, int nFormatFrom, const std::wstring &sTemp, InputParams& params);
|
||||
|
||||
int fromXlsxDir (const std::wstring &sFrom, const std::wstring &sTo, int nFormatTo, const std::wstring &sTemp, const std::wstring &sThemeDir, bool bFromChanges, bool bPaid, InputParams& params, const std::wstring &sXlsxFile);
|
||||
int fromXlstBin (const std::wstring &sFrom, const std::wstring &sTo, int nFormatTo, const std::wstring &sTemp, const std::wstring &sThemeDir, bool bFromChanges, bool bPaid, InputParams& params);
|
||||
int fromSpreadsheet (const std::wstring &sFrom, int nFormatFrom, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 fromXlsxDir (const std::wstring &sFrom, const std::wstring &sTo, int nFormatTo, const std::wstring &sTemp, const std::wstring &sThemeDir, bool bFromChanges, bool bPaid, InputParams& params, const std::wstring &sXlsxFile);
|
||||
_UINT32 fromXlstBin (const std::wstring &sFrom, const std::wstring &sTo, int nFormatTo, const std::wstring &sTemp, const std::wstring &sThemeDir, bool bFromChanges, bool bPaid, InputParams& params);
|
||||
_UINT32 fromSpreadsheet (const std::wstring &sFrom, int nFormatFrom, const std::wstring &sTemp, InputParams& params);
|
||||
|
||||
int fromPptxDir (const std::wstring &sFrom, const std::wstring &sTo, int nFormatTo, const std::wstring &sTemp, const std::wstring &sThemeDir, bool bFromChanges, bool bPaid, InputParams& params);
|
||||
int fromPpttBin (const std::wstring &sFrom, const std::wstring &sTo, int nFormatTo, const std::wstring &sTemp, const std::wstring &sThemeDir, bool bFromChanges, bool bPaid, InputParams& params);
|
||||
int fromPresentation(const std::wstring &sFrom, int nFormatFrom, const std::wstring &sTemp, InputParams& params);
|
||||
_UINT32 fromPptxDir (const std::wstring &sFrom, const std::wstring &sTo, int nFormatTo, const std::wstring &sTemp, const std::wstring &sThemeDir, bool bFromChanges, bool bPaid, InputParams& params);
|
||||
_UINT32 fromPpttBin (const std::wstring &sFrom, const std::wstring &sTo, int nFormatTo, const std::wstring &sTemp, const std::wstring &sThemeDir, bool bFromChanges, bool bPaid, InputParams& params);
|
||||
_UINT32 fromPresentation(const std::wstring &sFrom, int nFormatFrom, const std::wstring &sTemp, InputParams& params);
|
||||
|
||||
int fromT(const std::wstring &sFrom, int nFormatFrom, const std::wstring &sTo, int nFormatTo, const std::wstring &sTemp, const std::wstring &sThemeDir, bool bFromChanges, bool bPaid, InputParams& params);
|
||||
int fromCrossPlatform(const std::wstring &sFrom, int nFormatFrom, const std::wstring &sTo, int nFormatTo, const std::wstring &sTemp, const std::wstring &sThemeDir, bool bFromChanges, bool bPaid, InputParams& params);
|
||||
int fromCanvasPdf(const std::wstring &sFrom, int nFormatFrom, const std::wstring &sTo, int nFormatTo, const std::wstring &sTemp, const std::wstring &sThemeDir, bool bFromChanges, bool bPaid, InputParams& params);
|
||||
_UINT32 fromT(const std::wstring &sFrom, int nFormatFrom, const std::wstring &sTo, int nFormatTo, const std::wstring &sTemp, const std::wstring &sThemeDir, bool bFromChanges, bool bPaid, InputParams& params);
|
||||
_UINT32 fromCrossPlatform(const std::wstring &sFrom, int nFormatFrom, const std::wstring &sTo, int nFormatTo, const std::wstring &sTemp, const std::wstring &sThemeDir, bool bFromChanges, bool bPaid, InputParams& params);
|
||||
_UINT32 fromCanvasPdf(const std::wstring &sFrom, int nFormatFrom, const std::wstring &sTo, int nFormatTo, const std::wstring &sTemp, const std::wstring &sThemeDir, bool bFromChanges, bool bPaid, InputParams& params);
|
||||
|
||||
int fromInputParams(InputParams& oInputParams);
|
||||
int detectMacroInFile(InputParams& oInputParams);
|
||||
_UINT32 fromInputParams(InputParams& oInputParams);
|
||||
_UINT32 detectMacroInFile(InputParams& oInputParams);
|
||||
|
||||
X2T_DECL_EXPORT int FromFile(const std::wstring& file);
|
||||
X2T_DECL_EXPORT int FromXml(const std::wstring& xml);
|
||||
X2T_DECL_EXPORT _UINT32 FromFile(const std::wstring& file);
|
||||
X2T_DECL_EXPORT _UINT32 FromXml(const std::wstring& xml);
|
||||
}
|
||||
#endif // ASCCONVERTERS_H
|
||||
|
||||
@ -403,7 +403,7 @@ namespace NExtractTools
|
||||
}
|
||||
std::sort (aChangesFiles.begin(), aChangesFiles.end(), compare_string_by_length);
|
||||
|
||||
for(int i = 0; i < aChangesFiles.size(); ++i)
|
||||
for(size_t i = 0; i < aChangesFiles.size(); ++i)
|
||||
{
|
||||
oBuilder.WriteString(_T("<Change>"));
|
||||
oBuilder.WriteEncodeXmlString(aChangesFiles[i]);
|
||||
@ -419,7 +419,7 @@ namespace NExtractTools
|
||||
oBuilder.WriteString(_T("</Settings>"));
|
||||
return oBuilder.GetData();
|
||||
}
|
||||
int apply_changes(const std::wstring &sBinFrom, const std::wstring &sToResult, NSDoctRenderer::DoctRendererFormat::FormatFile eType, const std::wstring &sThemeDir, std::wstring &sBinTo, const InputParams& params)
|
||||
_UINT32 apply_changes(const std::wstring &sBinFrom, const std::wstring &sToResult, NSDoctRenderer::DoctRendererFormat::FormatFile eType, const std::wstring &sThemeDir, std::wstring &sBinTo, const InputParams& params)
|
||||
{
|
||||
std::wstring sBinDir = NSDirectory::GetFolderPath(sBinFrom);
|
||||
std::wstring sChangesDir = sBinDir + FILE_SEPARATOR_STR + _T("changes");
|
||||
@ -464,7 +464,7 @@ namespace NExtractTools
|
||||
{
|
||||
std::vector<std::wstring> aImages = oDoctRenderer.GetImagesInChanges();
|
||||
//todo сделать interface у COfficeUtils, чтобы можно было делать архив из файлов в разных папках.
|
||||
for(int i = 0; i < aImages.size(); ++i)
|
||||
for(size_t i = 0; i < aImages.size(); ++i)
|
||||
{
|
||||
std::wstring sImageName = aImages[i];
|
||||
std::wstring sImage = sImagesDirectory + FILE_SEPARATOR_STR + sImageName;
|
||||
|
||||
@ -677,7 +677,7 @@ namespace NExtractTools
|
||||
oLimit.uncompressed = std::stoul(oZipNode.GetAttribute(L"uncompressed", L"0"));
|
||||
oLimit.pattern = oZipNode.GetAttribute(L"template", L"");
|
||||
}
|
||||
for (int j = 0; j < aTypes.size(); ++j)
|
||||
for (size_t j = 0; j < aTypes.size(); ++j)
|
||||
{
|
||||
m_mapInputLimits[COfficeFileFormatChecker::GetFormatByExtension(L"." + aTypes[j])] = oLimit;
|
||||
}
|
||||
@ -999,7 +999,7 @@ namespace NExtractTools
|
||||
}
|
||||
return str;
|
||||
}
|
||||
static int getReturnErrorCode(int nDefine)
|
||||
static int getReturnErrorCode(_UINT32 nDefine)
|
||||
{
|
||||
return 0 == nDefine ? 0 : nDefine - AVS_ERROR_FIRST - AVS_FILEUTILS_ERROR_FIRST;
|
||||
}
|
||||
@ -1170,7 +1170,7 @@ namespace NExtractTools
|
||||
std::wstring getDoctXml(NSDoctRenderer::DoctRendererFormat::FormatFile eFromType, NSDoctRenderer::DoctRendererFormat::FormatFile eToType,
|
||||
const std::wstring& sTFileDir, const std::wstring& sPdfBinFile, const std::wstring& sImagesDirectory,
|
||||
const std::wstring& sThemeDir, int nTopIndex, const std::wstring& sMailMerge, const InputParams& params);
|
||||
int apply_changes(const std::wstring &sBinFrom, const std::wstring &sToResult, NSDoctRenderer::DoctRendererFormat::FormatFile eType, const std::wstring &sThemeDir, std::wstring &sBinTo, const InputParams& params);
|
||||
_UINT32 apply_changes(const std::wstring &sBinFrom, const std::wstring &sToResult, NSDoctRenderer::DoctRendererFormat::FormatFile eType, const std::wstring &sThemeDir, std::wstring &sBinTo, const InputParams& params);
|
||||
#endif
|
||||
}
|
||||
#endif // CEXTRACTTOOLS_H
|
||||
|
||||
@ -116,7 +116,7 @@ static std::wstring utf8_to_unicode(const char *src)
|
||||
if (argc >= 3) sArg2 = std::wstring(argv [2]);
|
||||
#endif
|
||||
|
||||
int result = 0;
|
||||
_UINT32 result = 0;
|
||||
std::wstring sXmlExt = _T(".xml");
|
||||
if((sArg1.length() > 3) && (sXmlExt == sArg1.substr(sArg1.length() - sXmlExt.length(), sXmlExt.length())))
|
||||
{
|
||||
|
||||
@ -4764,10 +4764,10 @@ namespace BinXlsxRW
|
||||
{
|
||||
RELEASEOBJECT(m_oBcw);
|
||||
}
|
||||
int Open(const std::wstring& sInputDir, const std::wstring& sFileDst, NSFontCutter::CEmbeddedFontsManager* pEmbeddedFontsManager,
|
||||
_UINT32 Open(const std::wstring& sInputDir, const std::wstring& sFileDst, NSFontCutter::CEmbeddedFontsManager* pEmbeddedFontsManager,
|
||||
NSBinPptxRW::CDrawingConverter* pOfficeDrawingConverter, const std::wstring& sXMLOptions, bool bIsNoBase64)
|
||||
{
|
||||
int result = 0;
|
||||
_UINT32 result = 0;
|
||||
|
||||
OOX::CPath path(sFileDst);
|
||||
//создаем папку для media
|
||||
|
||||
@ -225,7 +225,7 @@ namespace CSVReader
|
||||
pCell->setRowCol(nRow, nCol);
|
||||
oRow.m_arrItems.push_back(pCell);
|
||||
}
|
||||
int ReadFromCsvToXlsx(const std::wstring &sFileName, OOX::Spreadsheet::CXlsx &oXlsx, UINT nCodePage, const std::wstring& sDelimiter)
|
||||
_UINT32 ReadFromCsvToXlsx(const std::wstring &sFileName, OOX::Spreadsheet::CXlsx &oXlsx, UINT nCodePage, const std::wstring& sDelimiter)
|
||||
{
|
||||
NSFile::CFileBinary oFile;
|
||||
if (false == oFile.OpenFile(sFileName)) return AVS_FILEUTILS_ERROR_CONVERT;
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
namespace CSVReader
|
||||
{
|
||||
void AddCell(std::wstring &sText, INT nStartCell, std::stack<INT> &oDeleteChars, OOX::Spreadsheet::CRow &oRow, INT nRow, INT nCol, bool bIsWrap);
|
||||
int ReadFromCsvToXlsx(const std::wstring &sFileName, OOX::Spreadsheet::CXlsx &oXlsx, UINT nCodePage, const std::wstring& wcDelimiter);
|
||||
_UINT32 ReadFromCsvToXlsx(const std::wstring &sFileName, OOX::Spreadsheet::CXlsx &oXlsx, UINT nCodePage, const std::wstring& wcDelimiter);
|
||||
}
|
||||
|
||||
#endif //CSV_READER
|
||||
|
||||
Reference in New Issue
Block a user