Compare commits

...

2 Commits

Author SHA1 Message Date
9991195d56 . 2018-07-13 18:59:23 +03:00
51f579a682 [ios][pe] events 2018-07-13 18:23:28 +03:00
7 changed files with 64 additions and 35 deletions

View File

@ -369,42 +369,51 @@ void docx_conversion_context::start_index_content()
std::wstring sInstrText;
switch(table_content_context_.type_table_content)
if (table_content_context_.type_table_content == 3)
{
case 1: sInstrText += L" TOC \\f \\h \\u"; break;
case 2:
case 4:
case 6:
case 7: sInstrText += L" TOC \\h \\z"; break;
case 5: sInstrText += L" INDEX \\z"; break;
case 3: sInstrText += L" BIBLIOGRAPHY"; break;
sInstrText = L" BIBLIOGRAPHY ";
}
if (table_content_context_.min_outline_level > 0)
else if (table_content_context_.type_table_content == 5)
{
if (table_content_context_.max_outline_level > 9)
table_content_context_.max_outline_level = 9;
sInstrText += L" \\o \"" + std::to_wstring(table_content_context_.min_outline_level) + L"-" +
std::to_wstring(table_content_context_.max_outline_level) + L"\"";
sInstrText = L" INDEX";
if (table_content_context_.bSeparators)
sInstrText += L" \\h \"A\"";
}
if (false == table_content_context_.outline_level_styles.empty())
else
{
sInstrText += L"\\t \"";
sInstrText += L" TOC \\h";
for (std::map<int, std::wstring>::iterator it = table_content_context_.outline_level_styles.begin();
it != table_content_context_.outline_level_styles.end(); ++it)
if (table_content_context_.type_table_content == 1)
sInstrText += L" \\f \\u";
else
sInstrText += L" \\z";
if (table_content_context_.min_outline_level > 0)
{
sInstrText += it->second + L";" + std::to_wstring(it->first) + L";";
if (table_content_context_.max_outline_level > 9)
table_content_context_.max_outline_level = 9;
sInstrText += L" \\o \"" + std::to_wstring(table_content_context_.min_outline_level) + L"-" +
std::to_wstring(table_content_context_.max_outline_level) + L"\"";
}
if (false == table_content_context_.outline_level_styles.empty())
{
sInstrText += L" \\t \"";
for (std::map<int, std::wstring>::iterator it = table_content_context_.outline_level_styles.begin();
it != table_content_context_.outline_level_styles.end(); ++it)
{
sInstrText += it->second + L";" + std::to_wstring(it->first) + L";";
}
sInstrText += L"\"";
}
sInstrText += L"\"";
if (!table_content_context_.caption_sequence_name.empty())
{
sInstrText += L" \\c \"" + table_content_context_.caption_sequence_name + L"\"";
}
}
if (!table_content_context_.caption_sequence_name.empty())
{
sInstrText += L" \\c \"" + table_content_context_.caption_sequence_name + L"\"";
}
output_stream() << L"<w:r>";
output_stream() << L"<w:fldChar w:fldCharType=\"begin\"/>";
output_stream() << L"</w:r>";

View File

