Compare commits

...

13 Commits

Author SHA1 Message Date
e0a1c688bf . 2018-01-24 19:28:04 +03:00
9e0b301179 write verion x2t to converted files 2018-01-24 18:25:23 +03:00
8680fb2e0e . 2018-01-24 15:45:10 +03:00
c7c605a970 fix bug #31327
convert script text in toggle property in simple text
2018-01-23 19:34:07 +03:00
23d648d92d fix bug #36409 2018-01-23 16:53:40 +03:00
b098c98dbb x2t version 2.4.510 2018-01-23 16:23:09 +03:00
b88726beaf fix bug #36514 2018-01-23 14:09:55 +03:00
b2d3e5e194 . 2018-01-22 19:21:57 +03:00
a8315efae0 . 2018-01-22 18:26:40 +03:00
3781cf6774 . 2018-01-22 17:45:21 +03:00
7e36d47991 fix bug #8010
OdfFormatReader - dropdown & user fields
2018-01-22 15:09:23 +03:00
419a01bd09 fix bug #36725 2018-01-22 11:21:28 +03:00
804a01cab3 x2t version 2.4.509 2018-01-20 15:22:31 +03:00
61 changed files with 1263 additions and 795 deletions

View File

@ -69,6 +69,7 @@ namespace OpenXmlContentTypes
static const wchar_t* Tiff = L"image/tiff";
static const wchar_t* Wmf = L"image/x-wmf";
static const wchar_t* Bmp = L"image/bmp";
static const wchar_t* Pcz = L"image/x-pcz";
}
namespace WordprocessingMLContentTypes

View File

@ -110,6 +110,11 @@ namespace DocFileFormat
unused2 = Reader->ReadByte();
unused3 = Reader->ReadByte();
if (btMacOS != btWin32)
{
btWin32 = btMacOS = (Global::BlipType)this->Instance;
}
if (BodySize > 0x24)
{
Blip = RecordFactory::ReadRecord(Reader, 0);

View File

@ -192,14 +192,14 @@ public:
{
if (!bIsCompressed)
{
m_pMetaFile = pCompress;
m_lMetaFileSize = lUncompressSize;
m_pMetaFile = new BYTE[lCompressSize];
m_lMetaFileSize = lCompressSize;
memcpy(m_pMetaFile, pCompress, lCompressSize);
}
else
{
ULONG lSize = lUncompressSize;
m_pMetaFile = new BYTE[lUncompressSize];
//bool bRes = NSZLib::Decompress(pCompress, (ULONG)lCompressSize, m_pMetaFile, lSize);
HRESULT res = S_OK;
COfficeUtils* pOfficeUtils = new COfficeUtils(NULL);
@ -340,6 +340,8 @@ typedef enum _BlipCompression
if (typeCode == 0xf01b)
{
oMetaFile.m_sExtension = L".wmf";
WmfPlaceableFileHeader oWmfHeader = {};
oMetaHeader.ToWMFHeader(&oWmfHeader);
@ -349,24 +351,12 @@ typedef enum _BlipCompression
oMetaFile.SetHeader(pMetaHeader, lLenHeader);
}
if (typeCode == 0xf01c)
{
oMetaFile.m_sExtension = L".pcz";
//decompress???
}
oMetaFile.SetData(m_pvBits, oMetaHeader.cbSave, oMetaHeader.cbSize, 0 == oMetaHeader.compression);
//if (pos < sz)
//{
// NSFile::CFileBinary oFile;
// if (oFile.CreateFile(L"d:\\blop.dat"))
// {
// BYTE * d = Reader->ReadBytes( sz - pos, true );
// if (d)
// {
// oFile.WriteFile (d, sz - pos);
// delete []d;
// oFile.CloseFile();
// }
// }
//}
}
virtual ~MetafilePictBlip()

View File

@ -500,6 +500,7 @@ namespace DocFileFormat
{
case Global::msoblipEMF:
case Global::msoblipWMF:
case Global::msoblipPICT:
{
MetafilePictBlip* metaBlip = static_cast<MetafilePictBlip*>(oBlipEntry->Blip);
if (metaBlip)
@ -567,6 +568,9 @@ namespace DocFileFormat
case Global::msoblipWMF:
return std::wstring(L".wmf");
case Global::msoblipPICT:
return std::wstring(L".pcz");
default:
return std::wstring(L".png");
}
@ -601,6 +605,9 @@ namespace DocFileFormat
case Global::msoblipWMF:
return std::wstring(OpenXmlContentTypes::Wmf);
case Global::msoblipPICT:
return std::wstring(OpenXmlContentTypes::Pcz);
case Global::msoblipDIB:
return std::wstring(OpenXmlContentTypes::Bmp);

View File

@ -1287,6 +1287,7 @@ namespace DocFileFormat
{
case Global::msoblipEMF:
case Global::msoblipWMF:
case Global::msoblipPICT:
{
//it's a meta image
MetafilePictBlip* metaBlip = static_cast<MetafilePictBlip*>(RecordFactory::ReadRecord(&reader, 0));
@ -1373,6 +1374,9 @@ namespace DocFileFormat
case Global::msoblipWMF:
return std::wstring( L".wmf" );
case Global::msoblipPICT:
return std::wstring( L".pcz" );
default:
return std::wstring( L".png" );
}

View File

@ -298,8 +298,10 @@ bool BinDocxRW::CDocxSerializer::loadFromFile(const std::wstring& sSrcFileName,
OOX::CApp* pApp = new OOX::CApp(NULL);
if (pApp)
{
pApp->SetApplication(_T("OnlyOffice"));
pApp->SetAppVersion(_T("5.0"));
pApp->SetApplication(L"OnlyOffice");
#if defined(INTVER)
pApp->SetAppVersion(VALUE2STR(INTVER));
#endif
pApp->SetDocSecurity(0);
pApp->SetScaleCrop(false);
pApp->SetLinksUpToDate(false);

View File

@ -144,7 +144,6 @@ private:
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
virtual void add_text(const std::wstring & Text);
};
CP_REGISTER_OFFICE_ELEMENT2(svg_font_face_name);
// svg:definition-src
@ -164,10 +163,8 @@ private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
};
CP_REGISTER_OFFICE_ELEMENT2(svg_definition_src);
// style:font-face
class style_font_face : public office_element_impl<style_font_face>
{
@ -233,7 +230,6 @@ public:
friend class odf_document;
};
CP_REGISTER_OFFICE_ELEMENT2(style_font_face);
// office-font-face-decls
@ -257,7 +253,6 @@ private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
};
CP_REGISTER_OFFICE_ELEMENT2(office_font_face_decls);
}

View File

@ -34,7 +34,6 @@
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/attributes.h>
#include "paragraph_elements.h"

View File

@ -38,7 +38,6 @@
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/utils.h>
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/CPColorUtils.h>
#include "serialize_elements.h"

View File

@ -34,7 +34,6 @@
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/attributes.h>
namespace cpdoccore {
namespace odf_reader {

View File

@ -36,7 +36,6 @@
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/odf/odf_document.h>

View File

@ -34,7 +34,6 @@
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/attributes.h>
#include "serialize_elements.h"

View File

@ -69,8 +69,14 @@ enum ElementType
typeTextTime,
typeTextModificationTime,
typeTextFileName,
typeTextSequence,
typeTextSheetName,
typeTextTemplateName,
typeTextDropDown,
typeTextLabel,
typeTextSequenceDecls,
typeTextSequenceDecl,
typeTextSequence,
typePresentationFooter,
typePresentationDateTime,
@ -78,6 +84,8 @@ enum ElementType
typeDcCreator,
typeDcDate,
typeDrawA,
typeTextH,
typeTextP,
@ -90,28 +98,42 @@ enum ElementType
typeTextSectionSource,
typeTextIndexTitle,
typeTextIndexBody,
typeTextNumberedParagraph,
typeDrawA,
typeTextNumberedParagraph,
typeTextExpression,
typeTextTableOfContent,
typeTextIllustrationIndex,
typeTextTableIndex,
typeTextObjectIndex,
typeTextUserIndex,
typeTextAlphabeticalIndex,
typeTextBibliography,
typeTextBibliographyMark,
typeTextTableOfContentSource,
typeTextIllustrationIndex,
typeTextIllustrationIndexSource,
typeTextTableIndex,
typeTextTableIndexSource,
typeTextObjectIndex,
typeTextObjectIndexSource,
typeTextUserIndex,
typeTextUserIndexSource,
typeTextAlphabeticalIndex,
typeTextAlphabeticalIndexSource,
typeTextBibliographySource,
typeTextBibliography,
typeTextBibliographyMark,
typeTextBibliographySource,
typeTextVariableInput,
typeTextVariableGet,
typeTextVariableSet,
typeTextVariableDecl,
typeTextVariableDecls,
typeTextUserFieldDecls,
typeTextUserFieldDecl,
typeTextUserFieldGet,
typeTextUserFieldSet,
typeTextUserFieldInput,
typeTextTrackedChanges,
typeTextChangedRegion,
@ -125,6 +147,11 @@ enum ElementType
typeTextFormatChange,
typeTextInsertion,
typeTextMeta,
typeTextMetaField,
typeTextTextInput,
typeShape,
typeChangeMarks,

View File

@ -34,7 +34,6 @@
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/attributes.h>
#include "serialize_elements.h"

View File

@ -34,7 +34,6 @@
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/attributes.h>
#include "serialize_elements.h"

View File

@ -39,7 +39,6 @@
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/utils.h>
#include <cpdoccore/common/readstring.h>
#include <cpdoccore/odf/odf_document.h>
@ -742,7 +741,7 @@ std::wostream & title::text_to_stream(std::wostream & _Wostream) const
void title::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
common_field_fixed_attlist_.add_attributes(Attributes);
attlist_.add_attributes(Attributes);
}
void title::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
@ -806,7 +805,7 @@ std::wostream & subject::text_to_stream(std::wostream & _Wostream) const
void subject::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
common_field_fixed_attlist_.add_attributes(Attributes);
attlist_.add_attributes(Attributes);
}
void subject::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
@ -823,8 +822,8 @@ void subject::docx_convert(oox::docx_conversion_context & Context)
{
std::wostream & strm = Context.output_stream();
Context.finish_run();
strm << L"<w:r><w:fldChar w:fldCharType=\"begin\" /></w:r>";
strm << L"<w:r><w:instrText>SUBJECT</w:instrText></w:r><w:r><w:fldChar w:fldCharType=\"separate\" /></w:r>";
strm << L"<w:r><w:fldChar w:fldCharType=\"begin\"/></w:r>";
strm << L"<w:r><w:instrText>SUBJECT</w:instrText></w:r><w:r><w:fldChar w:fldCharType=\"separate\"/></w:r>";
Context.add_new_run();
std::wstring textNode = L"w:t";
@ -838,7 +837,7 @@ void subject::docx_convert(oox::docx_conversion_context & Context)
strm << L"</" << textNode << L">";
Context.finish_run();
strm << L"<w:r><w:fldChar w:fldCharType=\"end\" /></w:r>";
strm << L"<w:r><w:fldChar w:fldCharType=\"end\"/></w:r>";
}
void subject::xlsx_convert(oox::xlsx_conversion_context & Context)
@ -869,7 +868,7 @@ std::wostream & chapter::text_to_stream(std::wostream & _Wostream) const
void chapter::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
common_field_fixed_attlist_.add_attributes(Attributes);
attlist_.add_attributes(Attributes);
}
void chapter::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
@ -1379,9 +1378,77 @@ void sequence::pptx_convert(oox::pptx_conversion_context & Context)
text_[i]->pptx_convert(Context);
}
}
//-------------------------------------------------------------------------------------------------------------------
// text:drop-down
//-------------------------------------------------------------------------------------------------------------------
const wchar_t * text_drop_down::ns = L"text";
const wchar_t * text_drop_down::name = L"drop-down";
// text:sequesheet-namence
//////////////////////////////////////////////////////////////////////////////////////////////////
void text_drop_down::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"text:name", text_name_);
}
void text_drop_down::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
{
if CP_CHECK_NAME(L"text", L"label")
{
CP_CREATE_ELEMENT(content_);
}
else
{
}
}
void text_drop_down::add_text(const std::wstring & Text)
{
text_ = Text;
}
std::wostream & text_drop_down::text_to_stream(std::wostream & _Wostream) const
{
_Wostream << xml::utils::replace_text_to_xml( text_ );
return _Wostream;
}
void text_drop_down::docx_convert(oox::docx_conversion_context & Context)
{
std::wostream & strm = Context.output_stream();
Context.finish_run();
strm << L"<w:r><w:fldChar w:fldCharType=\"begin\"><w:ffData><w:name w:val=\"" << text_name_.get_value_or(L"") << L"\"/><w:enabled/>";
strm << L"<w:ddList><w:result w:val=\"0\"/>";
for (size_t i = 0; i < content_.size(); i++)
{
content_[i]->docx_convert(Context);
}
strm << L"</w:ddList></w:ffData>";
strm << L"</w:fldChar></w:r>";
strm << L"<w:r><w:instrText>FORMDROPDOWN</w:instrText></w:r>";
strm << L"<w:r><w:fldChar w:fldCharType=\"separate\"/></w:r>";
strm << L"<w:r><w:t>" << text_ << L"</w:t></w:r>";
strm << L"<w:r><w:fldChar w:fldCharType=\"end\"/></w:r>";
}
//-------------------------------------------------------------------------------------------------------------------
// text:label
//-------------------------------------------------------------------------------------------------------------------
const wchar_t * text_label::ns = L"text";
const wchar_t * text_label::name = L"label";
void text_label::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"text:value", text_value_);
}
void text_label::docx_convert(oox::docx_conversion_context & Context)
{
std::wostream & strm = Context.output_stream();
strm << L"<w:listEntry w:val=\"" << text_value_.get_value_or(L"") << L"\"/>";
}
//-------------------------------------------------------------------------------------------------------------------
// text:sheet-name
//-------------------------------------------------------------------------------------------------------------------
const wchar_t * sheet_name::ns = L"text";
const wchar_t * sheet_name::name = L"sheet-name";

View File

