Commit b06681bd authored by ElenaSubbotina's avatar ElenaSubbotina

OdfFormatReader - fix mac build, ...

parent ab441215
......@@ -223,7 +223,7 @@ public:
const std::pair<int, double> c = cols_.search (x_pt);
const std::pair<int, double> r = rows_.search (y_pt);
xlsx_table_position res = {c.first, c.second, r.first, r.second};
xlsx_table_position res = {(size_t)c.first, c.second, (size_t)r.first, r.second};
return res;
}
......@@ -236,7 +236,7 @@ public:
r = rows_.search(offset_row, y_pt);
xlsx_table_position res = {c.first, c.second, r.first, r.second};
xlsx_table_position res = {(size_t)c.first, c.second, (size_t)r.first, r.second};
return res;
}
......@@ -246,7 +246,7 @@ public:
std::pair<int, double> r = rows_.search (last_row, 0);
xlsx_table_position res = {c.first, c.second, r.first, r.second};
xlsx_table_position res = {(size_t)c.first, c.second, (size_t)r.first, r.second};
return res;
}
......
......@@ -147,6 +147,14 @@ void office_text::pptx_convert(oox::pptx_conversion_context & Context)
const wchar_t * office_change_info::ns = L"office";
const wchar_t * office_change_info::name = L"change-info";
void office_change_info::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
int count = Attributes->size();
CP_APPLY_ATTR(L"office:chg-author", office_chg_author_);
CP_APPLY_ATTR(L"office:chg-date-time", office_chg_date_time_);
}
void office_change_info::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
{
if CP_CHECK_NAME(L"dc", L"date")
......@@ -165,14 +173,23 @@ void office_change_info::docx_convert(oox::docx_conversion_context & Context)
{
std::wstring date;
std::wstring author;
if (dc_date_)
{
date = xml::utils::replace_text_to_xml(dynamic_cast<dc_date * >(dc_date_.get())->content_);
}
else if (office_chg_date_time_)
{
date = *office_chg_date_time_;
}
if (dc_creator_)
{
author = xml::utils::replace_text_to_xml(dynamic_cast<dc_creator * >(dc_creator_.get())->content_);
}
else if (office_chg_author_)
{
author = *office_chg_author_;
}
Context.get_text_tracked_context().set_user_info(author, date);
}
......
......@@ -88,11 +88,14 @@ public:
virtual void docx_convert(oox::docx_conversion_context & Context) ;
private:
virtual void add_attributes ( const xml::attributes_wc_ptr & Attributes ){}
virtual void add_attributes ( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element ( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
office_element_ptr dc_date_;
office_element_ptr dc_creator_;
_CP_OPT(std::wstring) office_chg_author_;
_CP_OPT(std::wstring) office_chg_date_time_;
};
CP_REGISTER_OFFICE_ELEMENT2(office_change_info)
......
......@@ -1031,14 +1031,19 @@ void text_changed_region::add_attributes( const xml::attributes_wc_ptr & Attribu
void text_changed_region::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
{
CP_CREATE_ELEMENT(element_);
CP_CREATE_ELEMENT(content_);
}
void text_changed_region::docx_convert(oox::docx_conversion_context & Context)
{
if (!element_ || !text_id_) return;
if (content_.empty() || !text_id_) return;
Context.get_text_tracked_context().start_change (*text_id_);
element_->docx_convert(Context);
for (int i = 0; i < content_.size(); i++)
{
content_[i]->docx_convert(Context);
}
Context.get_text_tracked_context().end_change ();
}
......
......@@ -545,8 +545,8 @@ private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
_CP_OPT(std::wstring) text_id_; //== xml:id
office_element_ptr element_;
_CP_OPT(std::wstring) text_id_; //== xml:id
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(text_changed_region);
......
......@@ -32,5 +32,5 @@ core_linux_32 {
DESTDIR = $$DESTDIR/linux_32
}
core_mac {
DESTDIR = $$DESTDIR/mac
DESTDIR = $$DESTDIR/mac_64
}
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment