mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
Compare commits
30 Commits
v5.1.99.71
...
core-linux
| Author | SHA1 | Date | |
|---|---|---|---|
| dafcbacfaf | |||
| 1c73ff0c3f | |||
| 5a8c9069be | |||
| 4ba2e1fa6d | |||
| 95af281145 | |||
| 00fb2ba7bb | |||
| 0f65e36517 | |||
| aa1af73fda | |||
| 1610978821 | |||
| 20faf24556 | |||
| ae90e4ae96 | |||
| 6fae9115ea | |||
| c14a21b2da | |||
| b952692225 | |||
| 23249e69f9 | |||
| 09f6c3f4e8 | |||
| 111ceff368 | |||
| 867b0634f3 | |||
| f9c27275a7 | |||
| dd12ee0b9e | |||
| de83971832 | |||
| 0d158e46b5 | |||
| dde6b8bdc7 | |||
| b66bb0d63f | |||
| d666da2697 | |||
| 8e35f9b063 | |||
| 97ff1efba8 | |||
| 50ff5fc0b2 | |||
| 1c2b86519e | |||
| 323d1b44cd |
@ -1877,25 +1877,22 @@ public:
|
||||
sRes += L"\"";
|
||||
}
|
||||
sRes += L">";
|
||||
if(false == pComment->Text.empty())
|
||||
std::wstring sText = pComment->Text;
|
||||
|
||||
XmlUtils::replace_all(sText, L"\r", L"");
|
||||
|
||||
bool bFirst = true;
|
||||
int nPrevIndex = 0;
|
||||
for (int i = 0; i < (int)sText.length(); i++)
|
||||
{
|
||||
std::wstring sText = pComment->Text;
|
||||
|
||||
XmlUtils::replace_all(sText, L"\r", L"");
|
||||
|
||||
bool bFirst = true;
|
||||
int nPrevIndex = 0;
|
||||
for (int i = 0; i < (int)sText.length(); i++)
|
||||
wchar_t cToken = sText[i];
|
||||
if('\n' == cToken)
|
||||
{
|
||||
wchar_t cToken = sText[i];
|
||||
if('\n' == cToken)
|
||||
{
|
||||
bFirst = writeContentWritePart(pComment, sText, nPrevIndex, i, bFirst, sRes);
|
||||
nPrevIndex = i + 1;
|
||||
}
|
||||
bFirst = writeContentWritePart(pComment, sText, nPrevIndex, i, bFirst, sRes);
|
||||
nPrevIndex = i + 1;
|
||||
}
|
||||
writeContentWritePart(pComment, sText, nPrevIndex, (int)sText.length(), bFirst, sRes);
|
||||
}
|
||||
writeContentWritePart(pComment, sText, nPrevIndex, (int)sText.length(), bFirst, sRes);
|
||||
sRes += L"</w:comment>";
|
||||
return sRes;
|
||||
}
|
||||
|
||||
@ -39,10 +39,9 @@
|
||||
namespace cpdoccore {
|
||||
namespace oox {
|
||||
|
||||
/**/
|
||||
|
||||
docx_table_state::docx_table_state(docx_conversion_context & Context,
|
||||
const std::wstring & StyleName) : context_(Context),
|
||||
docx_table_state::docx_table_state(docx_conversion_context & Context, const std::wstring & StyleName) :
|
||||
context_(Context),
|
||||
table_style_(StyleName),
|
||||
current_table_column_(-1),
|
||||
columns_spanned_num_(0),
|
||||
@ -93,6 +92,19 @@ std::wstring docx_table_state::current_row_style() const
|
||||
return L"";
|
||||
}
|
||||
|
||||
double docx_table_state::get_current_cell_width()
|
||||
{
|
||||
if (current_table_column_ < columns_width_.size())
|
||||
return columns_width_[current_table_column_];
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
void docx_table_state::add_column_width(double width)
|
||||
{
|
||||
columns_width_.push_back(width);
|
||||
}
|
||||
|
||||
void docx_table_state::start_cell()
|
||||
{
|
||||
current_table_column_++;
|
||||
@ -102,7 +114,6 @@ void docx_table_state::start_cell()
|
||||
|
||||
void docx_table_state::end_cell()
|
||||
{}
|
||||
|
||||
bool docx_table_state::start_covered_cell(docx_conversion_context & Context)
|
||||
{
|
||||
std::wostream & _Wostream = context_.output_stream();
|
||||
|
||||
@ -70,6 +70,8 @@ public:
|
||||
void set_rows_spanned(unsigned int Column, unsigned int Val, unsigned int ColumnsSpanned, const std::wstring & Style);
|
||||
unsigned int current_rows_spanned(unsigned int Column) const;
|
||||
|
||||
double get_current_cell_width();
|
||||
void add_column_width(double width);
|
||||
private:
|
||||
docx_conversion_context & context_;
|
||||
std::wstring table_style_;
|
||||
@ -81,7 +83,8 @@ private:
|
||||
std::vector<table_row_spanned> rows_spanned_;
|
||||
bool close_table_covered_cell_;
|
||||
std::vector<unsigned int> columns_;
|
||||
std::vector<std::wstring> columnsDefaultCellStyleName_;
|
||||
std::vector<double> columns_width_;
|
||||
std::vector<std::wstring> columnsDefaultCellStyleName_;
|
||||
|
||||
};
|
||||
|
||||
@ -135,6 +138,14 @@ public:
|
||||
{
|
||||
return table_states_.back().start_cell();
|
||||
}
|
||||
double get_current_cell_width()
|
||||
{
|
||||
return table_states_.back().get_current_cell_width();
|
||||
}
|
||||
void add_column_width(double width)
|
||||
{
|
||||
table_states_.back().add_column_width(width);
|
||||
}
|
||||
|
||||
void end_cell()
|
||||
{
|
||||
|
||||
@ -56,6 +56,39 @@ std::wostream & operator << (std::wostream & _Wostream, const style_numformat &
|
||||
case style_numformat::alphaLc:
|
||||
_Wostream << L"a";
|
||||
break;
|
||||
case style_numformat::aiueo:
|
||||
_Wostream << L"ア, イ, ウ, ...";
|
||||
break;
|
||||
case style_numformat::chineseCounting:
|
||||
_Wostream << L"イ, ロ, ハ, ...";
|
||||
break;
|
||||
case style_numformat::chineseLegal:
|
||||
_Wostream << L"一, 二, 三, ...";
|
||||
break;
|
||||
case style_numformat::ideographLegal:
|
||||
_Wostream << L"壹, 貳, 參, ...";
|
||||
break;
|
||||
case style_numformat::ideographTraditional:
|
||||
_Wostream << L"甲, 乙, 丙, ...";
|
||||
break;
|
||||
case style_numformat::ideographZodiac:
|
||||
_Wostream << L"子, 丑, 寅, ...";
|
||||
break;
|
||||
case style_numformat::ideographZodiacTraditional:
|
||||
_Wostream << L"甲子, 乙丑, 丙寅, ...";
|
||||
break;
|
||||
case style_numformat::iroha:
|
||||
_Wostream << L"イ, ロ, ハ, ...";
|
||||
break;
|
||||
case style_numformat::koreanDigital:
|
||||
_Wostream << L"일, 이, 삼, ...";
|
||||
break;
|
||||
case style_numformat::russianLo:
|
||||
_Wostream << L"А, Б, .., Аа, Аб, ... (ru)";
|
||||
break;
|
||||
case style_numformat::russianUp:
|
||||
_Wostream << L"А, Б, .., Аа, Аб, ... (ru)";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -77,7 +110,28 @@ style_numformat style_numformat::parse(const std::wstring & Str)
|
||||
return style_numformat( alphaUc );
|
||||
else if (tmp == L"a")
|
||||
return style_numformat( alphaLc );
|
||||
else
|
||||
else if (tmp == L"А, Б, .., Аа, Аб, ... (ru)")
|
||||
return style_numformat( russianUp );
|
||||
else if (tmp == L"일, 이, 삼, ...")
|
||||
return style_numformat( koreanDigital );
|
||||
else if (tmp == L"イ, ロ, ハ, ...")
|
||||
return style_numformat( iroha );
|
||||
else if (tmp == L"甲, 乙, 丙, ...")
|
||||
return style_numformat( ideographTraditional );
|
||||
else if (tmp == L"甲子, 乙丑, 丙寅, ...")
|
||||
return style_numformat( ideographZodiacTraditional );
|
||||
else if (tmp == L"子, 丑, 寅, ...")
|
||||
return style_numformat( ideographZodiac );
|
||||
else if (tmp == L"壹, 貳, 參, ...")
|
||||
return style_numformat( ideographLegal );
|
||||
else if (tmp == L"一, 二, 三, ...")
|
||||
return style_numformat( chineseLegal );
|
||||
else if (tmp == L"イ, ロ, ハ, ...")
|
||||
return style_numformat( chineseCounting );
|
||||
else if (tmp == L"ア, イ, ウ, ...")
|
||||
return style_numformat( aiueo );
|
||||
|
||||
else
|
||||
{
|
||||
return style_numformat( arabic );
|
||||
}
|
||||
|
||||
@ -52,7 +52,18 @@ public:
|
||||
romanUc,
|
||||
romanLc,
|
||||
alphaUc,
|
||||
alphaLc
|
||||
alphaLc,
|
||||
aiueo,
|
||||
chineseCounting,
|
||||
chineseLegal,
|
||||
ideographLegal,
|
||||
ideographTraditional,
|
||||
ideographZodiac,
|
||||
ideographZodiacTraditional,
|
||||
iroha,
|
||||
koreanDigital,
|
||||
russianLo,
|
||||
russianUp
|
||||
};
|
||||
|
||||
style_numformat() {}
|
||||
|
||||
@ -594,7 +594,8 @@ void a::docx_convert(oox::docx_conversion_context & Context)
|
||||
}
|
||||
|
||||
style_instance * styleInst = NULL;
|
||||
|
||||
style_text_properties_ptr tempStyleTextProp;
|
||||
|
||||
if (!text_style_name_.empty())
|
||||
styleInst = Context.root()->odf_context().styleContainer().style_by_name(text_style_name_, style_family::Text, Context.process_headers_footers_);
|
||||
else if (false == Context.is_table_content())
|
||||
@ -616,8 +617,6 @@ void a::docx_convert(oox::docx_conversion_context & Context)
|
||||
}
|
||||
else
|
||||
{
|
||||
style_text_properties_ptr tempStyleTextProp;
|
||||
|
||||
const std::wstring id = Context.styles_map_.get( styleInst->name(), styleInst->type() );
|
||||
tempStyleTextProp = style_text_properties_ptr( new style_text_properties(id) );
|
||||
Context.push_text_properties( tempStyleTextProp.get() );
|
||||
|
||||
@ -207,10 +207,9 @@ void style_table_column_properties::docx_convert(oox::docx_conversion_context &
|
||||
{
|
||||
std::wostream & strm = Context.output_stream();
|
||||
|
||||
|
||||
if (attlist_.style_column_width_)
|
||||
{
|
||||
double kf_max_width_ms =1.;
|
||||
double kf_max_width_ms = 1.;
|
||||
|
||||
const page_layout_instance * pp = Context.root()->odf_context().pageLayoutContainer().page_layout_first();//
|
||||
if ((pp) && (pp->properties()))
|
||||
@ -226,17 +225,15 @@ void style_table_column_properties::docx_convert(oox::docx_conversion_context &
|
||||
|
||||
int val = attlist_.style_column_width_->get_value_unit(length::pt);
|
||||
|
||||
double width = 0.5 + 20.0 * val * kf_max_width_ms;
|
||||
|
||||
//_CP_OPT(int) iUnormalWidth;
|
||||
//if (odf_reader::GetProperty(Context.get_settings_properties(),L"UnormalWidthPage",iUnormalWidth))
|
||||
{
|
||||
//kf_max_width_ms = 31680./iUnormalWidth.get();//эквивалент 22"
|
||||
}
|
||||
|
||||
|
||||
strm << L"<w:gridCol w:w=\"" <<
|
||||
(int)(0.5 + 20.0 * val * kf_max_width_ms) << "\"/>";
|
||||
Context.get_table_context().add_column_width(width);
|
||||
strm << L"<w:gridCol w:w=\"" << (int)(width) << "\"/>";
|
||||
}
|
||||
else
|
||||
{
|
||||
Context.get_table_context().add_column_width(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -244,7 +241,6 @@ void style_table_column_properties::pptx_convert(oox::pptx_conversion_context &
|
||||
{
|
||||
std::wostream & strm = Context.get_table_context().tableData();
|
||||
|
||||
|
||||
if (attlist_.style_column_width_)
|
||||
{
|
||||
int val = attlist_.style_column_width_->get_value_unit(length::emu);
|
||||
|
||||
@ -345,13 +345,13 @@ void text_list_level_style_number::docx_convert(oox::docx_conversion_context & C
|
||||
{
|
||||
switch(text_list_level_style_number_attr_.common_num_format_attlist_.style_num_format_->get_type())
|
||||
{
|
||||
case odf_types::style_numformat::romanUc: num_format= L"romanUc"; break;
|
||||
case odf_types::style_numformat::romanLc: num_format= L"romanLc"; break;
|
||||
case odf_types::style_numformat::alphaUc: num_format= L"alphaUc"; break;
|
||||
case odf_types::style_numformat::alphaLc: num_format= L"alphaLc"; break;
|
||||
case odf_types::style_numformat::romanUc: num_format= L"upperRoman"; break;
|
||||
case odf_types::style_numformat::romanLc: num_format= L"lowerRoman"; break;
|
||||
case odf_types::style_numformat::alphaUc: num_format= L"upperLetter"; break;
|
||||
case odf_types::style_numformat::alphaLc: num_format= L"lowerLetter"; break;
|
||||
case odf_types::style_numformat::arabic:
|
||||
default:
|
||||
num_format= L"arabic"; break;
|
||||
num_format= L"decimal"; break;
|
||||
}
|
||||
}
|
||||
CP_XML_ATTR(L"w:val", num_format);
|
||||
|
||||
@ -238,16 +238,24 @@ void table_table_column::docx_convert(oox::docx_conversion_context & Context)
|
||||
|
||||
for (unsigned int i = 0; i < columnsRepeated; ++i)
|
||||
{
|
||||
bool bAddWidth = false;
|
||||
if (table_table_column_attlist_.table_style_name_)
|
||||
{
|
||||
const std::wstring colStyleName = table_table_column_attlist_.table_style_name_.get();
|
||||
if (style_instance * inst =
|
||||
Context.root()->odf_context().styleContainer().style_by_name( colStyleName , style_family::TableColumn,Context.process_headers_footers_ ))
|
||||
Context.root()->odf_context().styleContainer().style_by_name( colStyleName , style_family::TableColumn, Context.process_headers_footers_ ))
|
||||
{
|
||||
if (inst->content())
|
||||
{
|
||||
inst->content()->docx_convert(Context);
|
||||
bAddWidth = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (false == bAddWidth)
|
||||
{
|
||||
Context.get_table_context().add_column_width(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -266,22 +274,27 @@ void table_table_cell::docx_convert(oox::docx_conversion_context & Context)
|
||||
_Wostream << L"<w:tcPr>";
|
||||
|
||||
const std::wstring styleName = attlist_.table_style_name_.get_value_or(L"");
|
||||
|
||||
//_Wostream << L"<w:tcW w:w=\"0\" w:type=\"auto\" />";
|
||||
|
||||
if (attlist_extra_.table_number_rows_spanned_ > 1)
|
||||
{
|
||||
_Wostream << L"<w:vMerge w:val=\"restart\" />";
|
||||
_Wostream << L"<w:vMerge w:val=\"restart\"/>";
|
||||
Context.get_table_context().set_rows_spanned(Context.get_table_context().current_column(),
|
||||
attlist_extra_.table_number_rows_spanned_ - 1,
|
||||
attlist_extra_.table_number_columns_spanned_ - 1,
|
||||
styleName
|
||||
);
|
||||
}
|
||||
|
||||
double width = Context.get_table_context().get_current_cell_width();
|
||||
|
||||
if (width > 0.01)
|
||||
{
|
||||
_Wostream << L"<w:tcW w:w=\"" << (int)width << L"\" w:type=\"dxa\"/>";
|
||||
}
|
||||
|
||||
if (attlist_extra_.table_number_columns_spanned_ > 1)
|
||||
{
|
||||
_Wostream << L"<w:gridSpan w:val=\"" << attlist_extra_.table_number_columns_spanned_ << "\" />";
|
||||
_Wostream << L"<w:gridSpan w:val=\"" << attlist_extra_.table_number_columns_spanned_ << "\"/>";
|
||||
Context.get_table_context().set_columns_spanned(attlist_extra_.table_number_columns_spanned_ - 1);
|
||||
}
|
||||
|
||||
@ -324,8 +337,7 @@ void table_table_cell::docx_convert(oox::docx_conversion_context & Context)
|
||||
|
||||
/// Стиль по умолчанию для данной строки
|
||||
{
|
||||
const std::wstring & defaultCellStyle =
|
||||
Context.get_table_context().get_default_cell_style_row();
|
||||
const std::wstring & defaultCellStyle = Context.get_table_context().get_default_cell_style_row();
|
||||
|
||||
if (const style_instance * inst =
|
||||
Context.root()->odf_context().styleContainer().style_by_name(defaultCellStyle, style_family::TableCell,Context.process_headers_footers_))
|
||||
|
||||
@ -99,6 +99,7 @@ namespace
|
||||
case XmlUtils::XmlNodeType_DocumentType:
|
||||
return typeDocumentType;
|
||||
case XmlUtils::XmlNodeType_Whitespace:
|
||||
case XmlUtils::XmlNodeType_SIGNIFICANT_WHITESPACE:
|
||||
return typeWhitespace;
|
||||
case XmlUtils::XmlNodeType_EndElement:
|
||||
return typeEndElement;
|
||||
|
||||
@ -250,13 +250,13 @@ int odf_lists_styles_context::start_style_level(int level, int type)
|
||||
int odf_type =1;
|
||||
int format_type = -1;
|
||||
|
||||
std::wstring num_format = L"1";
|
||||
style_numformat num_format;
|
||||
bool sync_letter = false;
|
||||
switch(type)
|
||||
{
|
||||
case 0: //numberformatAiueo :
|
||||
case 1: //numberformatAiueoFullWidth :
|
||||
num_format = L"ア, イ, ウ, ...";
|
||||
num_format = style_numformat(style_numformat::aiueo);
|
||||
break;
|
||||
case 2: //numberformatArabicAbjad :
|
||||
break;
|
||||
@ -272,19 +272,19 @@ int odf_lists_styles_context::start_style_level(int level, int type)
|
||||
case 7: //numberformatChicago :
|
||||
break;
|
||||
case 8: //numberformatChineseCounting :
|
||||
num_format = L"イ, ロ, ハ, ...";
|
||||
num_format = style_numformat(style_numformat::chineseCounting);
|
||||
break;
|
||||
case 9: //numberformatChineseCountingThousand :
|
||||
break;
|
||||
case 10: //numberformatChineseLegalSimplified :
|
||||
num_format = L"一, 二, 三, ...";
|
||||
num_format = style_numformat(style_numformat::chineseLegal);
|
||||
break;
|
||||
case 11: //numberformatChosung :
|
||||
break;
|
||||
case 12: //numberformatCustom :
|
||||
break;
|
||||
case 13: //numberformatDecimal :
|
||||
num_format = L"1";
|
||||
num_format = style_numformat(style_numformat::arabic);
|
||||
break;
|
||||
case 14: //numberformatDecimalEnclosedCircle :
|
||||
break;
|
||||
@ -326,19 +326,19 @@ int odf_lists_styles_context::start_style_level(int level, int type)
|
||||
case 32: //numberformatIdeographEnclosedCircle :
|
||||
break;
|
||||
case 33: //numberformatIdeographLegalTraditional :
|
||||
num_format = L"壹, 貳, 參, ...";
|
||||
num_format = style_numformat(style_numformat::ideographLegal);
|
||||
break;
|
||||
case 34: //numberformatIdeographTraditional :
|
||||
num_format = L"甲, 乙, 丙, ...";
|
||||
num_format = style_numformat(style_numformat::ideographTraditional);
|
||||
break;
|
||||
case 35: //numberformatIdeographZodiac :
|
||||
num_format = L"子, 丑, 寅, ...";
|
||||
num_format = style_numformat(style_numformat::ideographZodiac);
|
||||
break;
|
||||
case 36: //numberformatIdeographZodiacTraditional :
|
||||
num_format = L"甲子, 乙丑, 丙寅, ...";
|
||||
num_format = style_numformat(style_numformat::ideographZodiacTraditional);
|
||||
break;
|
||||
case 37: //numberformatIroha :
|
||||
num_format = L"イ, ロ, ハ, ...";
|
||||
num_format = style_numformat(style_numformat::iroha);
|
||||
break;
|
||||
case 38: //numberformatIrohaFullWidth :
|
||||
break;
|
||||
@ -350,21 +350,21 @@ int odf_lists_styles_context::start_style_level(int level, int type)
|
||||
break;
|
||||
case 42: //numberformatKoreanCounting :
|
||||
case 43: //numberformatKoreanDigital :
|
||||
num_format = L"일, 이, 삼, ...";
|
||||
num_format = style_numformat(style_numformat::koreanDigital);
|
||||
break;
|
||||
case 44: //numberformatKoreanDigital2 :
|
||||
break;
|
||||
case 45: //numberformatKoreanLegal :
|
||||
break;
|
||||
case 46: //numberformatLowerLetter
|
||||
num_format = L"a";
|
||||
num_format = style_numformat(style_numformat::alphaLc);
|
||||
sync_letter = true;
|
||||
break;
|
||||
case 47: //numberformatLowerRoman :
|
||||
num_format = L"i";
|
||||
num_format = style_numformat(style_numformat::romanLc);
|
||||
break;
|
||||
case 48: //numberformatNone :
|
||||
num_format = L"";
|
||||
//num_format = L"";
|
||||
break;
|
||||
case 49: //numberformatNumberInDash : //??
|
||||
//suffix -
|
||||
@ -375,11 +375,11 @@ int odf_lists_styles_context::start_style_level(int level, int type)
|
||||
case 51: //numberformatOrdinalText :
|
||||
break;
|
||||
case 52: //numberformatRussianLower :
|
||||
num_format = L"А, Б, .., Аа, Аб, ... (ru)";
|
||||
num_format = style_numformat(style_numformat::russianLo);
|
||||
sync_letter = true;
|
||||
break;
|
||||
case 53: //numberformatRussianUpper :
|
||||
num_format = L"А, Б, .., Аа, Аб, ... (ru)";
|
||||
num_format = style_numformat(style_numformat::russianUp);
|
||||
sync_letter = true;
|
||||
break;
|
||||
case 54: //numberformatTaiwaneseCounting :
|
||||
@ -395,11 +395,11 @@ int odf_lists_styles_context::start_style_level(int level, int type)
|
||||
case 59: //numberformatThaiNumbers :
|
||||
break;
|
||||
case 60: //numberformatUpperLetter :
|
||||
num_format = L"A";
|
||||
num_format = style_numformat(style_numformat::alphaUc);
|
||||
sync_letter = true;
|
||||
break;
|
||||
case 61: //numberformatUpperRoman :
|
||||
num_format = L"I";
|
||||
num_format = style_numformat(style_numformat::romanUc);
|
||||
break;
|
||||
case 62: //numberformatVietnameseCounting :
|
||||
break;
|
||||
|
||||
@ -537,7 +537,7 @@ void odf_page_layout_context::set_page_number_format(_CP_OPT(int) & type, _CP_OP
|
||||
case 34: break; //numberformatIdeographTraditional = 34,
|
||||
case 35: break; //numberformatIdeographZodiac = 35,
|
||||
case 36: break; //numberformatIdeographZodiacTraditional = 36,
|
||||
case 37: break; //numberformatIroha = 37,
|
||||
case 37: layout_state_list_.back().page_number_format = style_numformat(style_numformat::iroha); break;
|
||||
case 38: break; //numberformatIrohaFullWidth = 38,
|
||||
case 39: break; //numberformatJapaneseCounting = 39,
|
||||
case 40: break; //numberformatJapaneseDigitalTenThousand = 40,
|
||||
@ -546,26 +546,27 @@ void odf_page_layout_context::set_page_number_format(_CP_OPT(int) & type, _CP_OP
|
||||
case 43: break; //numberformatKoreanDigital = 43,
|
||||
case 44: break; //numberformatKoreanDigital2 = 44,
|
||||
case 45: break; //numberformatKoreanLegal = 45,
|
||||
case 46: layout_state_list_.back().page_number_format = L"a"; break; //numberformatLowerLetter = 46,
|
||||
case 47: layout_state_list_.back().page_number_format = L"i"; break; //numberformatLowerRoman = 47,
|
||||
case 46: layout_state_list_.back().page_number_format = style_numformat(style_numformat::alphaLc); break; //numberformatLowerLetter = 46,
|
||||
case 47: layout_state_list_.back().page_number_format = style_numformat(style_numformat::romanLc); break; //numberformatLowerRoman = 47,
|
||||
case 48: break; //numberformatNone = 48,
|
||||
case 49: break; //numberformatnumberInDash = 49,
|
||||
case 50: break; //numberformatOrdinal = 50,
|
||||
case 51: break; //numberformatOrdinalText = 51,
|
||||
case 52: break; //numberformatRussianLower = 52,
|
||||
case 53: break; //numberformatRussianUpper = 53,
|
||||
case 52: layout_state_list_.back().page_number_format = style_numformat(style_numformat::russianUp); break;
|
||||
case 53: layout_state_list_.back().page_number_format = style_numformat(style_numformat::russianLo); break;
|
||||
|
||||
case 54: break; //numberformatTaiwaneseCounting = 54,
|
||||
case 55: break; //numberformatTaiwaneseCountingThousand = 55,
|
||||
case 56: break; //numberformatTaiwaneseDigital = 56,
|
||||
case 57: break; //numberformatThaiCounting = 57,
|
||||
case 58: break; //numberformatThaiLetters = 58,
|
||||
case 59: break; //numberformatThainumbers = 59,
|
||||
case 60: layout_state_list_.back().page_number_format = L"A"; break; //numberformatUpperLetter = 60,
|
||||
case 61: layout_state_list_.back().page_number_format = L"I"; break; //numberformatUpperRoman = 61,
|
||||
case 60: layout_state_list_.back().page_number_format = style_numformat(style_numformat::alphaUc); break; //numberformatUpperLetter = 60,
|
||||
case 61: layout_state_list_.back().page_number_format = style_numformat(style_numformat::romanUc); break; //numberformatUpperRoman = 61,
|
||||
case 62: break; //numberformatVietnameseCounting = 62
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}//todooo
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -37,6 +37,7 @@
|
||||
#include "office_elements_create.h"
|
||||
|
||||
#include "length.h"
|
||||
#include "stylenumformat.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace odf_writer {
|
||||
@ -106,7 +107,7 @@ public:
|
||||
_CP_OPT(odf_types::length) header_size_;
|
||||
_CP_OPT(odf_types::length) footer_size_;
|
||||
|
||||
_CP_OPT(std::wstring) page_number_format;
|
||||
_CP_OPT(odf_types::style_numformat) page_number_format;
|
||||
|
||||
private:
|
||||
std::wstring style_oox_name_;
|
||||
|
||||
@ -3590,28 +3590,28 @@ void DocxConverter::convert_comment(int oox_comm_id)
|
||||
{
|
||||
if (!docx_document->m_pComments)return;
|
||||
|
||||
for (size_t comm = 0 ; comm < docx_document->m_pComments->m_arrComments.size(); comm++)
|
||||
{
|
||||
OOX::CComment* oox_comment = docx_document->m_pComments->m_arrComments[comm];
|
||||
|
||||
if (oox_comment == NULL) continue;
|
||||
if (oox_comment->m_oId.IsInit() == false) continue;
|
||||
|
||||
if (oox_comment->m_oId->GetValue() == oox_comm_id)
|
||||
{
|
||||
odt_context->start_comment_content();
|
||||
{
|
||||
if (oox_comment->m_oAuthor.IsInit()) odt_context->comment_context()->set_author (*oox_comment->m_oAuthor);
|
||||
if (oox_comment->m_oDate.IsInit()) odt_context->comment_context()->set_date (oox_comment->m_oDate->GetValue());
|
||||
if (oox_comment->m_oInitials.IsInit()) {}
|
||||
std::map<int, int>::iterator pFind = docx_document->m_pComments->m_mapComments.find(oox_comm_id);
|
||||
|
||||
for (std::vector<OOX::WritingElement*>::iterator it = oox_comment->m_arrItems.begin(); it != oox_comment->m_arrItems.end(); ++it)
|
||||
{
|
||||
convert(*it);
|
||||
}
|
||||
if (pFind == docx_document->m_pComments->m_mapComments.end()) return;
|
||||
|
||||
if ( pFind->second < docx_document->m_pComments->m_arrComments.size() && pFind->second >= 0)
|
||||
{
|
||||
OOX::CComment* oox_comment = docx_document->m_pComments->m_arrComments[pFind->second];
|
||||
|
||||
if (oox_comment == NULL) return;
|
||||
|
||||
odt_context->start_comment_content();
|
||||
{
|
||||
if (oox_comment->m_oAuthor.IsInit()) odt_context->comment_context()->set_author (*oox_comment->m_oAuthor);
|
||||
if (oox_comment->m_oDate.IsInit()) odt_context->comment_context()->set_date (oox_comment->m_oDate->GetValue());
|
||||
if (oox_comment->m_oInitials.IsInit()) {}
|
||||
|
||||
for (std::vector<OOX::WritingElement*>::iterator it = oox_comment->m_arrItems.begin(); it != oox_comment->m_arrItems.end(); ++it)
|
||||
{
|
||||
convert(*it);
|
||||
}
|
||||
odt_context->end_comment_content();
|
||||
}
|
||||
odt_context->end_comment_content();
|
||||
}
|
||||
}
|
||||
void DocxConverter::convert_footnote(int oox_ref_id)
|
||||
|
||||
@ -163,78 +163,64 @@ namespace PPTX
|
||||
|
||||
COfficeFileFormatChecker office_checker;
|
||||
office_checker.isOOXFormatFile(oox_file.GetPath());
|
||||
//if ( std::wstring::npos != sProgID.find(L"Word.Document"))
|
||||
//-----------------------------------------------------------------------------------------
|
||||
DocWrapper::FontProcessor oFontProcessor;
|
||||
NSBinPptxRW::CDrawingConverter oDrawingConverter;
|
||||
|
||||
NSCommon::smart_ptr<OOX::IFileContainer> old_rels = *pWriter->m_pCurrentContainer;
|
||||
NSCommon::smart_ptr<PPTX::Theme> old_theme = *pWriter->m_pTheme;
|
||||
|
||||
NSShapeImageGen::CMediaManager* old_manager = oDrawingConverter.m_pBinaryWriter->m_pCommon->m_pMediaManager;
|
||||
oDrawingConverter.m_pBinaryWriter->m_pCommon->m_pMediaManager = pWriter->m_pCommon->m_pMediaManager;
|
||||
|
||||
oDrawingConverter.SetFontPicker(pWriter->m_pCommon->m_pFontPicker);
|
||||
|
||||
int type = 0;
|
||||
if (office_checker.nFileType == AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCX ||
|
||||
office_checker.nFileType == AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCM )
|
||||
{
|
||||
pWriter->StartRecord(1);
|
||||
pWriter->WriteBYTE(1);
|
||||
pWriter->EndRecord();
|
||||
|
||||
DocWrapper::FontProcessor oFontProcessor;
|
||||
NSBinPptxRW::CDrawingConverter oDrawingConverter;
|
||||
BinDocxRW::CDocxSerializer oDocxSerializer;
|
||||
|
||||
NSBinPptxRW::CBinaryFileWriter* old_writer = oDrawingConverter.m_pBinaryWriter;
|
||||
NSCommon::smart_ptr<OOX::IFileContainer> old_rels = *pWriter->m_pCurrentContainer;
|
||||
BinDocxRW::CDocxSerializer* old_serial = pWriter->m_pMainDocument;
|
||||
NSCommon::smart_ptr<PPTX::Theme> old_theme = *pWriter->m_pTheme;
|
||||
|
||||
oDrawingConverter.m_pBinaryWriter = pWriter;
|
||||
oDocxSerializer.m_pParamsWriter = new BinDocxRW::ParamsWriter(pWriter, &oFontProcessor, &oDrawingConverter, NULL);
|
||||
|
||||
pWriter->m_pMainDocument = &oDocxSerializer;
|
||||
type = 1;
|
||||
BinDocxRW::CDocxSerializer* old_serializer = pWriter->m_pMainDocument;
|
||||
|
||||
BinDocxRW::CDocxSerializer oDocxSerializer;
|
||||
oDrawingConverter.m_pBinaryWriter->m_pMainDocument = &oDocxSerializer;
|
||||
oDocxSerializer.m_pParamsWriter = new BinDocxRW::ParamsWriter(oDrawingConverter.m_pBinaryWriter, &oFontProcessor, &oDrawingConverter, NULL);
|
||||
|
||||
BinDocxRW::BinaryFileWriter oBinaryFileWriter(*oDocxSerializer.m_pParamsWriter);
|
||||
|
||||
pWriter->StartRecord(2);
|
||||
oBinaryFileWriter.intoBindoc(oox_unpacked.GetPath());
|
||||
pWriter->EndRecord();
|
||||
|
||||
oDrawingConverter.m_pBinaryWriter = old_writer;
|
||||
*pWriter->m_pCurrentContainer = old_rels;
|
||||
pWriter->m_pMainDocument = old_serial;
|
||||
*pWriter->m_pTheme = old_theme;
|
||||
oBinaryFileWriter.intoBindoc(oox_unpacked.GetPath());
|
||||
|
||||
pWriter->m_pMainDocument = old_serializer;
|
||||
}
|
||||
else if (office_checker.nFileType == AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSX ||
|
||||
office_checker.nFileType == AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSM)
|
||||
//if ( std::wstring::npos != sProgID.find(L"Excel.Sheet")) //"ET.Xlsx.6" !!!
|
||||
{
|
||||
pWriter->StartRecord(1);
|
||||
pWriter->WriteBYTE(2);
|
||||
pWriter->EndRecord();
|
||||
|
||||
DocWrapper::FontProcessor fp;
|
||||
NSBinPptxRW::CDrawingConverter oDrawingConverter;
|
||||
type = 2;
|
||||
|
||||
NSBinPptxRW::CBinaryFileWriter* old_writer = oDrawingConverter.m_pBinaryWriter;
|
||||
NSCommon::smart_ptr<OOX::IFileContainer> old_rels = *pWriter->m_pCurrentContainer;
|
||||
NSCommon::smart_ptr<PPTX::Theme> old_theme = *pWriter->m_pTheme;
|
||||
|
||||
oDrawingConverter.m_pBinaryWriter = pWriter;
|
||||
|
||||
BinXlsxRW::BinaryFileWriter xlsxBinaryWriter(fp);
|
||||
BinXlsxRW::BinaryFileWriter xlsxBinaryWriter(oFontProcessor);
|
||||
OOX::Spreadsheet::CXlsx oXlsxEmbedded(oox_unpacked);
|
||||
|
||||
pWriter->StartRecord(2);
|
||||
xlsxBinaryWriter.intoBindoc(oXlsxEmbedded, *pWriter , NULL, &oDrawingConverter);
|
||||
pWriter->EndRecord();
|
||||
|
||||
oDrawingConverter.m_pBinaryWriter = old_writer;
|
||||
*pWriter->m_pCurrentContainer = old_rels;
|
||||
*pWriter->m_pTheme = old_theme;
|
||||
xlsxBinaryWriter.intoBindoc(oXlsxEmbedded, *oDrawingConverter.m_pBinaryWriter , NULL, &oDrawingConverter);
|
||||
}
|
||||
//else if (office_checker.nFileType == AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTX)
|
||||
//{
|
||||
//}
|
||||
else
|
||||
{//unknown ms package
|
||||
pWriter->StartRecord(1);
|
||||
pWriter->WriteBYTE(0);
|
||||
pWriter->EndRecord();
|
||||
|
||||
pWriter->WriteString1(2, ole_file->filename().GetFilename());
|
||||
oDrawingConverter.m_pBinaryWriter->WriteString1(2, ole_file->filename().GetFilename());
|
||||
}
|
||||
*pWriter->m_pCurrentContainer = old_rels;
|
||||
*pWriter->m_pTheme = old_theme;
|
||||
oDrawingConverter.m_pBinaryWriter->m_pCommon->m_pMediaManager = old_manager;
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
pWriter->StartRecord(1);
|
||||
pWriter->WriteBYTE(type);
|
||||
pWriter->EndRecord();
|
||||
|
||||
pWriter->StartRecord(2);
|
||||
pWriter->WriteBYTEArray(oDrawingConverter.m_pBinaryWriter->GetBuffer(), oDrawingConverter.m_pBinaryWriter->GetPosition());
|
||||
pWriter->EndRecord();
|
||||
|
||||
NSDirectory::DeleteDirectory(oox_unpacked.GetPath());
|
||||
}
|
||||
else if ( std::wstring::npos != sProgID.find(L"Equation"))
|
||||
@ -359,14 +345,8 @@ namespace PPTX
|
||||
|
||||
std::wstring sThemePath, sMediaPath, sEmbedPath;
|
||||
oDocxSerializer.CreateDocxFolders (sDstEmbeddedTemp, sThemePath, sMediaPath, sEmbedPath);
|
||||
|
||||
NSBinPptxRW::CBinaryFileReader* old_reader = oDrawingConverter.m_pReader;
|
||||
NSBinPptxRW::CRelsGenerator* old_rels = pReader->m_pRels;
|
||||
|
||||
//m_mapEnumeratedGlobal.clear();
|
||||
|
||||
oDrawingConverter.m_pReader = pReader;
|
||||
pReader->m_pRels = new NSBinPptxRW::CRelsGenerator();
|
||||
oDrawingConverter.m_pReader->Init(pReader->GetData() + pReader->GetPos(), 0, _embed_data_size);
|
||||
|
||||
oDrawingConverter.SetMainDocument(&oDocxSerializer);
|
||||
|
||||
@ -390,46 +370,24 @@ namespace PPTX
|
||||
|
||||
OOX::CContentTypes *pContentTypes = oDrawingConverter.GetContentTypes();
|
||||
//docProps
|
||||
OOX::CPath pathDocProps = sDstEmbeddedTemp + FILE_SEPARATOR_STR + _T("docProps");
|
||||
OOX::CPath pathDocProps = sDstEmbeddedTemp + FILE_SEPARATOR_STR + L"docProps";
|
||||
NSDirectory::CreateDirectory(pathDocProps.GetPath());
|
||||
|
||||
OOX::CPath DocProps = std::wstring(_T("docProps"));
|
||||
OOX::CPath DocProps = std::wstring(L"docProps");
|
||||
|
||||
OOX::CApp oApp(NULL);
|
||||
oApp.SetDefaults();
|
||||
oApp.write(pathDocProps + FILE_SEPARATOR_STR + _T("app.xml"), DocProps, *pContentTypes);
|
||||
|
||||
OOX::CCore oCore(NULL);
|
||||
oCore.SetDefaults();
|
||||
oCore.write(pathDocProps + FILE_SEPARATOR_STR + _T("core.xml"), DocProps, *pContentTypes);
|
||||
|
||||
OOX::CApp* pApp = new OOX::CApp(NULL);
|
||||
if (pApp)
|
||||
{
|
||||
pApp->SetApplication(L"ONLYOFFICE");
|
||||
#if defined(INTVER)
|
||||
pApp->SetAppVersion(VALUE2STR(INTVER));
|
||||
#endif
|
||||
pApp->SetDocSecurity(0);
|
||||
pApp->SetScaleCrop(false);
|
||||
pApp->SetLinksUpToDate(false);
|
||||
pApp->SetSharedDoc(false);
|
||||
pApp->SetHyperlinksChanged(false);
|
||||
|
||||
pApp->write(pathDocProps + FILE_SEPARATOR_STR + _T("app.xml"), DocProps, *pContentTypes);
|
||||
delete pApp;
|
||||
}
|
||||
OOX::CCore* pCore = new OOX::CCore(NULL);
|
||||
if (pCore)
|
||||
{
|
||||
pCore->SetCreator(_T(""));
|
||||
pCore->SetLastModifiedBy(_T(""));
|
||||
pCore->write(pathDocProps + FILE_SEPARATOR_STR + _T("core.xml"), DocProps, *pContentTypes);
|
||||
delete pCore;
|
||||
}
|
||||
oDocxSerializer.m_pCurFileWriter->Write();
|
||||
pContentTypes->Write(sDstEmbeddedTemp);
|
||||
|
||||
COfficeUtils oOfficeUtils(NULL);
|
||||
oOfficeUtils.CompressFileOrDirectory(sDstEmbeddedTemp, sDstEmbedded + FILE_SEPARATOR_STR + sDocxFilename, true);
|
||||
|
||||
pReader->m_pRels->CloseRels();
|
||||
delete pReader->m_pRels;
|
||||
|
||||
pReader->m_pRels = old_rels;
|
||||
oDrawingConverter.m_pReader = old_reader;
|
||||
//------------------------------------------------------------------
|
||||
//std::wstring sEmbWorksheetRelsName = L"embeddings/" + sDocxFilename;
|
||||
//std::wstring sEmbWorksheetRelType = OOX::FileTypes::MicrosoftOfficeWordDocument.RelationType();
|
||||
@ -455,13 +413,9 @@ namespace PPTX
|
||||
|
||||
boost::unordered_map<std::wstring, size_t> old_enum_map = oXlsx.m_mapEnumeratedGlobal;
|
||||
|
||||
NSBinPptxRW::CBinaryFileReader* old_reader = oDrawingConverter.m_pReader;
|
||||
NSBinPptxRW::CRelsGenerator* old_rels = pReader->m_pRels;
|
||||
|
||||
oXlsx.m_mapEnumeratedGlobal.clear();
|
||||
|
||||
oDrawingConverter.m_pReader = pReader;
|
||||
pReader->m_pRels = new NSBinPptxRW::CRelsGenerator();
|
||||
oDrawingConverter.m_pReader->Init(pReader->GetData() + pReader->GetPos(), 0, _embed_data_size);
|
||||
|
||||
oDrawingConverter.SetDstPath(sDstEmbeddedTemp + FILE_SEPARATOR_STR + L"xl");
|
||||
oDrawingConverter.SetSrcPath(pReader->m_strFolder, 2);
|
||||
@ -470,7 +424,7 @@ namespace PPTX
|
||||
oDrawingConverter.SetEmbedDstPath(sEmbedPath);
|
||||
|
||||
std::wstring sXlsxFilename = L"Microsoft_Excel_Worksheet" + std::to_wstring( id ) + L".xlsx";
|
||||
oEmbeddedReader.ReadMainTable(oXlsx, *pReader, pReader->m_strFolder, sDstEmbeddedTemp, oSaveParams, &oDrawingConverter);
|
||||
oEmbeddedReader.ReadMainTable(oXlsx, *oDrawingConverter.m_pReader, pReader->m_strFolder, sDstEmbeddedTemp, oSaveParams, &oDrawingConverter);
|
||||
|
||||
oXlsx.PrepareToWrite();
|
||||
|
||||
@ -479,11 +433,6 @@ namespace PPTX
|
||||
COfficeUtils oOfficeUtils(NULL);
|
||||
oOfficeUtils.CompressFileOrDirectory(sDstEmbeddedTemp, sDstEmbedded + FILE_SEPARATOR_STR + sXlsxFilename, true);
|
||||
|
||||
pReader->m_pRels->CloseRels();
|
||||
delete pReader->m_pRels;
|
||||
|
||||
pReader->m_pRels = old_rels;
|
||||
oDrawingConverter.m_pReader = old_reader;
|
||||
oXlsx.m_mapEnumeratedGlobal = old_enum_map;
|
||||
//------------------------------------------------------------------
|
||||
//std::wstring sEmbWorksheetRelsName = L"embeddings/" + sXlsxFilename;
|
||||
|
||||
@ -567,6 +567,10 @@
|
||||
<Filter
|
||||
Name="___"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\source\Writer\OOXCommentsWriter.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\source\Writer\OOXContentTypesWriter.h"
|
||||
>
|
||||
|
||||
@ -1007,32 +1007,32 @@ bool RtfCharPropsCommand::ExecuteCommand(RtfDocument& oDocument, RtfReader& oRea
|
||||
//COMMAND_RTF_BOOL( "ul", charProps->m_bUnderline, sCommand, hasParameter, parameter)
|
||||
COMMAND_RTF_INT ( "ulc", charProps->m_nUnderlineColor, sCommand, hasParameter, parameter)
|
||||
|
||||
COMMAND_RTF_INT ( "uld", charProps->m_eUnderStyle, sCommand, true, RtfCharProperty::uls_Dotted)
|
||||
COMMAND_RTF_INT ( "uld", charProps->m_eUnderStyle, sCommand, true, RtfCharProperty::uls_Dotted)
|
||||
COMMAND_RTF_INT ( "uldash", charProps->m_eUnderStyle, sCommand, true, RtfCharProperty::uls_Dashed)
|
||||
COMMAND_RTF_INT ( "uldashd", charProps->m_eUnderStyle, sCommand, true, RtfCharProperty::uls_Dash_dotted)
|
||||
COMMAND_RTF_INT ( "uldashdd", charProps->m_eUnderStyle, sCommand, true, RtfCharProperty::uls_Dash_dot_dotted)
|
||||
COMMAND_RTF_INT ( "uldb", charProps->m_eUnderStyle, sCommand, true, RtfCharProperty::uls_Double)
|
||||
COMMAND_RTF_INT ( "ulhwave", charProps->m_eUnderStyle, sCommand, true, RtfCharProperty::uls_Heavy_wave)
|
||||
COMMAND_RTF_INT ( "ulldash", charProps->m_eUnderStyle, sCommand, true, RtfCharProperty::uls_Long_dashe)
|
||||
COMMAND_RTF_INT ( "uldashd", charProps->m_eUnderStyle, sCommand, true, RtfCharProperty::uls_Dash_dotted)
|
||||
COMMAND_RTF_INT ( "uldashdd", charProps->m_eUnderStyle, sCommand, true, RtfCharProperty::uls_Dash_dot_dotted)
|
||||
COMMAND_RTF_INT ( "uldb", charProps->m_eUnderStyle, sCommand, true, RtfCharProperty::uls_Double)
|
||||
COMMAND_RTF_INT ( "ulhwave", charProps->m_eUnderStyle, sCommand, true, RtfCharProperty::uls_Heavy_wave)
|
||||
COMMAND_RTF_INT ( "ulldash", charProps->m_eUnderStyle, sCommand, true, RtfCharProperty::uls_Long_dashe)
|
||||
COMMAND_RTF_INT ( "ulnone", charProps->m_eUnderStyle, sCommand, true, RtfCharProperty::uls_none)
|
||||
COMMAND_RTF_INT ( "ulth", charProps->m_eUnderStyle, sCommand, true, RtfCharProperty::uls_Thick)
|
||||
COMMAND_RTF_INT ( "ulthd", charProps->m_eUnderStyle, sCommand, true, RtfCharProperty::uls_Thick_dotted)
|
||||
COMMAND_RTF_INT ( "ulthdash", charProps->m_eUnderStyle, sCommand, true, RtfCharProperty::uls_Thick_dashed)
|
||||
COMMAND_RTF_INT ( "ulthdashd", charProps->m_eUnderStyle, sCommand, true, RtfCharProperty::uls_Thick_dash_dotted)
|
||||
COMMAND_RTF_INT ( "ulth", charProps->m_eUnderStyle, sCommand, true, RtfCharProperty::uls_Thick)
|
||||
COMMAND_RTF_INT ( "ulthd", charProps->m_eUnderStyle, sCommand, true, RtfCharProperty::uls_Thick_dotted)
|
||||
COMMAND_RTF_INT ( "ulthdash", charProps->m_eUnderStyle, sCommand, true, RtfCharProperty::uls_Thick_dashed)
|
||||
COMMAND_RTF_INT ( "ulthdashd", charProps->m_eUnderStyle, sCommand, true, RtfCharProperty::uls_Thick_dash_dotted)
|
||||
COMMAND_RTF_INT ( "ulthdashdd", charProps->m_eUnderStyle, sCommand, true, RtfCharProperty::uls_Thick_dash_dot_dotted)
|
||||
COMMAND_RTF_INT ( "ulthldash", charProps->m_eUnderStyle, sCommand, true, RtfCharProperty::uls_Thick_long_dashed)
|
||||
COMMAND_RTF_INT ( "ulthldash", charProps->m_eUnderStyle, sCommand, true, RtfCharProperty::uls_Thick_long_dashed)
|
||||
COMMAND_RTF_INT ( "ululdbwave", charProps->m_eUnderStyle, sCommand, true, RtfCharProperty::uls_Double_wave)
|
||||
COMMAND_RTF_INT ( "ulw", charProps->m_eUnderStyle, sCommand, true, RtfCharProperty::uls_Word)
|
||||
COMMAND_RTF_INT ( "ulw", charProps->m_eUnderStyle, sCommand, true, RtfCharProperty::uls_Word)
|
||||
COMMAND_RTF_INT ( "ulwave", charProps->m_eUnderStyle, sCommand, true, RtfCharProperty::uls_Wave)
|
||||
|
||||
COMMAND_RTF_INT ( "up", charProps->m_nUp, sCommand, hasParameter, parameter)
|
||||
|
||||
COMMAND_RTF_INT ( "crauth", charProps->m_nCrAuth, sCommand, hasParameter, parameter)
|
||||
COMMAND_RTF_INT ( "crdate", charProps->m_nCrDate, sCommand, hasParameter, parameter)
|
||||
COMMAND_RTF_INT ( "insrsid", charProps->m_nInsrsid, sCommand, hasParameter, parameter)
|
||||
COMMAND_RTF_INT ( "insrsid", charProps->m_nInsrsid, sCommand, hasParameter, parameter)
|
||||
|
||||
COMMAND_RTF_INT ( "revauth", charProps->m_nRevauth, sCommand, hasParameter, parameter)
|
||||
COMMAND_RTF_INT ( "revdttm", charProps->m_nRevdttm, sCommand, hasParameter, parameter)
|
||||
COMMAND_RTF_INT ( "revauth", charProps->m_nRevauth, sCommand, hasParameter, parameter)
|
||||
COMMAND_RTF_INT ( "revdttm", charProps->m_nRevdttm, sCommand, hasParameter, parameter)
|
||||
COMMAND_RTF_INT ( "revauthdel", charProps->m_nRevauthDel, sCommand, hasParameter, parameter)
|
||||
COMMAND_RTF_INT ( "revdttmdel", charProps->m_nRevdttmDel, sCommand, hasParameter, parameter)
|
||||
|
||||
@ -2814,7 +2814,69 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
|
||||
if ( pNewBookmarkEnd->IsValid() )
|
||||
m_oCurParagraph->AddItem( pNewBookmarkEnd );
|
||||
}
|
||||
else if ( "footnote" == sCommand )
|
||||
else if ( "atrfstart" == sCommand )
|
||||
{
|
||||
RtfAnnotElemPtr pNewAnnotElem ( new RtfAnnotElem(1) );
|
||||
RtfAnnotElemReader oAnnotElemReader ( *pNewAnnotElem );
|
||||
|
||||
oAbstrReader.StartSubReader( oAnnotElemReader, oDocument, oReader );
|
||||
|
||||
if ( pNewAnnotElem->IsValid() )
|
||||
m_oCurParagraph->AddItem( pNewAnnotElem );
|
||||
}
|
||||
else if ( "atrfend" == sCommand )
|
||||
{
|
||||
RtfAnnotElemPtr pNewAnnotElem ( new RtfAnnotElem(2) );
|
||||
RtfAnnotElemReader oAnnotElemReader ( *pNewAnnotElem );
|
||||
|
||||
oAbstrReader.StartSubReader( oAnnotElemReader, oDocument, oReader );
|
||||
|
||||
if ( pNewAnnotElem->IsValid() )
|
||||
m_oCurParagraph->AddItem( pNewAnnotElem );
|
||||
|
||||
}
|
||||
else if ( "annotation" == sCommand )
|
||||
{
|
||||
RtfAnnotationPtr pNewAnnot ( new RtfAnnotation() );
|
||||
RtfAnnotationReader oAnnotReader ( *pNewAnnot );
|
||||
|
||||
oAbstrReader.StartSubReader( oAnnotReader, oDocument, oReader );
|
||||
|
||||
if ( pNewAnnot->IsValid() )
|
||||
m_oCurParagraph->AddItem( pNewAnnot );
|
||||
}
|
||||
else if ( "atnid" == sCommand )
|
||||
{
|
||||
RtfAnnotElemPtr pNewAnnotElem ( new RtfAnnotElem(5) );
|
||||
RtfAnnotElemReader oAnnotElemReader( *pNewAnnotElem );
|
||||
|
||||
oAbstrReader.StartSubReader( oAnnotElemReader, oDocument, oReader );
|
||||
|
||||
if ( pNewAnnotElem->IsValid() )
|
||||
m_oCurParagraph->AddItem( pNewAnnotElem );
|
||||
}
|
||||
else if ( "atnauthor" == sCommand )
|
||||
{
|
||||
RtfAnnotElemPtr pNewAnnotElem ( new RtfAnnotElem(4) );
|
||||
RtfAnnotElemReader oAnnotElemReader( *pNewAnnotElem );
|
||||
|
||||
oAbstrReader.StartSubReader( oAnnotElemReader, oDocument, oReader );
|
||||
|
||||
if ( pNewAnnotElem->IsValid() )
|
||||
m_oCurParagraph->AddItem( pNewAnnotElem );
|
||||
}
|
||||
else if ( "atnref" == sCommand )
|
||||
{
|
||||
RtfAnnotElemPtr pNewAnnotElem ( new RtfAnnotElem(3) );
|
||||
RtfAnnotElemReader oAnnotElemReader ( *pNewAnnotElem );
|
||||
|
||||
oAbstrReader.StartSubReader( oAnnotElemReader, oDocument, oReader );
|
||||
|
||||
if ( pNewAnnotElem->IsValid() )
|
||||
m_oCurParagraph->AddItem( pNewAnnotElem );
|
||||
|
||||
}
|
||||
else if ( "footnote" == sCommand )
|
||||
{
|
||||
RtfFootnotePtr pNewFootnote ( new RtfFootnote() );
|
||||
pNewFootnote->m_oCharProp = oReader.m_oState->m_oCharProp;
|
||||
@ -2825,6 +2887,14 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
|
||||
if ( pNewFootnote->IsValid() )
|
||||
m_oCurParagraph->AddItem( pNewFootnote );
|
||||
}
|
||||
//else if ( "chatn" == sCommand )
|
||||
//{
|
||||
// RtfCharSpecialPtr pNewChar ( new RtfCharSpecial() );
|
||||
//
|
||||
// pNewChar->m_oProperty = oReader.m_oState->m_oCharProp;
|
||||
// pNewChar->m_eType = RtfCharSpecial::rsc_chatn;
|
||||
// m_oCurParagraph->AddItem( pNewChar );
|
||||
//}
|
||||
else if ( "chftn" == sCommand )
|
||||
{
|
||||
if ( 1 == oReader.m_nFootnote )
|
||||
|
||||
@ -1513,6 +1513,40 @@ private:
|
||||
m_oField.m_bTextOnly = true;
|
||||
}
|
||||
};
|
||||
class RtfAnnotElemReader: public RtfAbstractReader
|
||||
{
|
||||
public:
|
||||
RtfAnnotElem& m_oAnnot;
|
||||
|
||||
RtfAnnotElemReader( RtfAnnotElem& oAnnot ) : m_oAnnot(oAnnot)
|
||||
{
|
||||
}
|
||||
bool ExecuteCommand(RtfDocument& oDocument, RtfReader& oReader, std::string sCommand, bool hasParameter, int parameter)
|
||||
{
|
||||
if( "atrfstart" == sCommand )
|
||||
;
|
||||
else if( "atrfend" == sCommand )
|
||||
;
|
||||
else if( "atnref" == sCommand )
|
||||
;
|
||||
else if( "atndate" == sCommand )
|
||||
;
|
||||
else if( "atnid" == sCommand )
|
||||
;
|
||||
else if( "atnauthor" == sCommand )
|
||||
;
|
||||
else if ( "atnparent" == sCommand )
|
||||
;
|
||||
else
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
void ExecuteText(RtfDocument& oDocument, RtfReader& oReader, std::wstring sText)
|
||||
{
|
||||
m_oAnnot.m_sValue += sText ;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class RtfBookmarkStartReader: public RtfAbstractReader
|
||||
{
|
||||
@ -1679,6 +1713,60 @@ public:
|
||||
oReader.m_nFootnote = PROP_DEF;
|
||||
}
|
||||
};
|
||||
|
||||
class RtfAnnotationReader: public RtfAbstractReader
|
||||
{
|
||||
private:
|
||||
RtfParagraphPropDestination m_oParPropDest;
|
||||
public:
|
||||
RtfAnnotation& m_oRtfAnnotation;
|
||||
|
||||
RtfAnnotationReader( RtfAnnotation& oRtfAnnotation ) : m_oRtfAnnotation(oRtfAnnotation)
|
||||
{
|
||||
}
|
||||
bool ExecuteCommand(RtfDocument& oDocument, RtfReader& oReader, std::string sCommand, bool hasParameter, int parameter)
|
||||
{
|
||||
if( "annotation" == sCommand )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if( "atnref" == sCommand )
|
||||
{
|
||||
m_oRtfAnnotation.m_oRef = RtfAnnotElemPtr ( new RtfAnnotElem(3) );
|
||||
RtfAnnotElemReader oAnnotReader ( *m_oRtfAnnotation.m_oRef );
|
||||
|
||||
StartSubReader( oAnnotReader, oDocument, oReader );
|
||||
|
||||
}
|
||||
else if( "atndate" == sCommand )
|
||||
{
|
||||
m_oRtfAnnotation.m_oDate = RtfAnnotElemPtr ( new RtfAnnotElem(6) );
|
||||
RtfAnnotElemReader oAnnotReader ( *m_oRtfAnnotation.m_oDate );
|
||||
|
||||
StartSubReader( oAnnotReader, oDocument, oReader );
|
||||
}
|
||||
else if( "atnparent" == sCommand )
|
||||
{
|
||||
m_oRtfAnnotation.m_oParent = RtfAnnotElemPtr ( new RtfAnnotElem(7) );
|
||||
RtfAnnotElemReader oAnnotReader ( *m_oRtfAnnotation.m_oParent );
|
||||
|
||||
StartSubReader( oAnnotReader, oDocument, oReader );
|
||||
}
|
||||
else
|
||||
return m_oParPropDest.ExecuteCommand( oDocument, oReader, (*this), sCommand, hasParameter, parameter );
|
||||
return true;
|
||||
}
|
||||
void ExecuteText( RtfDocument& oDocument, RtfReader& oReader, std::wstring sText )
|
||||
{
|
||||
m_oParPropDest.ExecuteText( oDocument, oReader, sText );
|
||||
}
|
||||
void ExitReader( RtfDocument& oDocument, RtfReader& oReader )
|
||||
{
|
||||
m_oParPropDest.Finalize( oReader );
|
||||
|
||||
m_oRtfAnnotation.m_oContent = m_oParPropDest.m_oTextItems;
|
||||
}
|
||||
};
|
||||
class RtfDefParPropReader: public RtfAbstractReader
|
||||
{
|
||||
private:
|
||||
|
||||
@ -135,14 +135,14 @@ public:
|
||||
int nId = ooxFtnEdn->m_oId->GetValue();
|
||||
OOXTextItemReader oTextItemReader;
|
||||
|
||||
for (std::vector<OOX::WritingElement*>::iterator it = ooxFtnEdn->m_arrItems.begin(); it != ooxFtnEdn->m_arrItems.end(); ++it)
|
||||
for (size_t i = 0; i < ooxFtnEdn->m_arrItems.size(); ++i)
|
||||
{
|
||||
if( nSeparatorId == nId )
|
||||
{
|
||||
TextItemContainerPtr oNewTextItem ( new TextItemContainer() );
|
||||
oTextItemReader.m_oTextItems = oNewTextItem;
|
||||
|
||||
if( true == oTextItemReader.Parse( *it, oParam ) )
|
||||
if( true == oTextItemReader.Parse( ooxFtnEdn->m_arrItems[i], oParam ) )
|
||||
{
|
||||
if( true == bFootnote )
|
||||
oParam.oRtf->m_oFootnoteSep = oNewTextItem;
|
||||
@ -155,7 +155,7 @@ public:
|
||||
TextItemContainerPtr oNewTextItem ( new TextItemContainer() );
|
||||
oTextItemReader.m_oTextItems = oNewTextItem;
|
||||
|
||||
if( true == oTextItemReader.Parse( *it, oParam ) )
|
||||
if( true == oTextItemReader.Parse( ooxFtnEdn->m_arrItems[i], oParam ) )
|
||||
{
|
||||
if( true == bFootnote )
|
||||
oParam.oRtf->m_oFootnoteCon = oNewTextItem;
|
||||
@ -168,7 +168,7 @@ public:
|
||||
TextItemContainerPtr oNewTextItem ( new TextItemContainer() );
|
||||
oTextItemReader.m_oTextItems = oNewTextItem;
|
||||
|
||||
if( true == oTextItemReader.Parse( *it, oParam ) )
|
||||
if( true == oTextItemReader.Parse( ooxFtnEdn->m_arrItems[i], oParam ) )
|
||||
{
|
||||
if( true == bFootnote )
|
||||
oParam.oReader->m_mapFootnotes[ nId] = oNewTextItem;
|
||||
|
||||
@ -32,9 +32,9 @@
|
||||
|
||||
#include "OOXParagraphReader.h"
|
||||
|
||||
#include "OOXTextItemReader.h"
|
||||
#include "OOXpPrFrameReader.h"
|
||||
#include "OOXpPrTabReader.h"
|
||||
#include "OOXTableReader.h"
|
||||
|
||||
#include "../RtfOle.h"
|
||||
|
||||
@ -457,6 +457,117 @@ bool OOXParagraphReader::Parse3( ReaderParameter oParam , RtfParagraph& oOutputP
|
||||
}
|
||||
}
|
||||
}break;
|
||||
case OOX::et_w_commentRangeStart:
|
||||
case OOX::et_w_commentReference:
|
||||
{
|
||||
OOX::Logic::CCommentRangeStart * pCommentStart = dynamic_cast<OOX::Logic::CCommentRangeStart*>(m_ooxElement);
|
||||
|
||||
if(pCommentStart->m_oId.IsInit())
|
||||
{
|
||||
int nId = pCommentStart->m_oId->GetValue();
|
||||
std::map<int, OOXReader::_comment>::iterator pFind = oParam.oReader->m_mapComments.find( nId );
|
||||
|
||||
if( pFind == oParam.oReader->m_mapComments.end())
|
||||
{
|
||||
RtfAnnotElemPtr oNewAnnotElem ( new RtfAnnotElem(1) );
|
||||
oNewAnnotElem->m_sValue = std::to_wstring(0x7700000 + nId);
|
||||
|
||||
OOXReader::_comment comment;
|
||||
comment.ref = oNewAnnotElem->m_sValue;
|
||||
comment.index = oParam.oReader->m_mapComments.size();
|
||||
|
||||
oParam.oReader->m_mapComments.insert(std::make_pair( nId, comment));
|
||||
oOutputParagraph.AddItem( oNewAnnotElem );
|
||||
}
|
||||
}
|
||||
}break;
|
||||
case OOX::et_w_commentRangeEnd:
|
||||
{
|
||||
OOX::Logic::CCommentRangeEnd * pCommentEnd = dynamic_cast<OOX::Logic::CCommentRangeEnd*>(m_ooxElement);
|
||||
|
||||
int nId = pCommentEnd->m_oId->GetValue();
|
||||
|
||||
std::map<int, OOXReader::_comment>::iterator pFindRef = oParam.oReader->m_mapComments.find( nId );
|
||||
|
||||
if( pFindRef != oParam.oReader->m_mapComments.end())
|
||||
{
|
||||
RtfAnnotElemPtr oNewAnnotElem ( new RtfAnnotElem(2) );
|
||||
oNewAnnotElem->m_sValue = pFindRef->second.ref;
|
||||
oOutputParagraph.AddItem( oNewAnnotElem );
|
||||
|
||||
//find comment and add info
|
||||
std::map<int, int>::iterator pFindComment = oParam.oDocx->m_pComments->m_mapComments.find(nId);
|
||||
|
||||
if (pFindComment != oParam.oDocx->m_pComments->m_mapComments.end())
|
||||
{
|
||||
if ( pFindComment->second < oParam.oDocx->m_pComments->m_arrComments.size() && pFindComment->second >= 0)
|
||||
{
|
||||
OOX::CComment* oox_comment = oParam.oDocx->m_pComments->m_arrComments[pFindComment->second];
|
||||
if (oox_comment)
|
||||
{
|
||||
if (oox_comment->m_oAuthor.IsInit())
|
||||
{
|
||||
RtfAnnotElemPtr oNewAnnotAuthor ( new RtfAnnotElem(4) );
|
||||
oNewAnnotAuthor->m_sValue = *oox_comment->m_oAuthor;
|
||||
oOutputParagraph.AddItem( oNewAnnotAuthor );
|
||||
}
|
||||
if (oox_comment->m_oInitials.IsInit())
|
||||
{
|
||||
RtfAnnotElemPtr oNewAnnotAuthorId ( new RtfAnnotElem(5) );
|
||||
oNewAnnotAuthorId->m_sValue = *oox_comment->m_oInitials;
|
||||
oOutputParagraph.AddItem( oNewAnnotAuthorId );
|
||||
}
|
||||
|
||||
RtfAnnotationPtr oNewAnnotContent(new RtfAnnotation());
|
||||
|
||||
oNewAnnotContent->m_oRef = RtfAnnotElemPtr ( new RtfAnnotElem(3) );
|
||||
oNewAnnotContent->m_oRef->m_sValue = pFindRef->second.ref;
|
||||
|
||||
if (oox_comment->m_oDate.IsInit())
|
||||
{
|
||||
oNewAnnotContent->m_oDate = RtfAnnotElemPtr ( new RtfAnnotElem(6) );
|
||||
|
||||
int nDate = RtfUtility::convertDateTime(oox_comment->m_oDate->GetValue());
|
||||
oNewAnnotContent->m_oDate->m_sValue = std::to_wstring(nDate);
|
||||
}
|
||||
|
||||
OOXTextItemReader oTextItemReader;
|
||||
oTextItemReader.m_oTextItems = oNewAnnotContent->m_oContent;
|
||||
|
||||
for (size_t i = 0; i < oox_comment->m_arrItems.size(); ++i)
|
||||
{
|
||||
if (oParam.oDocx->m_pCommentsExt)
|
||||
{
|
||||
OOX::Logic::CParagraph *pParagraph = dynamic_cast<OOX::Logic::CParagraph*>(oox_comment->m_arrItems[i]);
|
||||
if ((pParagraph) && (pParagraph->m_oParaId.IsInit()))
|
||||
{
|
||||
std::map<int, int>::iterator pFindPara = oParam.oDocx->m_pCommentsExt->m_mapComments.find(pParagraph->m_oParaId->GetValue());
|
||||
if (pFindPara != oParam.oDocx->m_pCommentsExt->m_mapComments.end())
|
||||
{
|
||||
oParam.oReader->m_mapCommentsPara.insert(std::make_pair( pParagraph->m_oParaId->GetValue(), pFindRef->second.index));
|
||||
|
||||
if (oParam.oDocx->m_pCommentsExt->m_arrComments[pFindPara->second]->m_oParaIdParent.IsInit())
|
||||
{
|
||||
std::map<int, int>::iterator pFindParent = oParam.oReader->m_mapCommentsPara.find(oParam.oDocx->m_pCommentsExt->m_arrComments[pFindPara->second]->m_oParaIdParent->GetValue());
|
||||
if (pFindParent != oParam.oReader->m_mapCommentsPara.end())
|
||||
{
|
||||
oNewAnnotContent->m_oParent = RtfAnnotElemPtr ( new RtfAnnotElem(7) );
|
||||
oNewAnnotContent->m_oParent->m_sValue = std::to_wstring( pFindParent->second - pFindRef->second.index);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
oTextItemReader.Parse(oox_comment->m_arrItems[i], oParam);
|
||||
}
|
||||
|
||||
oOutputParagraph.AddItem( oNewAnnotContent );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@ -66,8 +66,17 @@ public:
|
||||
|
||||
int m_nCurOleChartId;
|
||||
int m_nCurFittextId;
|
||||
|
||||
std::map<int, std::wstring> m_aBookmarks;
|
||||
|
||||
struct _comment
|
||||
{
|
||||
std::wstring ref;
|
||||
int index;
|
||||
};
|
||||
std::map<int, _comment> m_mapComments; //nId, ref & index added
|
||||
std::map<int, int> m_mapCommentsPara; //paraId, index added
|
||||
|
||||
std::map<int, int> m_mapPictureBullet;
|
||||
std::map<int, TextItemContainerPtr> m_mapFootnotes;
|
||||
std::map<int, TextItemContainerPtr> m_mapEndnotes;
|
||||
|
||||
@ -34,6 +34,7 @@
|
||||
|
||||
#include "Writer/OOXWriter.h"
|
||||
#include "Writer/OOXFootnoteWriter.h"
|
||||
#include "Writer/OOXCommentsWriter.h"
|
||||
|
||||
#include "Utils.h"
|
||||
|
||||
@ -56,11 +57,10 @@ std::wstring RtfBookmarkStart::RenderToRtf(RenderParameter oRenderParameter)
|
||||
std::wstring RtfBookmarkStart::RenderToOOX(RenderParameter oRenderParameter)
|
||||
{
|
||||
std::wstring sResult;
|
||||
//ATLASSERT( false == m_sName.empty() );
|
||||
sResult += L"<w:bookmarkStart";
|
||||
|
||||
OOXWriter * poOOXWriter = static_cast<OOXWriter*> ( oRenderParameter.poWriter );
|
||||
RtfDocument * poDocument = static_cast<RtfDocument*> (oRenderParameter.poDocument);
|
||||
RtfDocument * poDocument = static_cast<RtfDocument*> ( oRenderParameter.poDocument );
|
||||
|
||||
std::map<std::wstring, int>::iterator pPair = poOOXWriter->m_aBookmarksId.find( m_sName );
|
||||
|
||||
@ -118,6 +118,131 @@ std::wstring RtfBookmarkEnd::RenderToOOX(RenderParameter oRenderParameter)
|
||||
sResult += L"/>";
|
||||
return sResult;
|
||||
}
|
||||
|
||||
std::wstring RtfAnnotElem::RenderToRtf(RenderParameter oRenderParameter)
|
||||
{
|
||||
std::wstring sResult;
|
||||
|
||||
if (m_nType == 1) sResult += L"{\\*\\atrfstart " + m_sValue + L"}";
|
||||
else if (m_nType == 2) sResult += L"{\\*\\atrfend " + m_sValue + L"}";
|
||||
else if (m_nType == 3) sResult += L"{\\*\\atnref " + m_sValue + L"}";
|
||||
else if (m_nType == 4) sResult += L"{\\*\\atnauthor " + m_sValue + L"}";
|
||||
else if (m_nType == 5) sResult += L"{\\*\\atnid " + m_sValue + L"}";
|
||||
else if (m_nType == 6) sResult += L"{\\*\\atndate " + m_sValue + L"}";
|
||||
else if (m_nType == 7) sResult += L"{\\*\\atnparent " + m_sValue + L"}";
|
||||
|
||||
return sResult;
|
||||
}
|
||||
|
||||
std::wstring RtfAnnotElem::RenderToOOX(RenderParameter oRenderParameter)
|
||||
{
|
||||
if (m_nType > 8 || m_nType < 1) return L"";
|
||||
|
||||
std::wstring sResult;
|
||||
|
||||
OOXWriter* poOOXWriter = static_cast<OOXWriter*> (oRenderParameter.poWriter);
|
||||
OOXCommentsWriter* poCommentsWriter = static_cast<OOXCommentsWriter*>( poOOXWriter->m_poCommentsWriter );
|
||||
|
||||
if (m_nType == 4)
|
||||
{
|
||||
poCommentsWriter->AddCommentAuthor(m_sValue);
|
||||
}
|
||||
else if (m_nType == 5)
|
||||
{
|
||||
poCommentsWriter->AddCommentID(m_sValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::map<std::wstring,OOXCommentsWriter::_comment>::iterator pFind = poCommentsWriter->m_mapComments.find(m_sValue);
|
||||
|
||||
int id = -1;
|
||||
if (pFind == poCommentsWriter->m_mapComments.end())
|
||||
{
|
||||
id = poCommentsWriter->m_mapComments.size() ;//+ 1;
|
||||
poCommentsWriter->AddComment(m_sValue, id);
|
||||
}
|
||||
else
|
||||
{
|
||||
id = pFind->second.nID;
|
||||
}
|
||||
if (m_nType == 1)
|
||||
{
|
||||
sResult += L"<w:commentRangeStart w:id=\"" + std::to_wstring(id) + L"\"/>";
|
||||
}
|
||||
else if (m_nType == 3)
|
||||
{
|
||||
sResult += L"<w:commentReference w:id=\"" + std::to_wstring(id) + L"\"/>";
|
||||
}
|
||||
else if (m_nType == 2)
|
||||
{
|
||||
poCommentsWriter->SetCommentEnd(m_sValue);
|
||||
|
||||
sResult += L"<w:commentRangeEnd w:id=\"" + std::to_wstring(id) + L"\"/>";
|
||||
sResult += L"<w:r><w:commentReference w:id=\"" + std::to_wstring(id) + L"\"/></w:r>";
|
||||
}
|
||||
}
|
||||
|
||||
return sResult;
|
||||
}
|
||||
|
||||
std::wstring RtfAnnotation::RenderToRtf(RenderParameter oRenderParameter)
|
||||
{
|
||||
std::wstring sResult;
|
||||
|
||||
sResult += L"\\chatn{\\*\\annotation";
|
||||
if (m_oRef)
|
||||
{
|
||||
sResult += m_oRef->RenderToRtf(oRenderParameter);
|
||||
}
|
||||
if (m_oDate)
|
||||
{
|
||||
sResult += m_oDate->RenderToRtf(oRenderParameter);
|
||||
}
|
||||
if (m_oParent)
|
||||
{
|
||||
sResult += m_oParent->RenderToRtf(oRenderParameter);
|
||||
}
|
||||
if (m_oContent)
|
||||
{
|
||||
sResult += m_oContent->RenderToRtf(oRenderParameter);
|
||||
}
|
||||
sResult += L"}";
|
||||
return sResult;
|
||||
}
|
||||
|
||||
std::wstring RtfAnnotation::RenderToOOX(RenderParameter oRenderParameter)
|
||||
{
|
||||
OOXWriter* poOOXWriter = static_cast<OOXWriter*> (oRenderParameter.poWriter);
|
||||
OOXCommentsWriter* poCommentsWriter = static_cast<OOXCommentsWriter*>( poOOXWriter->m_poCommentsWriter );
|
||||
|
||||
if (!m_oRef) return L"";
|
||||
|
||||
if (m_oDate)
|
||||
{
|
||||
int nValue = boost::lexical_cast<int>(m_oDate->m_sValue);
|
||||
|
||||
poCommentsWriter->AddCommentDate(m_oRef->m_sValue, RtfUtility::convertDateTime(nValue));
|
||||
}
|
||||
if (m_oContent)
|
||||
{
|
||||
RenderParameter oNewParameter = oRenderParameter;
|
||||
|
||||
oNewParameter.nType = RENDER_TO_OOX_PARAM_COMMENT;
|
||||
oNewParameter.poRels = poCommentsWriter->m_oRelsWriter.get();
|
||||
|
||||
std::wstring content = m_oContent->RenderToOOX(oNewParameter);
|
||||
|
||||
std::wstring sParaId = XmlUtils::IntToString(poOOXWriter->m_nextParaId, L"%08X");//last para id in comment
|
||||
|
||||
poCommentsWriter->AddCommentContent(m_oRef->m_sValue, sParaId, content);
|
||||
}
|
||||
if (m_oParent)
|
||||
{
|
||||
poCommentsWriter->AddCommentParent(m_oRef->m_sValue, m_oParent->m_sValue);
|
||||
}
|
||||
return L"";
|
||||
}
|
||||
|
||||
std::wstring RtfFootnote::RenderToRtf(RenderParameter oRenderParameter)
|
||||
{
|
||||
std::wstring sResult;
|
||||
@ -147,9 +272,11 @@ std::wstring RtfFootnote::RenderToOOX(RenderParameter oRenderParameter)
|
||||
{
|
||||
int nID = poDocument->m_oIdGenerator.Generate_EndnoteNumber();
|
||||
OOXEndnoteWriter* poEndnoteWriter = static_cast<OOXEndnoteWriter*>( poOOXWriter->m_poEndnoteWriter );
|
||||
|
||||
RenderParameter oNewParameter = oRenderParameter;
|
||||
oNewParameter.nType = RENDER_TO_OOX_PARAM_UNKNOWN;
|
||||
oNewParameter.poRels = poEndnoteWriter->m_oRelsWriter.get();
|
||||
|
||||
poEndnoteWriter->AddEndnote( L"", nID, m_oContent->RenderToOOX(oNewParameter) );
|
||||
|
||||
sResult += L"<w:r>";
|
||||
|
||||
@ -64,6 +64,48 @@ public:
|
||||
std::wstring RenderToRtf(RenderParameter oRenderParameter);
|
||||
std::wstring RenderToOOX(RenderParameter oRenderParameter);
|
||||
};
|
||||
|
||||
class RtfAnnotElem : public IDocumentElement
|
||||
{
|
||||
public:
|
||||
std::wstring m_sValue;
|
||||
int m_nType;
|
||||
|
||||
RtfAnnotElem(int type = 0) : m_nType (type)
|
||||
{
|
||||
}
|
||||
int GetType()
|
||||
{
|
||||
return TYPE_RTF_ANNOTVALUE;
|
||||
}
|
||||
std::wstring RenderToRtf(RenderParameter oRenderParameter);
|
||||
std::wstring RenderToOOX(RenderParameter oRenderParameter);
|
||||
};
|
||||
typedef boost::shared_ptr<RtfAnnotElem> RtfAnnotElemPtr;
|
||||
|
||||
class RtfAnnotation : public IDocumentElement
|
||||
{
|
||||
public:
|
||||
RtfAnnotElemPtr m_oRef;
|
||||
RtfAnnotElemPtr m_oDate;
|
||||
RtfAnnotElemPtr m_oParent;
|
||||
|
||||
TextItemContainerPtr m_oContent;
|
||||
RtfCharProperty m_oCharProp;
|
||||
|
||||
RtfAnnotation()
|
||||
{
|
||||
m_oContent = TextItemContainerPtr( new TextItemContainer() );
|
||||
}
|
||||
int GetType()
|
||||
{
|
||||
return TYPE_RTF_ANNOTATION;
|
||||
}
|
||||
std::wstring RenderToRtf(RenderParameter oRenderParameter);
|
||||
std::wstring RenderToOOX(RenderParameter oRenderParameter);
|
||||
};
|
||||
typedef boost::shared_ptr<RtfAnnotation> RtfAnnotationPtr;
|
||||
|
||||
class RtfFootnote : public IDocumentElement
|
||||
{
|
||||
public:
|
||||
|
||||
@ -40,7 +40,7 @@ std::wstring RtfChar::RenderToOOX(RenderParameter oRenderParameter)
|
||||
OOXWriter* poOOXWriter = static_cast<OOXWriter*> (oRenderParameter.poWriter);
|
||||
|
||||
std::wstring sResult;
|
||||
if (RENDER_TO_OOX_PARAM_RUN == oRenderParameter.nType)
|
||||
if (RENDER_TO_OOX_PARAM_RUN == oRenderParameter.nType)
|
||||
{
|
||||
bool bInsert = false;
|
||||
bool bDelete = false;
|
||||
@ -69,6 +69,7 @@ std::wstring RtfChar::RenderToOOX(RenderParameter oRenderParameter)
|
||||
sResult += L"<w:rPr>";
|
||||
sResult += m_oProperty.RenderToOOX(oRenderParameter);
|
||||
sResult += L"</w:rPr>";
|
||||
|
||||
sResult += renderTextToXML(L"Text", bDelete );
|
||||
sResult += L"</w:r>";
|
||||
|
||||
|
||||
@ -82,6 +82,11 @@ const long g_cdMaxPercent = 1000000;
|
||||
|
||||
#define TYPE_RTF_FOOTNOTE 30
|
||||
|
||||
#define TYPE_RTF_ANNOTSTART 31
|
||||
#define TYPE_RTF_ANNOTEND 32
|
||||
#define TYPE_RTF_ANNOTVALUE 33
|
||||
#define TYPE_RTF_ANNOTATION 34
|
||||
|
||||
#define RENDER_TO_OOX_PARAM_UNKNOWN 0
|
||||
#define RENDER_TO_OOX_PARAM_LAST 1
|
||||
#define RENDER_TO_OOX_PARAM_RUN 2
|
||||
@ -107,6 +112,7 @@ const long g_cdMaxPercent = 1000000;
|
||||
#define RENDER_TO_OOX_PARAM_OLE_ONLY 25
|
||||
#define RENDER_TO_OOX_PARAM_OLDLIST_ABS 26
|
||||
#define RENDER_TO_OOX_PARAM_OLDLIST_OVR 27
|
||||
#define RENDER_TO_OOX_PARAM_COMMENT 28
|
||||
|
||||
#define RENDER_TO_RTF_PARAM_UNKNOWN 0
|
||||
#define RENDER_TO_RTF_PARAM_CHAR 1
|
||||
|
||||
@ -32,6 +32,8 @@
|
||||
#include "RtfParagraph.h"
|
||||
#include "RtfWriter.h"
|
||||
|
||||
#include "Writer/OOXWriter.h"
|
||||
|
||||
int RtfParagraph::AddItem( IDocumentElementPtr piRend )
|
||||
{
|
||||
if( TYPE_RTF_CHAR == piRend->GetType() )
|
||||
@ -85,7 +87,10 @@ std::wstring RtfParagraph::RenderToRtf(RenderParameter oRenderParameter)
|
||||
|
||||
std::wstring RtfParagraph::RenderToOOX(RenderParameter oRenderParameter)
|
||||
{
|
||||
std::wstring sResult ;
|
||||
OOXWriter* poOOXWriter = static_cast<OOXWriter*>(oRenderParameter.poWriter);
|
||||
|
||||
std::wstring sResult ;
|
||||
|
||||
if( RENDER_TO_OOX_PARAM_PLAIN == oRenderParameter.nType )
|
||||
{
|
||||
for (size_t i = 0; i < m_aArray.size(); i++ )
|
||||
@ -125,8 +130,13 @@ std::wstring RtfParagraph::RenderToOOX(RenderParameter oRenderParameter)
|
||||
if( NULL != m_oOldList )
|
||||
bCanConvertToNumbering = m_oOldList->CanConvertToNumbering();
|
||||
|
||||
sResult += L"<w:p>";
|
||||
sResult += L"<w:pPr>";
|
||||
sResult += L"<w:p";
|
||||
if (oRenderParameter.nType == RENDER_TO_OOX_PARAM_COMMENT)
|
||||
{
|
||||
std::wstring sParaId = XmlUtils::IntToString(++poOOXWriter->m_nextParaId, L"%08X");
|
||||
sResult += L" w14:paraId=\"" + sParaId + L"\" w14:textId=\"" + sParaId + L"\"";
|
||||
}
|
||||
sResult += L"><w:pPr>";
|
||||
|
||||
m_oProperty.m_bOldList = (NULL != m_oOldList);
|
||||
sResult += m_oProperty.RenderToOOX(oRenderParameter);
|
||||
@ -162,7 +172,15 @@ std::wstring RtfParagraph::RenderToOOX(RenderParameter oRenderParameter)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (oRenderParameter.nType == RENDER_TO_OOX_PARAM_COMMENT)
|
||||
{
|
||||
sResult += L"<w:r>";
|
||||
sResult += L"<w:rPr>";
|
||||
sResult += m_oProperty.m_oCharProperty.RenderToOOX(oRenderParameter);
|
||||
sResult += L"</w:rPr>";
|
||||
sResult += L"<w:annotationRef/>";
|
||||
sResult += L"</w:r>";
|
||||
}
|
||||
oNewParam.nType = RENDER_TO_OOX_PARAM_RUN;
|
||||
|
||||
std::wstring ParagraphContent;
|
||||
|
||||
@ -379,7 +379,7 @@ public:
|
||||
|
||||
return date_str;
|
||||
}
|
||||
static int convertDateTime (std::wstring & dt_)
|
||||
static int convertDateTime (const std::wstring & dt_)
|
||||
{
|
||||
int result = 0;
|
||||
|
||||
|
||||
236
ASCOfficeRtfFile/RtfFormatLib/source/Writer/OOXCommentsWriter.h
Normal file
236
ASCOfficeRtfFile/RtfFormatLib/source/Writer/OOXCommentsWriter.h
Normal file
@ -0,0 +1,236 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "OOXWriter.h"
|
||||
|
||||
class OOXCommentsWriter
|
||||
{
|
||||
public:
|
||||
OOXRelsWriterPtr m_oRelsWriter;
|
||||
|
||||
OOXCommentsWriter( OOXWriter& oWriter, RtfDocument& oDocument ) : m_oWriter(oWriter), m_oDocument(oDocument)
|
||||
{
|
||||
m_oRelsWriter = OOXRelsWriterPtr( new OOXRelsWriter( _T("comments.xml"), oDocument ) );
|
||||
oWriter.m_oCustomRelsWriter.push_back( m_oRelsWriter );
|
||||
}
|
||||
void SetCommentEnd(const std::wstring & ref) //for author
|
||||
{
|
||||
m_sCurrent_ref = ref;
|
||||
}
|
||||
void AddComment( const std::wstring & ref, int nID)
|
||||
{
|
||||
_comment comment(nID);
|
||||
m_mapComments.insert(std::make_pair(ref, comment));
|
||||
}
|
||||
void AddCommentID( const std::wstring & id)
|
||||
{
|
||||
std::map<std::wstring, _comment>::iterator pFind = m_mapComments.find(m_sCurrent_ref);
|
||||
|
||||
if (pFind != m_mapComments.end())
|
||||
{
|
||||
pFind->second.authorId = id;
|
||||
}
|
||||
}
|
||||
void AddCommentAuthor( const std::wstring & author)
|
||||
{
|
||||
std::map<std::wstring, _comment>::iterator pFind = m_mapComments.find(m_sCurrent_ref);
|
||||
|
||||
if (pFind != m_mapComments.end())
|
||||
{
|
||||
pFind->second.author = author;
|
||||
}
|
||||
}
|
||||
void AddCommentContent( const std::wstring & ref, const std::wstring & paraId, const std::wstring & content)
|
||||
{
|
||||
std::map<std::wstring, _comment>::iterator pFind = m_mapComments.find(ref);
|
||||
|
||||
if (pFind != m_mapComments.end())
|
||||
{
|
||||
pFind->second.content = content;
|
||||
pFind->second.paraId = paraId;
|
||||
|
||||
m_mapCommentsParent.insert(std::make_pair(pFind->second.nID, paraId));
|
||||
}
|
||||
}
|
||||
void AddCommentParent( const std::wstring & ref, const std::wstring & parent)
|
||||
{
|
||||
std::map<std::wstring, _comment>::iterator pFind = m_mapComments.find(ref);
|
||||
|
||||
if (pFind != m_mapComments.end())
|
||||
{
|
||||
pFind->second.nParentID = boost::lexical_cast<int>(parent);
|
||||
}
|
||||
}
|
||||
void AddCommentDate( const std::wstring & ref, const std::wstring & date)
|
||||
{
|
||||
std::map<std::wstring, _comment>::iterator pFind = m_mapComments.find(ref);
|
||||
|
||||
if (pFind != m_mapComments.end())
|
||||
{
|
||||
pFind->second.date = date;
|
||||
}
|
||||
}
|
||||
bool Save( std::wstring sFolder )
|
||||
{
|
||||
if( m_mapComments.empty() ) return false;
|
||||
|
||||
CFile file;
|
||||
if (file.CreateFile(sFolder + FILE_SEPARATOR_STR + _T("comments.xml"))) return false;
|
||||
|
||||
m_oWriter.m_oDocRels.AddRelationship( _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments"), _T("comments.xml") );
|
||||
m_oWriter.m_oContentTypes.AddContent( _T("application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml"), _T("/word/comments.xml") );
|
||||
|
||||
std::wstring sXml = CreateXml();
|
||||
|
||||
std::string sXmlUTF = NSFile::CUtf8Converter::GetUtf8StringFromUnicode(sXml);
|
||||
|
||||
file.WriteFile((void*)sXmlUTF.c_str(), (DWORD)sXmlUTF.length());
|
||||
|
||||
file.CloseFile();
|
||||
//-------------------------------------------------------------------------------------------------------------------------
|
||||
if (file.CreateFile(sFolder + FILE_SEPARATOR_STR + L"commentsExtended.xml")) return false;
|
||||
|
||||
m_oWriter.m_oDocRels.AddRelationship( L"http://schemas.microsoft.com/office/2011/relationships/commentsExtended", L"commentsExtended.xml" );
|
||||
m_oWriter.m_oContentTypes.AddContent( L"application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml", L"/word/commentsExtended.xml" );
|
||||
|
||||
sXml = CreateXmlExtended();
|
||||
|
||||
sXmlUTF = NSFile::CUtf8Converter::GetUtf8StringFromUnicode(sXml);
|
||||
|
||||
file.WriteFile((void*)sXmlUTF.c_str(), (DWORD)sXmlUTF.length());
|
||||
|
||||
file.CloseFile();
|
||||
return true;
|
||||
}
|
||||
struct _comment
|
||||
{
|
||||
_comment(int id) : nID(id) {}
|
||||
int nID = 0;
|
||||
int nParentID = 0;
|
||||
std::wstring author;
|
||||
std::wstring date;
|
||||
std::wstring content;
|
||||
std::wstring authorId;
|
||||
std::wstring paraId;
|
||||
|
||||
};
|
||||
std::map<std::wstring, _comment> m_mapComments;
|
||||
private:
|
||||
RtfDocument& m_oDocument;
|
||||
OOXWriter& m_oWriter;
|
||||
|
||||
std::wstring m_sCurrent_ref;
|
||||
std::wstring m_sCommentsExtended;
|
||||
std::map<int, std::wstring> m_mapCommentsParent;
|
||||
|
||||
std::wstring CreateXml()
|
||||
{
|
||||
std::wstring sResult = L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n";
|
||||
|
||||
sResult += L"<w:comments \
|
||||
xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" \
|
||||
xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \
|
||||
xmlns:o=\"urn:schemas-microsoft-com:office:office\" \
|
||||
xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" \
|
||||
xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" \
|
||||
xmlns:v=\"urn:schemas-microsoft-com:vml\" \
|
||||
xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" \
|
||||
xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" \
|
||||
xmlns:w10=\"urn:schemas-microsoft-com:office:word\" \
|
||||
xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" \
|
||||
xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" \
|
||||
xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/wordml\" \
|
||||
xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" \
|
||||
xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" \
|
||||
xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" \
|
||||
xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" \
|
||||
mc:Ignorable=\"w14 w15 wp14\">";
|
||||
|
||||
for (std::map<std::wstring, _comment>::iterator it = m_mapComments.begin(); it != m_mapComments.end(); ++it)
|
||||
{
|
||||
sResult += L"<w:comment w:id=\"" + std::to_wstring(it->second.nID) + L"\" w:author=\"" +
|
||||
it->second.author + L"\" w:date=\"" + it->second.date + L"\" w:initials=\"" + it->second.authorId + L"\">";
|
||||
sResult += it->second.content;
|
||||
|
||||
sResult += L"</w:comment>";
|
||||
//--------------------------------------------------------
|
||||
m_sCommentsExtended += L"<w15:commentEx w15:paraId=\"" + it->second.paraId + L"\"";
|
||||
if (it->second.nParentID != 0)
|
||||
{
|
||||
it->second.nParentID = it->second.nID + it->second.nParentID;
|
||||
|
||||
std::map<int, std::wstring>::iterator pFind = m_mapCommentsParent.find(it->second.nParentID);
|
||||
|
||||
if (pFind != m_mapCommentsParent.end())
|
||||
{
|
||||
m_sCommentsExtended += L" w15:paraIdParent=\"" + pFind->second + L"\"";
|
||||
}
|
||||
}
|
||||
m_sCommentsExtended += L" w15:done=\"0\"/>";
|
||||
|
||||
}
|
||||
sResult += L"</w:comments>";
|
||||
return sResult;
|
||||
}
|
||||
std::wstring CreateXmlExtended()
|
||||
{
|
||||
std::wstring sResult;
|
||||
sResult += L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n";
|
||||
|
||||
sResult += L"<w15:commentsEx \
|
||||
xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" \
|
||||
xmlns:cx=\"http://schemas.microsoft.com/office/drawing/2014/chartex\" \
|
||||
xmlns:cx1=\"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex\" \
|
||||
xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \
|
||||
xmlns:o=\"urn:schemas-microsoft-com:office:office\" \
|
||||
xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" \
|
||||
xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" \
|
||||
xmlns:v=\"urn:schemas-microsoft-com:vml\" \
|
||||
xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" \
|
||||
xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" \
|
||||
xmlns:w10=\"urn:schemas-microsoft-com:office:word\" \
|
||||
xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" \
|
||||
xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" \
|
||||
xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/wordml\" \
|
||||
xmlns:w16se=\"http://schemas.microsoft.com/office/word/2015/wordml/symex\" \
|
||||
xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" \
|
||||
xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" \
|
||||
xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" \
|
||||
xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" \
|
||||
mc:Ignorable=\"w14 w15 w16se wp14\">";
|
||||
sResult += m_sCommentsExtended;
|
||||
sResult += L"</w15:commentsEx>";
|
||||
return sResult;
|
||||
}
|
||||
|
||||
};
|
||||
@ -51,27 +51,28 @@ std::wstring OOXDocumentWriter::CreateXmlStart()
|
||||
|
||||
//пишем document.xml
|
||||
std::wstring sResult = L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\n";
|
||||
sResult += L"<w:document ";
|
||||
|
||||
sResult += L"xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" \
|
||||
xmlns:cx=\"http://schemas.microsoft.com/office/drawing/2014/chartex\" \
|
||||
xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \
|
||||
xmlns:o=\"urn:schemas-microsoft-com:office:office\" \
|
||||
xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" \
|
||||
xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" \
|
||||
xmlns:v=\"urn:schemas-microsoft-com:vml\" \
|
||||
xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" \
|
||||
xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" \
|
||||
xmlns:w10=\"urn:schemas-microsoft-com:office:word\" \
|
||||
sResult += L"<w:document \
|
||||
xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" \
|
||||
xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" \
|
||||
xmlns:v=\"urn:schemas-microsoft-com:vml\" \
|
||||
xmlns:o=\"urn:schemas-microsoft-com:office:office\" \
|
||||
xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" \
|
||||
xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" \
|
||||
xmlns:w10=\"urn:schemas-microsoft-com:office:word\" \
|
||||
xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" \
|
||||
xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" \
|
||||
xmlns:cx=\"http://schemas.microsoft.com/office/drawing/2014/chartex\" \
|
||||
xmlns:cx1=\"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex\" \
|
||||
xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \
|
||||
xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" \
|
||||
xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" \
|
||||
xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/wordml\" \
|
||||
xmlns:w16se=\"http://schemas.microsoft.com/office/word/2015/wordml/symex\" \
|
||||
xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" \
|
||||
xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" \
|
||||
xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" \
|
||||
xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" \
|
||||
xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" \
|
||||
mc:Ignorable=\"w14 wp14\"";
|
||||
sResult += L">";
|
||||
mc:Ignorable=\"w14 w15 w16se wp14\">";
|
||||
|
||||
if (m_oDocument.m_pBackground)
|
||||
{
|
||||
|
||||
@ -41,6 +41,7 @@
|
||||
#include "OOXSettingsWriter.h"
|
||||
#include "OOXThemeWriter.h"
|
||||
#include "OOXFootnoteWriter.h"
|
||||
#include "OOXCommentsWriter.h"
|
||||
|
||||
#include "../../../../Common/DocxFormat/Source/DocxFormat/Docx.h"
|
||||
#include "../../../../Common/DocxFormat/Source/DocxFormat/App.h"
|
||||
@ -53,11 +54,13 @@ OOXWriter::OOXWriter( RtfDocument& oDocument, std::wstring sPath ) :
|
||||
m_sTargetFolder ( sPath.c_str() ),
|
||||
m_oRels ( L"", oDocument ),
|
||||
m_nCurTrackChangesId( 0),
|
||||
m_nextParaId ( 0x00000000),
|
||||
m_oDocRels ( L"document.xml", oDocument )
|
||||
{
|
||||
m_nCurFitWidth = PROP_DEF;
|
||||
m_poFootnoteWriter = NULL;
|
||||
m_poEndnoteWriter = NULL;
|
||||
m_poCommentsWriter = NULL;
|
||||
|
||||
m_poDocumentWriter = new OOXDocumentWriter ( *this, m_oDocument );
|
||||
m_poFootnoteWriter = new OOXFootnoteWriter ( *this, m_oDocument );
|
||||
@ -66,6 +69,7 @@ OOXWriter::OOXWriter( RtfDocument& oDocument, std::wstring sPath ) :
|
||||
m_poNumberingWriter = new OOXNumberingWriter( *this, m_oDocument );
|
||||
m_poSettingsWriter = new OOXSettingsWriter ( *this, m_oDocument );
|
||||
m_poStylesWriter = new OOXStylesWriter ( *this, m_oDocument );
|
||||
m_poCommentsWriter = new OOXCommentsWriter ( *this, m_oDocument );
|
||||
|
||||
m_poDocPropsApp = new OOX::CApp(NULL);
|
||||
m_poDocPropsCore = new OOX::CCore(NULL);
|
||||
@ -88,6 +92,7 @@ OOXWriter::OOXWriter( RtfDocument& oDocument, std::wstring sPath ) :
|
||||
}
|
||||
OOXWriter::~OOXWriter()
|
||||
{
|
||||
delete ((OOXCommentsWriter*) m_poCommentsWriter);
|
||||
delete ((OOXDocumentWriter*) m_poDocumentWriter);
|
||||
delete ((OOXFootnoteWriter*) m_poFootnoteWriter);
|
||||
delete ((OOXEndnoteWriter*) m_poEndnoteWriter);
|
||||
@ -142,10 +147,11 @@ bool OOXWriter::SaveByItemEnd()
|
||||
|
||||
((OOXFootnoteWriter*) m_poFootnoteWriter)->Save (pathWord.GetPath());
|
||||
((OOXEndnoteWriter*) m_poEndnoteWriter)->Save (pathWord.GetPath());
|
||||
((OOXCommentsWriter*) m_poCommentsWriter)->Save (pathWord.GetPath());
|
||||
((OOXNumberingWriter*) m_poNumberingWriter)->Save (m_sTargetFolder);
|
||||
((OOXStylesWriter*) m_poStylesWriter)->Save (m_sTargetFolder);
|
||||
((OOXFontTableWriter*) m_poFontTableWriter)->Save (m_sTargetFolder);
|
||||
|
||||
|
||||
((OOXSettingsWriter*) m_poSettingsWriter)->Save (m_sTargetFolder); //setting в последнюю очередь
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
|
||||
@ -44,6 +44,8 @@ public:
|
||||
int m_nCurFitWidth;
|
||||
int m_nCurTrackChangesId;
|
||||
|
||||
long int m_nextParaId;
|
||||
|
||||
OOXRelsWriter m_oDocRels;
|
||||
OOXRelsWriter m_oRels;
|
||||
|
||||
@ -57,6 +59,7 @@ public:
|
||||
void* m_poNumberingWriter;
|
||||
void* m_poSettingsWriter;
|
||||
void* m_poStylesWriter;
|
||||
void* m_poCommentsWriter;
|
||||
|
||||
void* m_poDocPropsApp;
|
||||
void* m_poDocPropsCore;
|
||||
|
||||
@ -40,6 +40,19 @@
|
||||
#include <algorithm>
|
||||
#include <string>
|
||||
|
||||
#if defined(_WIN64)
|
||||
#pragma comment(lib, "../../build/bin/icu/win_64/icuuc.lib")
|
||||
#elif defined (_WIN32)
|
||||
|
||||
#if defined(_DEBUG)
|
||||
#pragma comment(lib, "../../build/lib/win_32/DEBUG/graphics.lib")
|
||||
#pragma comment(lib, "../../build/lib/win_32/DEBUG/kernel.lib")
|
||||
#else
|
||||
#pragma comment(lib, "../../build/lib/win_32/graphics.lib")
|
||||
#pragma comment(lib, "../../build/lib/win_32/kernel.lib")
|
||||
#endif
|
||||
#pragma comment(lib, "../../build/bin/icu/win_32/icuuc.lib")
|
||||
#endif
|
||||
HRESULT convert_single(std::wstring srcFileName)
|
||||
{
|
||||
int n1 = srcFileName.rfind(_T('.'));
|
||||
|
||||
@ -2,82 +2,18 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual Studio 2005
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RtfFormatLib", "..\RtfFormatLib\Win32\RtfFormatLib.vcproj", "{AF2D00A7-A351-4700-AE88-C1D9ADE29345}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540} = {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DocxFormat", "..\..\Common\DocxFormat\Projects\DocxFormat2005.vcproj", "{A100103A-353E-45E8-A9B8-90B87CC5C0B0}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0} = {21663823-DE45-479B-91D0-B4FEF4916EF0}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "raster", "..\..\DesktopEditor\raster\raster_vs2005.vcproj", "{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36} = {BC52A07C-A797-423D-8C4F-8678805BBB36}
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3} = {0588563C-F05C-428C-B21A-DD74756628B3}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cximage", "..\..\DesktopEditor\cximage\CxImage\cximage_vs2005.vcproj", "{BC52A07C-A797-423D-8C4F-8678805BBB36}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470} = {818753F2-DBB9-4D3B-898A-A604309BE470}
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D} = {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1} = {EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E} = {9A037A69-D1DF-4505-AB2A-6CB3641C476E}
|
||||
{40A69F40-063E-43FD-8543-455495D8733E} = {40A69F40-063E-43FD-8543-455495D8733E}
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3} = {0588563C-F05C-428C-B21A-DD74756628B3}
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169} = {DF861D33-9BC1-418C-82B1-581F590FE169}
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239} = {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7} = {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jasper", "..\..\DesktopEditor\cximage\jasper\jasper_vs2005.vcproj", "{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jbig", "..\..\DesktopEditor\cximage\jbig\jbig_vs2005.vcproj", "{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jpeg", "..\..\DesktopEditor\cximage\jpeg\Jpeg_vs2005.vcproj", "{818753F2-DBB9-4D3B-898A-A604309BE470}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpsd", "..\..\DesktopEditor\cximage\libpsd\libpsd_vs2005.vcproj", "{9A037A69-D1DF-4505-AB2A-6CB3641C476E}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mng", "..\..\DesktopEditor\cximage\mng\mng_vs2005.vcproj", "{40A69F40-063E-43FD-8543-455495D8733E}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "png", "..\..\DesktopEditor\cximage\png\png_vs2005.vcproj", "{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libdcr", "..\..\DesktopEditor\cximage\raw\libdcr_vs2005.vcproj", "{DF861D33-9BC1-418C-82B1-581F590FE169}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tiff", "..\..\DesktopEditor\cximage\tiff\Tiff_vs2005.vcproj", "{0588563C-F05C-428C-B21A-DD74756628B3}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jbig2", "..\..\DesktopEditor\raster\JBig2\win32\jbig2.vcproj", "{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OfficeUtilsLib", "..\..\OfficeUtils\win32\OfficeUtilsLib.vcproj", "{F8274B05-168E-4D6E-B843-AA7510725363}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RtfFormatTest", "RtfFormatTest.vcproj", "{0F49D5D1-A8D3-4F97-8BC1-E2F65BB00C10}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B} = {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}
|
||||
{AF2D00A7-A351-4700-AE88-C1D9ADE29345} = {AF2D00A7-A351-4700-AE88-C1D9ADE29345}
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302} = {36636678-AE25-4BE6-9A34-2561D1BCF302}
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD} = {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}
|
||||
{A100103A-353E-45E8-A9B8-90B87CC5C0B0} = {A100103A-353E-45E8-A9B8-90B87CC5C0B0}
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2} = {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56} = {C739151F-5384-41DF-A1A6-F089E2C1AD56}
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363} = {F8274B05-168E-4D6E-B843-AA7510725363}
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0} = {21663823-DE45-479B-91D0-B4FEF4916EF0}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PPTXFormat", "..\..\ASCOfficePPTXFile\PPTXLib\PPTXFormat.vcproj", "{36636678-AE25-4BE6-9A34-2561D1BCF302}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "graphics", "..\..\DesktopEditor\graphics\graphics_vs2005.vcproj", "{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD} = {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "font_engine", "..\..\DesktopEditor\fontengine\font_engine_vs2005.vcproj", "{C739151F-5384-41DF-A1A6-F089E2C1AD56}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "agg2d", "..\..\DesktopEditor\agg-2.4\agg_vs2005.vcproj", "{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "freetype", "..\..\DesktopEditor\freetype-2.5.2\builds\windows\vc2005\freetype.vcproj", "{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libxml2", "..\..\DesktopEditor\xml\build\vs2005\libxml2.vcproj", "{21663823-DE45-479B-91D0-B4FEF4916EF0}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
@ -102,102 +38,6 @@ Global
|
||||
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Release|Win32.Build.0 = Release|Win32
|
||||
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Release|x64.ActiveCfg = Release|x64
|
||||
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Release|x64.Build.0 = Release|x64
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Debug|x64.Build.0 = Debug|x64
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Release|Win32.Build.0 = Release|Win32
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Release|x64.ActiveCfg = Release|x64
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Release|x64.Build.0 = Release|x64
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.Debug|x64.Build.0 = Debug|x64
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.Release|Win32.Build.0 = Release|Win32
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.Release|x64.ActiveCfg = Release|x64
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.Release|x64.Build.0 = Release|x64
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Debug|x64.Build.0 = Debug|x64
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Release|Win32.Build.0 = Release|Win32
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Release|x64.ActiveCfg = Release|x64
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Release|x64.Build.0 = Release|x64
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Debug|x64.Build.0 = Debug|x64
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Release|Win32.Build.0 = Release|Win32
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Release|x64.ActiveCfg = Release|x64
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Release|x64.Build.0 = Release|x64
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.Debug|x64.Build.0 = Debug|x64
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.Release|Win32.Build.0 = Release|Win32
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.Release|x64.ActiveCfg = Release|x64
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.Release|x64.Build.0 = Release|x64
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Debug|x64.Build.0 = Debug|x64
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Release|Win32.Build.0 = Release|Win32
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Release|x64.ActiveCfg = Release|x64
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Release|x64.Build.0 = Release|x64
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.Debug|x64.Build.0 = Debug|x64
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.Release|Win32.Build.0 = Release|Win32
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.Release|x64.ActiveCfg = Release|x64
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.Release|x64.Build.0 = Release|x64
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Debug|x64.Build.0 = Debug|x64
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Release|Win32.Build.0 = Release|Win32
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Release|x64.ActiveCfg = Release|x64
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Release|x64.Build.0 = Release|x64
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.Debug|x64.Build.0 = Debug|x64
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.Release|Win32.Build.0 = Release|Win32
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.Release|x64.ActiveCfg = Release|x64
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.Release|x64.Build.0 = Release|x64
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.Debug|x64.Build.0 = Debug|x64
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.Release|Win32.Build.0 = Release|Win32
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.Release|x64.ActiveCfg = Release|x64
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.Release|x64.Build.0 = Release|x64
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Debug|x64.Build.0 = Debug|x64
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Release|Win32.Build.0 = Release|Win32
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Release|x64.ActiveCfg = Release|x64
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Release|x64.Build.0 = Release|x64
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.Debug|x64.Build.0 = Debug|x64
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.Release|Win32.Build.0 = Release|Win32
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.Release|x64.ActiveCfg = Release|x64
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.Release|x64.Build.0 = Release|x64
|
||||
{0F49D5D1-A8D3-4F97-8BC1-E2F65BB00C10}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{0F49D5D1-A8D3-4F97-8BC1-E2F65BB00C10}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{0F49D5D1-A8D3-4F97-8BC1-E2F65BB00C10}.Debug|x64.ActiveCfg = Debug|x64
|
||||
@ -214,46 +54,6 @@ Global
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302}.Release|Win32.Build.0 = Release|Win32
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302}.Release|x64.ActiveCfg = Release|x64
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302}.Release|x64.Build.0 = Release|x64
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Debug|x64.Build.0 = Debug|x64
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Release|Win32.Build.0 = Release|Win32
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Release|x64.ActiveCfg = Release|x64
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Release|x64.Build.0 = Release|x64
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.Debug|x64.Build.0 = Debug|x64
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.Release|Win32.Build.0 = Release|Win32
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.Release|x64.ActiveCfg = Release|x64
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.Release|x64.Build.0 = Release|x64
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Debug|x64.Build.0 = Debug|x64
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Release|Win32.Build.0 = Release|Win32
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Release|x64.ActiveCfg = Release|x64
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Release|x64.Build.0 = Release|x64
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|x64.Build.0 = Debug|x64
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|Win32.Build.0 = Release|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|x64.ActiveCfg = Release|x64
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|x64.Build.0 = Release|x64
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Debug|x64.Build.0 = Debug|x64
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Release|Win32.Build.0 = Release|Win32
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Release|x64.ActiveCfg = Release|x64
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@ -48,7 +48,7 @@
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;AVS_USE_CONVERT_PPTX_TOCUSTOM_VML;DONT_WRITE_EMBEDDED_FONTS"
|
||||
MinimalRebuild="false"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
@ -427,23 +427,7 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\DesktopEditor\xml\src\xmldom.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\DesktopEditor\xml\src\xmllight.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath="..\..\build\bin\icu\win_32\icudt.lib"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\build\bin\icu\win_32\icuuc.lib"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="RtfFormatTest.cpp"
|
||||
>
|
||||
|
||||
@ -708,7 +708,7 @@ NAMESPACE_END
|
||||
// ***************** Miscellaneous ********************
|
||||
|
||||
// Nearly all Intel's and AMD's have SSE. Enable it independent of SSE ASM and intrinscs
|
||||
#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_PPC32 || CRYPTOPP_BOOL_PPC64) && !defined(CRYPTOPP_DISABLE_ASM)
|
||||
#if (CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_PPC32 || CRYPTOPP_BOOL_PPC64) && !defined(CRYPTOPP_DISABLE_ASM) && !defined(_IOS)
|
||||
#define CRYPTOPP_BOOL_ALIGN16 1
|
||||
#else
|
||||
#define CRYPTOPP_BOOL_ALIGN16 0
|
||||
|
||||
@ -30,8 +30,8 @@ fi
|
||||
echo "$platform$arch"
|
||||
|
||||
if [ ! -f Makefile ]; then
|
||||
perl ./Configure $platform$arch
|
||||
./config
|
||||
#perl ./Configure $platform$arch
|
||||
./config no-shared no-asm
|
||||
fi
|
||||
|
||||
make
|
||||
|
||||
@ -1,12 +1,8 @@
|
||||
core_linux {
|
||||
|
||||
#DEFINES += XMLSEC_OPENSSL_110
|
||||
#INCLUDEPATH += $$CORE_ROOT_DIR/Common/3dParty/openssl/openssl/include
|
||||
#LIBS += -L$$CORE_ROOT_DIR/Common/3dParty/openssl/openssl -lssl
|
||||
#LIBS += -L$$CORE_ROOT_DIR/Common/3dParty/openssl/openssl -lcrypto
|
||||
INCLUDEPATH += $$PWD/openssl/include
|
||||
|
||||
#INCLUDEPATH += /usr/include/openssl
|
||||
LIBS += -lssl
|
||||
LIBS += -lcrypto
|
||||
LIBS += -L$$PWD/openssl/libssl.a
|
||||
LIBS += -L$$PWD/openssl/libcrypto.a
|
||||
|
||||
}
|
||||
|
||||
@ -413,6 +413,18 @@ namespace OOX
|
||||
{
|
||||
return type().DefaultFileName();
|
||||
}
|
||||
void SetDefaults()
|
||||
{
|
||||
SetApplication(L"ONLYOFFICE");
|
||||
#if defined(INTVER)
|
||||
SetAppVersion(VALUE2STR(INTVER));
|
||||
#endif
|
||||
SetDocSecurity(0);
|
||||
SetScaleCrop(false);
|
||||
SetLinksUpToDate(false);
|
||||
SetSharedDoc(false);
|
||||
SetHyperlinksChanged(false);
|
||||
}
|
||||
void SetApplication(const std::wstring& sVal)
|
||||
{
|
||||
m_sApplication = sVal;
|
||||
|
||||
@ -336,7 +336,15 @@ namespace OOX
|
||||
{
|
||||
sName = oReader.GetName();
|
||||
if ( L"w:comment" == sName )
|
||||
m_arrComments.push_back( new CComment(oReader) );
|
||||
{
|
||||
CComment* pComment = new CComment(oReader);
|
||||
|
||||
if ((pComment) && (pComment->m_oId.IsInit()))
|
||||
{
|
||||
m_mapComments.insert( std::make_pair( pComment->m_oId->GetValue(), m_arrComments.size()));
|
||||
}
|
||||
m_arrComments.push_back( pComment );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -357,7 +365,8 @@ namespace OOX
|
||||
return type().DefaultFileName();
|
||||
}
|
||||
|
||||
std::vector<CComment*> m_arrComments;
|
||||
std::vector<CComment*> m_arrComments;
|
||||
std::map<int, int> m_mapComments; //id, index
|
||||
|
||||
};
|
||||
class CCommentExt : public WritingElement
|
||||
@ -401,10 +410,9 @@ namespace OOX
|
||||
}
|
||||
|
||||
public:
|
||||
// Attributes
|
||||
nullable<SimpleTypes::CLongHexNumber<> > m_oParaId;
|
||||
nullable<SimpleTypes::CLongHexNumber<> > m_oParaIdParent;
|
||||
nullable<SimpleTypes::COnOff<> > m_oDone;
|
||||
nullable<SimpleTypes::CLongHexNumber<> > m_oParaId;
|
||||
nullable<SimpleTypes::CLongHexNumber<> > m_oParaIdParent;
|
||||
nullable<SimpleTypes::COnOff<> > m_oDone;
|
||||
};
|
||||
|
||||
class CCommentsExt : public OOX::File
|
||||
@ -449,7 +457,14 @@ namespace OOX
|
||||
{
|
||||
sName = oReader.GetName();
|
||||
if ( L"w15:commentEx" == sName )
|
||||
m_arrComments.push_back( new CCommentExt(oReader) );
|
||||
{
|
||||
CCommentExt* pCommentExt = new CCommentExt(oReader);
|
||||
if ((pCommentExt) && (pCommentExt->m_oParaId.IsInit()))
|
||||
{
|
||||
m_mapComments.insert( std::make_pair( pCommentExt->m_oParaId->GetValue(), m_arrComments.size()));
|
||||
m_arrComments.push_back( pCommentExt );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -470,7 +485,8 @@ namespace OOX
|
||||
return type().DefaultFileName();
|
||||
}
|
||||
|
||||
std::vector<CCommentExt*> m_arrComments;
|
||||
std::vector<CCommentExt*> m_arrComments;
|
||||
std::map<int, int> m_mapComments; //paraId, index
|
||||
};
|
||||
|
||||
class CPresenceInfo : public WritingElement
|
||||
|
||||
@ -57,8 +57,6 @@ namespace OOX
|
||||
virtual ~CCore()
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void read(const CPath& oPath)
|
||||
{
|
||||
XmlUtils::CXmlNode oProperties;
|
||||
@ -230,7 +228,6 @@ namespace OOX
|
||||
oContent.Registration( type().OverrideType(), oDirectory, oPath.GetFilename() );
|
||||
}
|
||||
|
||||
public:
|
||||
virtual const FileType type() const
|
||||
{
|
||||
return FileTypes::Core;
|
||||
@ -244,7 +241,11 @@ namespace OOX
|
||||
{
|
||||
return type().DefaultFileName();
|
||||
}
|
||||
|
||||
void SetDefaults()
|
||||
{
|
||||
m_sCreator = L"";
|
||||
m_sLastModifiedBy = L"";
|
||||
}
|
||||
void SetCreator(std::wstring sVal)
|
||||
{
|
||||
m_sCreator = sVal;
|
||||
|
||||
@ -1,6 +1,10 @@
|
||||
VERSION = 2.4.535.0
|
||||
|
||||
VERSION = $$cat(version.txt)
|
||||
DEFINES += INTVER=$$VERSION
|
||||
|
||||
QMAKE_TARGET_COMPANY = Ascensio System SIA
|
||||
QMAKE_TARGET_COPYRIGHT = Ascensio System SIA Copyright (c) 2018
|
||||
|
||||
# CONFIGURATION
|
||||
CONFIG(debug, debug|release) {
|
||||
CONFIG += core_debug
|
||||
|
||||
1
Common/version.txt
Normal file
1
Common/version.txt
Normal file
@ -0,0 +1 @@
|
||||
2.4.537.0
|
||||
@ -29,14 +29,15 @@
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
#include "ApplicationFonts.h"
|
||||
//#include "ApplicationFonts.h"
|
||||
#include "ApplicationFontsWorker.h"
|
||||
#include "../common/File.h"
|
||||
#include "../common/Array.h"
|
||||
#include "../common/Directory.h"
|
||||
#include "./MemoryStream.h"
|
||||
#include "./../graphics/pro/Fonts.h"
|
||||
|
||||
using namespace NSFonts;
|
||||
#include "./MemoryStream.h"
|
||||
#include "./../graphics/pro/Fonts.h"
|
||||
|
||||
using namespace NSFonts;
|
||||
|
||||
namespace NSFontsApplication
|
||||
{
|
||||
@ -347,11 +348,11 @@ namespace NSFontsApplication
|
||||
}
|
||||
};
|
||||
|
||||
static std::vector<std::wstring> SaveAllFontsJS(CApplicationFonts& applicationFonts, CStringWriter& oWriterJS)
|
||||
static std::vector<std::wstring> SaveAllFontsJS(NSFonts::IApplicationFonts* applicationFonts, CStringWriter& oWriterJS)
|
||||
{
|
||||
std::vector<std::wstring> arrNames;
|
||||
|
||||
std::vector<NSFonts::CFontInfo*>* pList = applicationFonts.GetList()->GetFonts();
|
||||
std::vector<NSFonts::CFontInfo*>* pList = applicationFonts->GetList()->GetFonts();
|
||||
|
||||
#ifdef _IOS
|
||||
|
||||
@ -361,7 +362,7 @@ namespace NSFontsApplication
|
||||
CFontInfo* pInfo = pList->operator [](i);
|
||||
|
||||
if (pInfo->m_wsFontName.find(L".") == 0)
|
||||
{
|
||||
{
|
||||
pList->erase(pList->begin() + i);
|
||||
// странные шрифты какие-то есть в ios
|
||||
//pList->RemoveAt(i);
|
||||
@ -556,7 +557,7 @@ namespace NSFontsApplication
|
||||
{
|
||||
BYTE* pData = NULL;
|
||||
LONG lLen = 0;
|
||||
applicationFonts.GetList()->ToBuffer(&pData, &lLen, L"", true);
|
||||
applicationFonts->GetList()->ToBuffer(&pData, &lLen, L"", true);
|
||||
|
||||
char* cData64 = NULL;
|
||||
int nData64Dst = 0;
|
||||
@ -658,14 +659,14 @@ std::vector<std::wstring> CApplicationFontsWorker::CheckApplication(bool bIsNeed
|
||||
std::vector<std::wstring> arrNames;
|
||||
|
||||
std::vector<std::wstring> fonts;
|
||||
CApplicationFonts oFonts;
|
||||
NSFonts::IApplicationFonts* pFonts = NSFonts::NSApplication::Create();
|
||||
|
||||
pDataDst = NULL;
|
||||
nLenDst = 0;
|
||||
|
||||
if (bIsNeedSystemFonts)
|
||||
{
|
||||
fonts = oFonts.GetSetupFontFiles();
|
||||
fonts = pFonts->GetSetupFontFiles();
|
||||
}
|
||||
|
||||
for (std::vector<std::wstring>::iterator iter = m_arAdditionalFolders.begin(); iter != m_arAdditionalFolders.end(); ++iter)
|
||||
@ -720,10 +721,10 @@ std::vector<std::wstring> CApplicationFontsWorker::CheckApplication(bool bIsNeed
|
||||
}
|
||||
|
||||
// произошли изменения
|
||||
oFonts.InitializeFromArrayFiles(fonts);
|
||||
pFonts->InitializeFromArrayFiles(fonts);
|
||||
|
||||
NSFontsApplication::CStringWriter oWriterJS;
|
||||
arrNames = NSFontsApplication::SaveAllFontsJS(oFonts, oWriterJS);
|
||||
arrNames = NSFontsApplication::SaveAllFontsJS(pFonts, oWriterJS);
|
||||
|
||||
// теперь нужно записать новую дату
|
||||
NSMemoryStream::CMemoryStream oStream;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
@ -773,4 +773,32 @@ void CFontManager::SetSubpixelRendering(const bool& hmul, const bool& vmul)
|
||||
m_nRENDER_MODE = FT_RENDER_MODE_LCD_V;
|
||||
else
|
||||
m_nRENDER_MODE = FT_RENDER_MODE_NORMAL;
|
||||
}
|
||||
|
||||
void CFontManager::GetFace(double& d0, double& d1, double& d2)
|
||||
{
|
||||
d0 = 2048;
|
||||
d1 = 0;
|
||||
d2 = 0;
|
||||
|
||||
if (m_pFont)
|
||||
{
|
||||
TT_OS2* os2 = NULL;
|
||||
TT_Header* header = NULL;
|
||||
if (m_pFont->m_pFace)
|
||||
{
|
||||
if ((header = (TT_Header*)FT_Get_Sfnt_Table(m_pFont->m_pFace, ft_sfnt_head)) != NULL)
|
||||
{
|
||||
d1 = header->yMax;
|
||||
d2 = header->yMin;
|
||||
d0 = header->Units_Per_EM;
|
||||
}
|
||||
|
||||
if ((os2 = (TT_OS2*)FT_Get_Sfnt_Table(m_pFont->m_pFace, ft_sfnt_os2)) != NULL && os2->version != 0xFFFFU)
|
||||
{
|
||||
d1 = os2->usWinAscent;
|
||||
d2 = -os2->usWinDescent;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
@ -217,7 +217,9 @@ public:
|
||||
virtual std::wstring GetFontType();
|
||||
virtual unsigned int GetNameIndex(const std::wstring& wsName);
|
||||
|
||||
virtual void SetSubpixelRendering(const bool& hmul, const bool& vmul);
|
||||
virtual void SetSubpixelRendering(const bool& hmul, const bool& vmul);
|
||||
|
||||
virtual void GetFace(double& d0, double& d1, double& d2);
|
||||
};
|
||||
|
||||
#endif // _BUILD_FONT_ENGINE_FONTMANAGER_H_
|
||||
|
||||
@ -152,27 +152,7 @@ static inline unsigned char Div255(int nValue)
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
class CDIB : public IGrObject
|
||||
{
|
||||
public:
|
||||
BYTE* m_pBits;
|
||||
LONG m_lWidth;
|
||||
LONG m_lHeight;
|
||||
|
||||
public:
|
||||
CDIB() : IGrObject()
|
||||
{
|
||||
m_pBits = NULL;
|
||||
m_lWidth = 0;
|
||||
m_lHeight = 0;
|
||||
}
|
||||
virtual ~CDIB()
|
||||
{
|
||||
// delete all in system wrapper
|
||||
}
|
||||
|
||||
virtual INT Create(LONG lWidth, LONG lHeight, double dDPIX, double dDPIY) = 0;
|
||||
};
|
||||
class CDIB;
|
||||
|
||||
class CGraphics_ClipStateRecord
|
||||
{
|
||||
|
||||
@ -718,6 +718,16 @@ namespace Aggplus
|
||||
|
||||
return Ok;
|
||||
}
|
||||
|
||||
bool CGraphicsPath::IsPointInPath(const double& x, const double& y)
|
||||
{
|
||||
agg::rasterizer_scanline_aa<> rasterizer;
|
||||
agg::conv_curve<agg::path_storage> c_c_path(m_internal->m_agg_ps);
|
||||
rasterizer.add_path(c_c_path);
|
||||
|
||||
return rasterizer.hit_test((int)x, (int)y);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace Aggplus
|
||||
|
||||
@ -97,6 +97,7 @@ namespace Aggplus
|
||||
int EllipseArc3(double fX, double fY, double fXRad, double fYRad, double dAngle1, double dAngle2, double *pfXCur, double *pfYCur, INT bClockDirection = FALSE);
|
||||
int Ellipse(double fX, double fY, double fXRad, double fYRad);
|
||||
Status AddArc2(double fX, double fY, double fWidth, double fHeight, double fStartAngle, double fSweepAngle);
|
||||
bool IsPointInPath(const double& x, const double& y);
|
||||
|
||||
public:
|
||||
CGraphicsPath_private* m_internal;
|
||||
|
||||
@ -213,8 +213,13 @@ namespace Aggplus
|
||||
double CMatrix::ty() const
|
||||
{
|
||||
return m_internal->m_agg_mtx.ty;
|
||||
}
|
||||
double CMatrix::rotation()
|
||||
{
|
||||
return m_internal->m_agg_mtx.rotation();
|
||||
}
|
||||
|
||||
|
||||
void CMatrix::SetElements(const double& sx, const double& shy, const double& shx, const double& sy, const double& tx, const double& ty)
|
||||
{
|
||||
m_internal->m_agg_mtx.sx = sx;
|
||||
|
||||
@ -71,7 +71,7 @@ namespace Aggplus
|
||||
double shy() const;
|
||||
double tx() const;
|
||||
double ty() const;
|
||||
|
||||
double rotation();
|
||||
void SetElements(const double& sx, const double& shy, const double& shx, const double& sy, const double& tx = 0, const double& ty = 0);
|
||||
|
||||
Status GetElements(float* m) const;
|
||||
|
||||
@ -460,6 +460,10 @@ namespace NSFonts
|
||||
virtual bool IsItalic() = 0;
|
||||
virtual bool IsBold() = 0;
|
||||
|
||||
|
||||
virtual void SetItalic(const INT& value) = 0;
|
||||
virtual void SetNeedBold(const INT& value) = 0;
|
||||
|
||||
virtual bool IsSymbolic(bool bIsOS2Check = false) = 0;
|
||||
|
||||
virtual int IsUnicodeRangeAvailable(unsigned long ulBit, unsigned int un4ByteIndex) = 0;
|
||||
@ -565,6 +569,8 @@ namespace NSFonts
|
||||
virtual void SetSubpixelRendering(const bool& hmul, const bool& vmul) = 0;
|
||||
|
||||
virtual unsigned int GetNameIndex(const std::wstring& wsName) = 0;
|
||||
|
||||
virtual void GetFace(double& d0, double& d1, double& d2) = 0;
|
||||
|
||||
public:
|
||||
static IFontFile* LoadFontFile(CLibrary& library, IFontStream* pStream, int lFaceIndex);
|
||||
|
||||
@ -40,7 +40,31 @@
|
||||
#include "./Image.h"
|
||||
|
||||
#include "../IRenderer.h"
|
||||
#include "../structures.h"
|
||||
|
||||
namespace Aggplus {
|
||||
class CDIB : public IGrObject
|
||||
{
|
||||
public:
|
||||
BYTE* m_pBits;
|
||||
LONG m_lWidth;
|
||||
LONG m_lHeight;
|
||||
|
||||
public:
|
||||
CDIB() : IGrObject()
|
||||
{
|
||||
m_pBits = NULL;
|
||||
m_lWidth = 0;
|
||||
m_lHeight = 0;
|
||||
}
|
||||
virtual ~CDIB()
|
||||
{
|
||||
// delete all in system wrapper
|
||||
}
|
||||
|
||||
virtual INT Create(LONG lWidth, LONG lHeight, double dDPIX, double dDPIY) = 0;
|
||||
};
|
||||
}
|
||||
namespace NSGraphics
|
||||
{
|
||||
class GRAPHICS_DECL IGraphicsRenderer : public IRenderer
|
||||
@ -63,9 +87,46 @@ namespace NSGraphics
|
||||
public:
|
||||
virtual void CreateFromBgraFrame(CBgraFrame* pFrame) = 0;
|
||||
virtual void SetCoordTransformOffset(double dOffsetX, double dOffsetY) = 0;
|
||||
|
||||
|
||||
virtual void SavePen(NSStructures::CPen& oPen) = 0;
|
||||
virtual void RestorePen(const NSStructures::CPen& oPen) = 0;
|
||||
|
||||
virtual void SaveBrush(NSStructures::CBrush& oBrush) = 0;
|
||||
virtual void RestoreBrush(const NSStructures::CBrush& oBrush) = 0;
|
||||
|
||||
virtual void put_GlobalAlphaEnabled(const bool& bEnabled, const double& dVal) = 0;
|
||||
virtual void put_IntegerGrid(const bool& bEnabled) = 0;
|
||||
virtual bool get_IntegerGrid() = 0;
|
||||
virtual void AddRect(const double& x, const double& y, const double& w, const double& h) = 0;
|
||||
virtual void SetFontAttack() = 0;
|
||||
|
||||
virtual void Create(BYTE* pPixels, const Aggplus::CDoubleRect& oRect, LONG lWidthControl, LONG lHeightControl, Aggplus::CDIB* pDib = NULL) = 0;
|
||||
virtual void CreateFlip(BYTE* pPixels, const Aggplus::CDoubleRect& oRect, LONG lWidthControl, LONG lHeightControl, Aggplus::CDIB* pDib = NULL) = 0;
|
||||
|
||||
virtual Aggplus::CMatrix* GetFullTransform() = 0;
|
||||
virtual Aggplus::CMatrix* GetTransformMatrix() = 0;
|
||||
virtual void CalculateFullTransform() = 0;
|
||||
virtual void PathCommandRect(double x, double y, double w, double h) = 0;
|
||||
virtual Aggplus::CMatrix* GetCoordTransform() = 0;
|
||||
virtual void Fill() = 0;
|
||||
virtual void Stroke() = 0;
|
||||
virtual double GetPixW() = 0;
|
||||
virtual double GetPixH() = 0;
|
||||
|
||||
// smart methods
|
||||
virtual void drawHorLine(BYTE align, double y, double x, double r, double penW) = 0;
|
||||
virtual void drawHorLine2(BYTE align, double y, double x, double r, double penW) = 0;
|
||||
|
||||
virtual void drawVerLine(BYTE align, double x, double y, double b, double penW) = 0;
|
||||
virtual void drawHorLineExt(BYTE align, double y, double x, double r, double penW, double leftMW, double rightMW) = 0;
|
||||
|
||||
|
||||
};
|
||||
|
||||
GRAPHICS_DECL IGraphicsRenderer* Create();
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif // _GRAPHICS_EXPORTS_GRAPHICS_H_
|
||||
|
||||
@ -515,6 +515,9 @@ namespace MetaFile
|
||||
else //if (WINDING == unFillMode)
|
||||
unClipMode |= c_nClipRegionTypeWinding;
|
||||
|
||||
if (RGN_COPY == unMode)
|
||||
ResetClip();
|
||||
|
||||
m_pRenderer->put_ClipMode(unClipMode);
|
||||
m_pRenderer->BeginCommand(c_nClipType);
|
||||
m_pRenderer->BeginCommand(c_nPathType);
|
||||
|
||||
@ -232,7 +232,7 @@ static const struct ActionNamesEmf
|
||||
//-----------------------------------------------------------
|
||||
// 2.3.2 Clipping
|
||||
//-----------------------------------------------------------
|
||||
case EMR_EXCLUDECLIPRECT: Read_EMR_EXCLUDECLIPRECT(); break;
|
||||
case EMR_EXCLUDECLIPRECT: Read_EMR_EXCLUDECLIPRECT(); break;
|
||||
case EMR_EXTSELECTCLIPRGN: Read_EMR_EXTSELECTCLIPRGN(); break;
|
||||
case EMR_INTERSECTCLIPRECT: Read_EMR_INTERSECTCLIPRECT(); break;
|
||||
case EMR_SELECTCLIPPATH: Read_EMR_SELECTCLIPPATH(); break;
|
||||
|
||||
@ -211,7 +211,8 @@ namespace XmlUtils
|
||||
|
||||
if ((XmlNodeType_Element == eNodeType && nCurDepth == nDepth + 1)
|
||||
|| ((XmlNodeType_Text == eNodeType ||
|
||||
XmlNodeType_Whitespace == eNodeType) && nCurDepth == nDepth + 1))
|
||||
XmlNodeType_Whitespace == eNodeType ||
|
||||
XmlNodeType_SIGNIFICANT_WHITESPACE == eNodeType ) && nCurDepth == nDepth + 1))
|
||||
return true;
|
||||
else if (XmlNodeType_EndElement == eNodeType && nCurDepth == nDepth)
|
||||
return false;
|
||||
|
||||
@ -57,6 +57,7 @@
|
||||
69DA32F91CEE100E00E10AF0 /* libraster_ios.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 69DA32491CEE094A00E10AF0 /* libraster_ios.a */; };
|
||||
69EC66D91E01775B003527E2 /* libUnicodeConverter.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 69EC66D21E01770D003527E2 /* libUnicodeConverter.a */; };
|
||||
8A9FAC2B207772E1007787F6 /* libicu.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8A9FAC27207772CC007787F6 /* libicu.a */; };
|
||||
8ADB5F4220C52EFE00B72D37 /* version.h in Headers */ = {isa = PBXBuildFile; fileRef = 8ADB5F4120C52EFE00B72D37 /* version.h */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
@ -479,6 +480,7 @@
|
||||
69DA325C1CEE09BB00E10AF0 /* PPTXFormatLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = PPTXFormatLib.xcodeproj; path = ../../../../ASCOfficePPTXFile/PPTXLib/Mac/PPTXFormatLib.xcodeproj; sourceTree = "<group>"; };
|
||||
69EC66CD1E01770C003527E2 /* UnicodeConverter.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = UnicodeConverter.xcodeproj; path = ../../../../UnicodeConverter/build/UnicodeConverter/UnicodeConverter.xcodeproj; sourceTree = "<group>"; };
|
||||
8A9FAC22207772CC007787F6 /* icu.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = icu.xcodeproj; path = icu/icu.xcodeproj; sourceTree = "<group>"; };
|
||||
8ADB5F4120C52EFE00B72D37 /* version.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = version.h; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@ -567,6 +569,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
6967AFA51E27918600A129E2 /* src */,
|
||||
8ADB5F4120C52EFE00B72D37 /* version.h */,
|
||||
17C27A171AC2DB3D00E1D003 /* X2tConverter.h */,
|
||||
17C27A191AC2DB3D00E1D003 /* X2tConverter.mm */,
|
||||
);
|
||||
@ -828,6 +831,7 @@
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
6967AFB11E2793A500A129E2 /* cextracttools.h in Headers */,
|
||||
8ADB5F4220C52EFE00B72D37 /* version.h in Headers */,
|
||||
6911A9691F6036DA0061AB4D /* OfficeFileErrorDescription.h in Headers */,
|
||||
6967B10F1E27A65600A129E2 /* OfficeFileFormatChecker.h in Headers */,
|
||||
6967AFB51E27940600A129E2 /* ASCConverters.h in Headers */,
|
||||
@ -845,6 +849,7 @@
|
||||
17C8DEC61ACD696100902C85 /* Sources */,
|
||||
17C8DEC81ACD696100902C85 /* Frameworks */,
|
||||
17C8DECB1ACD696100902C85 /* Headers */,
|
||||
8ADB5F4420C52F6E00B72D37 /* ShellScript */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@ -1225,6 +1230,19 @@
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "SIMULATOR_LIBRARY_PATH=\"${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/lib${PROJECT_NAME}.a\" &&\nDEVICE_LIBRARY_PATH=\"${BUILD_DIR}/${CONFIGURATION}-iphoneos/lib${PROJECT_NAME}.a\" &&\nUNIVERSAL_LIBRARY_DIR=\"${BUILD_DIR}/${CONFIGURATION}-iphoneuniversal\" &&\nFRAMEWORK=\"${BUILD_DIR}/${CONFIGURATION}-iphoneuniversal/${PROJECT_NAME}.framework\" &&\n\n# Create framework directory structure.\nrm -rf \"${FRAMEWORK}\" &&\nmkdir -p \"${UNIVERSAL_LIBRARY_DIR}\" &&\n\n# Generate universal binary for the device and simulator.\nlipo \"${SIMULATOR_LIBRARY_PATH}\" \"${DEVICE_LIBRARY_PATH}\" -create -output \"${FRAMEWORK}\"";
|
||||
};
|
||||
8ADB5F4420C52F6E00B72D37 /* ShellScript */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "VERSION=$(cat \"../../../../Common/version.txt\")\n\necho \"#ifndef X2T_VERSION_H\n#define X2T_VERSION_H\n\n#define X2T_VERSION \\\"$VERSION\\\"\n\n#endif\" > \"X2tConverter/version.h\"\n\n";
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
|
||||
@ -41,6 +41,8 @@
|
||||
|
||||
@interface X2tConverter : NSObject
|
||||
|
||||
+ (NSString *)version;
|
||||
|
||||
@property (strong) NSString* password;
|
||||
@property (assign) BOOL isNoBase64;
|
||||
@property (strong) NSNumber* delimiter;
|
||||
|
||||
@ -32,6 +32,8 @@
|
||||
|
||||
#import "X2tConverter.h"
|
||||
|
||||
#include "version.h"
|
||||
|
||||
#include "cextracttools.h"
|
||||
#include "ASCConverters.h"
|
||||
|
||||
@ -94,11 +96,20 @@ static std::wstring nsstring_to_wstring(NSString* nsstring)
|
||||
oInputParams.m_sFontDir = new std::wstring(nsstring_to_wstring(nsFontPath));
|
||||
oInputParams.m_bIsNoBase64 = new bool(self.isNoBase64);
|
||||
|
||||
if (self.password) {
|
||||
oInputParams.m_sPassword = new std::wstring(nsstring_to_wstring(self.password));
|
||||
if (nil != self.password && self.password.length > 0) {
|
||||
oInputParams.m_sSavePassword = new std::wstring(nsstring_to_wstring(self.password));
|
||||
|
||||
std::wstring sResultDecryptFile = temp + FILE_SEPARATOR_STR + L"uncrypt_file.docx";
|
||||
|
||||
if ((int)AVS_FILEUTILS_ERROR_CONVERT != NExtractTools::doct_bin2docx(from, sResultDecryptFile, temp, bFromChanges, themeDir, oInputParams)) {
|
||||
return oox2mscrypt(sResultDecryptFile, to, temp, oInputParams);
|
||||
}
|
||||
|
||||
return AVS_FILEUTILS_ERROR_CONVERT;
|
||||
|
||||
} else {
|
||||
return NExtractTools::doct_bin2docx(from, to, temp, bFromChanges, themeDir, oInputParams);
|
||||
}
|
||||
|
||||
return NExtractTools::doct_bin2docx(from, to, temp, bFromChanges, themeDir, oInputParams);
|
||||
}
|
||||
- (int)sdk_doct2docx:(NSString*)nsFrom nsTo:(NSString*)nsTo nsTemp:(NSString*)nsTemp nsFontPath:(NSString*)nsFontPath fromChanges:(NSNumber*)fromChanges nsThemeDir:(NSString*)nsThemeDir {
|
||||
std::wstring from = nsstring_to_wstring(nsFrom);
|
||||
@ -160,7 +171,20 @@ static std::wstring nsstring_to_wstring(NSString* nsstring)
|
||||
oInputParams.m_sFontDir = new std::wstring(nsstring_to_wstring(nsFontPath));
|
||||
oInputParams.m_bIsNoBase64 = new bool(self.isNoBase64);
|
||||
|
||||
return NExtractTools::xlst_bin2xlsx(from, to, temp, bFromChanges, themeDir, oInputParams);
|
||||
if (nil != self.password && self.password.length > 0) {
|
||||
oInputParams.m_sSavePassword = new std::wstring(nsstring_to_wstring(self.password));
|
||||
|
||||
std::wstring sResultDecryptFile = temp + FILE_SEPARATOR_STR + L"uncrypt_file.xlsx";
|
||||
|
||||
if ((int)AVS_FILEUTILS_ERROR_CONVERT != NExtractTools::xlst_bin2xlsx(from, sResultDecryptFile, temp, bFromChanges, themeDir, oInputParams)) {
|
||||
return oox2mscrypt(sResultDecryptFile, to, temp, oInputParams);
|
||||
}
|
||||
|
||||
return AVS_FILEUTILS_ERROR_CONVERT;
|
||||
|
||||
} else {
|
||||
return NExtractTools::xlst_bin2xlsx(from, to, temp, bFromChanges, themeDir, oInputParams);
|
||||
}
|
||||
}
|
||||
- (int)sdk_xlst2xlsx:(NSString*)nsFrom nsTo:(NSString*)nsTo nsTemp:(NSString*)nsTemp nsFontPath:(NSString*)nsFontPath fromChanges:(NSNumber*)fromChanges nsThemeDir:(NSString*)nsThemeDir {
|
||||
std::wstring from = nsstring_to_wstring(nsFrom);
|
||||
@ -206,7 +230,7 @@ static std::wstring nsstring_to_wstring(NSString* nsstring)
|
||||
|
||||
return NExtractTools::pptx2pptt(from, to, temp, oInputParams);
|
||||
}
|
||||
- (int)sdk_pptt_bin2pptx:(NSString*)nsFrom nsTo:(NSString*)nsTo nsTemp:(NSString*)nsTemp nsFontPath:(NSString*)nsFontPath fromChanges:(NSNumber*)fromChanges nsThemeDir:(NSString*)nsThemeDir{
|
||||
- (int)sdk_pptt_bin2pptx:(NSString*)nsFrom nsTo:(NSString*)nsTo nsTemp:(NSString*)nsTemp nsFontPath:(NSString*)nsFontPath fromChanges:(NSNumber*)fromChanges nsThemeDir:(NSString*)nsThemeDir {
|
||||
std::wstring from = nsstring_to_wstring(nsFrom);
|
||||
std::wstring to = nsstring_to_wstring(nsTo);
|
||||
std::wstring temp = nsstring_to_wstring(nsTemp);
|
||||
@ -216,7 +240,20 @@ static std::wstring nsstring_to_wstring(NSString* nsstring)
|
||||
NExtractTools::InputParams oInputParams;
|
||||
oInputParams.m_sFontDir = new std::wstring(nsstring_to_wstring(nsFontPath));
|
||||
|
||||
return NExtractTools::pptt_bin2pptx(from, to, temp, bFromChanges, themeDir, oInputParams);
|
||||
if (nil != self.password && self.password.length > 0) {
|
||||
oInputParams.m_sSavePassword = new std::wstring(nsstring_to_wstring(self.password));
|
||||
|
||||
std::wstring sResultDecryptFile = temp + FILE_SEPARATOR_STR + L"uncrypt_file.pptx";
|
||||
|
||||
if ((int)AVS_FILEUTILS_ERROR_CONVERT != NExtractTools::pptt_bin2pptx(from, sResultDecryptFile, temp, bFromChanges, themeDir, oInputParams)) {
|
||||
return oox2mscrypt(sResultDecryptFile, to, temp, oInputParams);
|
||||
}
|
||||
|
||||
return AVS_FILEUTILS_ERROR_CONVERT;
|
||||
|
||||
} else {
|
||||
return NExtractTools::pptt_bin2pptx(from, to, temp, bFromChanges, themeDir, oInputParams);
|
||||
}
|
||||
}
|
||||
- (int)sdk_pptt2pptx:(NSString*)nsFrom nsTo:(NSString*)nsTo nsTemp:(NSString*)nsTemp nsFontPath:(NSString*)nsFontPath fromChanges:(NSNumber*)fromChanges nsThemeDir:(NSString*)nsThemeDir{
|
||||
std::wstring from = nsstring_to_wstring(nsFrom);
|
||||
@ -351,4 +388,8 @@ static std::wstring nsstring_to_wstring(NSString* nsstring)
|
||||
return values;
|
||||
}
|
||||
|
||||
+ (NSString *)version {
|
||||
return [[NSString alloc] initWithUTF8String:X2T_VERSION];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@ -0,0 +1,6 @@
|
||||
#ifndef X2T_VERSION_H
|
||||
#define X2T_VERSION_H
|
||||
|
||||
#define X2T_VERSION "2.4.537.0"
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@ -52,6 +52,8 @@
|
||||
{
|
||||
[super viewDidLoad];
|
||||
|
||||
NSLog(@"x2t version converter: %@", [X2tConverter version]);
|
||||
|
||||
NSLog(@"%@", [X2tConverter delimiters]);
|
||||
NSLog(@"%@", [X2tConverter encodingings]);
|
||||
|
||||
|
||||
@ -203,7 +203,7 @@
|
||||
TargetAttributes = {
|
||||
17DAB6771ACC371E005AF479 = {
|
||||
CreatedOnToolsVersion = 6.2;
|
||||
DevelopmentTeam = N7BSMD6B3N;
|
||||
DevelopmentTeam = 2WH24U26GJ;
|
||||
ProvisioningStyle = Automatic;
|
||||
};
|
||||
};
|
||||
@ -422,7 +422,7 @@
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "compiler-default";
|
||||
CLANG_CXX_LIBRARY = "compiler-default";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
DEVELOPMENT_TEAM = N7BSMD6B3N;
|
||||
DEVELOPMENT_TEAM = 2WH24U26GJ;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = TestIOSX2tConverter/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
|
||||
@ -447,7 +447,7 @@
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "compiler-default";
|
||||
CLANG_CXX_LIBRARY = "compiler-default";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
DEVELOPMENT_TEAM = N7BSMD6B3N;
|
||||
DEVELOPMENT_TEAM = 2WH24U26GJ;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = TestIOSX2tConverter/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
|
||||
|
||||
@ -358,7 +358,7 @@ namespace XPS
|
||||
ReadAttribute(oReader, L"Source", wsSource);
|
||||
if (!wsSource.empty())
|
||||
{
|
||||
std::wstring wsPath = m_wsRootPath + wsSource.c_str();
|
||||
std::wstring wsPath = m_wsRootPath + wsSource.c_stdstr();
|
||||
pState->PushResource(m_pDocument->GetStaticResource(wsPath.c_str()), false);
|
||||
}
|
||||
else
|
||||
@ -687,7 +687,14 @@ namespace XPS
|
||||
if (oEntry.bGid)
|
||||
pRenderer->CommandDrawTextExCHAR(oEntry.nUnicode, oEntry.nGid, xpsUnitToMM(dXorigin), xpsUnitToMM(dYorigin), 0, 0);
|
||||
else
|
||||
pRenderer->CommandDrawTextCHAR(oEntry.nUnicode, xpsUnitToMM(dXorigin), xpsUnitToMM(dYorigin), 0, 0);
|
||||
{
|
||||
LONG nRenType = 0;
|
||||
pRenderer->get_Type(&nRenType);
|
||||
if (c_nGrRenderer == nRenType)
|
||||
pRenderer->put_FontStringGID(FALSE);
|
||||
|
||||
pRenderer->CommandDrawTextCHAR(oEntry.nUnicode, xpsUnitToMM(dXorigin), xpsUnitToMM(dYorigin), 0, 0);
|
||||
}
|
||||
|
||||
if (bNeedBold)
|
||||
{
|
||||
|
||||
@ -152,13 +152,13 @@ namespace XPS
|
||||
}
|
||||
bool CImageBrush::SetToRenderer(IRenderer* pRenderer)
|
||||
{
|
||||
std::wstring wsPath = m_wsRoot.c_str();
|
||||
wsPath += m_wsPath.c_str();
|
||||
std::wstring wsPath = m_wsRoot.c_stdstr();
|
||||
wsPath += m_wsPath.c_stdstr();
|
||||
|
||||
if (!NSFile::CFileBinary::Exists(wsPath))
|
||||
{
|
||||
wsPath = m_wsPage.c_str();
|
||||
wsPath += m_wsPath.c_str();
|
||||
wsPath = m_wsPage.c_stdstr();
|
||||
wsPath += m_wsPath.c_stdstr();
|
||||
if (!NSFile::CFileBinary::Exists(wsPath))
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -186,6 +186,13 @@ namespace XPS
|
||||
|
||||
return (const wchar_t*)m_pBuffer;
|
||||
}
|
||||
const std::wstring CWString::c_stdstr() const
|
||||
{
|
||||
const wchar_t* pData = c_str();
|
||||
if (NULL == pData)
|
||||
return L"";
|
||||
return std::wstring(pData);
|
||||
}
|
||||
bool CWString::operator<(const CWString& wsString) const
|
||||
{
|
||||
const wchar_t* wsLeft = this->c_str();
|
||||
|
||||
@ -59,6 +59,7 @@ namespace XPS
|
||||
bool empty() const;
|
||||
wchar_t operator[](const unsigned int& unIndex) const;
|
||||
const wchar_t* c_str() const;
|
||||
const std::wstring c_stdstr() const;
|
||||
void clear();
|
||||
|
||||
int tointeger() const;
|
||||
|
||||
Reference in New Issue
Block a user