@ -122,7 +122,6 @@ private:
_CP_OPT(unsigned int) text_c_;
_CP_OPT(std::wstring) content_;
};
CP_REGISTER_OFFICE_ELEMENT2(s);
// text:tab
@ -431,7 +430,6 @@ CP_REGISTER_OFFICE_ELEMENT2(a);
// text:note
//////////////////////////////////////////////////////////////////////////////////////////////////
class note : public paragraph_content_element<note>
{
public:
@ -452,18 +450,16 @@ private:
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
virtual void add_text(const std::wstring & Text);
std::wstring text_id_;
odf_types::noteclass text_note_class_;
office_element_ptr text_note_citation_;
office_element_ptr text_note_body_;
std::wstring text_id_;
odf_types::noteclass text_note_class_;
office_element_ptr text_note_citation_;
office_element_ptr text_note_body_;
};
CP_REGISTER_OFFICE_ELEMENT2(note);
// text:ruby
//////////////////////////////////////////////////////////////////////////////////////////////////
class ruby : public paragraph_content_element<ruby>
{
public:
@ -485,7 +481,6 @@ private:
office_element_ptr text_ruby_text_;
};
CP_REGISTER_OFFICE_ELEMENT2(ruby);
class common_field_fixed_attlist
@ -521,8 +516,8 @@ private:
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
virtual void add_text(const std::wstring & Text);
common_field_fixed_attlist common_field_fixed_attlist_;
office_element_ptr_array content_;
common_field_fixed_attlist attlist_;
office_element_ptr_array content_;
};
@ -549,7 +544,7 @@ private:
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
virtual void add_text(const std::wstring & Text);
common_field_fixed_attlist common_field_fixed_attlist_;
common_field_fixed_attlist attlist_;
office_element_ptr_array content_;
};
@ -577,7 +572,7 @@ private:
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
virtual void add_text(const std::wstring & Text);
common_field_fixed_attlist common_field_fixed_attlist_;
common_field_fixed_attlist attlist_;
office_element_ptr_array content_;
};
@ -687,7 +682,7 @@ public:
_CP_OPT(bool) text_fixed_;
_CP_OPT(std::wstring) text_date_value_;//with format
office_element_ptr_array text_;
office_element_ptr_array text_;
private:
void add_attributes( const xml::attributes_wc_ptr & Attributes );
@ -715,8 +710,9 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(text_modification_date);
//-------------------------------------------------------------------------------------------------------------------
// text:time
//////////////////////////////////////////////////////////////////////////////////////////////////
//-------------------------------------------------------------------------------------------------------------------
class text_time : public paragraph_content_element<text_time>
{
public:
@ -745,8 +741,9 @@ private:
CP_REGISTER_OFFICE_ELEMENT2(text_time);
//-------------------------------------------------------------------------------------------------------------------
// text:modification-date
//////////////////////////////////////////////////////////////////////////////////////////////////
//-------------------------------------------------------------------------------------------------------------------
class text_modification_time : public text_time
{
public:
@ -762,8 +759,9 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(text_modification_time);
//-------------------------------------------------------------------------------------------------------------------
// text:file-name
//////////////////////////////////////////////////////////////////////////////////////////////////
//-------------------------------------------------------------------------------------------------------------------
class text_file_name : public paragraph_content_element<text_file_name>
{
public:
@ -787,11 +785,11 @@ private:
office_element_ptr_array text_;
};
CP_REGISTER_OFFICE_ELEMENT2(text_file_name);
//-------------------------------------------------------------------------------------------------------------------
// text:sequence
//////////////////////////////////////////////////////////////////////////////////////////////////
//-------------------------------------------------------------------------------------------------------------------
class sequence : public paragraph_content_element<sequence>
{
public:
@ -815,11 +813,58 @@ private:
office_element_ptr_array text_;
};
CP_REGISTER_OFFICE_ELEMENT2(sequence);
//-------------------------------------------------------------------------------------------------------------------
//text:drop-down
//-------------------------------------------------------------------------------------------------------------------
class text_drop_down : public paragraph_content_element<text_drop_down>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextDropDown;
CPDOCCORE_DEFINE_VISITABLE();
void docx_convert(oox::docx_conversion_context & Context);
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
virtual void add_text(const std::wstring & Text);
_CP_OPT(std::wstring) text_name_;
office_element_ptr_array content_;
std::wstring text_;
};
CP_REGISTER_OFFICE_ELEMENT2(text_drop_down);
//-------------------------------------------------------------------------------------------------------------------
//text:drop-down
//-------------------------------------------------------------------------------------------------------------------
class text_label : public paragraph_content_element<text_label>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextLabel;
CPDOCCORE_DEFINE_VISITABLE();
void docx_convert(oox::docx_conversion_context & Context);
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name){}
_CP_OPT(std::wstring) text_value_;
};
CP_REGISTER_OFFICE_ELEMENT2(text_label);
//-------------------------------------------------------------------------------------------------------------------
// text:sheet-name
//////////////////////////////////////////////////////////////////////////////////////////////////
//-------------------------------------------------------------------------------------------------------------------
class sheet_name : public paragraph_content_element<sheet_name>
{
public:
@ -837,11 +882,11 @@ private:
office_element_ptr_array text_;
};
CP_REGISTER_OFFICE_ELEMENT2(sheet_name);
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//-------------------------------------------------------------------------------------------------------------------
//presentation:footer
//-------------------------------------------------------------------------------------------------------------------
class presentation_footer : public paragraph_content_element<presentation_footer>
{
public:
@ -861,8 +906,9 @@ private:
};
CP_REGISTER_OFFICE_ELEMENT2(presentation_footer);
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//-------------------------------------------------------------------------------------------------------------------
//presentation:date-time
//-------------------------------------------------------------------------------------------------------------------
class presentation_date_time: public paragraph_content_element<presentation_date_time>
{
public:

View File

@ -33,7 +33,6 @@
#include "ruby.h"
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/xmlchar.h>

View File

@ -34,7 +34,6 @@
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/attributes.h>
#include "serialize_elements.h"

View File

@ -34,7 +34,6 @@
#include "styles.h"
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/simple_xml_writer.h>
#include <cpdoccore/odf/odf_document.h>

View File

@ -35,7 +35,6 @@
#include <boost/make_shared.hpp>
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/attributes.h>
#include "serialize_elements.h"

View File

@ -34,7 +34,6 @@
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/attributes.h>
#include "serialize_elements.h"

View File

@ -34,7 +34,6 @@
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/attributes.h>
#include "serialize_elements.h"
#include "odfcontext.h"

View File

@ -34,7 +34,6 @@
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/simple_xml_writer.h>
#include "serialize_elements.h"

View File

@ -34,7 +34,6 @@
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/utils.h>
#include <cpdoccore/odf/odf_document.h>
#include <cpdoccore/xml/simple_xml_writer.h>

View File

@ -34,7 +34,7 @@
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/utils.h>
#include "paragraph_elements.h"
#include "serialize_elements.h"
@ -341,13 +341,13 @@ void paragraph::drop_cap_text_docx_convert(office_element_ptr first_text_element
int textStyle = process_paragraph_attr(attrs_, Context);
first_text_paragraph->docx_convert(Context);
int str_start = Context.get_drop_cap_context().Length;
int str_size = store_str.length()-Context.get_drop_cap_context().Length;
size_t str_start = Context.get_drop_cap_context().Length;
size_t str_size = store_str.length() - Context.get_drop_cap_context().Length;
if (str_size < 0) str_size = 0; // это если на буквы в буквице разные стили
if (str_start > store_str.length()) str_start = store_str.length(); // это если на буквы в буквице разные стили
str=store_str.substr(str_start, str_size);
str = store_str.substr(str_start, str_size);
}
size_t paragraph::drop_cap_docx_convert(oox::docx_conversion_context & Context)
@ -1424,7 +1424,119 @@ void text_change_end::docx_convert(oox::docx_conversion_context & Context)
{
Context.end_text_changes (*text_change_id_);
}
//---------------------------------------------------------------------------------------------------
const wchar_t * text_variable_input::ns = L"text";
const wchar_t * text_variable_input::name = L"variable-input";
void text_variable_input::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"office:value-type", office_value_type_);
CP_APPLY_ATTR(L"style:data-style-name", style_data_style_name_);
CP_APPLY_ATTR(L"text:description", text_description_);
CP_APPLY_ATTR(L"text:display", text_display_);
CP_APPLY_ATTR(L"text:name", text_name_);
}
void text_variable_input::add_text(const std::wstring & Text)
{
text_ = Text;
}
std::wostream & text_variable_input::text_to_stream(std::wostream & _Wostream) const
{
_Wostream << xml::utils::replace_text_to_xml( text_ );
return _Wostream;
}
void text_variable_input::docx_convert(oox::docx_conversion_context & Context)
{
std::wostream & strm = Context.output_stream();
Context.finish_run();
strm << L"<w:r><w:fldChar w:fldCharType=\"begin\"/></w:r>";
strm << L"<w:r><w:instrText>ASK &quot;" << text_name_.get_value_or(L"") << L"&quot; " << text_description_.get_value_or(L"") << L" \\d ";
strm << text_;
strm << L"</w:instrText></w:r>";
strm << L"<w:r><w:fldChar w:fldCharType=\"separate\"/></w:r>";
strm << L"<w:r><w:fldChar w:fldCharType=\"end\"/></w:r>";
strm << L"<w:r><w:fldChar w:fldCharType=\"begin\"/></w:r>";
strm << L"<w:r><w:instrText>REF &quot;" << text_name_.get_value_or(L"") << L"&quot; </w:instrText></w:r>";
strm << L"<w:r><w:fldChar w:fldCharType=\"separate\"/></w:r>";
strm << L"<w:r><w:t>" << text_ << L"</w:t></w:r>";
strm << L"<w:r><w:fldChar w:fldCharType=\"end\"/></w:r>";
}
//---------------------------------------------------------------------------------------------------
const wchar_t * text_variable_get::ns = L"text";
const wchar_t * text_variable_get::name = L"variable-get";
void text_variable_get::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"style:data-style-name", style_data_style_name_);
CP_APPLY_ATTR(L"text:display", text_display_);
CP_APPLY_ATTR(L"text:name", text_name_);
}
void text_variable_get::docx_convert(oox::docx_conversion_context & Context)
{
}
//---------------------------------------------------------------------------------------------------
const wchar_t * text_variable_set::ns = L"text";
const wchar_t * text_variable_set::name = L"variable-set";
void text_variable_set::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"office:value-type", office_value_type_);
CP_APPLY_ATTR(L"style:data-style-name", style_data_style_name_);
CP_APPLY_ATTR(L"text:display", text_display_);
CP_APPLY_ATTR(L"text:name", text_name_);
CP_APPLY_ATTR(L"office:value", office_value_);
CP_APPLY_ATTR(L"office:boolean-value", office_boolean_value_);
CP_APPLY_ATTR(L"office:date-value", office_date_value_);
CP_APPLY_ATTR(L"office:time-value", office_time_value_);
CP_APPLY_ATTR(L"office:string-value", office_string_value_);
CP_APPLY_ATTR(L"office:currency", office_currency_);
CP_APPLY_ATTR(L"office:formula", office_formula_);
}
void text_variable_set::docx_convert(oox::docx_conversion_context & Context)
{
}
//---------------------------------------------------------------------------------------------------
const wchar_t * text_variable_decl::ns = L"text";
const wchar_t * text_variable_decl::name = L"variable-decl";
void text_variable_decl::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"office:value-type", office_value_type_);
CP_APPLY_ATTR(L"text:display", text_display_);
CP_APPLY_ATTR(L"text:name", text_name_);
}
void text_variable_decl::docx_convert(oox::docx_conversion_context & Context)
{
}
//---------------------------------------------------------------------------------------------------
const wchar_t * text_variable_decls::ns = L"text";
const wchar_t * text_variable_decls::name = L"variable-decls";
void text_variable_decls::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
{
if CP_CHECK_NAME(L"text", L"variable-decl")
{
CP_CREATE_ELEMENT(content_);
}
else
{
}
}
void text_variable_decls::docx_convert(oox::docx_conversion_context & Context)
{
for (size_t i = 0; i < content_.size(); i++)
{
content_[i]->docx_convert(Context);
}
}
}
}
}

View File

@ -535,8 +535,6 @@ public:
};
CP_REGISTER_OFFICE_ELEMENT2(text_index_title);
//---------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------
class text_unknown_base_change : public office_element_impl<text_unknown_base_change>
{
@ -717,8 +715,137 @@ public:
virtual void docx_convert(oox::docx_conversion_context & Context);
};
CP_REGISTER_OFFICE_ELEMENT2(text_change_end);
//-------------------------------------------------------------------------------------------------------------------
//text:variable-input
//---------------------------------------------------------------------------------------------------
class text_variable_input : public office_element_impl<text_variable_input>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextVariableInput;
CPDOCCORE_DEFINE_VISITABLE()
void docx_convert(oox::docx_conversion_context & Context);
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name){}
virtual void add_text(const std::wstring & Text);
_CP_OPT(odf_types::office_value_type) office_value_type_;
_CP_OPT(std::wstring) style_data_style_name_;
_CP_OPT(std::wstring) text_description_;
_CP_OPT(std::wstring) text_display_;
_CP_OPT(std::wstring) text_name_;
std::wstring text_;
};
CP_REGISTER_OFFICE_ELEMENT2(text_variable_input);
//-------------------------------------------------------------------------------------------------------------------
//text:variable-get
//---------------------------------------------------------------------------------------------------
class text_variable_get : public office_element_impl<text_variable_get>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextVariableGet;
CPDOCCORE_DEFINE_VISITABLE()
void docx_convert(oox::docx_conversion_context & Context);
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name){}
_CP_OPT(std::wstring) style_data_style_name_;
_CP_OPT(std::wstring) text_display_;
_CP_OPT(std::wstring) text_name_;
};
CP_REGISTER_OFFICE_ELEMENT2(text_variable_get);
//-------------------------------------------------------------------------------------------------------------------
//text:variable-set
//---------------------------------------------------------------------------------------------------
class text_variable_set : public office_element_impl<text_variable_set>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextVariableSet;
CPDOCCORE_DEFINE_VISITABLE()
void docx_convert(oox::docx_conversion_context & Context);
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name){}
_CP_OPT(odf_types::office_value_type) office_value_type_;
_CP_OPT(std::wstring) office_boolean_value_;
_CP_OPT(std::wstring) office_date_value_;
_CP_OPT(std::wstring) office_time_value_;
_CP_OPT(std::wstring) office_string_value_;
_CP_OPT(std::wstring) office_value_;
_CP_OPT(std::wstring) office_currency_;
_CP_OPT(std::wstring) office_formula_;
_CP_OPT(std::wstring) style_data_style_name_;
_CP_OPT(std::wstring) text_display_;
_CP_OPT(std::wstring) text_name_;
};
CP_REGISTER_OFFICE_ELEMENT2(text_variable_set);
//---------------------------------------------------------------------------------------------------
//text:variable-decl
//---------------------------------------------------------------------------------------------------
class text_variable_decl : public office_element_impl<text_variable_decl>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextVariableDecl;
CPDOCCORE_DEFINE_VISITABLE()
void docx_convert(oox::docx_conversion_context & Context);
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name){}
_CP_OPT(odf_types::office_value_type) office_value_type_;
_CP_OPT(std::wstring) text_display_;
_CP_OPT(std::wstring) text_name_;
};
CP_REGISTER_OFFICE_ELEMENT2(text_variable_decl);
//---------------------------------------------------------------------------------------------------
//text:variable-decls
//---------------------------------------------------------------------------------------------------
class text_variable_decls : public office_element_impl<text_variable_decls>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextVariableDecls;
CPDOCCORE_DEFINE_VISITABLE()
void docx_convert(oox::docx_conversion_context & Context);
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes ){}
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(text_variable_decls);
}
}
}

View File

@ -2992,7 +2992,10 @@ void DocxConverter::convert_styles()
{
if (docx_styles->m_arrStyle[i] == NULL) continue;
current_font_size.erase(current_font_size.begin() + 1, current_font_size.end());
if (!current_font_size.empty())
{
current_font_size.erase(current_font_size.begin() + 1, current_font_size.end());
}
convert(docx_styles->m_arrStyle[i]);

View File

@ -247,7 +247,7 @@ void CStylesWriter::ConvertStyleLevel(NSPresentationEditor::CTextStyleLevel& oLe
else if ((pCF->FontProperties.is_init()) && (!pCF->FontProperties->strFontName.empty()))
{
oWriter.WriteString(L"<a:latin typeface=\"" + pCF->FontProperties->strFontName + L"\"/>");
}
}
if (pCF->FontPropertiesEA.is_init())
{
oWriter.WriteString(L"<a:ea typeface=\"" + pCF->FontPropertiesEA->strFontName + L"\"/>");
@ -1172,13 +1172,11 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
{
if (0 == pCF->Typeface.get())
{
std::wstring strProp = _T("<a:latin typeface=\"+mj-lt\"/>");
m_oWriter.WriteString(strProp);
m_oWriter.WriteString(L"<a:latin typeface=\"+mj-lt\"/>");
}
else
{
std::wstring strProp = _T("<a:latin typeface=\"+mn-lt\"/>");
m_oWriter.WriteString(strProp);
m_oWriter.WriteString(L"<a:latin typeface=\"+mn-lt\"/>");
}
}
else if (pCF->FontProperties.is_init())

View File

@ -1002,11 +1002,12 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide)
CElementPtr pElement = oArrayShapes[nShape]->GetElement(&m_oExMedia, pSlide->m_lOriginalWidth, pSlide->m_lOriginalHeight,
pTheme, pLayout, pThemeWrapper, pSlideWrapper, pSlide);
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElement.get());
if (NULL != pElement)
{
if (pElement->m_bIsBackground && !pElement->m_bHaveAnchor && !bMasterBackGround)
{
CShapeElement* pShape = dynamic_cast<CShapeElement*>(pElement.get());
if (NULL != pShape)
{
pShape->SetupProperties(pSlide, pTheme, pLayout);
@ -1019,6 +1020,9 @@ void CPPTUserInfo::LoadSlide(DWORD dwSlideID, CSlide* pSlide)
}else
AddAnimation ( dwSlideID, pSlide->m_lOriginalWidth, pSlide->m_lOriginalHeight, pElement );
if (NULL != pShape)
pShape->SetupProperties(pSlide, pTheme, pLayout);
if (pElement->m_bHaveAnchor)
{
pSlide->m_arElements.push_back(pElement);

View File

@ -803,11 +803,11 @@ HRESULT CElementProps::GetProperty(LONG lId, ASC_VARIANT* pProp)
if (NULL == pProp)
return S_FALSE;
std::map<LONG, ASC_VARIANT>::iterator pPair = m_Properties.find(lId);
if (m_Properties.end() == pPair)
std::map<LONG, ASC_VARIANT>::iterator pFind = m_Properties.find(lId);
if (m_Properties.end() == pFind)
return S_FALSE;
bool bIsSupportProp = CopyProperty(*pProp, pPair->second);
bool bIsSupportProp = CopyProperty(*pProp, pFind->second);
if (!bIsSupportProp)
{
@ -965,7 +965,7 @@ HRESULT CDrawingConverter::AddShapeType(const std::wstring& bsXml)
strXml += L">";
strXml += (std::wstring)bsXml;
strXml += bsXml;
strXml += L"</main>";
@ -1540,9 +1540,10 @@ bool CDrawingConverter::ParceObject(const std::wstring& strXml, std::wstring** p
pPicture->oleObject.reset(pOle);
pOle = NULL;
}
if (pElem)
m_pBinaryWriter->WriteRecord1(1, *pElem);
}
if (pElem)
m_pBinaryWriter->WriteRecord1(1, *pElem);
RELEASEOBJECT(pElem)
RELEASEOBJECT(pOle)
}
@ -1838,10 +1839,10 @@ void CDrawingConverter::doc_LoadShape(PPTX::Logic::SpTreeElem *elem, XmlUtils::C
{
strType = strType.substr(1);
std::map<std::wstring, CShapePtr>::iterator pPair = m_mapShapeTypes.find(strType);
if (m_mapShapeTypes.end() != pPair)
std::map<std::wstring, CShapePtr>::iterator pFind = m_mapShapeTypes.find(strType);
if (m_mapShapeTypes.end() != pFind)
{
CBaseShapePtr base_shape_type = pPair->second->getBaseShape();
CBaseShapePtr base_shape_type = pFind->second->getBaseShape();
CPPTShape* ppt_shape_type = dynamic_cast<CPPTShape*>(base_shape_type.get());
pPPTShape = new CPPTShape();
@ -2111,16 +2112,16 @@ void CDrawingConverter::doc_LoadShape(PPTX::Logic::SpTreeElem *elem, XmlUtils::C
std::wstring strStyle = oNodeP.GetAttribute(L"style");
PPTX::CCSS oCSSParser;
oCSSParser.LoadFromString2(strStyle);
std::map<std::wstring, std::wstring>::iterator pPair = oCSSParser.m_mapSettings.find(L"font-family");
if (pPair != oCSSParser.m_mapSettings.end())
std::map<std::wstring, std::wstring>::iterator pFind = oCSSParser.m_mapSettings.find(L"font-family");
if (pFind != oCSSParser.m_mapSettings.end())
{
sFont = pPair->second;
sFont = pFind->second;
XmlUtils::replace_all(sFont, L"\"", L"");
}
pPair = oCSSParser.m_mapSettings.find(L"font-size");
if (pPair != oCSSParser.m_mapSettings.end())
pFind = oCSSParser.m_mapSettings.find(L"font-size");
if (pFind != oCSSParser.m_mapSettings.end())
{
nFontSize = _wtoi(pPair->second.c_str()) * 2;
nFontSize = _wtoi(pFind->second.c_str()) * 2;
}
nullable_string sFitPath;
@ -2572,21 +2573,21 @@ void CDrawingConverter::doc_LoadShape(PPTX::Logic::SpTreeElem *elem, XmlUtils::C
if (oCSSParser.m_mapSettings.size() > 0)
{
std::map<std::wstring, std::wstring>::iterator pPair = oCSSParser.m_mapSettings.find(L"layout-flow");
std::map<std::wstring, std::wstring>::iterator pFind = oCSSParser.m_mapSettings.find(L"layout-flow");
if (pPair != oCSSParser.m_mapSettings.end())
if (pFind != oCSSParser.m_mapSettings.end())
{
if (pPair->second == L"vertical")
if (pFind->second == L"vertical")
{
pShape->oTextBoxBodyPr->vert = new PPTX::Limit::TextVerticalType();
pShape->oTextBoxBodyPr->vert->set(L"vert");
}
}
pPair = oCSSParser.m_mapSettings.find(L"mso-layout-flow-alt");
if (pPair != oCSSParser.m_mapSettings.end())
pFind = oCSSParser.m_mapSettings.find(L"mso-layout-flow-alt");
if (pFind != oCSSParser.m_mapSettings.end())
{
if (pPair->second == L"bottom-to-top")
if (pFind->second == L"bottom-to-top")
{
if (pShape->oTextBoxBodyPr->vert.IsInit() == false)
pShape->oTextBoxBodyPr->vert = new PPTX::Limit::TextVerticalType();
@ -2604,12 +2605,12 @@ void CDrawingConverter::doc_LoadShape(PPTX::Logic::SpTreeElem *elem, XmlUtils::C
pShape->txBody->bodyPr->vert = pShape->oTextBoxBodyPr->vert;
}
pPair = oCSSParser.m_mapSettings.find(L"mso-rotate");
if (pPair != oCSSParser.m_mapSettings.end())
pFind = oCSSParser.m_mapSettings.find(L"mso-rotate");
if (pFind != oCSSParser.m_mapSettings.end())
{
try
{
pShape->oTextBoxBodyPr->rot = _wtoi(pPair->second.c_str()) * 60000; //для docx, xlsx
pShape->oTextBoxBodyPr->rot = _wtoi(pFind->second.c_str()) * 60000; //для docx, xlsx
if (pShape->txBody.IsInit() == false) //для pptx
pShape->txBody = new PPTX::Logic::TxBody();
@ -2685,25 +2686,25 @@ void CDrawingConverter::doc_LoadShape(PPTX::Logic::SpTreeElem *elem, XmlUtils::C
//-------------------------------------------------------------------------------------------------------------------
if (pShape && oCSSParser.m_mapSettings.size() > 0)
{
std::map<std::wstring, std::wstring>::iterator pPair = oCSSParser.m_mapSettings.find(L"v-text-anchor");
std::map<std::wstring, std::wstring>::iterator pFind = oCSSParser.m_mapSettings.find(L"v-text-anchor");
if (pPair != oCSSParser.m_mapSettings.end())
if (pFind != oCSSParser.m_mapSettings.end())
{
if (pPair->second == L"middle") pShape->oTextBoxBodyPr->anchor = L"ctr";
if (pPair->second == L"bottom") pShape->oTextBoxBodyPr->anchor = L"b";
if (pPair->second == L"top-center") pShape->oTextBoxBodyPr->anchor = L"t";
if (pPair->second == L"middle-center") pShape->oTextBoxBodyPr->anchor = L"ctr";
if (pPair->second == L"bottom-center") pShape->oTextBoxBodyPr->anchor = L"b";
if (pPair->second == L"top-baseline") pShape->oTextBoxBodyPr->anchor = L"t";
if (pPair->second == L"bottom-baseline") pShape->oTextBoxBodyPr->anchor = L"b";
if (pPair->second == L"top-center-baseline") pShape->oTextBoxBodyPr->anchor = L"t";
if (pPair->second == L"bottom-center-baseline") pShape->oTextBoxBodyPr->anchor = L"b";
if (pFind->second == L"middle") pShape->oTextBoxBodyPr->anchor = L"ctr";
if (pFind->second == L"bottom") pShape->oTextBoxBodyPr->anchor = L"b";
if (pFind->second == L"top-center") pShape->oTextBoxBodyPr->anchor = L"t";
if (pFind->second == L"middle-center") pShape->oTextBoxBodyPr->anchor = L"ctr";
if (pFind->second == L"bottom-center") pShape->oTextBoxBodyPr->anchor = L"b";
if (pFind->second == L"top-baseline") pShape->oTextBoxBodyPr->anchor = L"t";
if (pFind->second == L"bottom-baseline") pShape->oTextBoxBodyPr->anchor = L"b";
if (pFind->second == L"top-center-baseline") pShape->oTextBoxBodyPr->anchor = L"t";
if (pFind->second == L"bottom-center-baseline") pShape->oTextBoxBodyPr->anchor = L"b";
}
pPair = oCSSParser.m_mapSettings.find(L"mso-wrap-style");
if (pPair != oCSSParser.m_mapSettings.end() )
pFind = oCSSParser.m_mapSettings.find(L"mso-wrap-style");
if (pFind != oCSSParser.m_mapSettings.end() )
{
if (pPair->second == L"none")
if (pFind->second == L"none")
pShape->oTextBoxBodyPr->wrap = L"none";
else
pShape->oTextBoxBodyPr->wrap = L"wrap";
@ -2730,26 +2731,24 @@ void CDrawingConverter::doc_LoadShape(PPTX::Logic::SpTreeElem *elem, XmlUtils::C
pSpPr->xfrm->extY = oProps.Height;
}
std::map<std::wstring, std::wstring>::iterator pPair;
pPair = oCSSParser.m_mapSettings.find(L"flip");
if (oCSSParser.m_mapSettings.end() != pPair)
std::map<std::wstring, std::wstring>::iterator pFind = oCSSParser.m_mapSettings.find(L"flip");
if (oCSSParser.m_mapSettings.end() != pFind)
{
if (pPair->second == L"x")
if (pFind->second == L"x")
pSpPr->xfrm->flipH = true;
else if (pPair->second == L"y")
else if (pFind->second == L"y")
pSpPr->xfrm->flipV = true;
else if ((pPair->second == L"xy") || (pPair->second == L"yx") || (pPair->second == L"x y") || (pPair->second == L"y x"))
else if ((pFind->second == L"xy") || (pFind->second == L"yx") || (pFind->second == L"x y") || (pFind->second == L"y x"))
{
pSpPr->xfrm->flipH = true;
pSpPr->xfrm->flipV = true;
}
}
pPair = oCSSParser.m_mapSettings.find(L"rotation");
if (oCSSParser.m_mapSettings.end() != pPair)
pFind = oCSSParser.m_mapSettings.find(L"rotation");
if (oCSSParser.m_mapSettings.end() != pFind)
{
pSpPr->xfrm->rot = NS_DWC_Common::getRotateAngle(pPair->second, pSpPr->xfrm->flipH, pSpPr->xfrm->flipV);
pSpPr->xfrm->rot = NS_DWC_Common::getRotateAngle(pFind->second, pSpPr->xfrm->flipH, pSpPr->xfrm->flipV);
}
}
else
@ -2766,26 +2765,24 @@ void CDrawingConverter::doc_LoadShape(PPTX::Logic::SpTreeElem *elem, XmlUtils::C
pSpPr->xfrm->extX = oProps.Width;
pSpPr->xfrm->extY = oProps.Height;
std::map<std::wstring, std::wstring>::iterator pPair;
pPair = oCSSParser.m_mapSettings.find(L"flip");
if (oCSSParser.m_mapSettings.end() != pPair)
std::map<std::wstring, std::wstring>::iterator pFind = oCSSParser.m_mapSettings.find(L"flip");
if (oCSSParser.m_mapSettings.end() != pFind)
{
if (pPair->second == L"x")
if (pFind->second == L"x")
pSpPr->xfrm->flipH = true;
else if (pPair->second == L"y")
else if (pFind->second == L"y")
pSpPr->xfrm->flipV = true;
else if ((pPair->second == L"xy") || (pPair->second == L"yx") || (pPair->second == L"x y") || (pPair->second == L"y x"))
else if ((pFind->second == L"xy") || (pFind->second == L"yx") || (pFind->second == L"x y") || (pFind->second == L"y x"))
{
pSpPr->xfrm->flipH = true;
pSpPr->xfrm->flipV = true;
}
}
pPair = oCSSParser.m_mapSettings.find(L"rotation");
if (oCSSParser.m_mapSettings.end() != pPair)
pFind = oCSSParser.m_mapSettings.find(L"rotation");
if (oCSSParser.m_mapSettings.end() != pFind)
{
pSpPr->xfrm->rot = NS_DWC_Common::getRotateAngle(pPair->second, pSpPr->xfrm->flipH, pSpPr->xfrm->flipV);
pSpPr->xfrm->rot = NS_DWC_Common::getRotateAngle(pFind->second, pSpPr->xfrm->flipH, pSpPr->xfrm->flipV);
}
}
@ -2946,26 +2943,24 @@ void CDrawingConverter::doc_LoadGroup(PPTX::Logic::SpTreeElem *result, XmlUtils:
pTree->grpSpPr.xfrm->chExtY = lCoordSizeH;
}
std::map<std::wstring, std::wstring>::iterator pPair;
pPair = oCSSParser.m_mapSettings.find(L"flip");
if (oCSSParser.m_mapSettings.end() != pPair)
std::map<std::wstring, std::wstring>::iterator pFind = oCSSParser.m_mapSettings.find(L"flip");
if (oCSSParser.m_mapSettings.end() != pFind)
{
if (pPair->second == L"x")
if (pFind->second == L"x")
pTree->grpSpPr.xfrm->flipH = true;
else if (pPair->second == L"y")
else if (pFind->second == L"y")
pTree->grpSpPr.xfrm->flipV = true;
else if ((pPair->second == L"xy") || (pPair->second == L"yx") || (pPair->second == L"x y") || (pPair->second == L"y x"))
else if ((pFind->second == L"xy") || (pFind->second == L"yx") || (pFind->second == L"x y") || (pFind->second == L"y x"))
{
pTree->grpSpPr.xfrm->flipH = true;
pTree->grpSpPr.xfrm->flipV = true;
}
}
pPair = oCSSParser.m_mapSettings.find(L"rotation");
if (oCSSParser.m_mapSettings.end() != pPair)
pFind = oCSSParser.m_mapSettings.find(L"rotation");
if (oCSSParser.m_mapSettings.end() != pFind)
{
pTree->grpSpPr.xfrm->rot = NS_DWC_Common::getRotateAngle(pPair->second, pTree->grpSpPr.xfrm->flipH, pTree->grpSpPr.xfrm->flipV);
pTree->grpSpPr.xfrm->rot = NS_DWC_Common::getRotateAngle(pFind->second, pTree->grpSpPr.xfrm->flipH, pTree->grpSpPr.xfrm->flipV);
}
}
else
@ -2988,26 +2983,24 @@ void CDrawingConverter::doc_LoadGroup(PPTX::Logic::SpTreeElem *result, XmlUtils:
pTree->grpSpPr.xfrm->chExtY = lCoordSizeH;
}
std::map<std::wstring, std::wstring>::iterator pPair;
pPair = oCSSParser.m_mapSettings.find(L"flip");
if (oCSSParser.m_mapSettings.end() != pPair)
std::map<std::wstring, std::wstring>::iterator pFind = oCSSParser.m_mapSettings.find(L"flip");
if (oCSSParser.m_mapSettings.end() != pFind)
{
if (pPair->second == L"x")
if (pFind->second == L"x")
pTree->grpSpPr.xfrm->flipH = true;
else if (pPair->second == L"y")
else if (pFind->second == L"y")
pTree->grpSpPr.xfrm->flipV = true;
else if ((pPair->second == L"xy") || (pPair->second == L"yx") || (pPair->second == L"x y") || (pPair->second == L"y x"))
else if ((pFind->second == L"xy") || (pFind->second == L"yx") || (pFind->second == L"x y") || (pFind->second == L"y x"))
{
pTree->grpSpPr.xfrm->flipH = true;
pTree->grpSpPr.xfrm->flipV = true;
}
}
pPair = oCSSParser.m_mapSettings.find(L"rotation");
if (oCSSParser.m_mapSettings.end() != pPair)
pFind = oCSSParser.m_mapSettings.find(L"rotation");
if (oCSSParser.m_mapSettings.end() != pFind)
{
pTree->grpSpPr.xfrm->rot = NS_DWC_Common::getRotateAngle(pPair->second, pTree->grpSpPr.xfrm->flipH, pTree->grpSpPr.xfrm->flipV);
pTree->grpSpPr.xfrm->rot = NS_DWC_Common::getRotateAngle(pFind->second, pTree->grpSpPr.xfrm->flipH, pTree->grpSpPr.xfrm->flipV);
}
}
@ -3110,7 +3103,7 @@ void CDrawingConverter::LoadCoordSize(XmlUtils::CXmlNode& oNode, CShapePtr pShap
std::wstring CDrawingConverter::GetDrawingMainProps(XmlUtils::CXmlNode& oNode, PPTX::CCSS& oCssStyles, CSpTreeElemProps& oProps)
{
std::map<std::wstring, std::wstring>::iterator pPair;
std::map<std::wstring, std::wstring>::iterator pFind;
bool bIsInline = false;
@ -3124,8 +3117,8 @@ std::wstring CDrawingConverter::GetDrawingMainProps(XmlUtils::CXmlNode& oNode, P
if (!bIsInline)
{
pPair = oCssStyles.m_mapSettings.find(L"position");
if (oCssStyles.m_mapSettings.end() != pPair && pPair->second == L"static")
pFind = oCssStyles.m_mapSettings.find(L"position");
if (oCssStyles.m_mapSettings.end() != pFind && pFind->second == L"static")
{
bIsInline = true;
}
@ -3140,55 +3133,55 @@ std::wstring CDrawingConverter::GetDrawingMainProps(XmlUtils::CXmlNode& oNode, P
LONG width = 0;
LONG height = 0;
pPair = oCssStyles.m_mapSettings.find(L"polyline_correct");
bool bIsPolyCorrect = (oCssStyles.m_mapSettings.end() != pPair) ? true : false;
pFind = oCssStyles.m_mapSettings.find(L"polyline_correct");
bool bIsPolyCorrect = (oCssStyles.m_mapSettings.end() != pFind) ? true : false;
if (bIsPolyCorrect)
dKoefSize = 1;
if (!bIsInline)
{
pPair = oCssStyles.m_mapSettings.find(L"margin-left");
if (oCssStyles.m_mapSettings.end() == pPair)
pPair = oCssStyles.m_mapSettings.find(L"left");
pFind = oCssStyles.m_mapSettings.find(L"margin-left");
if (oCssStyles.m_mapSettings.end() == pFind)
pFind = oCssStyles.m_mapSettings.find(L"left");
if (oCssStyles.m_mapSettings.end() != pPair)
if (oCssStyles.m_mapSettings.end() != pFind)
{
left = (LONG)(dKoefSize * parserPoint.FromString(pPair->second) + 0.5);
left = (LONG)(dKoefSize * parserPoint.FromString(pFind->second) + 0.5);
}
pPair = oCssStyles.m_mapSettings.find(L"margin-top");
pFind = oCssStyles.m_mapSettings.find(L"margin-top");
if (oCssStyles.m_mapSettings.end() == pPair)
pPair = oCssStyles.m_mapSettings.find(L"top");
if (oCssStyles.m_mapSettings.end() == pFind)
pFind = oCssStyles.m_mapSettings.find(L"top");
if (oCssStyles.m_mapSettings.end() != pPair)
if (oCssStyles.m_mapSettings.end() != pFind)
{
top = (LONG)(dKoefSize * parserPoint.FromString(pPair->second) + 0.5);
top = (LONG)(dKoefSize * parserPoint.FromString(pFind->second) + 0.5);
}
}
pPair = oCssStyles.m_mapSettings.find(L"width");
if (oCssStyles.m_mapSettings.end() != pPair)
pFind = oCssStyles.m_mapSettings.find(L"width");
if (oCssStyles.m_mapSettings.end() != pFind)
{
width = (LONG)(dKoefSize * parserPoint.FromString(pPair->second) + 0.5);
width = (LONG)(dKoefSize * parserPoint.FromString(pFind->second) + 0.5);
}
else
{
pPair = oCssStyles.m_mapSettings.find(L"margin-right");
pFind = oCssStyles.m_mapSettings.find(L"margin-right");
if (oCssStyles.m_mapSettings.end() != oCssStyles.m_mapSettings.end())
width = (LONG)(dKoefSize * parserPoint.FromString(pPair->second) + 0.5) - left;
width = (LONG)(dKoefSize * parserPoint.FromString(pFind->second) + 0.5) - left;
}
pPair = oCssStyles.m_mapSettings.find(L"height");
if (oCssStyles.m_mapSettings.end() != pPair)
pFind = oCssStyles.m_mapSettings.find(L"height");
if (oCssStyles.m_mapSettings.end() != pFind)
{
height = (LONG)(dKoefSize * parserPoint.FromString(pPair->second) + 0.5);
height = (LONG)(dKoefSize * parserPoint.FromString(pFind->second) + 0.5);
}
else
{
pPair = oCssStyles.m_mapSettings.find(L"margin-bottom");
pFind = oCssStyles.m_mapSettings.find(L"margin-bottom");
if (oCssStyles.m_mapSettings.end() != oCssStyles.m_mapSettings.end())
height = (LONG)(dKoefSize * parserPoint.FromString(pPair->second) + 0.5) - top;
height = (LONG)(dKoefSize * parserPoint.FromString(pFind->second) + 0.5) - top;
}
unsigned long margL = (unsigned long)(9 * dKoef + 0.5);
@ -3196,21 +3189,47 @@ std::wstring CDrawingConverter::GetDrawingMainProps(XmlUtils::CXmlNode& oNode, P
unsigned long margR = (unsigned long)(9 * dKoef + 0.5);
unsigned long margB = 0;
pPair = oCssStyles.m_mapSettings.find(L"mso-wrap-distance-left");
if (oCssStyles.m_mapSettings.end() != pPair)
margL = (unsigned long)(dKoef * parserPoint.FromString(pPair->second) + 0.5);
pFind = oCssStyles.m_mapSettings.find(L"mso-wrap-distance-left");
if (oCssStyles.m_mapSettings.end() != pFind)
margL = (unsigned long)(dKoef * parserPoint.FromString(pFind->second) + 0.5);
pPair = oCssStyles.m_mapSettings.find(L"mso-wrap-distance-top");
if (oCssStyles.m_mapSettings.end() != pPair)
margT = (unsigned long)(dKoef * parserPoint.FromString(pPair->second) + 0.5);
pFind = oCssStyles.m_mapSettings.find(L"mso-wrap-distance-top");
if (oCssStyles.m_mapSettings.end() != pFind)
margT = (unsigned long)(dKoef * parserPoint.FromString(pFind->second) + 0.5);
pPair = oCssStyles.m_mapSettings.find(L"mso-wrap-distance-right");
if (oCssStyles.m_mapSettings.end() != pPair)
margR = (unsigned long)(dKoef * parserPoint.FromString(pPair->second) + 0.5);
pFind = oCssStyles.m_mapSettings.find(L"mso-wrap-distance-right");
if (oCssStyles.m_mapSettings.end() != pFind)
margR = (unsigned long)(dKoef * parserPoint.FromString(pFind->second) + 0.5);
pPair = oCssStyles.m_mapSettings.find(L"mso-wrap-distance-bottom");
if (oCssStyles.m_mapSettings.end() != pPair)
margB = (unsigned long)(dKoef * parserPoint.FromString(pPair->second) + 0.5);
pFind = oCssStyles.m_mapSettings.find(L"mso-wrap-distance-bottom");
if (oCssStyles.m_mapSettings.end() != pFind)
margB = (unsigned long)(dKoef * parserPoint.FromString(pFind->second) + 0.5);
nullable_double rel_width;
nullable_double rel_height;
nullable_double rel_top;
nullable_double rel_left;
pFind = oCssStyles.m_mapSettings.find(L"mso-width-percent");
if (oCssStyles.m_mapSettings.end() != pFind)
{
rel_width = parserPoint.FromString(pFind->second) / 1000.;
}
pFind = oCssStyles.m_mapSettings.find(L"mso-height-percent");
if (oCssStyles.m_mapSettings.end() != pFind)
{
rel_height = parserPoint.FromString(pFind->second) / 1000.;
}
pFind = oCssStyles.m_mapSettings.find(L"mso-top-percent");
if (oCssStyles.m_mapSettings.end() != pFind)
{
rel_top = parserPoint.FromString(pFind->second) / 1000.;
}
pFind = oCssStyles.m_mapSettings.find(L"mso-left-percent");
if (oCssStyles.m_mapSettings.end() != pFind)
{
rel_left = parserPoint.FromString(pFind->second) / 1000.;
}
oProps.X = left;
oProps.Y = top;
@ -3229,7 +3248,7 @@ std::wstring CDrawingConverter::GetDrawingMainProps(XmlUtils::CXmlNode& oNode, P
oWriter.StartNode(L"wp:inline");
oWriter.StartAttributes();
oWriter.WriteAttribute(L"xmlns:wp", (std::wstring)L"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing");
oWriter.WriteAttribute(L"xmlns:wp", L"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing");
oWriter.WriteAttribute(L"distT", margT);
oWriter.WriteAttribute(L"distB", margB);
oWriter.WriteAttribute(L"distL", margL);
@ -3238,8 +3257,8 @@ std::wstring CDrawingConverter::GetDrawingMainProps(XmlUtils::CXmlNode& oNode, P
oWriter.StartNode(L"wp:extent");
oWriter.StartAttributes();
oWriter.WriteAttribute(L"cx", width);
oWriter.WriteAttribute(L"cy", height);
oWriter.WriteAttribute(L"cx", width );
oWriter.WriteAttribute(L"cy", height );
oWriter.EndAttributes();
oWriter.EndNode(L"wp:extent");
@ -3252,6 +3271,35 @@ std::wstring CDrawingConverter::GetDrawingMainProps(XmlUtils::CXmlNode& oNode, P
oWriter.EndAttributes();
oWriter.EndNode(L"wp:effectExtent");
if (rel_width.is_init())
{
oWriter.StartNode(L"wp14:sizeRelH");
oWriter.StartAttributes();
oWriter.WriteAttribute(L"relativeFrom", L"page");
oWriter.EndAttributes();
oWriter.StartNode(L"wp14:pctWidth");
oWriter.EndAttributes();
oWriter.WriteString(std::to_wstring((INT)(*rel_width * 100000)));
oWriter.EndNode(L"wp14:pctWidth");
oWriter.EndNode(L"wp14:sizeRelH");
}
if (rel_height.is_init())
{
oWriter.StartNode(L"wp14:sizeRelV");
oWriter.StartAttributes();
oWriter.WriteAttribute(L"relativeFrom", L"page");
oWriter.EndAttributes();
oWriter.StartNode(L"wp14:pctHeight");
oWriter.EndAttributes();
oWriter.WriteString(std::to_wstring((INT)(*rel_height * 100000)));
oWriter.EndNode(L"wp14:pctHeight");
oWriter.EndNode(L"wp14:sizeRelV");
}
std::wstring strId = L"<wp:docPr id=\"" + std::to_wstring(m_lNextId) + L"\" name=\"\"/>";
m_lNextId++;
@ -3267,27 +3315,25 @@ std::wstring CDrawingConverter::GetDrawingMainProps(XmlUtils::CXmlNode& oNode, P
oWriter.StartAttributes();
oWriter.WriteAttribute(L"xmlns:wp", (std::wstring)L"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing");
oWriter.WriteAttribute(L"xmlns:wp", L"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing");
oWriter.WriteAttribute(L"distT", margT);
oWriter.WriteAttribute(L"distB", margB);
oWriter.WriteAttribute(L"distL", margL);
oWriter.WriteAttribute(L"distR", margR);
pPair = oCssStyles.m_mapSettings.find(L"z-index");
nullable_int zIndex;
if (oCssStyles.m_mapSettings.end() != pPair)
pFind = oCssStyles.m_mapSettings.find(L"z-index");
nullable_int64 zIndex;
if (oCssStyles.m_mapSettings.end() != pFind)
{
zIndex = (int)parserPoint.FromString(pPair->second);
if (*zIndex >= 0)
{
oWriter.WriteAttribute(L"relativeHeight", *zIndex);
}
else
{
// DWORD dwIndex = (DWORD)(*zIndex);
oWriter.WriteAttribute(L"relativeHeight", -(*zIndex));
}
zIndex = parserPoint.FromString(pFind->second);
_INT64 zIndex_ = *zIndex >= 0 ? *zIndex : -*zIndex;
if (zIndex_ < 0xF000000 && zIndex_ > 0x80000 )
zIndex_ = 0xF000000 - 0x80000 + zIndex_;
oWriter.WriteAttribute(L"relativeHeight", std::to_wstring(zIndex_));
}
XmlUtils::CXmlNode oNodeWrap = oNode.ReadNode(L"w10:wrap");
@ -3311,6 +3357,7 @@ std::wstring CDrawingConverter::GetDrawingMainProps(XmlUtils::CXmlNode& oNode, P
nullable_bool isAllowInCell;
nullable_string sAllowInCell;
oNode.ReadAttributeBase(L"o:allowincell", sAllowInCell);
if (sAllowInCell.is_init())
{
@ -3319,7 +3366,17 @@ std::wstring CDrawingConverter::GetDrawingMainProps(XmlUtils::CXmlNode& oNode, P
if ((L"t" == *sAllowInCell) || (L"true"== *sAllowInCell))
isAllowInCell = true;
}
nullable_bool isAllowOverlap;
nullable_string sAllowOverlap;
oNode.ReadAttributeBase(L"o:allowoverlap", sAllowOverlap);
if (sAllowOverlap.is_init())
{
if ((L"f" == *sAllowOverlap) || (L"false"== *sAllowOverlap))
isAllowOverlap = false;
if ((L"t" == *sAllowOverlap) || (L"true"== *sAllowOverlap))
isAllowOverlap = true;
}
std::wstring strWrapPoints = oNode.GetAttribute(L"wrapcoords");
std::wstring strWrapPointsResult;
if (!strWrapPoints.empty())
@ -3352,20 +3409,26 @@ std::wstring CDrawingConverter::GetDrawingMainProps(XmlUtils::CXmlNode& oNode, P
{
if (*zIndex > 0)
{
oWriter.WriteAttribute(L"allowOverlap", (std::wstring)L"1");
oWriter.WriteAttribute(L"behindDoc", L"0");
}
else if (*zIndex < 0)
{
oWriter.WriteAttribute(L"behindDoc", (std::wstring)L"1");
oWriter.WriteAttribute(L"behindDoc", L"1");
}
}
if (isAllowOverlap.is_init())
{
if (*isAllowOverlap)
oWriter.WriteAttribute(L"allowOverlap", L"1");
else
oWriter.WriteAttribute(L"allowOverlap", L"0");
}
if (isAllowInCell.is_init())
{
if (*isAllowInCell)
oWriter.WriteAttribute(L"layoutInCell", (std::wstring)L"1");
oWriter.WriteAttribute(L"layoutInCell", L"1");
else
oWriter.WriteAttribute(L"layoutInCell", (std::wstring)L"0");
oWriter.WriteAttribute(L"layoutInCell", L"0");
}
oWriter.EndAttributes();
@ -3374,43 +3437,50 @@ std::wstring CDrawingConverter::GetDrawingMainProps(XmlUtils::CXmlNode& oNode, P
oWriter.StartAttributes();
pPair = oCssStyles.m_mapSettings.find(L"mso-position-horizontal-relative");
if (pPair != oCssStyles.m_mapSettings.end())
pFind = oCssStyles.m_mapSettings.find(L"mso-position-horizontal-relative");
nullable_string sHRelativeFrom;
nullable_string sVRelativeFrom;
if (pFind != oCssStyles.m_mapSettings.end())
{
if (L"char" == pPair->second)
oWriter.WriteAttribute(L"relativeFrom", (std::wstring)L"character");
else if (L"page" == pPair->second)
oWriter.WriteAttribute(L"relativeFrom", (std::wstring)L"page");
else if (L"margin" == pPair->second)
oWriter.WriteAttribute(L"relativeFrom", (std::wstring)L"margin");
else if (L"left-margin-area" == pPair->second)
oWriter.WriteAttribute(L"relativeFrom", (std::wstring)L"leftMargin");
else if (L"right-margin-area" == pPair->second)
oWriter.WriteAttribute(L"relativeFrom", (std::wstring)L"rightMargin");
else if (L"inner-margin-area" == pPair->second)
oWriter.WriteAttribute(L"relativeFrom", (std::wstring)L"insideMargin");
else if (L"outer-margin-area" == pPair->second)
oWriter.WriteAttribute(L"relativeFrom", (std::wstring)L"outsideMargin");
if (L"char" == pFind->second) sHRelativeFrom = L"character";
else if (L"page" == pFind->second) sHRelativeFrom = L"page";
else if (L"margin" == pFind->second) sHRelativeFrom = L"margin";
else if (L"left-margin-area" == pFind->second) sHRelativeFrom = L"leftMargin";
else if (L"right-margin-area" == pFind->second) sHRelativeFrom = L"rightMargin";
else if (L"inner-margin-area" == pFind->second) sHRelativeFrom = L"insideMargin";
else if (L"outer-margin-area" == pFind->second) sHRelativeFrom = L"outsideMargin";
else
oWriter.WriteAttribute(L"relativeFrom", (std::wstring)L"column");
sHRelativeFrom = L"column";
}
else
{
oWriter.WriteAttribute(L"relativeFrom", (std::wstring)L"column");
sHRelativeFrom = L"column";
}
oWriter.WriteAttribute(L"relativeFrom", *sHRelativeFrom);
oWriter.EndAttributes();
std::wstring strPosH = L"absolute";
pPair = oCssStyles.m_mapSettings.find(L"mso-position-horizontal");
if (oCssStyles.m_mapSettings.end() != pPair)
strPosH = pPair->second;
pFind = oCssStyles.m_mapSettings.find(L"mso-position-horizontal");
if (oCssStyles.m_mapSettings.end() != pFind)
strPosH = pFind->second;
if (strPosH == L"absolute")
{
oWriter.WriteString(L"<wp:posOffset>");
oWriter.WriteLONG(left);
oWriter.WriteString(L"</wp:posOffset>");
if (rel_left.is_init())
{
oWriter.WriteString(L"<wp14:pctPosHOffset>");
oWriter.WriteLONG((INT)(*rel_left * 100000));
oWriter.WriteString(L"</wp14:pctPosHOffset>");
}
else
{
oWriter.WriteString(L"<wp:posOffset>");
oWriter.WriteLONG(left);
oWriter.WriteString(L"</wp:posOffset>");
}
}
else
{
@ -3425,43 +3495,46 @@ std::wstring CDrawingConverter::GetDrawingMainProps(XmlUtils::CXmlNode& oNode, P
oWriter.StartAttributes();
pPair = oCssStyles.m_mapSettings.find(L"mso-position-vertical-relative");
if (pPair != oCssStyles.m_mapSettings.end())
pFind = oCssStyles.m_mapSettings.find(L"mso-position-vertical-relative");
if (pFind != oCssStyles.m_mapSettings.end())
{
if (L"margin" == pPair->second)
oWriter.WriteAttribute(L"relativeFrom", (std::wstring)L"margin");
else if (L"text" == pPair->second)
oWriter.WriteAttribute(L"relativeFrom", (std::wstring)L"paragraph");
else if (L"page" == pPair->second)
oWriter.WriteAttribute(L"relativeFrom", (std::wstring)L"page");
else if (L"top-margin-area" == pPair->second)
oWriter.WriteAttribute(L"relativeFrom", (std::wstring)L"topMargin");
else if (L"bottom-margin-area" == pPair->second)
oWriter.WriteAttribute(L"relativeFrom", (std::wstring)L"bottomMargin");
else if (L"inner-margin-area" == pPair->second)
oWriter.WriteAttribute(L"relativeFrom", (std::wstring)L"insideMargin");
else if (L"outer-margin-area" == pPair->second)
oWriter.WriteAttribute(L"relativeFrom", (std::wstring)L"outsideMargin");
if (L"margin" == pFind->second) sVRelativeFrom = L"margin";
else if (L"text" == pFind->second) sVRelativeFrom = L"paragraph";
else if (L"page" == pFind->second) sVRelativeFrom = L"page";
else if (L"top-margin-area" == pFind->second) sVRelativeFrom = L"topMargin";
else if (L"bottom-margin-area" == pFind->second) sVRelativeFrom = L"bottomMargin";
else if (L"inner-margin-area" == pFind->second) sVRelativeFrom = L"insideMargin";
else if (L"outer-margin-area" == pFind->second) sVRelativeFrom = L"outsideMargin";
else
oWriter.WriteAttribute(L"relativeFrom", (std::wstring)L"line");
sVRelativeFrom = L"line";
}
else
{
oWriter.WriteAttribute(L"relativeFrom", (std::wstring)L"paragraph");
sVRelativeFrom = L"paragraph";
}
oWriter.WriteAttribute(L"relativeFrom", *sVRelativeFrom);
oWriter.EndAttributes();
std::wstring strPosV = L"absolute";
pPair = oCssStyles.m_mapSettings.find(L"mso-position-vertical");
if (oCssStyles.m_mapSettings.end() != pPair)
strPosV = pPair->second;
pFind = oCssStyles.m_mapSettings.find(L"mso-position-vertical");
if (oCssStyles.m_mapSettings.end() != pFind)
strPosV = pFind->second;
if (strPosV == L"absolute")
{
oWriter.WriteString(L"<wp:posOffset>");
oWriter.WriteLONG(top);
oWriter.WriteString(L"</wp:posOffset>");
if (rel_top.is_init())
{
oWriter.WriteString(L"<wp14:pctPosVOffset>");
oWriter.WriteLONG((INT)(*rel_top * 100000));
oWriter.WriteString(L"</wp14:pctPosVOffset>");
}
else
{
oWriter.WriteString(L"<wp:posOffset>");
oWriter.WriteLONG(top);
oWriter.WriteString(L"</wp:posOffset>");
}
}
else
{
@ -3474,7 +3547,7 @@ std::wstring CDrawingConverter::GetDrawingMainProps(XmlUtils::CXmlNode& oNode, P
oWriter.StartNode(L"wp:extent");
oWriter.StartAttributes();
oWriter.WriteAttribute(L"cx", width);
oWriter.WriteAttribute(L"cx", width );
oWriter.WriteAttribute(L"cy", height);
oWriter.EndAttributes();
oWriter.EndNode(L"wp:extent");
@ -3521,12 +3594,40 @@ std::wstring CDrawingConverter::GetDrawingMainProps(XmlUtils::CXmlNode& oNode, P
oWriter.WriteString(L"<wp:wrapNone/>");
}
bool bHidden = false;
pPair = oCssStyles.m_mapSettings.find(L"visibility");
if (oCssStyles.m_mapSettings.end() != pPair)
pFind = oCssStyles.m_mapSettings.find(L"visibility");
if (oCssStyles.m_mapSettings.end() != pFind)
{
if (L"hidden" == pPair->second)
if (L"hidden" == pFind->second)
bHidden = true;
}
if (rel_width.is_init())
{
oWriter.StartNode(L"wp14:sizeRelH");
oWriter.StartAttributes();
oWriter.WriteAttribute(L"relativeFrom", *sHRelativeFrom);
oWriter.EndAttributes();
oWriter.StartNode(L"wp14:pctWidth");
oWriter.EndAttributes();
oWriter.WriteString(std::to_wstring((INT)(*rel_width * 100000)));
oWriter.EndNode(L"wp14:pctWidth");
oWriter.EndNode(L"wp14:sizeRelH");
}
if (rel_height.is_init())
{
oWriter.StartNode(L"wp14:sizeRelV");
oWriter.StartAttributes();
oWriter.WriteAttribute(L"relativeFrom", *sVRelativeFrom);
oWriter.EndAttributes();
oWriter.StartNode(L"wp14:pctHeight");
oWriter.EndAttributes();
oWriter.WriteString(std::to_wstring((INT)(*rel_height * 100000)));
oWriter.EndNode(L"wp14:pctHeight");
oWriter.EndNode(L"wp14:sizeRelV");
}
std::wstring strId = L"<wp:docPr id=\"" + std::to_wstring(m_lNextId) + L"\" name=\"\"" + (bHidden ? L" hidden=\"true\"" : L"") + L"/>";
m_lNextId++;
@ -3894,6 +3995,10 @@ void CDrawingConverter::CheckBrushShape(PPTX::Logic::SpTreeElem* oElem, XmlUtils
{
pBlipFill->tile = new PPTX::Logic::Tile();
}
else
{
pBlipFill->stretch = new PPTX::Logic::Stretch();
}
pSpPr->Fill.m_type = PPTX::Logic::UniFill::blipFill;
pSpPr->Fill.Fill = pBlipFill;
@ -4390,7 +4495,7 @@ HRESULT CDrawingConverter::LoadClrMap(const std::wstring& bsXml)
{
smart_ptr<PPTX::Logic::ClrMap> pClrMap = new PPTX::Logic::ClrMap();
std::wstring strXml = L"<main xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\">" + (std::wstring)bsXml + L"</main>";
std::wstring strXml = L"<main xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\">" + bsXml + L"</main>";
XmlUtils::CXmlNode oNode;
oNode.FromXmlString(strXml);
@ -4845,6 +4950,10 @@ void CDrawingConverter::ConvertMainPropsToVML(const std::wstring& bsMainProps, N
nullable_int margL; oNode.ReadAttributeBase(L"distL", margL);
nullable_int margR; oNode.ReadAttributeBase(L"distR", margR);
nullable_bool behindDoc; oNode.ReadAttributeBase(L"behindDoc", behindDoc);
nullable_bool allowOverlap; oNode.ReadAttributeBase(L"allowOverlap", allowOverlap);
nullable_bool layoutInCell; oNode.ReadAttributeBase(L"layoutInCell", layoutInCell);
if (margL.is_init())
oWriter.WriteAttributeCSS_double1_pt(L"mso-wrap-distance-left", dKoef * (*margL));
if (margT.is_init())
@ -4854,9 +4963,27 @@ void CDrawingConverter::ConvertMainPropsToVML(const std::wstring& bsMainProps, N
if (margB.is_init())
oWriter.WriteAttributeCSS_double1_pt(L"mso-wrap-distance-bottom", dKoef * (*margB));
nullable_int zIndex; oNode.ReadAttributeBase(L"relativeHeight", zIndex);
nullable_int64 zIndex; oNode.ReadAttributeBase(L"relativeHeight", zIndex);
if (zIndex.is_init())
oWriter.WriteAttributeCSS_int(L"z-index", *zIndex);
{
_INT64 z_index = *zIndex;
if ((behindDoc.IsInit()) && (*behindDoc == true))
{
z_index = -z_index;
}
oWriter.WriteAttributeCSS(L"z-index", std::to_wstring(z_index));
}
if (allowOverlap.is_init())
{
oWriter.WriteAttributeCSS(L"o:allowoverlap", *allowOverlap ? L"true" : L"false");
}
if (layoutInCell.is_init())
{
oWriter.WriteAttributeCSS(L"o:allowincell", *layoutInCell ? L"true" : L"false");
}
XmlUtils::CXmlNode oNodeHorP;
if (oNode.GetNode(L"wp:positionH", oNodeHorP))
@ -5077,7 +5204,7 @@ void CDrawingConverter::ConvertMainPropsToVML(const std::wstring& bsMainProps, N
HRESULT CDrawingConverter::SetFontDir(const std::wstring& bsFontDir)
{
m_strFontDirectory = (std::wstring)bsFontDir;
m_strFontDirectory = bsFontDir;
return S_OK;
}
@ -5273,7 +5400,7 @@ HRESULT CDrawingConverter::SetDstContentRels()
HRESULT CDrawingConverter::SaveDstContentRels(const std::wstring& bsRelsPath)
{
m_pReader->m_pRels->CloseRels();
m_pReader->m_pRels->SaveRels((std::wstring)bsRelsPath);
m_pReader->m_pRels->SaveRels(bsRelsPath);
--m_pReader->m_nCurrentRelsStack;
if (-1 > m_pReader->m_nCurrentRelsStack)
@ -5318,7 +5445,7 @@ HRESULT CDrawingConverter::SetFontPicker(COfficeFontPicker* pFontPicker)
HRESULT CDrawingConverter::SetAdditionalParam(const std::wstring& ParamName, BYTE *pArray, size_t szCount)
{
std::wstring name = (std::wstring)ParamName;
std::wstring name = ParamName;
if (name == L"xfrm_override" && pArray)
{
PPTX::Logic::Xfrm *pXfrm = (PPTX::Logic::Xfrm*)pArray;
@ -5330,7 +5457,7 @@ HRESULT CDrawingConverter::SetAdditionalParam(const std::wstring& ParamName, BYT
}
HRESULT CDrawingConverter::GetAdditionalParam(const std::wstring& ParamName, BYTE **pArray, size_t& szCount)
{
//std::wstring name = (std::wstring)ParamName;
//std::wstring name = ParamName;
//if (name == L"SerializeImageManager")
//{
// NSBinPptxRW::CBinaryFileWriter oWriter;

View File

@ -32,11 +32,11 @@
#pragma once
#include "Converter.h"
#include "../../DesktopEditor/common/Directory.h"
#include "../../Common/DocxFormat/Source/DocxFormat/App.h"
#include "DefaultNotesMaster.h"
#include "DefaultNotesTheme.h"
namespace NSBinPptxRW
{
class CPPTXWriter
@ -1012,8 +1012,12 @@ namespace NSBinPptxRW
{
m_oApp.TotalTime = 0;
m_oApp.Words = 0;
m_oApp.Application = _T("OnlyOffice");
m_oApp.PresentationFormat = _T("On-screen Show (4:3)");
m_oApp.Application = L"OnlyOffice";
#if defined(INTVER)
std::string s = VALUE2STR(INTVER);
m_oApp.AppVersion = std::wstring(s.begin(), s.end());
#endif
m_oApp.PresentationFormat = L"On-screen Show (4:3)";
m_oApp.Paragraphs = 0;
m_oApp.Slides = (int)m_arSlides.size();
m_oApp.Notes = (int)m_arSlides.size();

View File

@ -356,7 +356,15 @@ namespace NSBinPptxRW
m_oWriter.WriteString(val);
m_oWriter.AddCharNoCheck(WCHAR(';'));
}
AVSINLINE void WriteAttributeCSS_int(const std::wstring& strAttributeName, const int& val)
AVSINLINE void WriteAttributeCSS(const std::wstring& strAttributeName, const wchar_t* val)
{
m_oWriter.WriteString(strAttributeName);
m_oWriter.AddSize(15);
m_oWriter.AddCharNoCheck(WCHAR(':'));
m_oWriter.WriteString(val);
m_oWriter.AddCharNoCheck(WCHAR(';'));
}
AVSINLINE void WriteAttributeCSS_int(const std::wstring& strAttributeName, const int& val)
{
m_oWriter.WriteString(strAttributeName);
m_oWriter.AddSize(15);
@ -404,7 +412,16 @@ namespace NSBinPptxRW
m_oWriter.WriteString(val);
m_oWriter.WriteString(g_bstr_node_quote);
}
AVSINLINE void WriteAttribute2(const std::wstring& strAttributeName, const std::wstring& val)
AVSINLINE void WriteAttribute(const std::wstring& strAttributeName, const wchar_t* val)
{
m_oWriter.WriteString(g_bstr_node_space);
m_oWriter.WriteString(strAttributeName);
m_oWriter.WriteString(g_bstr_node_equal);
m_oWriter.WriteString(g_bstr_node_quote);
m_oWriter.WriteString(val);
m_oWriter.WriteString(g_bstr_node_quote);
}
AVSINLINE void WriteAttribute2(const std::wstring& strAttributeName, const std::wstring& val)
{
m_oWriter.WriteString(g_bstr_node_space);
m_oWriter.WriteString(strAttributeName);

View File

@ -33,9 +33,12 @@
#ifndef PPTX_IFILE_CONTAINER_INCLUDE_H_
#define PPTX_IFILE_CONTAINER_INCLUDE_H_
#include "../../Common/DocxFormat/Source/DocxFormat/IFileContainer.h"
#include "FileMap.h"
#include "PPTXEvent.h"
#include "../../Common/DocxFormat/Source/DocxFormat/IFileContainer.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Media/Image.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Media/OleObject.h"
#include "../../Common/DocxFormat/Source/DocxFormat/External/External.h"
namespace PPTX
{
@ -52,7 +55,32 @@ namespace PPTX
virtual ~FileContainer()
{
}
virtual std::wstring GetImagePathNameFromRId(const OOX::RId& rid)const
{
smart_ptr<OOX::Image> p = Get<OOX::Image>(rid);
if (!p.is_init())
return _T("");
return p->filename().m_strFilename;
}
virtual std::wstring GetLinkFromRId(const OOX::RId& rid)const
{
smart_ptr<OOX::External> pExt = Find(rid).smart_dynamic_cast<OOX::External>();
if (pExt.IsInit())
return pExt->Uri().m_strFilename;
smart_ptr<OOX::Media> pMedia = Find(rid).smart_dynamic_cast<OOX::Media>();
if (pMedia.IsInit())
return pMedia->filename().m_strFilename;
return _T("");
}
virtual std::wstring GetOleFromRId(const OOX::RId& rid)const
{
smart_ptr<OOX::OleObject> p = Get<OOX::OleObject>(rid);
if (!p.is_init())
return _T("");
return p->filename().m_strFilename;
}
protected:
void read(const OOX::CPath& filename);
void read(const OOX::CRels& rels, const OOX::CPath& path);

View File

@ -110,11 +110,9 @@ namespace PPTX
return p->filename().m_strFilename;
}
if(parentFileIs<Slide>()) return parentFileAs<Slide>().GetImagePathNameFromRId(*embed);
else if(parentFileIs<SlideLayout>()) return parentFileAs<SlideLayout>().GetImagePathNameFromRId(*embed);
else if(parentFileIs<SlideMaster>()) return parentFileAs<SlideMaster>().GetImagePathNameFromRId(*embed);
else if(parentFileIs<Theme>()) return parentFileAs<Theme>().GetImagePathNameFromRId(*embed);
else if(parentFileIs<NotesSlide>()) return parentFileAs<NotesSlide>().GetImagePathNameFromRId(*embed);
if(parentFileIs<FileContainer>())
return parentFileAs<FileContainer>().GetImagePathNameFromRId(*embed);
return _T("");
}
else if(link.IsInit())
@ -126,11 +124,9 @@ namespace PPTX
return p->filename().m_strFilename;
}
if(parentFileIs<Slide>()) return parentFileAs<Slide>().GetImagePathNameFromRId(*link);
else if(parentFileIs<SlideLayout>()) return parentFileAs<SlideLayout>().GetImagePathNameFromRId(*link);
else if(parentFileIs<SlideMaster>()) return parentFileAs<SlideMaster>().GetImagePathNameFromRId(*link);
else if(parentFileIs<Theme>()) return parentFileAs<Theme>().GetImagePathNameFromRId(*link);
else if(parentFileIs<NotesSlide>()) return parentFileAs<NotesSlide>().GetImagePathNameFromRId(*link);
if(parentFileIs<FileContainer>())
return parentFileAs<FileContainer>().GetImagePathNameFromRId(*link);
return _T("");
}
return _T("");
@ -140,12 +136,7 @@ namespace PPTX
smart_ptr<OOX::OleObject> pOleObject;
if (pRels != NULL) pOleObject = pRels->Get<OOX::OleObject>(oRId);
else if(parentFileIs<Slide>()) pOleObject = parentFileAs<Slide>().Get<OOX::OleObject>(oRId);
else if(parentFileIs<SlideLayout>()) pOleObject = parentFileAs<SlideLayout>().Get<OOX::OleObject>(oRId);
else if(parentFileIs<SlideMaster>()) pOleObject = parentFileAs<SlideMaster>().Get<OOX::OleObject>(oRId);
else if(parentFileIs<Theme>()) pOleObject = parentFileAs<Theme>().Get<OOX::OleObject>(oRId);
else if(parentFileIs<NotesSlide>()) pOleObject = parentFileAs<NotesSlide>().Get<OOX::OleObject>(oRId);
else if(parentFileIs<FileContainer>()) pOleObject = parentFileAs<FileContainer>().Get<OOX::OleObject>(oRId);
if (pOleObject.IsInit())
return pOleObject->filename().m_strFilename;

View File

@ -58,11 +58,8 @@ namespace PPTX
}
if(sLink.empty())
{
if(parentFileIs<Slide>()) sLink = parentFileAs<Slide>().GetLinkFromRId(rid);
else if(parentFileIs<SlideLayout>()) sLink = parentFileAs<SlideLayout>().GetLinkFromRId(rid);
else if(parentFileIs<SlideMaster>()) sLink = parentFileAs<SlideMaster>().GetLinkFromRId(rid);
else if(parentFileIs<Theme>()) sLink = parentFileAs<Theme>().GetLinkFromRId(rid);
else if(parentFileIs<NotesSlide>()) sLink = parentFileAs<NotesSlide>().GetLinkFromRId(rid);
if(parentFileIs<FileContainer>())
sLink = parentFileAs<FileContainer>().GetLinkFromRId(rid);
}
XmlUtils::replace_all(sLink, L"\\", L"/");

View File

@ -57,11 +57,8 @@ namespace PPTX
}
if(sLink.empty())
{
if(parentFileIs<Slide>()) sLink = parentFileAs<Slide>().GetLinkFromRId(rid);
else if(parentFileIs<SlideLayout>()) sLink = parentFileAs<SlideLayout>().GetLinkFromRId(rid);
else if(parentFileIs<SlideMaster>()) sLink = parentFileAs<SlideMaster>().GetLinkFromRId(rid);
else if(parentFileIs<Theme>()) sLink = parentFileAs<Theme>().GetLinkFromRId(rid);
else if(parentFileIs<NotesSlide>()) sLink = parentFileAs<NotesSlide>().GetLinkFromRId(rid);
if(parentFileIs<FileContainer>())
sLink = parentFileAs<FileContainer>().GetLinkFromRId(rid);
}
return sLink;

View File

@ -385,8 +385,10 @@ namespace PPTX
OOX::CApp* pApp = new OOX::CApp(NULL);
if (pApp)
{
pApp->SetApplication(_T("OnlyOffice"));
pApp->SetAppVersion(_T("5.0"));
pApp->SetApplication(L"OnlyOffice");
#if defined(INTVER)
pApp->SetAppVersion(VALUE2STR(INTVER));
#endif
pApp->SetDocSecurity(0);
pApp->SetScaleCrop(false);
pApp->SetLinksUpToDate(false);
@ -658,12 +660,12 @@ namespace PPTX
}
if (oleObject->m_sShapeId.IsInit() && pVml && !blipFill.blip->embed.IsInit() && blipFill.blip->oleFilepathImage.empty())
{
boost::unordered_map<std::wstring, OOX::CVmlDrawing::_vml_shape>::iterator pPair = pVml->m_mapShapes.find(*oleObject->m_sShapeId);
boost::unordered_map<std::wstring, OOX::CVmlDrawing::_vml_shape>::iterator pFind = pVml->m_mapShapes.find(*oleObject->m_sShapeId);
if (pVml->m_mapShapes.end() != pPair)
if (pVml->m_mapShapes.end() != pFind)
{
pPair->second.bUsed = true;
OOX::Vml::CVmlCommonElements* pShape = dynamic_cast<OOX::Vml::CVmlCommonElements*>(pPair->second.pElement);
pFind->second.bUsed = true;
OOX::Vml::CVmlCommonElements* pShape = dynamic_cast<OOX::Vml::CVmlCommonElements*>(pFind->second.pElement);
if (pShape)
{
@ -1148,7 +1150,7 @@ namespace PPTX
{
double trim = 0.0;
if (parentFileIs<Slide>())
if (parentFileIs<FileContainer>())
{
if (nvPicPr.nvPr.media.is<MediaFile>())
{
@ -1156,7 +1158,7 @@ namespace PPTX
(nvPicPr.nvPr.media.as<MediaFile>().name == _T("quickTimeFile")) ||
(nvPicPr.nvPr.media.as<MediaFile>().name == _T("audioFile")) )
{
if (std::wstring (_T("NULL")) == parentFileAs<Slide>().GetLinkFromRId(nvPicPr.nvPr.media.as<MediaFile>().link.get()) ) // HAVE TRIM
if (std::wstring (_T("NULL")) == parentFileAs<FileContainer>().GetLinkFromRId(nvPicPr.nvPr.media.as<MediaFile>().link.get()) ) // HAVE TRIM
{
if(nvPicPr.nvPr.extLst.size())
{
@ -1175,15 +1177,15 @@ namespace PPTX
{
double trim = -1.0;
if (parentFileIs<Slide>())
if (nvPicPr.nvPr.media.is<MediaFile>())
{
if (nvPicPr.nvPr.media.is<MediaFile>())
if ((nvPicPr.nvPr.media.as<MediaFile>().name == _T("videoFile")) ||
(nvPicPr.nvPr.media.as<MediaFile>().name == _T("quickTimeFile")) ||
(nvPicPr.nvPr.media.as<MediaFile>().name == _T("audioFile")) )
{
if ((nvPicPr.nvPr.media.as<MediaFile>().name == _T("videoFile")) ||
(nvPicPr.nvPr.media.as<MediaFile>().name == _T("quickTimeFile")) ||
(nvPicPr.nvPr.media.as<MediaFile>().name == _T("audioFile")) )
if (parentFileIs<FileContainer>())
{
if (std::wstring (_T("NULL")) == parentFileAs<Slide>().GetLinkFromRId(nvPicPr.nvPr.media.as<MediaFile>().link.get())) // HAVE TRIM
if (std::wstring (_T("NULL")) == parentFileAs<FileContainer>().GetLinkFromRId(nvPicPr.nvPr.media.as<MediaFile>().link.get())) // HAVE TRIM
{
if(nvPicPr.nvPr.extLst.size())
{

View File

@ -88,25 +88,6 @@ namespace PPTX
{
return type().DefaultFileName();
}
virtual std::wstring GetImagePathNameFromRId(const OOX::RId& rid)const
{
smart_ptr<OOX::Image> p = Get<OOX::Image>(rid);
if (!p.is_init())
return _T("");
return p->filename().m_strFilename;
}
virtual std::wstring GetLinkFromRId(const OOX::RId& rid)const
{
smart_ptr<OOX::External> pExt = Find(rid).smart_dynamic_cast<OOX::External>();
if (pExt.IsInit())
return pExt->Uri().m_strFilename; //??? целесообразность ??
smart_ptr<OOX::Media> pMedia = Find(rid).smart_dynamic_cast<OOX::Media>();
if (pMedia.IsInit())
return pMedia->filename().m_strFilename;
return _T("");
}
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
{
pWriter->StartRecord(NSBinPptxRW::NSMainTables::NotesSlides);

View File

@ -49,9 +49,6 @@
#include "NotesSlide.h"
#include "TableStyles.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Media/Image.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Media/OleObject.h"
#include "../../Common/DocxFormat/Source/DocxFormat/External/External.h"
#include "../../Common/DocxFormat/Source/DocxFormat/External/HyperLink.h"
#include "../../Common/DocxFormat/Source/DocxFormat/VmlDrawing.h"
@ -144,33 +141,6 @@ namespace PPTX
return type().DefaultFileName();
}
//-------------------------------------------------
virtual std::wstring GetImagePathNameFromRId(const OOX::RId& rid)const
{
smart_ptr<OOX::Image> p = Get<OOX::Image>(rid);
if (!p.is_init())
return _T("");
return p->filename().m_strFilename;
}
virtual std::wstring GetLinkFromRId(const OOX::RId& rid)const
{
smart_ptr<OOX::External> pExt = Find(rid).smart_dynamic_cast<OOX::External>();
if (pExt.IsInit())
return pExt->Uri().m_strFilename;
smart_ptr<OOX::Media> pMedia = Find(rid).smart_dynamic_cast<OOX::Media>();
if (pMedia.IsInit())
return pMedia->filename().m_strFilename;
return _T("");
}
virtual std::wstring GetOleFromRId(const OOX::RId& rid)const
{
smart_ptr<OOX::OleObject> p = Get<OOX::OleObject>(rid);
if (!p.is_init())
return _T("");
return p->filename().m_strFilename;
}
virtual DWORD GetRGBAFromMap(const std::wstring& str)const
{
if(!(clrMapOvr.is_init()))

View File

@ -185,32 +185,6 @@ namespace PPTX
}
}
}
virtual std::wstring GetImagePathNameFromRId(const OOX::RId& rid)const
{
smart_ptr<OOX::Image> p = Get<OOX::Image>(rid);
if (!p.is_init())
return _T("");
return p->filename().m_strFilename;
}
virtual std::wstring GetLinkFromRId(const OOX::RId& rid)const
{
smart_ptr<OOX::External> pExt = Find(rid).smart_dynamic_cast<OOX::External>();
if (pExt.IsInit())
return pExt->Uri().m_strFilename;
smart_ptr<OOX::Media> pMedia = Find(rid).smart_dynamic_cast<OOX::Media>();
if (pMedia.IsInit())
return pMedia->filename().m_strFilename;
return _T("");
}
virtual std::wstring GetOleFromRId(const OOX::RId& rid)const
{
smart_ptr<OOX::OleObject> p = Get<OOX::OleObject>(rid);
if (!p.is_init())
return _T("");
return p->filename().m_strFilename;
}
virtual DWORD GetRGBAFromMap(const std::wstring& str)const
{
if(!(clrMapOvr.is_init()))

View File

@ -51,8 +51,6 @@
#include "Theme.h"
#include "TableStyles.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Media/Image.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Media/OleObject.h"
#include "../../Common/DocxFormat/Source/DocxFormat/External/HyperLink.h"
#include "../../Common/DocxFormat/Source/DocxFormat/VmlDrawing.h"
@ -172,32 +170,6 @@ namespace PPTX
}
}
}
virtual std::wstring GetImagePathNameFromRId(const OOX::RId& rid)const
{
smart_ptr<OOX::Image> p = Get<OOX::Image>(rid);
if (!p.is_init())
return _T("");
return p->filename().m_strFilename;
}
virtual std::wstring GetLinkFromRId(const OOX::RId& rid)const
{
smart_ptr<OOX::External> pExt = Find(rid).smart_dynamic_cast<OOX::External>();
if (pExt.IsInit())
return pExt->Uri().m_strFilename;
smart_ptr<OOX::Media> pMedia = Find(rid).smart_dynamic_cast<OOX::Media>();
if (pMedia.IsInit())
return pMedia->filename().m_strFilename;
return _T("");
}
virtual std::wstring GetOleFromRId(const OOX::RId& rid)const
{
smart_ptr<OOX::OleObject> p = Get<OOX::OleObject>(rid);
if (!p.is_init())
return _T("");
return p->filename().m_strFilename;
}
//---------------------Colors from map---------------------------------------
DWORD GetRGBAFromMap(const std::wstring& str)const

View File

@ -334,33 +334,6 @@ namespace PPTX
{
return GetABGRFromScheme(m_map->GetColorSchemeIndex(str));
}
virtual std::wstring GetImagePathNameFromRId(const OOX::RId& rid)const
{
smart_ptr<OOX::Image> p = Get<OOX::Image>(rid);
if (!p.is_init())
return _T("");
return p->filename().m_strFilename;
}
virtual std::wstring GetLinkFromRId(const OOX::RId& rid)const
{
smart_ptr<OOX::External> pExt = Find(rid).smart_dynamic_cast<OOX::External>();
if (pExt.IsInit())
return pExt->Uri().m_strFilename;
smart_ptr<OOX::Media> pMedia = Find(rid).smart_dynamic_cast<OOX::Media>();
if (pMedia.IsInit())
return pMedia->filename().m_strFilename;
return _T("");
}
virtual std::wstring GetOleFromRId(const OOX::RId& rid)const
{
smart_ptr<OOX::OleObject> p = Get<OOX::OleObject>(rid);
if (!p.is_init())
return _T("");
return p->filename().m_strFilename;
}
void GetLineStyle(int number, Logic::Ln& lnStyle)const
{
themeElements.fmtScheme.GetLineStyle(number, lnStyle);

View File

@ -148,8 +148,9 @@ bool OOXWriter::SaveByItemEnd()
if (m_poDocPropsApp)
{
((OOX::CApp*)m_poDocPropsApp)->SetApplication ( L"OnlyOffice" );
((OOX::CApp*)m_poDocPropsApp)->SetAppVersion ( L"5.0" );
#if defined(INTVER)
((OOX::CApp*)m_poDocPropsApp)->SetAppVersion ( VALUE2STR(INTVER) );
#endif
((OOX::CApp*)m_poDocPropsApp)->write(pathDocProps + FILE_SEPARATOR_STR + L"app.xml", pathDocProps.GetDirectory(), oContentTypes);
m_oRels.AddRelationship( L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties", L"docProps/app.xml" );

View File

@ -218,8 +218,10 @@ void CTxtXmlFile::CreateDocxEmpty(const std::wstring & _strDirectory, Writers::F
OOX::CApp* pApp = new OOX::CApp(NULL);
if (pApp)
{
pApp->SetApplication(_T("OnlyOffice"));
pApp->SetAppVersion(_T("5.07"));
pApp->SetApplication(L"OnlyOffice");
#if defined(INTVER)
pApp->SetAppVersion(VALUE2STR(INTVER));
#endif
pApp->SetDocSecurity(0);
pApp->SetScaleCrop(false);
pApp->SetLinksUpToDate(false);

View File

@ -149,6 +149,7 @@ void OfficeArtBStoreContainerFileBlock::load(XLS::CFRecord& record)
break;
case OfficeArtRecord::BlipPICT:
{
pict_type = L".pcz";
if (rc_header.recInstance == 0x542)
rgbUid1 = ReadMD4Digest(record);
else
@ -165,7 +166,6 @@ void OfficeArtBStoreContainerFileBlock::load(XLS::CFRecord& record)
isCompressed = true;
readCompressedData(record, metafileHeader);
}
pict_type = L".pic";///???? todooo
}
break;
case OfficeArtRecord::BlipJPEG:

View File

@ -62,8 +62,6 @@ namespace NSCommon
{
RELEASEOBJECT(m_pPointer);
}
public:
Type& operator*() { return *m_pPointer; }
Type* operator->() { return m_pPointer; }
@ -73,7 +71,6 @@ namespace NSCommon
const Type& get()const { return *m_pPointer; }
Type& get() { return *m_pPointer; }
public:
nullable_base<Type>& operator=(const nullable_base<Type> &oOther)
{
RELEASEOBJECT(m_pPointer);
@ -95,8 +92,6 @@ namespace NSCommon
m_pPointer = new Type(oSrc);
return *this;
}
public:
bool IsInit() const
{
return (NULL != m_pPointer);
@ -167,20 +162,6 @@ namespace NSCommon
return *this;
}
//nullable<Type>& operator=(std::wstring& cwsValue)
//{
// RELEASEOBJECT(this->m_pPointer);
// this->m_pPointer = new Type( cwsValue.c_str() );
// return *this;
//}
//nullable<Type>& operator=(const std::wstring& cwsValue)
//{
// RELEASEOBJECT(this->m_pPointer);
// this->m_pPointer = new Type( cwsValue.c_str() );
// return *this;
//}
nullable<Type>& operator=(const nullable<Type> &oOther)
{
RELEASEOBJECT(this->m_pPointer);
@ -283,8 +264,6 @@ namespace NSCommon
{
}
public:
void operator=(const std::wstring& value)
{
RELEASEOBJECT(this->m_pPointer);
@ -296,17 +275,6 @@ namespace NSCommon
RELEASEOBJECT(this->m_pPointer);
this->m_pPointer = pType;
}
//#if defined(_WIN32) || defined (_WIN64)
// void operator=(const BSTR& value)
// {
// RELEASEOBJECT(this->m_pPointer);
// if (NULL != value)
// {
// this->m_pPointer = new Type();
// this->m_pPointer->_set((std::wstring)value);
// }
// }
//#endif
void operator=(const BYTE& value)
{
RELEASEOBJECT(this->m_pPointer);
@ -343,7 +311,6 @@ namespace NSCommon
return this->m_pPointer->get();
}
public:
Type& operator*() { return *this->m_pPointer; }
Type* operator->() { return this->m_pPointer; }
@ -387,15 +354,6 @@ namespace NSCommon
return *this;
}
//#if defined(_WIN32) || defined (_WIN64)
// void operator=(const BSTR& value)
// {
// RELEASEOBJECT(this->m_pPointer);
//
// if (NULL != value)
// this->m_pPointer = new int(XmlUtils::GetInteger(value));
// }
//#endif
void operator=(const std::wstring& value)
{
RELEASEOBJECT(this->m_pPointer);
@ -425,8 +383,6 @@ namespace NSCommon
}
return *m_pPointer;
}
public:
int& operator*() { return *m_pPointer; }
int* operator->() { return m_pPointer; }
@ -434,15 +390,77 @@ namespace NSCommon
int* operator->() const { return m_pPointer; }
const int& get()const { return *m_pPointer; }
};
class nullable_int64 : public nullable_base<_INT64>
{
public:
std::wstring toString() const
nullable_int64() : nullable_base<_INT64>()
{
std::wstring result;
//if (IsInit())
// result = std::to_wstring( get());
return result;
}
void normalize(const _INT64& min, const _INT64& max)
{
if (IsInit())
{
if (*m_pPointer < min)
*m_pPointer = min;
else if (*m_pPointer > max)
*m_pPointer = max;
}
}
void normalize_positive()
{
if (IsInit())
{
if (*m_pPointer < 0)
*m_pPointer = 0;
}
}
nullable_int64& operator=(const wchar_t* cwsValue)
{
RELEASEOBJECT(m_pPointer);
if ( NULL != cwsValue )
m_pPointer = new _INT64(XmlUtils::GetInteger64(cwsValue));
return *this;
}
void operator=(const std::wstring& value)
{
RELEASEOBJECT(this->m_pPointer);
this->m_pPointer = new _INT64(XmlUtils::GetInteger64(value));
}
void operator=(const _INT64& value)
{
RELEASEOBJECT(this->m_pPointer);
this->m_pPointer = new _INT64(value);
}
nullable_int64& operator=(const nullable_int64& oSrc)
{
RELEASEOBJECT(m_pPointer);
if (NULL != oSrc.m_pPointer )
m_pPointer = new _INT64(*oSrc);
return *this;
}
_INT64 get_value_or(const _INT64& value) const
{
if (NULL == m_pPointer)
{
int ret = value;
return ret;
}
return *m_pPointer;
}
_INT64& operator*() { return *m_pPointer; }
_INT64* operator->() { return m_pPointer; }
_INT64& operator*() const { return *m_pPointer; }
_INT64* operator->() const { return m_pPointer; }
const _INT64& get()const { return *m_pPointer; }
};
class nullable_sizet : public nullable_base<size_t>
{
@ -494,7 +512,6 @@ namespace NSCommon
}
return *m_pPointer;
}
public:
size_t& operator*() { return *m_pPointer; }
size_t* operator->() { return m_pPointer; }
@ -630,12 +647,6 @@ namespace NSCommon
const bool& get()const { return *m_pPointer; }
std::wstring toString() const
{
std::wstring result;
return result;
}
};
class nullable_string : public nullable_base<std::wstring>
{
@ -679,8 +690,6 @@ namespace NSCommon
}
return *m_pPointer;
}
public:
std::wstring& operator*() { return *m_pPointer; }
std::wstring* operator->() { return m_pPointer; }

View File

@ -39,6 +39,9 @@
#include "../Common/SimpleTypes_Word.h"
#include "../Common/SimpleTypes_Shared.h"
#define VALUE_TO_STRING(x) #x
#define VALUE2STR(x) VALUE_TO_STRING(x)
namespace OOX
{
class CApp : public OOX::File
@ -416,7 +419,11 @@ namespace OOX
{
m_sAppVersion = sVal;
}
void SetDocSecurity(int nVal)
void SetAppVersion(const std::string& sVal)
{
m_sAppVersion = std::wstring(sVal.begin(), sVal.end());
}
void SetDocSecurity(int nVal)
{
m_nDocSecurity = nVal;
}

View File

@ -189,6 +189,12 @@ namespace OOX
}
}
}
if ((m_oRunProperty) && (m_oRunProperty->m_pText))
{
m_arrItems.push_back( m_oRunProperty->m_pText);
m_oRunProperty->m_pText = NULL;
}
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
@ -279,6 +285,11 @@ namespace OOX
if ( pItem )
m_arrItems.push_back( pItem );
}
if ((m_oRunProperty) && (m_oRunProperty->m_pText))
{
m_arrItems.push_back( m_oRunProperty->m_pText);
m_oRunProperty->m_pText = NULL;
}
}
virtual std::wstring toXML() const
{

View File

@ -776,15 +776,13 @@ namespace OOX
CText() {}
virtual ~CText() {}
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
oNode.ReadAttributeBase( _T("xml:space"), m_oSpace );
m_sText = oNode.GetText();
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
@ -793,7 +791,7 @@ namespace OOX
m_sText = oReader.GetText2();
}
virtual std::wstring toXML() const
virtual std::wstring toXML() const
{
std::wstring sResult;

View File

@ -30,6 +30,7 @@
*
*/
#include "RunProperty.h"
#include "RunContent.h"
namespace OOX
{
@ -164,7 +165,26 @@ namespace OOX
if ( _T("w:b") == sName )
m_oBold = oReader;
else if ( _T("w:bCs") == sName )
m_oBoldCs = oReader;
{
if (!oReader.IsEmptyNode())
{
m_oBoldCs.Init();
int nParentDepth1 = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nParentDepth1 ) )
{
std::wstring sName1 = oReader.GetName();
if ( _T("w:t") == sName1 )
{
m_pText = new CText( oReader );
break;
}
}
}
else
m_oBoldCs = oReader;
}
else if ( _T("w:bdr") == sName )
m_oBdr = oReader;
else if ( _T("w:caps") == sName )
@ -269,6 +289,159 @@ namespace OOX
}
}
}
void CRunProperty::fromXML(XmlUtils::CXmlNode& oNode)
{
if ( _T("w:rPr") != oNode.GetName() )
return;
XmlUtils::CXmlNode oChild;
if ( oNode.GetNode( _T("w:b"), oChild ) )
m_oBold = oChild;
if ( oNode.GetNode( _T("w:bCs"), oChild ) )
{
m_oBoldCs = oChild;
XmlUtils::CXmlNode oChild1;
if (oChild.GetNode(L"w:t", oChild1))
{
m_pText = new CText(oChild1); //XpertdocOnlineDemoEn.docx
}
}
if ( oNode.GetNode( _T("w:bdr"), oChild ) )
m_oBdr = oChild;
if ( oNode.GetNode( _T("w:caps"), oChild ) )
m_oCaps = oChild;
if ( oNode.GetNode( _T("w:color"), oChild ) )
m_oColor = oChild;
if ( oNode.GetNode( _T("w:cs"), oChild ) )
m_oCs = oChild;
if ( oNode.GetNode( _T("w:del"), oChild ) )
m_oDel = oChild;
if ( oNode.GetNode( _T("w:dstrike"), oChild ) )
m_oDStrike = oChild;
if ( oNode.GetNode( _T("w:eastAsianLayout"), oChild ) )
m_oEastAsianLayout = oChild;
if ( oNode.GetNode( _T("w:effect"), oChild ) )
m_oEffect = oChild;
if ( oNode.GetNode( _T("w:em"), oChild ) )
m_oEm = oChild;
if ( oNode.GetNode( _T("w:emboss"), oChild ) )
m_oEmboss = oChild;
if ( oNode.GetNode( _T("w:fitText"), oChild ) )
m_oFitText = oChild;
if ( oNode.GetNode( _T("w:highlight"), oChild ) )
m_oHighlight = oChild;
if ( oNode.GetNode( _T("w:ins"), oChild ) )
m_oIns = oChild;
if ( oNode.GetNode( _T("w:i"), oChild ) )
m_oItalic = oChild;
if ( oNode.GetNode( _T("w:iCs"), oChild ) )
m_oItalicCs = oChild;
if ( oNode.GetNode( _T("w:imprint"), oChild ) )
m_oImprint = oChild;
if ( oNode.GetNode( _T("w:kern"), oChild ) )
m_oKern = oChild;
if ( oNode.GetNode( _T("w:lang"), oChild ) )
m_oLang = oChild;
if ( oNode.GetNode( _T("w:noProof"), oChild ) )
m_oNoProof = oChild;
if ( oNode.GetNode( _T("m:oMath"), oChild ) )
m_oMath = oChild;
if ( oNode.GetNode( _T("w:outline"), oChild ) )
m_oOutline = oChild;
if ( oNode.GetNode( _T("w:position"), oChild ) )
m_oPosition = oChild;
if ( oNode.GetNode( _T("w:rFonts"), oChild ) )
m_oRFonts = oChild;
if ( !m_bRPRChange && oNode.GetNode( _T("w:rPrChange"), oChild ) )
m_oRPrChange = oChild;
// В спецификации почему-то написано pStyle, хотя по смыслы, по ссылке в самой
// же спецификации и, в конце концов, по алфавиту тут толжно быть rStyle
if ( oNode.GetNode( _T("w:rStyle"), oChild ) )
m_oRStyle = oChild;
if ( !m_oRStyle.IsInit() && oNode.GetNode( _T("w:pStyle"), oChild ) )
m_oRStyle = oChild;
if ( oNode.GetNode( _T("w:rtl"), oChild ) )
m_oRtL = oChild;
if ( oNode.GetNode( _T("w:shadow"), oChild ) )
m_oShadow = oChild;
if ( oNode.GetNode( _T("w:shd"), oChild ) )
m_oShd = oChild;
if ( oNode.GetNode( _T("w:smallCaps"), oChild ) )
m_oSmallCaps = oChild;
if ( oNode.GetNode( _T("w:snapToGrid"), oChild ) )
m_oSnapToGrid = oChild;
if ( oNode.GetNode( _T("w:spacing"), oChild ) )
m_oSpacing = oChild;
if ( oNode.GetNode( _T("w:specVanish"), oChild ) )
m_oSpecVanish = oChild;
if ( oNode.GetNode( _T("w:strike"), oChild ) )
m_oStrike = oChild;
if ( oNode.GetNode( _T("w:sz"), oChild ) )
m_oSz = oChild;
if ( oNode.GetNode( _T("w:szCs"), oChild ) )
m_oSzCs = oChild;
if ( oNode.GetNode( _T("w:u"), oChild ) )
m_oU = oChild;
if ( oNode.GetNode( _T("w:vanish"), oChild ) )
m_oVanish = oChild;
if ( oNode.GetNode( _T("w:vertAlign"), oChild ) )
m_oVertAlign = oChild;
if ( oNode.GetNode( _T("w:w"), oChild ) )
m_oW = oChild;
if ( oNode.GetNode( _T("w:webHidden"), oChild ) )
m_oWebHidden = oChild;
if ( oNode.GetNode( _T("w:moveFrom"), oChild ) )
m_oMoveFrom = oChild;
if ( oNode.GetNode( _T("w:moveTo"), oChild ) )
m_oMoveTo = oChild;
}
} // Logic
} // ComplexTypes

View File

@ -737,18 +737,22 @@ namespace OOX
public:
CRunProperty()
{
m_pText = NULL;
m_bRPRChange = false;
}
virtual ~CRunProperty()
{
RELEASEOBJECT(m_pText);
}
CRunProperty(const XmlUtils::CXmlNode &oNode)
{
m_pText = NULL;
m_bRPRChange = false;
fromXML( (XmlUtils::CXmlNode &)oNode );
}
CRunProperty(const XmlUtils::CXmlLiteReader& oReader)
{
m_pText = NULL;
m_bRPRChange = false;
fromXML( (XmlUtils::CXmlLiteReader&)oReader );
}
@ -764,152 +768,8 @@ namespace OOX
}
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
if ( _T("w:rPr") != oNode.GetName() )
return;
XmlUtils::CXmlNode oChild;
if ( oNode.GetNode( _T("w:b"), oChild ) )
m_oBold = oChild;
if ( oNode.GetNode( _T("w:bCs"), oChild ) )
m_oBoldCs = oChild;
if ( oNode.GetNode( _T("w:bdr"), oChild ) )
m_oBdr = oChild;
if ( oNode.GetNode( _T("w:caps"), oChild ) )
m_oCaps = oChild;
if ( oNode.GetNode( _T("w:color"), oChild ) )
m_oColor = oChild;
if ( oNode.GetNode( _T("w:cs"), oChild ) )
m_oCs = oChild;
if ( oNode.GetNode( _T("w:del"), oChild ) )
m_oDel = oChild;
if ( oNode.GetNode( _T("w:dstrike"), oChild ) )
m_oDStrike = oChild;
if ( oNode.GetNode( _T("w:eastAsianLayout"), oChild ) )
m_oEastAsianLayout = oChild;
if ( oNode.GetNode( _T("w:effect"), oChild ) )
m_oEffect = oChild;
if ( oNode.GetNode( _T("w:em"), oChild ) )
m_oEm = oChild;
if ( oNode.GetNode( _T("w:emboss"), oChild ) )
m_oEmboss = oChild;
if ( oNode.GetNode( _T("w:fitText"), oChild ) )
m_oFitText = oChild;
if ( oNode.GetNode( _T("w:highlight"), oChild ) )
m_oHighlight = oChild;
if ( oNode.GetNode( _T("w:ins"), oChild ) )
m_oIns = oChild;
if ( oNode.GetNode( _T("w:i"), oChild ) )
m_oItalic = oChild;
if ( oNode.GetNode( _T("w:iCs"), oChild ) )
m_oItalicCs = oChild;
if ( oNode.GetNode( _T("w:imprint"), oChild ) )
m_oImprint = oChild;
if ( oNode.GetNode( _T("w:kern"), oChild ) )
m_oKern = oChild;
if ( oNode.GetNode( _T("w:lang"), oChild ) )
m_oLang = oChild;
if ( oNode.GetNode( _T("w:noProof"), oChild ) )
m_oNoProof = oChild;
if ( oNode.GetNode( _T("m:oMath"), oChild ) )
m_oMath = oChild;
if ( oNode.GetNode( _T("w:outline"), oChild ) )
m_oOutline = oChild;
if ( oNode.GetNode( _T("w:position"), oChild ) )
m_oPosition = oChild;
if ( oNode.GetNode( _T("w:rFonts"), oChild ) )
m_oRFonts = oChild;
if ( !m_bRPRChange && oNode.GetNode( _T("w:rPrChange"), oChild ) )
m_oRPrChange = oChild;
// В спецификации почему-то написано pStyle, хотя по смыслы, по ссылке в самой
// же спецификации и, в конце концов, по алфавиту тут толжно быть rStyle
if ( oNode.GetNode( _T("w:rStyle"), oChild ) )
m_oRStyle = oChild;
if ( !m_oRStyle.IsInit() && oNode.GetNode( _T("w:pStyle"), oChild ) )
m_oRStyle = oChild;
if ( oNode.GetNode( _T("w:rtl"), oChild ) )
m_oRtL = oChild;
if ( oNode.GetNode( _T("w:shadow"), oChild ) )
m_oShadow = oChild;
if ( oNode.GetNode( _T("w:shd"), oChild ) )
m_oShd = oChild;
if ( oNode.GetNode( _T("w:smallCaps"), oChild ) )
m_oSmallCaps = oChild;
if ( oNode.GetNode( _T("w:snapToGrid"), oChild ) )
m_oSnapToGrid = oChild;
if ( oNode.GetNode( _T("w:spacing"), oChild ) )
m_oSpacing = oChild;
if ( oNode.GetNode( _T("w:specVanish"), oChild ) )
m_oSpecVanish = oChild;
if ( oNode.GetNode( _T("w:strike"), oChild ) )
m_oStrike = oChild;
if ( oNode.GetNode( _T("w:sz"), oChild ) )
m_oSz = oChild;
if ( oNode.GetNode( _T("w:szCs"), oChild ) )
m_oSzCs = oChild;
if ( oNode.GetNode( _T("w:u"), oChild ) )
m_oU = oChild;
if ( oNode.GetNode( _T("w:vanish"), oChild ) )
m_oVanish = oChild;
if ( oNode.GetNode( _T("w:vertAlign"), oChild ) )
m_oVertAlign = oChild;
if ( oNode.GetNode( _T("w:w"), oChild ) )
m_oW = oChild;
if ( oNode.GetNode( _T("w:webHidden"), oChild ) )
m_oWebHidden = oChild;
if ( oNode.GetNode( _T("w:moveFrom"), oChild ) )
m_oMoveFrom = oChild;
if ( oNode.GetNode( _T("w:moveTo"), oChild ) )
m_oMoveTo = oChild;
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
virtual void fromXML(XmlUtils::CXmlNode& oNode);
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
virtual std::wstring toXML() const
{
std::wstring sResult = _T("<w:rPr>");
@ -1228,9 +1088,6 @@ namespace OOX
{
return et_w_rPr;
}
public:
static const CRunProperty Merge(const CRunProperty& oPrev, const CRunProperty& oCurrent)
{
CRunProperty oProperties;
@ -1292,8 +1149,7 @@ namespace OOX
return oResult;
}
public:
const bool IsSimple() const
{
if ( m_oBold.IsInit() )
@ -1428,9 +1284,6 @@ namespace OOX
return true;
}
public:
bool m_bRPRChange; // Является ли данный w:rPr дочерним по отношению к w:rPrChange
nullable<ComplexTypes::Word::COnOff2<SimpleTypes::onoffTrue> > m_oBold;
@ -1480,6 +1333,7 @@ namespace OOX
PPTX::Logic::UniFill m_oTextFill;
nullable<PPTX::Logic::Ln> m_oTextOutline;
OOX::WritingElement* m_pText; //temp ... for Run object -> XpertdocOnlineDemoEn.docx
};
} // namespace Logic

View File

@ -54,12 +54,12 @@ namespace ComplexTypes
{
}
virtual void FromXML(XmlUtils::CXmlNode& oNode)
virtual void FromXML(XmlUtils::CXmlNode& oNode)
{
oNode.ReadAttributeBase( _T("w:displayText"), m_sDisplayText );
oNode.ReadAttributeBase( _T("w:value"), m_sValue );
}
virtual void FromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void FromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes(oReader);
@ -91,7 +91,6 @@ namespace ComplexTypes
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
// Читаем атрибуты
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("w:displayText"), m_sDisplayText )
WritingElement_ReadAttributes_Read_else_if( oReader, _T("w:value"), m_sValue )
@ -118,13 +117,13 @@ namespace ComplexTypes
{
}
virtual void FromXML(XmlUtils::CXmlNode& oNode)
virtual void FromXML(XmlUtils::CXmlNode& oNode)
{
oNode.ReadAttributeBase( _T("w:prefixMappings"), m_sPrefixMappings );
oNode.ReadAttributeBase( _T("w:storeItemID"), m_sStoreItemID );
oNode.ReadAttributeBase( _T("w:xpath"), m_sXPath );
}
virtual void FromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void FromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes(oReader);
@ -142,13 +141,6 @@ namespace ComplexTypes
sResult += _T("\" ");
}
if ( m_sStoreItemID.IsInit() )
{
sResult += _T("w:storeItemID=\"");
sResult += m_sStoreItemID.get2();
sResult += _T("\" ");
}
if ( m_sXPath.IsInit() )
{
sResult += _T("w:xpath=\"");
@ -156,13 +148,18 @@ namespace ComplexTypes
sResult += _T("\" ");
}
if ( m_sStoreItemID.IsInit() )
{
sResult += _T("w:storeItemID=\"");
sResult += m_sStoreItemID.get2();
sResult += _T("\" ");
}
return sResult;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
// Читаем атрибуты
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("w:prefixMappings"), m_sPrefixMappings )
WritingElement_ReadAttributes_Read_else_if( oReader, _T("w:storeItemID"), m_sStoreItemID )
@ -191,11 +188,11 @@ namespace ComplexTypes
{
}
virtual void FromXML(XmlUtils::CXmlNode& oNode)
virtual void FromXML(XmlUtils::CXmlNode& oNode)
{
oNode.ReadAttributeBase( _T("w:val"), m_oVal );
}
virtual void FromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void FromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes(oReader);
@ -236,11 +233,11 @@ namespace ComplexTypes
{
}
virtual void FromXML(XmlUtils::CXmlNode& oNode)
virtual void FromXML(XmlUtils::CXmlNode& oNode)
{
oNode.ReadAttributeBase( _T("w:val"), m_oVal );
}
virtual void FromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void FromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes(oReader);
@ -256,7 +253,6 @@ namespace ComplexTypes
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
// Читаем атрибуты
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_ReadSingle( oReader, _T("w:val"), m_oVal )
WritingElement_ReadAttributes_End( oReader )
@ -281,11 +277,11 @@ namespace ComplexTypes
{
}
virtual void FromXML(XmlUtils::CXmlNode& oNode)
virtual void FromXML(XmlUtils::CXmlNode& oNode)
{
oNode.ReadAttributeBase( _T("w:val"), m_oVal );
}
virtual void FromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void FromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes(oReader);
@ -302,7 +298,6 @@ namespace ComplexTypes
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
// Читаем атрибуты
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_ReadSingle( oReader, _T("w:val"), m_oVal )
WritingElement_ReadAttributes_End( oReader )
@ -327,11 +322,11 @@ namespace ComplexTypes
{
}
virtual void FromXML(XmlUtils::CXmlNode& oNode)
virtual void FromXML(XmlUtils::CXmlNode& oNode)
{
oNode.ReadAttributeBase( _T("w:multiLine"), m_oMultiLine );
}
virtual void FromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void FromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes(oReader);
@ -352,7 +347,6 @@ namespace ComplexTypes
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
// Читаем атрибуты
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_ReadSingle( oReader, _T("w:multiLine"), m_oMultiLine )
WritingElement_ReadAttributes_End( oReader )
@ -382,7 +376,7 @@ namespace OOX
}
virtual ~CSdtComboBox()
{
for ( unsigned int nIndex = 0; nIndex < m_arrListItem.size(); nIndex++ )
for ( size_t nIndex = 0; nIndex < m_arrListItem.size(); nIndex++ )
{
if ( m_arrListItem[nIndex] )
delete m_arrListItem[nIndex];
@ -395,7 +389,7 @@ namespace OOX
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
oNode.ReadAttributeBase( _T("w:lastValue"), m_sLastValue );
@ -414,7 +408,7 @@ namespace OOX
}
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
@ -432,7 +426,7 @@ namespace OOX
}
}
}
virtual std::wstring toXML() const
virtual std::wstring toXML() const
{
std::wstring sResult;
@ -445,7 +439,7 @@ namespace OOX
else
sResult = _T("<w:comboBox>");
for (unsigned int nIndex = 0; nIndex < m_arrListItem.size(); nIndex++ )
for (size_t nIndex = 0; nIndex < m_arrListItem.size(); nIndex++ )
{
sResult += _T("<w:listItem ");
if (m_arrListItem[nIndex])
@ -467,7 +461,6 @@ namespace OOX
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
// Читаем атрибуты
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_ReadSingle( oReader, _T("w:lastValue"), m_sLastValue )
WritingElement_ReadAttributes_End( oReader )
@ -498,7 +491,7 @@ namespace OOX
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
oNode.ReadAttributeBase( _T("w:fullDate"), m_oFullDate );
@ -510,7 +503,7 @@ namespace OOX
WritingElement_ReadNode( oNode, oChild, _T("w:storeMappedDateAs"), m_oStoreMappedDateAs );
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
@ -531,7 +524,7 @@ namespace OOX
m_oStoreMappedDateAs = oReader;
}
}
virtual std::wstring toXML() const
virtual std::wstring toXML() const
{
std::wstring sResult;
@ -562,7 +555,6 @@ namespace OOX
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
// Читаем атрибуты
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_ReadSingle( oReader, _T("w:fullDate"), m_oFullDate )
WritingElement_ReadAttributes_End( oReader )
@ -596,7 +588,7 @@ namespace OOX
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
XmlUtils::CXmlNode oChild;
@ -605,7 +597,7 @@ namespace OOX
WritingElement_ReadNode( oNode, oChild, _T("w:docPartUnique"), m_oDocPartUnique );
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
if ( oReader.IsEmptyNode() )
return;
@ -622,7 +614,7 @@ namespace OOX
m_oDocPartUnique = oReader;
}
}
virtual std::wstring toXML() const
virtual std::wstring toXML() const
{
std::wstring sResult = _T("<w:docPartList>");
@ -634,7 +626,7 @@ namespace OOX
return sResult;
}
std::wstring toXML2(const std::wstring& sName) const
std::wstring toXML2(const std::wstring& sName) const
{
std::wstring sResult = L"<" + sName + L">";
@ -670,7 +662,7 @@ namespace OOX
}
virtual ~CSdtDropDownList()
{
for ( unsigned int nIndex = 0; nIndex < m_arrListItem.size(); nIndex++ )
for ( size_t nIndex = 0; nIndex < m_arrListItem.size(); nIndex++ )
{
if ( m_arrListItem[nIndex] )
delete m_arrListItem[nIndex];
@ -681,9 +673,7 @@ namespace OOX
m_arrListItem.clear();
}
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
oNode.ReadAttributeBase( _T("w:lastValue"), m_sLastValue );
@ -702,7 +692,7 @@ namespace OOX
}
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
@ -720,7 +710,7 @@ namespace OOX
}
}
}
virtual std::wstring toXML() const
virtual std::wstring toXML() const
{
std::wstring sResult;
@ -733,7 +723,7 @@ namespace OOX
else
sResult = _T("<w:dropDownList>");
for (unsigned int nIndex = 0; nIndex < m_arrListItem.size(); nIndex++ )
for (size_t nIndex = 0; nIndex < m_arrListItem.size(); nIndex++ )
{
sResult += _T("<w:listItem ");
if (m_arrListItem[nIndex])
@ -754,7 +744,6 @@ namespace OOX
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
// Читаем атрибуты
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_ReadSingle( oReader, _T("w:lastValue"), m_sLastValue )
WritingElement_ReadAttributes_End( oReader )
@ -782,16 +771,14 @@ namespace OOX
{
}
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
XmlUtils::CXmlNode oChild;
WritingElement_ReadNode( oNode, oChild, _T("w:docPart"), m_oDocPart );
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
if ( oReader.IsEmptyNode() )
return;
@ -804,7 +791,7 @@ namespace OOX
m_oDocPart = oReader;
}
}
virtual std::wstring toXML() const
virtual std::wstring toXML() const
{
std::wstring sResult = _T("<w:placeholder>");
@ -841,7 +828,7 @@ namespace OOX
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
XmlUtils::CXmlNode oChild;
@ -849,7 +836,7 @@ namespace OOX
m_oRPr = oChild;
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
if ( oReader.IsEmptyNode() )
return;
@ -862,7 +849,7 @@ namespace OOX
m_oRPr = oReader;
}
}
virtual std::wstring toXML() const
virtual std::wstring toXML() const
{
std::wstring sResult = _T("<w:sdtEndPr>");
@ -917,7 +904,7 @@ namespace OOX
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
m_eType = sdttypeUnknown;
@ -932,7 +919,7 @@ namespace OOX
if ( sdttypeUnknown == m_eType && oNode.GetNode( _T("w:citation"), oChild ) )
m_eType = sdttypeCitation;
if ( sdttypeUnknown == m_eType && oNode.GetNode( _T("w:alias"), oChild ) )
if ( sdttypeUnknown == m_eType && oNode.GetNode( _T("w:comboBox"), oChild ) )
{
m_oComboBox = oChild;
m_eType = sdttypeComboBox;
@ -1011,7 +998,7 @@ namespace OOX
}
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
m_eType = sdttypeUnknown;
@ -1089,21 +1076,21 @@ namespace OOX
}
}
}
std::wstring toXMLStart() const
std::wstring toXMLStart() const
{
std::wstring sResult = _T("<w:sdtPr>");
WritingElement_WriteNode_2( m_oRPr );
WritingElement_WriteNode_1( _T("<w:alias "), m_oAlias );
WritingElement_WriteNode_1( _T("<w:label "), m_oLabel );
WritingElement_WriteNode_1( _T("<w:tabIndex "), m_oTabIndex );
WritingElement_WriteNode_1( _T("<w:lock "), m_oLock );
WritingElement_WriteNode_1( L"<w:alias ", m_oAlias );
WritingElement_WriteNode_1( L"<w:id ", m_oId );
WritingElement_WriteNode_1( L"<w:label ", m_oLabel );
WritingElement_WriteNode_1( L"<w:tabIndex ", m_oTabIndex );
WritingElement_WriteNode_1( L"<w:lock ", m_oLock );
WritingElement_WriteNode_2( m_oPlaceHolder );
WritingElement_WriteNode_1( _T("<w:showingPlcHdr "), m_oShowingPlcHdr );
WritingElement_WriteNode_1( _T("<w:dataBinding "), m_oDataBinding );
WritingElement_WriteNode_1( _T("<w:temporary "), m_oTemporary );
WritingElement_WriteNode_1( _T("<w:id "), m_oId );
WritingElement_WriteNode_1( _T("<w:tag "), m_oTag );
WritingElement_WriteNode_1( L"<w:showingPlcHdr ", m_oShowingPlcHdr );
WritingElement_WriteNode_1( L"<w:dataBinding ", m_oDataBinding );
WritingElement_WriteNode_1( L"<w:temporary ", m_oTemporary );
WritingElement_WriteNode_1( L"<w:tag ", m_oTag );
switch(m_eType)
{
@ -1186,12 +1173,12 @@ namespace OOX
return sResult;
}
std::wstring toXMLEnd() const
std::wstring toXMLEnd() const
{
return _T("</w:sdtPr>");
}
virtual std::wstring toXML() const
virtual std::wstring toXML() const
{
return toXMLStart() + toXMLEnd();
}
@ -1233,8 +1220,8 @@ namespace OOX
{
}
virtual void fromXML(XmlUtils::CXmlNode& oNode);
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
virtual void fromXML(XmlUtils::CXmlNode& oNode);
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
virtual std::wstring toXML() const;
virtual EElementType getType() const
{
@ -1261,7 +1248,7 @@ namespace OOX
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
XmlUtils::CXmlNode oChild;
@ -1275,7 +1262,7 @@ namespace OOX
m_oSdtPr = oChild;
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
if ( oReader.IsEmptyNode() )
return;
@ -1292,7 +1279,7 @@ namespace OOX
m_oSdtPr = oReader;
}
}
virtual std::wstring toXML() const
virtual std::wstring toXML() const
{
std::wstring sResult = _T("<w:sdt>");

View File

@ -45,6 +45,8 @@
#include "../../../../DesktopEditor/common/File.h"
#include <boost/unordered_map.hpp>
namespace OOX
{
namespace Rels
@ -313,7 +315,7 @@ namespace OOX
{
(*ppRelationShip) = NULL;
std::map<std::wstring, Rels::CRelationShip*>::iterator pFind = m_mapRelations.find(rId.get());
boost::unordered_map<std::wstring, Rels::CRelationShip*>::iterator pFind = m_mapRelations.find(rId.get());
if (pFind != m_mapRelations.end())
{
(*ppRelationShip) = pFind->second;
@ -336,7 +338,7 @@ namespace OOX
public:
std::vector<Rels::CRelationShip*> m_arRelations;
std::map<std::wstring, Rels::CRelationShip*> m_mapRelations;
boost::unordered_map<std::wstring, Rels::CRelationShip*> m_mapRelations;
};
} // namespace OOX

View File

@ -33,6 +33,7 @@
#include "../Base/Base.h"
#include "../Base/SmartPtr.h"
#include "../Base/Types_32.h"
#include <algorithm>
#include <sstream>
@ -77,9 +78,9 @@ namespace XmlUtils
return true;
return false;
}
AVSINLINE static __int64 GetHex (const std::wstring& string)
AVSINLINE static _INT64 GetHex (const std::wstring& string)
{
__int64 nResult = 0;
_INT64 nResult = 0;
size_t nLen = string.length();
for (size_t nIndex = 0; nIndex < nLen; ++nIndex )
{
@ -88,9 +89,9 @@ namespace XmlUtils
return nResult;
}
AVSINLINE static __int64 GetHex (const std::string& string)
AVSINLINE static _INT64 GetHex (const std::string& string)
{
__int64 nResult = 0;
_INT64 nResult = 0;
size_t nLen = string.length();
for (size_t nIndex = 0; nIndex < nLen; ++nIndex )
{
@ -169,7 +170,20 @@ namespace XmlUtils
return ( L"true" == sTemp || L"1" == sTemp || L"t" == sTemp || L"on" == sTemp );
}
AVSINLINE static int GetInteger (const std::wstring& string)
AVSINLINE static _INT64 GetInteger64 (const std::wstring& string)
{
if (string.empty()) return 0;
try
{
return _wtoi64(string.c_str());
}
catch(...)
{
return 0;
}
}
AVSINLINE static int GetInteger (const std::wstring& string)
{
if (string.empty()) return 0;

View File

@ -52,7 +52,8 @@ namespace OOX
m_bSpreadsheets = true;
CXlsx* xlsx = dynamic_cast<CXlsx*>(File::m_pMainDocument);
if (xlsx) xlsx->m_pSharedStrings = this;
if ((xlsx) && (!xlsx->m_pSharedStrings))
xlsx->m_pSharedStrings = this;
}
CSharedStrings(OOX::Document* pMain, const CPath& oRootPath, const CPath& oPath) : OOX::File(pMain), OOX::IFileContainer(pMain)
{
@ -60,7 +61,8 @@ namespace OOX
m_bSpreadsheets = true;
CXlsx* xlsx = dynamic_cast<CXlsx*>(File::m_pMainDocument);
if (xlsx) xlsx->m_pSharedStrings = this;
if ((xlsx) && (!xlsx->m_pSharedStrings))
xlsx->m_pSharedStrings = this;
read( oRootPath, oPath );
}

View File

@ -71,7 +71,7 @@ namespace OOX
m_bSpreadsheets = true;
CXlsx* xlsx = dynamic_cast<CXlsx*>(File::m_pMainDocument);
if (xlsx)
if ((xlsx) && (!xlsx->m_pWorkbook))
{
xlsx->m_pWorkbook = this;
}
@ -82,7 +82,7 @@ namespace OOX
m_bSpreadsheets = true;
CXlsx* xlsx = dynamic_cast<CXlsx*>(File::m_pMainDocument);
if (xlsx)
if ((xlsx) && (!xlsx->m_pWorkbook))
{
xlsx->m_pWorkbook = this;
}

View File

@ -118,8 +118,11 @@ bool OOX::Spreadsheet::CXlsx::Write(const CPath& oDirPath, OOX::CContentTypes &o
//CApp
OOX::CApp* pApp = new OOX::CApp(this);
pApp->SetApplication(_T("OnlyOffice"));
pApp->SetAppVersion(_T("5.0"));
pApp->SetApplication(L"OnlyOffice");
#if defined(INTVER)
pApp->SetAppVersion(VALUE2STR(INTVER));
#endif
pApp->SetDocSecurity(0);
pApp->SetScaleCrop(false);
pApp->SetLinksUpToDate(false);
@ -455,4 +458,4 @@ void OOX::Spreadsheet::CXlsx::PrepareWorksheet(CWorksheet* pWorksheet)
}
}
}
}
}

View File

@ -1,3 +1,6 @@
VERSION = 2.4.510.0
DEFINES += INTVER=$$VERSION
# CONFIGURATION
CONFIG(debug, debug|release) {
CONFIG += core_debug

View File

@ -7,9 +7,6 @@
QT -= core
QT -= gui
VERSION = 2.4.508.0
DEFINES += INTVER=$$VERSION
TARGET = x2t
CORE_ROOT_DIR = $$PWD/../../..
PWD_ROOT_DIR = $$PWD

View File

@ -4490,7 +4490,6 @@ namespace BinXlsxRW
oXlsx.m_pTheme = oSaveParams.pTheme;
}
OOX::Spreadsheet::CSharedStrings* pSharedStrings = NULL;
if(-1 != nSharedStringsOffBits)
{
oBufferedStream.Seek(nSharedStringsOffBits);
@ -4526,7 +4525,7 @@ namespace BinXlsxRW
break;
case c_oSerTableTypes::Worksheets:
{
res = BinaryWorksheetsTableReader(oBufferedStream, *oXlsx.m_pWorkbook, pSharedStrings, oXlsx.m_arWorksheets, oXlsx.m_mapWorksheets, mapMedia, sOutDir, sMediaDir, oSaveParams, pOfficeDrawingConverter, m_mapPivotCacheDefinitions).Read();
res = BinaryWorksheetsTableReader(oBufferedStream, *oXlsx.m_pWorkbook, oXlsx.m_pSharedStrings, oXlsx.m_arWorksheets, oXlsx.m_mapWorksheets, mapMedia, sOutDir, sMediaDir, oSaveParams, pOfficeDrawingConverter, m_mapPivotCacheDefinitions).Read();
}
break;
}