@ -731,6 +731,7 @@ public:
min_outline_level = -1;
max_outline_level = -1;
outline_level_styles.clear();
bSeparators = false;
}
void add_sequence(const std::wstring & name, int outline_level)
{
@ -755,6 +756,7 @@ public:
int min_outline_level;
int max_outline_level;
std::map<int, std::wstring> outline_level_styles;
bool bSeparators;
private:
std::vector<int> current_content_template_;

View File

@ -1278,7 +1278,7 @@ void sequence::docx_convert(oox::docx_conversion_context & Context)
}
}
Context.output_stream() << L"<w:fldSimple w:instr=\" SEQ " << sequence << L" \\* " << num_format << L" \">";
Context.output_stream() << L"<w:fldSimple w:instr=\" SEQ " << XmlUtils::EncodeXmlString(sequence) << L" \\* " << num_format << L" \">";
Context.add_new_run();
for (size_t i = 0; i < text_.size(); i++)
{
@ -1846,12 +1846,22 @@ void alphabetical_index_mark::add_attributes( const xml::attributes_wc_ptr & Att
}
void alphabetical_index_mark::docx_convert(oox::docx_conversion_context & Context)
{
if (!string_value_) return;
std::wstring value;
if (string_value_ && false == string_value_->empty())
{
if (*string_value_ != L" ")
value = *string_value_;
}
if (value.empty() && key1_)
{
value = *key1_;
}
if (value.empty()) return;
Context.finish_run();
Context.output_stream() << L"<w:r><w:fldChar w:fldCharType=\"begin\"/></w:r>";
Context.output_stream() << L"<w:r><w:instrText> XE \"" << *string_value_ << L"\"</w:instrText></w:r><w:r><w:fldChar w:fldCharType=\"end\"/></w:r>";
Context.output_stream() << L"<w:r><w:instrText> XE \"" << XmlUtils::EncodeXmlString(value) << L"\"</w:instrText></w:r><w:r><w:fldChar w:fldCharType=\"end\"/></w:r>";
}
//-----------------------------------------------------------------------------------------------
// text:alphabetical-index-mark-start

View File

@ -1273,7 +1273,9 @@ const wchar_t * alphabetical_index_source::name = L"alphabetical-index-source";
void alphabetical_index_source::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"text:index-scope", index_scope_); // chapter or document
CP_APPLY_ATTR(L"text:index-scope", index_scope_); // chapter or document
CP_APPLY_ATTR(L"text:alphabetical-separators", alphabetical_separators_);
CP_APPLY_ATTR(L"text:ignore-case", ignore_case_);
}
void alphabetical_index_source::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
@ -1286,6 +1288,11 @@ void alphabetical_index_source::add_child_element( xml::sax * Reader, const std:
}
void alphabetical_index_source::docx_convert(oox::docx_conversion_context & Context)
{
if (alphabetical_separators_)
{
Context.get_table_content_context().bSeparators = alphabetical_separators_->get();
}
Context.get_table_content_context().start_template(5);
for (size_t i = 0; i < entry_templates_.size(); i++)
{

View File

@ -1283,7 +1283,9 @@ private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
_CP_OPT(std::wstring) index_scope_; // chapter or document:
_CP_OPT(std::wstring) index_scope_; // chapter or document:
_CP_OPT(odf_types::Bool) alphabetical_separators_;
_CP_OPT(odf_types::Bool) ignore_case_;
//fo:country
//fo:language
@ -1295,7 +1297,6 @@ private:
//text:combine-entries-with-dash
//text:combine-entries-with-pp
//text:comma-separated
//text:ignore-case
//text:main-entry-style-name
//text:relative-tab-stop-position
//text:sort-algorithm

View File

@ -1041,7 +1041,7 @@ namespace NSEditorApi
js_wrapper<bool> m_bLockLayout;
js_wrapper<bool> m_bLockRemove;
js_wrapper<bool> m_bLockTiming;
js_wrapper<bool> m_bLockTranzition;
js_wrapper<bool> m_bLockTransition;
public:
CAscSlideProp()
@ -1060,7 +1060,7 @@ namespace NSEditorApi
LINK_PROPERTY_BOOL_JS(LockLayout)
LINK_PROPERTY_BOOL_JS(LockRemove)
LINK_PROPERTY_BOOL_JS(LockTiming)
LINK_PROPERTY_BOOL_JS(LockTranzition)
LINK_PROPERTY_BOOL_JS(LockTransition)
};

View File

@ -689,7 +689,7 @@
#define ASC_MENU_EVENT_TYPE_TABLESPLITCELLS 16
#define ASC_MENU_EVENT_TYPE_SECTION 17
#define ASC_MENU_EVENT_TYPE_SHAPE 18
#define ASC_MENU_EVENT_TYPE_SLIDE 19
#define ASC_MENU_EVENT_TYPE_SLIDE 20
// insert commands
#define ASC_MENU_EVENT_TYPE_INSERT_IMAGE 50