Compare commits

..

5 Commits

Author SHA1 Message Date
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
931d6aa17c . 2018-01-20 14:24:40 +03:00
2861539949 . 2018-01-19 19:33:12 +03:00
37 changed files with 556 additions and 313 deletions

View File

@ -146,7 +146,8 @@ namespace BinXlsxRW{
void ChartWriter::toXlsx(OOX::Spreadsheet::CXlsx& oXlsx)
{
std::vector<std::wstring> aSharedStrings;
//Sheet
oXlsx.CreateWorkbook();
oXlsx.m_pWorkbook->m_oSheets.Init();
int nSheetId = 1;

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

@ -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

@ -162,6 +162,7 @@ namespace PPTX
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{
pWriter->StartNode(_T("p:controls"));
pWriter->EndAttributes();
for (size_t i = 0; i < arrControls.size(); ++i)
arrControls[i].toXmlWriter(pWriter);

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

@ -1148,7 +1148,7 @@ namespace PPTX
{
double trim = 0.0;
if (parentFileIs<Slide>())
if (parentFileIs<FileContainer>())
{
if (nvPicPr.nvPr.media.is<MediaFile>())
{
@ -1156,7 +1156,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 +1175,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

@ -153,6 +153,18 @@ namespace PPTX
pReader->Skip(1); // start attributes
while (true)
{
BYTE _at = pReader->GetUChar_TypeNode();
if (_at == NSBinPptxRW::g_nodeAttributeEnd)
break;
switch (_at)
{
default:
break;
}
}
while (pReader->GetPos() < _end_rec)
{
BYTE _at = pReader->GetUChar();
@ -161,12 +173,10 @@ namespace PPTX
case 0:
{
Fill.fromPPTY(pReader);
break;
}
}break;
default:
{
pReader->SkipRecord();
}
}break;
}
}
pReader->Seek(_end_rec);
@ -175,6 +185,7 @@ namespace PPTX
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{
pWriter->StartNode(m_name);
pWriter->EndAttributes();
Fill.toXmlWriter(pWriter);
pWriter->EndNode(m_name);
}
@ -244,6 +255,18 @@ namespace PPTX
pReader->Skip(1); // start attributes
while (true)
{
BYTE _at = pReader->GetUChar_TypeNode();
if (_at == NSBinPptxRW::g_nodeAttributeEnd)
break;
switch (_at)
{
default:
break;
}
}
while (pReader->GetPos() < _end_rec)
{
BYTE _at = pReader->GetUChar();
@ -252,12 +275,10 @@ namespace PPTX
case 0:
{
Color.fromPPTY(pReader);
break;
}
}break;
default:
{
pReader->SkipRecord();
}
}break;
}
}
pReader->Seek(_end_rec);
@ -266,6 +287,7 @@ namespace PPTX
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
{
pWriter->StartNode(L"a:highlight");
pWriter->EndAttributes();
Color.toXmlWriter(pWriter);
pWriter->EndNode(L"a:highlight");
}
@ -479,7 +501,6 @@ namespace PPTX
pWriter->Write(rtl);
pWriter->Write(uFill);
pWriter->Write(uFillTx);
pWriter->Write(uFillTx);
pWriter->Write(highlight);
pWriter->EndNode(m_name);
@ -599,101 +620,82 @@ namespace PPTX
case 0:
{
altLang = pReader->GetString2();
break;
}
}break;
case 1:
{
b = pReader->GetBool();
break;
}
}break;
case 2:
{
baseline = pReader->GetLong();
break;
}
}break;
case 3:
{
bmk = pReader->GetString2();
break;
}
}break;
case 4:
{
cap = new Limit::TextCaps();
cap->SetBYTECode(pReader->GetUChar());
break;
}
}break;
case 5:
{
dirty = pReader->GetBool();
break;
}
}break;
case 6:
{
err = pReader->GetBool();
break;
}
}break;
case 7:
{
i = pReader->GetBool();
break;
}
}break;
case 8:
{
kern = pReader->GetLong();
break;
}
}break;
case 9:
{
kumimoji = pReader->GetBool();
break;
}
}break;
case 10:
{
lang = pReader->GetString2();
break;
}
}break;
case 11:
{
noProof = pReader->GetBool(); // noproof
break;
}
}break;
case 12:
{
normalizeH = pReader->GetBool();
break;
}
}break;
case 13:
{
smtClean = pReader->GetBool();
break;
}
}break;
case 14:
{
smtId = pReader->GetLong();
break;
}
}break;
case 15:
{
spc = pReader->GetLong();
break;
}
}break;
case 16:
{
strike = new Limit::TextStrike();
strike->SetBYTECode(pReader->GetUChar());
break;
}
}break;
case 17:
{
sz = pReader->GetLong();
break;
}
}break;
case 18:
{
u = new Limit::TextUnderline();
u->SetBYTECode(pReader->GetUChar());
break;
}
}break;
default:
break;
}
@ -708,77 +710,69 @@ namespace PPTX
{
ln = new Logic::Ln();
ln->fromPPTY(pReader);
break;
}
}break;
case 1:
{
Fill.fromPPTY(pReader);
break;
}
}break;
case 2:
{
EffectList.fromPPTY(pReader);
break;
}
}break;
case 3:
{
latin = new Logic::TextFont();
latin->m_name = L"a:latin";
latin->fromPPTY(pReader);
break;
}
}break;
case 4:
{
ea = new Logic::TextFont();
ea->m_name = L"a:ea";
ea->fromPPTY(pReader);
break;
}
}break;
case 5:
{
cs = new Logic::TextFont();
cs->m_name = L"a:cs";
cs->fromPPTY(pReader);
break;
}
}break;
case 6:
{
sym = new Logic::TextFont();
sym->m_name = L"a:sym";
sym->fromPPTY(pReader);
break;
}
}break;
case 7:
{
hlinkClick = new Logic::Hyperlink(L"hlinkClick");
hlinkClick->fromPPTY(pReader);
break;
}
hlinkClick->fromPPTY(pReader);
}break;
case 8:
{
hlinkMouseOver = new Logic::Hyperlink(L"hlinkMouseOver");
hlinkMouseOver->fromPPTY(pReader);
}
}break;
case 9:
{
rtl = new Logic::Rtl();
rtl->fromPPTY(pReader);
}
}break;
case 10:
{
uFill = new Logic::UFillTx(L"a:uFill");
uFill->fromPPTY(pReader);
}
}break;
case 11:
{
uFillTx = new Logic::UFillTx(L"a:uFillTx");
uFillTx->fromPPTY(pReader);
}
}break;
case 12:
{
highlight = new Logic::Highlight();
highlight->fromPPTY(pReader);
}
}break;
default:
{
pReader->SkipRecord();

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

@ -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

@ -7,7 +7,7 @@
QT -= core
QT -= gui
VERSION = 2.4.508.0
VERSION = 2.4.509.0
DEFINES += INTVER=$$VERSION
TARGET = x2t