mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-25 21:13:22 +08:00
Compare commits
15 Commits
core-win-3
...
core-linux
| Author | SHA1 | Date | |
|---|---|---|---|
| abbbda090d | |||
| 38e82f0414 | |||
| 25574aff48 | |||
| f4d9901576 | |||
| ebaa8b9769 | |||
| 855442c1c9 | |||
| 30008873fe | |||
| 8d247dfb6e | |||
| a9f32fd7d0 | |||
| c727f0cba8 | |||
| 181f613893 | |||
| 8c4d1cde6c | |||
| 6e515a1ee5 | |||
| 3532d4088d | |||
| eec7ab20fd |
@ -131,6 +131,7 @@ text_tracked_context::_state & text_tracked_context::get_tracked_change(std::wst
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------
|
||||
docx_conversion_context::docx_conversion_context(odf_reader::odf_document * OdfDocument) :
|
||||
last_dump_page_properties_ (true),
|
||||
next_dump_page_properties_ (false),
|
||||
page_break_ (false),
|
||||
page_break_after_ (false),
|
||||
@ -1425,14 +1426,22 @@ void docx_conversion_context::next_dump_page_properties(bool val)
|
||||
if (process_headers_footers_ && val) return;
|
||||
|
||||
next_dump_page_properties_ = val;
|
||||
if (val)
|
||||
last_dump_page_properties(true);
|
||||
}
|
||||
|
||||
bool docx_conversion_context::is_next_dump_page_properties()
|
||||
{
|
||||
return next_dump_page_properties_;
|
||||
}
|
||||
|
||||
|
||||
void docx_conversion_context::last_dump_page_properties(bool val)
|
||||
{
|
||||
last_dump_page_properties_ = val;
|
||||
}
|
||||
bool docx_conversion_context::is_last_dump_page_properties()
|
||||
{
|
||||
return last_dump_page_properties_;
|
||||
}
|
||||
void docx_conversion_context::start_text_list_style(const std::wstring & StyleName)
|
||||
{
|
||||
text_list_style_name_ = StyleName;
|
||||
|
||||
@ -793,6 +793,7 @@ public:
|
||||
|
||||
bool next_dump_page_properties_;
|
||||
bool next_dump_section_;
|
||||
bool last_dump_page_properties_;
|
||||
|
||||
odf_reader::odf_document *root()
|
||||
{
|
||||
@ -862,6 +863,8 @@ public:
|
||||
|
||||
void next_dump_page_properties (bool val);
|
||||
bool is_next_dump_page_properties ();
|
||||
void last_dump_page_properties (bool val);
|
||||
bool is_last_dump_page_properties ();
|
||||
|
||||
void set_master_page_name(const std::wstring & MasterPageName);
|
||||
const std::wstring & get_master_page_name() const;
|
||||
|
||||
@ -152,8 +152,8 @@ std::wstring mediaitems::create_file_name(const std::wstring & uri, RelsType typ
|
||||
|
||||
if (sExt.empty())
|
||||
{
|
||||
int n = uri.find(L"ObjectReplacements");
|
||||
if (n >= 0)
|
||||
size_t n = uri.find(L"ObjectReplacements");
|
||||
if (n != std::wstring::npos)
|
||||
{
|
||||
if (!isInternal) return L"";
|
||||
|
||||
@ -164,14 +164,16 @@ std::wstring mediaitems::create_file_name(const std::wstring & uri, RelsType typ
|
||||
if (sExt.empty())
|
||||
{
|
||||
//то что есть ..
|
||||
int n = uri.rfind(L".");
|
||||
if (n > 0)
|
||||
sExt = uri.substr(n);
|
||||
size_t n = uri.rfind(L".");
|
||||
if (n != std::wstring::npos)
|
||||
sExt = XmlUtils::GetLower(uri.substr(n));
|
||||
}
|
||||
}
|
||||
|
||||
if (type == typeOleObject && sExt.empty())
|
||||
sExt = L".bin";
|
||||
else if ( type == typeChart)
|
||||
sExt = L".xml";
|
||||
|
||||
return get_default_file_name(type) + std::to_wstring(Num) + sExt;
|
||||
}
|
||||
@ -193,7 +195,7 @@ std::wstring mediaitems::detectImageFileExtension(const std::wstring &fileName)
|
||||
|
||||
if (!sExt.empty()) sExt = std::wstring(L".") + sExt;
|
||||
}
|
||||
return sExt;
|
||||
return XmlUtils::GetLower(sExt);
|
||||
}
|
||||
|
||||
std::wstring mediaitems::add_or_find(const std::wstring & href, RelsType type, bool & isInternal, std::wstring & ref)
|
||||
@ -240,8 +242,6 @@ std::wstring mediaitems::add_or_find(const std::wstring & href, RelsType type, b
|
||||
|
||||
std::wstring inputPath = isMediaInternal ? odf_packet_ + FILE_SEPARATOR_STR + href : href;
|
||||
std::wstring outputPath = isMediaInternal ? ( sub_path + inputFileName) : href;
|
||||
|
||||
if ( type == typeChart) outputPath = outputPath + L".xml";
|
||||
|
||||
std::wstring id;
|
||||
for (size_t i = 0 ; i < items_.size(); i++)
|
||||
@ -268,8 +268,8 @@ std::wstring mediaitems::add_or_find(const std::wstring & href, RelsType type, b
|
||||
}
|
||||
else if ( type == typeImage)
|
||||
{
|
||||
int n_svm = outputPath.rfind (L".svm");
|
||||
if ( n_svm >= 0 )
|
||||
size_t n_svm = outputPath.rfind (L".svm");
|
||||
if ( n_svm != std::wstring::npos )
|
||||
{
|
||||
outputPath = outputPath.substr(0, n_svm) + L".png";
|
||||
}
|
||||
|
||||
@ -112,7 +112,10 @@ static const std::wstring _ooxShapeType[]=
|
||||
L"curvedConnector3",
|
||||
L"",//3-D shape
|
||||
L"",
|
||||
L"polyline"
|
||||
L"polyline",
|
||||
L"cube",
|
||||
L"ellipse", //sphere
|
||||
L""
|
||||
};
|
||||
|
||||
|
||||
@ -427,7 +430,7 @@ void _oox_drawing::serialize_shape(std::wostream & strm)
|
||||
shapeGeomPreset = L"rect";
|
||||
}
|
||||
}
|
||||
else if (sub_type <= 14 && sub_type >= 0)
|
||||
else if (sub_type <= 16 && sub_type >= 0)
|
||||
{
|
||||
shapeGeomPreset = _ooxShapeType[sub_type]; //odf -> oox
|
||||
}
|
||||
@ -522,15 +525,6 @@ void _oox_drawing::serialize_xfrm(std::wostream & strm, const std::wstring & nam
|
||||
_CP_OPT(double) dSkewY;
|
||||
odf_reader::GetProperty(additional, L"svg:skewY", dSkewY);
|
||||
|
||||
//if (dRotate)
|
||||
//{
|
||||
// double new_x = (cx / 2 * cos(-(*dRotate)) - cy / 2 * sin(-(*dRotate)) ) - cx / 2;
|
||||
// double new_y = (cx / 2 * sin(-(*dRotate)) + cy / 2 * cos(-(*dRotate)) ) - cy / 2;
|
||||
//
|
||||
// x += new_x;
|
||||
// y += new_y;
|
||||
//}
|
||||
|
||||
CP_XML_NODE(xfrm)
|
||||
{
|
||||
if (dRotate)
|
||||
@ -539,7 +533,7 @@ void _oox_drawing::serialize_xfrm(std::wostream & strm, const std::wstring & nam
|
||||
CP_XML_ATTR(L"rot", (int)( d * 60000) ); //60 000 per 1 gr - 19.5.5 oox
|
||||
}
|
||||
_CP_OPT(bool)bVal;
|
||||
if (odf_reader::GetProperty(additional,L"flipH", bVal))
|
||||
if (odf_reader::GetProperty(additional, L"flipH", bVal))
|
||||
CP_XML_ATTR(L"flipH", bVal.get());
|
||||
|
||||
if (odf_reader::GetProperty(additional,L"flipV", bVal))
|
||||
|
||||
@ -42,7 +42,7 @@ namespace oox {
|
||||
|
||||
struct _pptx_comment
|
||||
{
|
||||
size_t x_, y_;
|
||||
int x_, y_;
|
||||
|
||||
int author_id_;
|
||||
int idx_;
|
||||
|
||||
@ -137,7 +137,8 @@ xlsx_table_state::xlsx_table_state(xlsx_conversion_context * Context, std::wstri
|
||||
in_cell(false),
|
||||
bEndTable(false),
|
||||
bRTL(false),
|
||||
bHidden(false)
|
||||
bHidden(false),
|
||||
bProtected(false)
|
||||
{
|
||||
odf_reader::style_table_properties * table_prop = NULL;
|
||||
odf_reader::style_instance * tableStyle = context_->root()->odf_context().styleContainer().style_by_name(table_style_, odf_types::style_family::Table, false);
|
||||
|
||||
@ -338,6 +338,38 @@ void xlsx_table_context::serialize_tableParts(std::wostream & _Wostream, rels &
|
||||
{
|
||||
if (false == xlsx_data_ranges_[it->second]->bTablePart) continue;
|
||||
|
||||
// из за дебелизма мсофис которому ОБЯЗАТЕЛЬНО нужно прописывать имена колонок таблицы (и они должны быть еще
|
||||
// прописаны и в самих данных таблицы !!
|
||||
int i = xlsx_data_ranges_[it->second]->header_values.size() - 1;
|
||||
for (; i >= 0; i--)
|
||||
{
|
||||
if (false == xlsx_data_ranges_[it->second]->header_values[i].empty())
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i == -1)
|
||||
{
|
||||
xlsx_data_ranges_[it->second]->bTablePart = false;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
size_t erase = xlsx_data_ranges_[it->second]->header_values.size() - 1 - i;
|
||||
if (erase > 0)
|
||||
{
|
||||
xlsx_data_ranges_[it->second]->header_values.erase(xlsx_data_ranges_[it->second]->header_values.begin() + i + 1, xlsx_data_ranges_[it->second]->header_values.end());
|
||||
xlsx_data_ranges_[it->second]->cell_end.first -= erase;
|
||||
|
||||
std::wstring ref1 = getCellAddress(xlsx_data_ranges_[it->second]->cell_start.first, xlsx_data_ranges_[it->second]->cell_start.second);
|
||||
std::wstring ref2 = getCellAddress(xlsx_data_ranges_[it->second]->cell_end.first, xlsx_data_ranges_[it->second]->cell_end.second);
|
||||
|
||||
xlsx_data_ranges_[it->second]->ref = ref1 + L":" + ref2;
|
||||
}
|
||||
}
|
||||
//--------------------------------------------------------
|
||||
|
||||
size_t id = xlsx_conversion_context_->get_table_parts_size() + 1;
|
||||
|
||||
std::wstring rId = L"tprtId" + std::to_wstring(id);
|
||||
@ -351,10 +383,10 @@ void xlsx_table_context::serialize_tableParts(std::wostream & _Wostream, rels &
|
||||
}
|
||||
}
|
||||
Rels.add( relationship(rId, L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/table", ref));
|
||||
|
||||
//--------------------------------------------------------
|
||||
std::wstringstream strm;
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
{
|
||||
CP_XML_NODE(L"table")
|
||||
{
|
||||
CP_XML_ATTR(L"xmlns", L"http://schemas.openxmlformats.org/spreadsheetml/2006/main");
|
||||
|
||||
@ -510,7 +510,7 @@ public:
|
||||
_CP_OPT(std::wstring) draw_id_;
|
||||
_CP_OPT(std::wstring) draw_layer_;
|
||||
_CP_OPT(std::wstring) draw_transform_;
|
||||
_CP_OPT(int) draw_z_index_;
|
||||
_CP_OPT(unsigned int) draw_z_index_;
|
||||
_CP_OPT(std::wstring) drawooo_display_;
|
||||
};
|
||||
|
||||
|
||||
@ -574,11 +574,7 @@ int ComputeMarginY(const style_page_layout_properties_attlist & pageProperties,
|
||||
const graphic_format_properties & graphicProperties,
|
||||
const std::vector<odf_reader::_property> & additional)
|
||||
{
|
||||
// TODO : recursive result!!!
|
||||
const _CP_OPT(anchor_type) anchor =
|
||||
attlists_.shape_with_text_and_styles_.
|
||||
common_text_anchor_attlist_.
|
||||
type_;
|
||||
const _CP_OPT(anchor_type) anchor = attlists_.shape_with_text_and_styles_.common_text_anchor_attlist_.type_;
|
||||
|
||||
//todooo пока не ясно как привязать к определеной странице в документе ...
|
||||
//const _CP_OPT(unsigned int) anchor_page_number =
|
||||
@ -589,6 +585,15 @@ int ComputeMarginY(const style_page_layout_properties_attlist & pageProperties,
|
||||
_CP_OPT(vertical_rel) styleVerticalRel = graphicProperties.common_vertical_rel_attlist_.style_vertical_rel_;
|
||||
_CP_OPT(vertical_pos) styleVerticallPos = graphicProperties.common_vertical_pos_attlist_.style_vertical_pos_;
|
||||
|
||||
if (!styleVerticalRel && anchor)
|
||||
{
|
||||
switch(anchor->get_type())
|
||||
{
|
||||
case anchor_type::Paragraph: styleVerticalRel = vertical_rel::Paragraph; break;
|
||||
case anchor_type::Page: styleVerticalRel = vertical_rel::Page; break;
|
||||
}
|
||||
}
|
||||
|
||||
_CP_OPT(double) dVal;
|
||||
GetProperty(additional, L"svg:translate_y", dVal);
|
||||
|
||||
@ -817,14 +822,31 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, union_comm
|
||||
}
|
||||
|
||||
_CP_OPT(run_through) styleRunThrough = graphicProperties.style_run_through_;
|
||||
_CP_OPT(anchor_type) anchor = attlists_.shape_with_text_and_styles_.common_text_anchor_attlist_.type_;
|
||||
|
||||
drawing->styleHorizontalRel = graphicProperties.common_horizontal_rel_attlist_.style_horizontal_rel_;
|
||||
drawing->styleHorizontalPos = graphicProperties.common_horizontal_pos_attlist_.style_horizontal_pos_;
|
||||
drawing->styleVerticalPos = graphicProperties.common_vertical_pos_attlist_.style_vertical_pos_;
|
||||
drawing->styleVerticalRel = graphicProperties.common_vertical_rel_attlist_.style_vertical_rel_;
|
||||
|
||||
_CP_OPT(anchor_type) anchor = attlists_.shape_with_text_and_styles_.common_text_anchor_attlist_.type_;
|
||||
|
||||
|
||||
if (!drawing->styleVerticalRel && anchor)
|
||||
{
|
||||
switch(anchor->get_type())
|
||||
{
|
||||
case anchor_type::Paragraph: drawing->styleVerticalRel = vertical_rel::Paragraph; break;
|
||||
case anchor_type::Page: drawing->styleVerticalRel = vertical_rel::Page; break;
|
||||
case anchor_type::Char: drawing->styleVerticalRel = vertical_rel::Char; break;
|
||||
}
|
||||
}
|
||||
if (!drawing->styleHorizontalRel && anchor)
|
||||
{
|
||||
switch(anchor->get_type())
|
||||
{
|
||||
case anchor_type::Paragraph: drawing->styleHorizontalRel = horizontal_rel::Paragraph; break;
|
||||
case anchor_type::Page: drawing->styleHorizontalRel = horizontal_rel::Page; break;
|
||||
case anchor_type::Char: drawing->styleHorizontalRel = horizontal_rel::Char; break;
|
||||
}
|
||||
}
|
||||
int level_drawing = Context.get_drawing_context().get_current_level();
|
||||
|
||||
if (drawing->parallel == 1 || anchor && anchor->get_type() == anchor_type::AsChar || level_drawing >1 )
|
||||
@ -852,7 +874,7 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, union_comm
|
||||
if (!drawing->styleWrap)
|
||||
drawing->styleWrap = style_wrap(style_wrap::Parallel);//у опен офис и мс разные дефолты
|
||||
|
||||
_CP_OPT(int) zIndex = attlists_.shape_with_text_and_styles_.common_shape_draw_attlist_.draw_z_index_;
|
||||
_CP_OPT(unsigned int) zIndex = attlists_.shape_with_text_and_styles_.common_shape_draw_attlist_.draw_z_index_;
|
||||
|
||||
if (zIndex)//порядок отрисовки объектов
|
||||
{
|
||||
@ -887,7 +909,7 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, union_comm
|
||||
}
|
||||
drawing->number_wrapped_paragraphs = graphicProperties.style_number_wrapped_paragraphs_.
|
||||
get_value_or( integer_or_nolimit( integer_or_nolimit::NoLimit) ).get_value();
|
||||
if (anchor && anchor->get_type() == anchor_type::AsChar && drawing->posOffsetV< 0)
|
||||
if (anchor && anchor->get_type() == anchor_type::AsChar && drawing->posOffsetV < 0)
|
||||
{
|
||||
drawing->posOffsetV = (int)(length(0.01, length::cm).get_value_unit(length::emu));
|
||||
}
|
||||
@ -936,14 +958,41 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, union_comm
|
||||
drawing->cx = get_value_emu(attlists_.rel_size_.common_draw_size_attlist_.svg_width_);
|
||||
drawing->cy = get_value_emu(attlists_.rel_size_.common_draw_size_attlist_.svg_height_);
|
||||
|
||||
_CP_OPT(double) dVal;
|
||||
|
||||
GetProperty(drawing->additional, L"svg:rotate", dVal);
|
||||
if (dVal)
|
||||
{
|
||||
double new_x = (drawing->cx / 2 * cos(-(*dVal)) - drawing->cy / 2 * sin(-(*dVal)) ) - drawing->cx / 2;
|
||||
double new_y = (drawing->cx / 2 * sin(-(*dVal)) + drawing->cy / 2 * cos(-(*dVal)) ) - drawing->cy / 2;
|
||||
|
||||
drawing->x += new_x;
|
||||
drawing->y += new_y;
|
||||
}
|
||||
|
||||
GetProperty(drawing->additional, L"svg:scale_x",dVal);
|
||||
if (dVal)drawing->cx = (int)(0.5 + drawing->cx * dVal.get());
|
||||
|
||||
GetProperty(drawing->additional, L"svg:scale_y",dVal);
|
||||
if (dVal)drawing->cy = (int)(0.5 + drawing->cy * dVal.get());
|
||||
|
||||
GetProperty(drawing->additional, L"svg:translate_x", dVal);
|
||||
if (dVal)
|
||||
{
|
||||
drawing->x += get_value_emu(dVal.get());
|
||||
}
|
||||
GetProperty(drawing->additional, L"svg:translate_y", dVal);
|
||||
if (dVal)
|
||||
{
|
||||
drawing->y += get_value_emu(dVal.get());
|
||||
}
|
||||
|
||||
if (drawing->cx < 0) //frame textbox int WORD_EXAMPLE.odt = 45 inch !!!!
|
||||
{
|
||||
drawing->cx = -drawing->cx;
|
||||
drawing->additional.push_back(_property(L"fit-to-size", true));
|
||||
}
|
||||
|
||||
if (drawing->cy < 0)
|
||||
drawing->cy = 0;
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
if ((drawing->styleWrap) && (drawing->styleWrap->get_type() == style_wrap::Dynamic)) //автоподбор
|
||||
{
|
||||
@ -988,34 +1037,6 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, union_comm
|
||||
//}
|
||||
}
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
_CP_OPT(double) dVal;
|
||||
|
||||
GetProperty(drawing->additional, L"svg:scale_x",dVal);
|
||||
if (dVal)drawing->cx = (int)(0.5 + drawing->cx * dVal.get());
|
||||
|
||||
GetProperty(drawing->additional, L"svg:scale_y",dVal);
|
||||
if (dVal)drawing->cy = (int)(0.5 + drawing->cy * dVal.get());
|
||||
|
||||
GetProperty(drawing->additional, L"svg:translate_x", dVal);
|
||||
if (dVal)
|
||||
{
|
||||
drawing->x = get_value_emu(dVal.get());
|
||||
}
|
||||
GetProperty(drawing->additional, L"svg:translate_x", dVal);
|
||||
if (dVal)
|
||||
{
|
||||
drawing->y = get_value_emu(dVal.get());
|
||||
}
|
||||
|
||||
GetProperty(drawing->additional, L"svg:rotate", dVal);
|
||||
if (dVal)
|
||||
{
|
||||
double new_x = (drawing->cx / 2 * cos(-(*dVal)) - drawing->cy / 2 * sin(-(*dVal)) ) - drawing->cx / 2;
|
||||
double new_y = (drawing->cx / 2 * sin(-(*dVal)) + drawing->cy / 2 * cos(-(*dVal)) ) - drawing->cy / 2;
|
||||
|
||||
drawing->x += new_x;
|
||||
drawing->y += new_y;
|
||||
}
|
||||
if (drawing->inGroup && drawing->type != oox::typeGroupShape)
|
||||
{
|
||||
_INT32 x_group_offset, y_group_offset;
|
||||
|
||||
@ -88,7 +88,7 @@ void draw_frame::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
common_shape_draw_attlist &common_draw_attlist_ = common_draw_attlists_.shape_with_text_and_styles_.common_shape_draw_attlist_;
|
||||
common_presentation_attlist &common_presentation_attlist_= common_draw_attlists_.shape_with_text_and_styles_.common_presentation_attlist_;
|
||||
|
||||
const int z_index = common_draw_attlist_.draw_z_index_.get_value_or(0);
|
||||
const unsigned int z_index = common_draw_attlist_.draw_z_index_.get_value_or(0);
|
||||
const std::wstring name = common_draw_attlist_.draw_name_.get_value_or(L"");
|
||||
const std::wstring textStyleName = common_draw_attlist_.draw_text_style_name_.get_value_or(L"");
|
||||
|
||||
|
||||
@ -73,8 +73,8 @@ void draw_g::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
common_draw_shape_with_text_and_styles_attlist common_draw_attlist_ = common_draw_attlists_.shape_with_text_and_styles_;
|
||||
|
||||
const int z_index = common_draw_attlist_.common_shape_draw_attlist_.draw_z_index_.get_value_or(0);
|
||||
const std::wstring name = common_draw_attlist_.common_shape_draw_attlist_.draw_name_.get_value_or(L"");
|
||||
const unsigned int z_index = common_draw_attlist_.common_shape_draw_attlist_.draw_z_index_.get_value_or(0);
|
||||
const std::wstring name = common_draw_attlist_.common_shape_draw_attlist_.draw_name_.get_value_or(L"");
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
Context.get_drawing_context().start_group( name);
|
||||
@ -118,7 +118,7 @@ void draw_frame::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
common_draw_shape_with_text_and_styles_attlist common_draw_attlist_ = common_draw_attlists_.shape_with_text_and_styles_;
|
||||
|
||||
const int z_index = common_draw_attlist_.common_shape_draw_attlist_.draw_z_index_.get_value_or(0);
|
||||
const unsigned int z_index = common_draw_attlist_.common_shape_draw_attlist_.draw_z_index_.get_value_or(0);
|
||||
const std::wstring name = common_draw_attlist_.common_shape_draw_attlist_.draw_name_.get_value_or(L"");
|
||||
const std::wstring styleName = common_draw_attlist_.common_shape_draw_attlist_.draw_style_name_.get_value_or(L"");
|
||||
const std::wstring textStyleName = common_draw_attlist_.common_shape_draw_attlist_.draw_text_style_name_.get_value_or(L"");
|
||||
|
||||
@ -492,6 +492,8 @@ void draw_enhanced_geometry_attlist::add_attributes( const xml::attributes_wc_pt
|
||||
CP_APPLY_ATTR(L"draw:enhanced-path" , draw_enhanced_path_);
|
||||
CP_APPLY_ATTR(L"drawooo:enhanced-path" , drawooo_enhanced_path_);
|
||||
CP_APPLY_ATTR(L"drawooo:sub-view-size" , drawooo_sub_view_size_);
|
||||
CP_APPLY_ATTR(L"draw:mirror-horizontal" , draw_mirror_horizontal_);
|
||||
CP_APPLY_ATTR(L"draw:mirror-vertical" , draw_mirror_vertical_);
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------
|
||||
// draw:enhanced_geometry
|
||||
@ -501,7 +503,7 @@ const wchar_t * draw_enhanced_geometry::name = L"enhanced-geometry";
|
||||
|
||||
void draw_enhanced_geometry::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
draw_enhanced_geometry_attlist_.add_attributes(Attributes);
|
||||
attlist_.add_attributes(Attributes);
|
||||
CP_APPLY_ATTR(L"svg:viewBox", svg_viewbox_);
|
||||
}
|
||||
|
||||
@ -525,20 +527,20 @@ void draw_enhanced_geometry::add_child_element( xml::sax * Reader, const std::ws
|
||||
}
|
||||
void draw_enhanced_geometry::find_draw_type_oox()
|
||||
{
|
||||
word_art_ = false;
|
||||
bOoxType_ = false;
|
||||
word_art_ = false;
|
||||
bOoxType_ = false;
|
||||
|
||||
if (draw_enhanced_geometry_attlist_.draw_text_path_ &&
|
||||
*draw_enhanced_geometry_attlist_.draw_text_path_ == true)
|
||||
if (attlist_.draw_text_path_ &&
|
||||
*attlist_.draw_text_path_ == true)
|
||||
{
|
||||
draw_type_oox_index_ = 0;
|
||||
word_art_ = true;
|
||||
sub_type_ = 1;
|
||||
}
|
||||
|
||||
if (draw_enhanced_geometry_attlist_.draw_type_)
|
||||
if (attlist_.draw_type_)
|
||||
{
|
||||
std::wstring odf_type = draw_enhanced_geometry_attlist_.draw_type_.get();
|
||||
std::wstring odf_type = attlist_.draw_type_.get();
|
||||
|
||||
if (word_art_)
|
||||
{
|
||||
@ -561,7 +563,7 @@ void draw_enhanced_geometry::find_draw_type_oox()
|
||||
|
||||
if (pos == std::wstring::npos)
|
||||
{
|
||||
for (long i = 0; i< count; i++)
|
||||
for (long i = 0; i < count; i++)
|
||||
{
|
||||
if (_OO_OOX_custom_shapes[i].odf_reader == odf_type)
|
||||
{
|
||||
@ -762,6 +764,38 @@ void dr3d_light::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
CP_APPLY_ATTR(L"dr3d:enabled", dr3d_enabled_);
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------
|
||||
// dr3d:cube
|
||||
//-------------------------------------------------------------------------------------------
|
||||
const wchar_t * dr3d_cube::ns = L"dr3d";
|
||||
const wchar_t * dr3d_cube::name = L"cube";
|
||||
|
||||
void dr3d_cube::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
draw_shape::add_attributes(Attributes);
|
||||
|
||||
CP_APPLY_ATTR(L"dr3d:max-edge", dr3d_max_edge_);
|
||||
CP_APPLY_ATTR(L"dr3d:min-edge", dr3d_min_edge_);
|
||||
CP_APPLY_ATTR(L"dr3d:transform", dr3d_transform_);
|
||||
|
||||
sub_type_ = 15;
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------
|
||||
// dr3d:sphere
|
||||
//-------------------------------------------------------------------------------------------
|
||||
const wchar_t * dr3d_sphere::ns = L"dr3d";
|
||||
const wchar_t * dr3d_sphere::name = L"sphere";
|
||||
|
||||
void dr3d_sphere::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
draw_shape::add_attributes(Attributes);
|
||||
|
||||
CP_APPLY_ATTR(L"dr3d:size", dr3d_size_); //vector3D
|
||||
CP_APPLY_ATTR(L"dr3d:center", dr3d_center_); //vector3D
|
||||
CP_APPLY_ATTR(L"dr3d:transform",dr3d_transform_);
|
||||
|
||||
sub_type_ = 16;
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------
|
||||
// draw:control
|
||||
//-------------------------------------------------------------------------------------------
|
||||
const wchar_t * draw_control::ns = L"draw";
|
||||
|
||||
@ -455,6 +455,8 @@ public:
|
||||
_CP_OPT(std::wstring) draw_enhanced_path_;
|
||||
_CP_OPT(std::wstring) drawooo_enhanced_path_;
|
||||
_CP_OPT(std::wstring) drawooo_sub_view_size_;
|
||||
_CP_OPT(bool) draw_mirror_horizontal_;
|
||||
_CP_OPT(bool) draw_mirror_vertical_;
|
||||
};
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
class draw_enhanced_geometry : public office_element_impl<draw_enhanced_geometry>
|
||||
@ -476,7 +478,7 @@ public:
|
||||
|
||||
void find_draw_type_oox();
|
||||
|
||||
draw_enhanced_geometry_attlist draw_enhanced_geometry_attlist_;
|
||||
draw_enhanced_geometry_attlist attlist_;
|
||||
|
||||
_CP_OPT(int) sub_type_;
|
||||
_CP_OPT(int) draw_type_oox_index_;
|
||||
@ -641,13 +643,61 @@ public:
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context);
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context);
|
||||
|
||||
_CP_OPT(std::wstring) dr3d_diffuse_color_;
|
||||
_CP_OPT(std::wstring) dr3d_direction_;
|
||||
_CP_OPT(std::wstring) dr3d_specular_;
|
||||
_CP_OPT(odf_types::Bool)dr3d_enabled_;
|
||||
_CP_OPT(std::wstring) dr3d_diffuse_color_;
|
||||
_CP_OPT(std::wstring) dr3d_direction_;
|
||||
_CP_OPT(odf_types::Bool) dr3d_specular_;
|
||||
_CP_OPT(odf_types::Bool) dr3d_enabled_;
|
||||
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(dr3d_light);
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------
|
||||
class dr3d_cube : public draw_shape
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
|
||||
static const ElementType type = typeDr3dCube;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context);
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context);
|
||||
|
||||
_CP_OPT(std::wstring) dr3d_max_edge_;
|
||||
_CP_OPT(std::wstring) dr3d_min_edge_;
|
||||
_CP_OPT(std::wstring) dr3d_transform_;
|
||||
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(dr3d_cube);
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------
|
||||
class dr3d_sphere : public draw_shape
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
|
||||
static const ElementType type = typeDr3dSphere;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context);
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context);
|
||||
|
||||
_CP_OPT(std::wstring) dr3d_size_; //vector3D
|
||||
_CP_OPT(std::wstring) dr3d_center_; //vector3D
|
||||
_CP_OPT(std::wstring) dr3d_transform_;
|
||||
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(dr3d_sphere);
|
||||
//----------------------------------------------------------------------------------------------
|
||||
class draw_control : public draw_shape
|
||||
{
|
||||
|
||||
@ -288,6 +288,14 @@ void draw_enhanced_geometry::docx_convert(oox::docx_conversion_context & Context
|
||||
|
||||
bool set_shape = false;
|
||||
|
||||
if (attlist_.draw_mirror_horizontal_)
|
||||
{
|
||||
shape->additional_.push_back(_property(L"flipH", *attlist_.draw_mirror_horizontal_));
|
||||
}
|
||||
if (attlist_.draw_mirror_vertical_)
|
||||
{
|
||||
shape->additional_.push_back(_property(L"flipV", *attlist_.draw_mirror_vertical_));
|
||||
}
|
||||
if (draw_type_oox_index_)
|
||||
{
|
||||
shape->additional_.push_back(_property(L"oox-geom-index", draw_type_oox_index_.get()));
|
||||
@ -305,10 +313,10 @@ void draw_enhanced_geometry::docx_convert(oox::docx_conversion_context & Context
|
||||
set_shape = true;
|
||||
}
|
||||
std::wstring odf_path; //общая часть - объединить ...
|
||||
if (draw_enhanced_geometry_attlist_.drawooo_enhanced_path_)
|
||||
odf_path = draw_enhanced_geometry_attlist_.drawooo_enhanced_path_.get();
|
||||
else if (draw_enhanced_geometry_attlist_.draw_enhanced_path_)
|
||||
odf_path = draw_enhanced_geometry_attlist_.draw_enhanced_path_.get();
|
||||
if (attlist_.drawooo_enhanced_path_)
|
||||
odf_path = attlist_.drawooo_enhanced_path_.get();
|
||||
else if (attlist_.draw_enhanced_path_)
|
||||
odf_path = attlist_.draw_enhanced_path_.get();
|
||||
|
||||
if (!odf_path.empty())
|
||||
{
|
||||
@ -339,10 +347,10 @@ void draw_enhanced_geometry::docx_convert(oox::docx_conversion_context & Context
|
||||
int w = 0;
|
||||
int h = 0;
|
||||
|
||||
if (draw_enhanced_geometry_attlist_.drawooo_sub_view_size_)
|
||||
if (attlist_.drawooo_sub_view_size_)
|
||||
{
|
||||
std::vector< std::wstring > splitted;
|
||||
boost::algorithm::split(splitted, *draw_enhanced_geometry_attlist_.drawooo_sub_view_size_, boost::algorithm::is_any_of(L" "), boost::algorithm::token_compress_on);
|
||||
boost::algorithm::split(splitted, *attlist_.drawooo_sub_view_size_, boost::algorithm::is_any_of(L" "), boost::algorithm::token_compress_on);
|
||||
|
||||
if (splitted.size() == 2)
|
||||
{
|
||||
@ -375,10 +383,10 @@ void draw_enhanced_geometry::docx_convert(oox::docx_conversion_context & Context
|
||||
}
|
||||
}
|
||||
|
||||
if (draw_enhanced_geometry_attlist_.draw_modifiers_)
|
||||
if (attlist_.draw_modifiers_)
|
||||
{
|
||||
if (bOoxType_)
|
||||
shape->additional_.push_back(_property(L"oox-draw-modifiers", draw_enhanced_geometry_attlist_.draw_modifiers_.get()));
|
||||
shape->additional_.push_back(_property(L"oox-draw-modifiers", attlist_.draw_modifiers_.get()));
|
||||
else
|
||||
{
|
||||
}
|
||||
@ -406,6 +414,14 @@ void dr3d_scene::docx_convert(oox::docx_conversion_context & Context)
|
||||
void dr3d_light::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
|
||||
}
|
||||
void dr3d_cube::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
|
||||
}
|
||||
void dr3d_sphere::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -68,7 +68,7 @@ void draw_shape::common_pptx_convert(oox::pptx_conversion_context & Context)
|
||||
common_shape_draw_attlist &common_draw_attlist_ = common_draw_attlists_.shape_with_text_and_styles_.common_shape_draw_attlist_;
|
||||
common_presentation_attlist &common_presentation_attlist_= common_draw_attlists_.shape_with_text_and_styles_.common_presentation_attlist_;
|
||||
|
||||
const int z_index = common_draw_attlist_.draw_z_index_.get_value_or(0);
|
||||
const unsigned int z_index = common_draw_attlist_.draw_z_index_.get_value_or(0);
|
||||
const std::wstring name = common_draw_attlist_.draw_name_.get_value_or(L"");
|
||||
const std::wstring textStyleName = common_draw_attlist_.draw_text_style_name_.get_value_or(L"");
|
||||
|
||||
@ -340,6 +340,14 @@ void draw_enhanced_geometry::pptx_convert(oox::pptx_conversion_context & Context
|
||||
|
||||
bool set_shape = false;
|
||||
|
||||
if (attlist_.draw_mirror_horizontal_)
|
||||
{
|
||||
Context.get_slide_context().set_property(_property(L"flipH", *attlist_.draw_mirror_horizontal_));
|
||||
}
|
||||
if (attlist_.draw_mirror_vertical_)
|
||||
{
|
||||
Context.get_slide_context().set_property(_property(L"flipV", *attlist_.draw_mirror_vertical_));
|
||||
}
|
||||
if (draw_type_oox_index_)
|
||||
{
|
||||
Context.get_slide_context().set_property(_property(L"oox-geom-index", draw_type_oox_index_.get()));
|
||||
@ -357,10 +365,10 @@ void draw_enhanced_geometry::pptx_convert(oox::pptx_conversion_context & Context
|
||||
}
|
||||
|
||||
std::wstring odf_path;
|
||||
if (draw_enhanced_geometry_attlist_.drawooo_enhanced_path_)
|
||||
odf_path = draw_enhanced_geometry_attlist_.drawooo_enhanced_path_.get();
|
||||
else if (draw_enhanced_geometry_attlist_.draw_enhanced_path_)
|
||||
odf_path = draw_enhanced_geometry_attlist_.draw_enhanced_path_.get();
|
||||
if (attlist_.drawooo_enhanced_path_)
|
||||
odf_path = attlist_.drawooo_enhanced_path_.get();
|
||||
else if (attlist_.draw_enhanced_path_)
|
||||
odf_path = attlist_.draw_enhanced_path_.get();
|
||||
|
||||
if (!odf_path.empty())
|
||||
{
|
||||
@ -388,10 +396,10 @@ void draw_enhanced_geometry::pptx_convert(oox::pptx_conversion_context & Context
|
||||
|
||||
set_shape = true;
|
||||
|
||||
if (draw_enhanced_geometry_attlist_.drawooo_sub_view_size_)
|
||||
if (attlist_.drawooo_sub_view_size_)
|
||||
{
|
||||
std::vector< std::wstring > splitted;
|
||||
boost::algorithm::split(splitted, *draw_enhanced_geometry_attlist_.drawooo_sub_view_size_, boost::algorithm::is_any_of(L" "), boost::algorithm::token_compress_on);
|
||||
boost::algorithm::split(splitted, *attlist_.drawooo_sub_view_size_, boost::algorithm::is_any_of(L" "), boost::algorithm::token_compress_on);
|
||||
|
||||
if (splitted.size() == 2)
|
||||
{
|
||||
@ -412,10 +420,10 @@ void draw_enhanced_geometry::pptx_convert(oox::pptx_conversion_context & Context
|
||||
}
|
||||
}
|
||||
}
|
||||
if (draw_enhanced_geometry_attlist_.draw_modifiers_)
|
||||
if (attlist_.draw_modifiers_)
|
||||
{
|
||||
if (bOoxType_)
|
||||
Context.get_slide_context().set_property(_property(L"oox-draw-modifiers", draw_enhanced_geometry_attlist_.draw_modifiers_.get()));
|
||||
Context.get_slide_context().set_property(_property(L"oox-draw-modifiers", attlist_.draw_modifiers_.get()));
|
||||
else
|
||||
{
|
||||
}
|
||||
@ -446,6 +454,14 @@ void dr3d_scene::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
void dr3d_light::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
{
|
||||
|
||||
}
|
||||
void dr3d_cube::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
{
|
||||
Context.get_slide_context().start_shape(sub_type_); //reset type
|
||||
}
|
||||
void dr3d_sphere::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
{
|
||||
Context.get_slide_context().start_shape(sub_type_); //reset type
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -71,7 +71,7 @@ void draw_shape::common_xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
|
||||
common_draw_shape_with_text_and_styles_attlist common_draw_attlist_ = common_draw_attlists_.shape_with_text_and_styles_;
|
||||
|
||||
const int z_index = common_draw_attlist_.common_shape_draw_attlist_.draw_z_index_.get_value_or(0);
|
||||
const unsigned int z_index = common_draw_attlist_.common_shape_draw_attlist_.draw_z_index_.get_value_or(0);
|
||||
const std::wstring name = common_draw_attlist_.common_shape_draw_attlist_.draw_name_.get_value_or(L"");
|
||||
const std::wstring styleName = common_draw_attlist_.common_shape_draw_attlist_.draw_style_name_.get_value_or(L"");
|
||||
const std::wstring textStyleName = common_draw_attlist_.common_shape_draw_attlist_.draw_text_style_name_.get_value_or(L"");
|
||||
@ -276,6 +276,14 @@ void draw_enhanced_geometry::xlsx_convert(oox::xlsx_conversion_context & Context
|
||||
{
|
||||
find_draw_type_oox();
|
||||
|
||||
if (attlist_.draw_mirror_horizontal_)
|
||||
{
|
||||
Context.get_drawing_context().set_property(_property(L"flipH", *attlist_.draw_mirror_horizontal_));
|
||||
}
|
||||
if (attlist_.draw_mirror_vertical_)
|
||||
{
|
||||
Context.get_drawing_context().set_property(_property(L"flipV", *attlist_.draw_mirror_vertical_));
|
||||
}
|
||||
if (draw_type_oox_index_)
|
||||
{
|
||||
Context.get_drawing_context().set_property(_property(L"oox-geom-index", draw_type_oox_index_.get()));
|
||||
@ -291,10 +299,10 @@ void draw_enhanced_geometry::xlsx_convert(oox::xlsx_conversion_context & Context
|
||||
}
|
||||
|
||||
std::wstring odf_path;
|
||||
if (draw_enhanced_geometry_attlist_.drawooo_enhanced_path_)
|
||||
odf_path = draw_enhanced_geometry_attlist_.drawooo_enhanced_path_.get();
|
||||
else if (draw_enhanced_geometry_attlist_.draw_enhanced_path_)
|
||||
odf_path = draw_enhanced_geometry_attlist_.draw_enhanced_path_.get();
|
||||
if (attlist_.drawooo_enhanced_path_)
|
||||
odf_path = attlist_.drawooo_enhanced_path_.get();
|
||||
else if (attlist_.draw_enhanced_path_)
|
||||
odf_path = attlist_.draw_enhanced_path_.get();
|
||||
|
||||
if (!odf_path.empty())
|
||||
{
|
||||
@ -320,10 +328,10 @@ void draw_enhanced_geometry::xlsx_convert(oox::xlsx_conversion_context & Context
|
||||
::svg_path::oox_serialize(output_, o_Polyline);
|
||||
Context.get_drawing_context().set_property(odf_reader::_property(L"custom_path", output_.str()));
|
||||
|
||||
if (draw_enhanced_geometry_attlist_.drawooo_sub_view_size_)
|
||||
if (attlist_.drawooo_sub_view_size_)
|
||||
{
|
||||
std::vector< std::wstring > splitted;
|
||||
boost::algorithm::split(splitted, *draw_enhanced_geometry_attlist_.drawooo_sub_view_size_, boost::algorithm::is_any_of(L" "), boost::algorithm::token_compress_on);
|
||||
boost::algorithm::split(splitted, *attlist_.drawooo_sub_view_size_, boost::algorithm::is_any_of(L" "), boost::algorithm::token_compress_on);
|
||||
|
||||
if (splitted.size() == 2)
|
||||
{
|
||||
@ -348,10 +356,10 @@ void draw_enhanced_geometry::xlsx_convert(oox::xlsx_conversion_context & Context
|
||||
draw_type_oox_index_ = 0;
|
||||
}
|
||||
}
|
||||
if (draw_enhanced_geometry_attlist_.draw_modifiers_)
|
||||
if (attlist_.draw_modifiers_)
|
||||
{
|
||||
if (bOoxType_)
|
||||
Context.get_drawing_context().set_property(_property(L"oox-draw-modifiers", draw_enhanced_geometry_attlist_.draw_modifiers_.get()));
|
||||
Context.get_drawing_context().set_property(_property(L"oox-draw-modifiers", attlist_.draw_modifiers_.get()));
|
||||
else
|
||||
{
|
||||
}
|
||||
@ -371,6 +379,15 @@ void dr3d_scene::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
void dr3d_light::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
|
||||
}
|
||||
void dr3d_cube::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
Context.get_drawing_context().start_shape(sub_type_); //reset type
|
||||
}
|
||||
void dr3d_sphere::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
Context.get_drawing_context().start_shape(sub_type_); //reset type
|
||||
|
||||
}
|
||||
void draw_control::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
|
||||
@ -268,7 +268,7 @@ void officeooo_annotation::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
}
|
||||
id_idx = Context.add_author_comments(author);
|
||||
|
||||
Context.get_comments_context().start_comment(x, y,id_idx.first,id_idx.second);//author & idx (uniq number for author
|
||||
Context.get_comments_context().start_comment(x, y, id_idx.first, id_idx.second);//author & idx (uniq number for author
|
||||
|
||||
Context.get_text_context().start_comment_content();
|
||||
for (size_t i = 0; i < content_.size(); i++)//текст + текстовый стиль
|
||||
|
||||
@ -151,7 +151,10 @@ void office_body::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
if (page_layout_instance *lastPageLayout = Context.root()->odf_context().pageLayoutContainer().page_layout_by_name(Context.get_page_properties()))
|
||||
{
|
||||
Context.next_dump_page_properties(true);
|
||||
if (Context.is_last_dump_page_properties())
|
||||
{
|
||||
Context.next_dump_page_properties(true);
|
||||
}
|
||||
|
||||
lastPageLayout->docx_serialize(Context.output_stream(), Context);
|
||||
//Context.remove_page_properties();
|
||||
|
||||
@ -129,6 +129,16 @@ void office_text::add_child_element( xml::sax * Reader, const std::wstring & Ns,
|
||||
else if (is_text_content(Ns, Name))
|
||||
{
|
||||
CP_CREATE_ELEMENT(content_);
|
||||
|
||||
if (!first_element_style_name && (content_.back()->get_type() == typeTextP ||
|
||||
content_.back()->get_type() == typeTextH))
|
||||
{//bus-modern_l.ott
|
||||
if (content_.back()->element_style_name)
|
||||
first_element_style_name = content_.back()->element_style_name;
|
||||
else
|
||||
first_element_style_name = L""; //default
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
CP_NOT_APPLICABLE_ELM();
|
||||
@ -155,6 +165,26 @@ void office_text::docx_convert(oox::docx_conversion_context & Context)
|
||||
//forms_->docx_convert(Context);
|
||||
|
||||
Context.start_office_text();
|
||||
|
||||
if ((first_element_style_name) && (!first_element_style_name->empty()))
|
||||
{
|
||||
std::wstring text___ = *first_element_style_name;
|
||||
|
||||
const _CP_OPT(std::wstring) masterPageName = Context.root()->odf_context().styleContainer().master_page_name_by_name(text___);
|
||||
|
||||
if (masterPageName)
|
||||
{
|
||||
std::wstring masterPageNameLayout = Context.root()->odf_context().pageLayoutContainer().page_layout_name_by_style(*masterPageName);
|
||||
|
||||
if (false == masterPageNameLayout.empty())
|
||||
{
|
||||
Context.set_master_page_name(*masterPageName); //проверка на то что тема действительно существует????
|
||||
|
||||
Context.remove_page_properties();
|
||||
Context.add_page_properties(masterPageNameLayout);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
if (content_[i]->element_style_name)
|
||||
|
||||
@ -70,6 +70,8 @@ private:
|
||||
//office_element_ptr forms_; -> content
|
||||
|
||||
office_element_ptr_array content_;
|
||||
|
||||
_CP_OPT(std::wstring) first_element_style_name;
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(office_text);
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
|
||||
@ -443,6 +443,8 @@ namespace {
|
||||
|
||||
double pixToSize(double pixels, double maxDigitSize)
|
||||
{
|
||||
if (pixels < 8) pixels = 8; //УВЕДОМЛЕНИЕ О ПРИБЫТИИ ИНОСТРАННОГО ГРАЖДАНИНА.ods
|
||||
|
||||
return (int(( pixels /*/ 0.75*/ - 5)/ maxDigitSize * 100. + 0.5)) /100. * 0.9; // * 9525. * 72.0 / (360000.0 * 2.54);
|
||||
}
|
||||
double cmToChars (double cm)
|
||||
@ -772,10 +774,10 @@ void table_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
double s;
|
||||
if (oox::parseTime(tv, h, m, s))
|
||||
{
|
||||
boost::int64_t intTime = (boost::int64_t)oox::convertTime(h, m, s);
|
||||
if (intTime > 0)
|
||||
double dTime = oox::convertTime(h, m, s);
|
||||
if (dTime >= 0)
|
||||
{
|
||||
number_val = boost::lexical_cast<std::wstring>(intTime);
|
||||
number_val = boost::lexical_cast<std::wstring>(dTime);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -308,7 +308,7 @@ void paragraph::docx_convert(oox::docx_conversion_context & Context)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (next_section_/* || next_end_section_*/)
|
||||
if (next_section_/* || next_end_section_*/)//remove in text::section
|
||||
{
|
||||
Context.get_section_context().get().is_dump_ = true;
|
||||
is_empty = false;
|
||||
@ -675,6 +675,7 @@ void section::add_child_element( xml::sax * Reader, const std::wstring & Ns, con
|
||||
|
||||
void section::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
bool bAddSection = false;
|
||||
if ( false == Context.get_drawing_state_content())
|
||||
{
|
||||
std::wstring current_page_properties = Context.get_page_properties();
|
||||
@ -682,6 +683,8 @@ void section::docx_convert(oox::docx_conversion_context & Context)
|
||||
Context.get_section_context().add_section (section_attr_.name_, section_attr_.style_name_.get_value_or(L""), current_page_properties);
|
||||
|
||||
Context.add_page_properties(current_page_properties);
|
||||
|
||||
bAddSection = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -729,6 +732,11 @@ void section::docx_convert(oox::docx_conversion_context & Context)
|
||||
}
|
||||
content_[i]->docx_convert(Context);
|
||||
}
|
||||
if (bAddSection)
|
||||
{
|
||||
Context.get_section_context().get().is_dump_ = true;
|
||||
Context.last_dump_page_properties(false);
|
||||
}
|
||||
}
|
||||
|
||||
// text-section-source-attr
|
||||
|
||||
@ -1854,7 +1854,7 @@ void odf_drawing_context::set_horizontal_pos(int align)
|
||||
}
|
||||
void odf_drawing_context::set_horizontal_pos(double offset_pt)
|
||||
{
|
||||
impl_->anchor_settings_.style_horizontal_pos_svg_x_ = length(length(offset_pt,length::pt).get_value_unit(length::cm),length::cm);
|
||||
impl_->anchor_settings_.style_horizontal_pos_svg_x_ = length(length(offset_pt, length::pt).get_value_unit(length::cm), length::cm);
|
||||
impl_->x = offset_pt;
|
||||
}
|
||||
void odf_drawing_context::set_default_wrap_style()
|
||||
|
||||
@ -74,6 +74,7 @@ namespace odf_writer
|
||||
count_rows = 0;
|
||||
|
||||
table_width = 0;
|
||||
table_height = 0;
|
||||
}
|
||||
std::vector<odf_row_state> rows;
|
||||
std::vector<odf_column_state> columns;
|
||||
@ -91,6 +92,8 @@ namespace odf_writer
|
||||
bool styled;
|
||||
|
||||
double table_width;
|
||||
double table_height;
|
||||
|
||||
std::wstring default_cell_properties;
|
||||
|
||||
_CP_OPT(std::wstring) border_inside_v_;
|
||||
@ -103,30 +106,34 @@ class odf_table_context::Impl
|
||||
public:
|
||||
Impl(odf_conversion_context *odf_context) :odf_context_(odf_context)
|
||||
{
|
||||
default_column_width = -1;
|
||||
default_column_width = boost::none;
|
||||
default_row_height = boost::none;
|
||||
optimal_column_width = false;
|
||||
}
|
||||
|
||||
odf_table_state & current_table() {return tables_.back();}
|
||||
bool empty () {return tables_.size() >0 ? false : true; }
|
||||
bool empty () {return (false == tables_.empty()) ? false : true; }
|
||||
|
||||
void start_table(odf_table_state & state) {tables_.push_back(state);}
|
||||
|
||||
void end_table()
|
||||
{
|
||||
if (tables_.size() > 0) tables_.pop_back();
|
||||
if (false == tables_.empty()) tables_.pop_back();
|
||||
|
||||
default_column_width = -1; // todo .. in level ???
|
||||
default_column_width = boost::none; // todo .. in level ???
|
||||
default_row_height = boost::none;
|
||||
default_cell_properties = L"";
|
||||
optimal_column_width = false;
|
||||
}
|
||||
|
||||
odf_style_context * styles_context() {return odf_context_->styles_context();}
|
||||
odf_style_context *styles_context() {return odf_context_->styles_context();}
|
||||
|
||||
odf_conversion_context *odf_context_;
|
||||
|
||||
double default_column_width;
|
||||
bool optimal_column_width;
|
||||
_CP_OPT(double) default_row_height;
|
||||
_CP_OPT(double) default_column_width;
|
||||
bool optimal_column_width;
|
||||
|
||||
std::wstring default_cell_properties; // для предустановки ..
|
||||
|
||||
private:
|
||||
@ -252,7 +259,7 @@ void odf_table_context::end_row()
|
||||
// start_cell(cell,false);
|
||||
// end_cell();
|
||||
//}
|
||||
impl_->current_table().current_column =0;
|
||||
impl_->current_table().current_column = 0;
|
||||
}
|
||||
|
||||
|
||||
@ -312,16 +319,25 @@ void odf_table_context::set_default_cell_properties(std::wstring style_name)
|
||||
{
|
||||
impl_->default_cell_properties = style_name;
|
||||
}
|
||||
double odf_table_context::get_table_width()
|
||||
_CP_OPT(double) odf_table_context::get_table_width()
|
||||
{
|
||||
if (impl_->empty()) return -1;
|
||||
if (impl_->empty()) return boost::none;
|
||||
else return impl_->current_table().table_width;
|
||||
}
|
||||
_CP_OPT(double) odf_table_context::get_table_height()
|
||||
{
|
||||
if (impl_->empty()) return boost::none;
|
||||
else return impl_->current_table().table_height;
|
||||
}
|
||||
std::wstring odf_table_context::get_default_cell_properties()
|
||||
{
|
||||
if (impl_->empty()) return impl_->default_cell_properties;
|
||||
else return impl_->current_table().default_cell_properties;
|
||||
}
|
||||
void odf_table_context::set_default_row_height(double height)
|
||||
{
|
||||
impl_->default_row_height = height;
|
||||
}
|
||||
void odf_table_context::set_default_column_width(double width)
|
||||
{
|
||||
impl_->default_column_width = width;
|
||||
@ -347,7 +363,7 @@ void odf_table_context::set_column_optimal(bool val)
|
||||
void odf_table_context::change_current_column_width(double width)
|
||||
{
|
||||
if (impl_->empty()) return;
|
||||
if (impl_->current_table().columns.size() < 1)return;
|
||||
if (impl_->current_table().columns.empty())return;
|
||||
|
||||
int index = impl_->current_table().current_column ;
|
||||
if (index < 0) return;
|
||||
@ -368,7 +384,7 @@ void odf_table_context::change_current_column_width(double width)
|
||||
style_table_column_properties *properties = style_->content_.get_style_table_column_properties();
|
||||
if (properties == NULL) return;
|
||||
|
||||
length length_ = length(length(width,length::pt).get_value_unit(length::cm),length::cm);
|
||||
length length_ = length(length(width, length::pt).get_value_unit(length::cm), length::cm);
|
||||
|
||||
if (!properties->style_table_column_properties_attlist_.style_column_width_)
|
||||
properties->style_table_column_properties_attlist_.style_column_width_ = length_;
|
||||
@ -383,39 +399,68 @@ void odf_table_context::change_current_column_width(double width)
|
||||
void odf_table_context::set_column_width(double width)
|
||||
{
|
||||
if (impl_->empty()) return;
|
||||
if (impl_->current_table().columns.size() < 1)return;
|
||||
if (impl_->current_table().columns.empty())return;
|
||||
|
||||
style *style_ = dynamic_cast<style*>(impl_->current_table().columns.back().style_elm.get());
|
||||
|
||||
if (style_ == NULL) return;
|
||||
style_table_column_properties *properties = style_->content_.get_style_table_column_properties();
|
||||
if (properties == NULL) return;
|
||||
style_table_column_properties *properties = style_ ? style_->content_.get_style_table_column_properties() : NULL;
|
||||
|
||||
if (width > 0)
|
||||
{
|
||||
properties->style_table_column_properties_attlist_.style_column_width_ = length(length(width,length::pt).get_value_unit(length::cm),length::cm);
|
||||
//properties->style_table_column_properties_attlist_.style_rel_column_width_ = length(length(width,length::pt).get_value_unit(length::cm),length::cm);
|
||||
|
||||
if (impl_->optimal_column_width)
|
||||
if (properties)
|
||||
{
|
||||
properties->style_table_column_properties_attlist_.style_use_optimal_column_width_ = true;
|
||||
properties->style_table_column_properties_attlist_.style_column_width_ = length(length(width,length::pt).get_value_unit(length::cm),length::cm);
|
||||
//properties->style_table_column_properties_attlist_.style_rel_column_width_ = length(length(width,length::pt).get_value_unit(length::cm),length::cm);
|
||||
|
||||
if (impl_->optimal_column_width)
|
||||
{
|
||||
properties->style_table_column_properties_attlist_.style_use_optimal_column_width_ = true;
|
||||
}
|
||||
}
|
||||
|
||||
impl_->current_table().table_width += width;
|
||||
}
|
||||
else
|
||||
{
|
||||
properties->style_table_column_properties_attlist_.style_use_optimal_column_width_ = true;
|
||||
|
||||
if (impl_->default_column_width >= 0)
|
||||
if (properties)
|
||||
{
|
||||
properties->style_table_column_properties_attlist_.style_column_width_ = length(length(impl_->default_column_width,length::pt).get_value_unit(length::cm),length::cm);
|
||||
//properties->style_table_column_properties_attlist_.style_rel_column_width_ = length(length(impl_->current_table().table_width,length::pt).get_value_unit(length::cm),length::cm);
|
||||
|
||||
impl_->current_table().table_width += impl_->default_column_width;
|
||||
properties->style_table_column_properties_attlist_.style_use_optimal_column_width_ = true;
|
||||
|
||||
if (impl_->default_column_width)
|
||||
{
|
||||
properties->style_table_column_properties_attlist_.style_column_width_ = length(length(impl_->default_column_width.get(), length::pt).get_value_unit(length::cm), length::cm);
|
||||
//properties->style_table_column_properties_attlist_.style_rel_column_width_ = length(length(impl_->current_table().table_width,length::pt).get_value_unit(length::cm),length::cm);
|
||||
}
|
||||
}
|
||||
impl_->current_table().table_width += impl_->default_column_width.get_value_or(0);
|
||||
}
|
||||
}
|
||||
void odf_table_context::set_row_height(double height)
|
||||
{
|
||||
if (impl_->empty()) return;
|
||||
|
||||
if (height > 0)
|
||||
{
|
||||
//style *style_ = dynamic_cast<odf_writer::style*>(rows_.back().style_elm.get());
|
||||
|
||||
//if (style_)
|
||||
//{
|
||||
// style_table_row_properties *properties = style_->content_.get_style_table_row_properties();
|
||||
// if (properties)
|
||||
// {
|
||||
// //properties->style_table_column_properties_attlist_.style_column_width_ = length(length(width,length::pt).get_value_unit(length::cm),length::cm);
|
||||
// }
|
||||
//}
|
||||
impl_->current_table().table_height += height;
|
||||
|
||||
if (!impl_->default_row_height)
|
||||
impl_->default_row_height = height;
|
||||
}
|
||||
else
|
||||
{
|
||||
impl_->current_table().table_height += impl_->default_row_height.get_value_or(0);
|
||||
}
|
||||
}
|
||||
|
||||
int odf_table_context::current_column ()
|
||||
{
|
||||
if (impl_->empty()) return 0;
|
||||
|
||||
@ -65,15 +65,17 @@ public:
|
||||
void count_rows (int count);
|
||||
|
||||
void start_table(office_element_ptr &elm, bool styled = false);
|
||||
void set_default_column_width(double width);
|
||||
void set_default_column_width(double val);
|
||||
void set_optimal_column_width(bool val);
|
||||
void change_current_column_width(double width);
|
||||
void change_current_column_width(double val);
|
||||
void set_default_row_height(double val);
|
||||
void end_table();
|
||||
|
||||
void set_default_cell_properties(std::wstring style_name);
|
||||
std::wstring get_default_cell_properties();
|
||||
|
||||
double get_table_width();
|
||||
_CP_OPT(double) get_table_width();
|
||||
_CP_OPT(double) get_table_height();
|
||||
|
||||
void set_table_inside_v(_CP_OPT(std::wstring) border);
|
||||
void set_table_inside_h(_CP_OPT(std::wstring) border);
|
||||
@ -82,6 +84,7 @@ public:
|
||||
_CP_OPT(std::wstring) get_table_inside_h();
|
||||
|
||||
void start_row(office_element_ptr &elm, bool styled = false);
|
||||
void set_row_height(double val);
|
||||
void end_row();
|
||||
|
||||
void start_cell(office_element_ptr &elm, bool styled = false);
|
||||
|
||||
@ -1509,7 +1509,7 @@ void odt_conversion_context::end_table_columns()
|
||||
void odt_conversion_context::start_table_header_rows()
|
||||
{
|
||||
office_element_ptr elm;
|
||||
create_element(L"table", L"table-header-rows",elm,this);
|
||||
create_element(L"table", L"table-header-rows", elm, this);
|
||||
|
||||
text_context()->start_element(elm);
|
||||
}
|
||||
@ -1520,11 +1520,11 @@ void odt_conversion_context::end_table_header_rows()
|
||||
void odt_conversion_context::start_table_row(bool styled)
|
||||
{
|
||||
office_element_ptr elm;
|
||||
create_element(L"table", L"table-row",elm,this);
|
||||
create_element(L"table", L"table-row", elm, this);
|
||||
|
||||
if (styled)
|
||||
{
|
||||
styles_context()->create_style(L"",odf_types::style_family::TableRow, true, false, -1);
|
||||
styles_context()->create_style(L"", odf_types::style_family::TableRow, true, false, -1);
|
||||
}
|
||||
text_context()->start_element(elm);
|
||||
|
||||
@ -1556,7 +1556,7 @@ void odt_conversion_context::end_table_cell()
|
||||
}
|
||||
void odt_conversion_context::end_table_row()
|
||||
{
|
||||
for (int i=table_context()->current_column() ; i < table_context()->count_columns(); i++)
|
||||
for (int i = table_context()->current_column() ; i < table_context()->count_columns(); i++)
|
||||
{
|
||||
add_default_cell();
|
||||
}
|
||||
|
||||
@ -2911,6 +2911,8 @@ void DocxConverter::convert(OOX::Drawing::CAnchor *oox_anchor)
|
||||
|
||||
_CP_OPT(int) anchor_type_x, anchor_type_y;
|
||||
|
||||
bool bThrough = oox_anchor->m_oBehindDoc.IsInit() ? oox_anchor->m_oBehindDoc->ToBool(): false;
|
||||
|
||||
if (oox_anchor->m_oPositionV.IsInit() && oox_anchor->m_oPositionV->m_oRelativeFrom.IsInit())
|
||||
{
|
||||
int vert_rel = oox_anchor->m_oPositionV->m_oRelativeFrom->GetValue();
|
||||
@ -3005,6 +3007,12 @@ void DocxConverter::convert(OOX::Drawing::CAnchor *oox_anchor)
|
||||
{
|
||||
odt_context->drawing_context()->set_wrap_style(odf_types::style_wrap::None);
|
||||
wrap_set = true;
|
||||
|
||||
if (bThrough)
|
||||
{//эффект_штурмовика.docx
|
||||
odt_context->drawing_context()->set_wrap_style(odf_types::style_wrap::RunThrough);
|
||||
odt_context->drawing_context()->set_object_background(true);
|
||||
}
|
||||
}
|
||||
else if (oox_anchor->m_oAllowOverlap.IsInit())
|
||||
{
|
||||
@ -3980,7 +3988,14 @@ void DocxConverter::convert(OOX::Logic::CTbl *oox_table)
|
||||
odt_context->start_drawings();
|
||||
_CP_OPT(double) width, height, x, y ;
|
||||
|
||||
if (oox_table->m_oTableProperties->m_oTblpPr->m_oTblpX.IsInit())
|
||||
if (oox_table->m_oTableProperties->m_oTblpPr->m_oTblpXSpec.IsInit())
|
||||
{
|
||||
odt_context->drawing_context()->set_horizontal_pos(oox_table->m_oTableProperties->m_oTblpPr->m_oTblpXSpec->GetValue());
|
||||
}
|
||||
bool bRightAlignX = ((oox_table->m_oTableProperties->m_oTblpPr->m_oTblpXSpec.IsInit()) &&
|
||||
(oox_table->m_oTableProperties->m_oTblpPr->m_oTblpXSpec->GetValue() == SimpleTypes::xalignRight));
|
||||
|
||||
if (!bRightAlignX && oox_table->m_oTableProperties->m_oTblpPr->m_oTblpX.IsInit())
|
||||
x = oox_table->m_oTableProperties->m_oTblpPr->m_oTblpX->ToPoints();
|
||||
if (oox_table->m_oTableProperties->m_oTblpPr->m_oTblpY.IsInit())
|
||||
y = oox_table->m_oTableProperties->m_oTblpPr->m_oTblpY->ToPoints();
|
||||
@ -3991,6 +4006,7 @@ void DocxConverter::convert(OOX::Logic::CTbl *oox_table)
|
||||
// else x = -*x + oox_table->m_oTableProperties->m_oTblpPr->m_oLeftFromText->ToPoints();
|
||||
//}
|
||||
|
||||
|
||||
odt_context->drawing_context()->set_drawings_rect(x, y, width, height);
|
||||
|
||||
odt_context->drawing_context()->set_anchor(in_frame_anchor);
|
||||
@ -4021,10 +4037,11 @@ void DocxConverter::convert(OOX::Logic::CTbl *oox_table)
|
||||
|
||||
if (oox_table->m_oTableProperties->m_oTblpPr->m_oRightFromText.IsInit())
|
||||
{
|
||||
if (!x) //x = *x + oox_table->m_oTableProperties->m_oTblpPr->m_oRightFromText->ToPoints();
|
||||
if (!bRightAlignX && !x) //x = *x + oox_table->m_oTableProperties->m_oTblpPr->m_oRightFromText->ToPoints();
|
||||
{
|
||||
x = oox_table->m_oTableProperties->m_oTblpPr->m_oRightFromText->ToPoints();
|
||||
|
||||
odt_context->drawing_context()->set_horizontal_pos(*x);
|
||||
odt_context->drawing_context()->set_horizontal_pos(*x);
|
||||
}
|
||||
}
|
||||
if (oox_table->m_oTableProperties->m_oTblpPr->m_oTopFromText.IsInit())
|
||||
{
|
||||
@ -4038,7 +4055,7 @@ void DocxConverter::convert(OOX::Logic::CTbl *oox_table)
|
||||
odt_context->drawing_context()->start_text_box();
|
||||
odt_context->drawing_context()->set_text_box_tableframe(true);
|
||||
odt_context->drawing_context()->set_text_box_min_size(0, 1.);
|
||||
odt_context->drawing_context()->set_z_order(0x7fffffff-1);
|
||||
odt_context->drawing_context()->set_z_order(0x7fffffff - 1024/* + id_tables*/);
|
||||
odt_context->drawing_context()->set_text_box_parent_style(L"Frame");
|
||||
odt_context->drawing_context()->set_name(L"TableFrame");
|
||||
odt_context->start_text_context();
|
||||
@ -4046,7 +4063,7 @@ void DocxConverter::convert(OOX::Logic::CTbl *oox_table)
|
||||
|
||||
odt_context->start_table(true);
|
||||
|
||||
_CP_OPT(std::wstring) border_inside_h,border_inside_v;
|
||||
_CP_OPT(std::wstring) border_inside_h, border_inside_v;
|
||||
|
||||
if (styled_table)
|
||||
{
|
||||
@ -4100,10 +4117,11 @@ void DocxConverter::convert(OOX::Logic::CTbl *oox_table)
|
||||
if (in_frame)
|
||||
{
|
||||
_CP_OPT(double) width = odt_context->table_context()->get_table_width();
|
||||
_CP_OPT(double) height;
|
||||
_CP_OPT(double) height = odt_context->table_context()->get_table_height();
|
||||
|
||||
odt_context->drawing_context()->set_size(width, height);
|
||||
|
||||
odt_context->drawing_context()->set_text_box_min_size(-1,0);
|
||||
odt_context->drawing_context()->set_text_box_min_size(-1, height.get_value_or(0));
|
||||
}
|
||||
|
||||
odt_context->end_table();
|
||||
@ -4295,7 +4313,7 @@ void DocxConverter::convert(OOX::Logic::CTc *oox_table_cell)
|
||||
if (id_change_properties >= 0)
|
||||
odt_context->end_change(id_change_properties, 3);
|
||||
}
|
||||
bool DocxConverter::convert(OOX::Logic::CTableProperty *oox_table_pr, odf_writer::style_table_properties * table_properties )
|
||||
bool DocxConverter::convert(OOX::Logic::CTableProperty *oox_table_pr, odf_writer::style_table_properties *table_properties )
|
||||
{
|
||||
if (oox_table_pr == NULL) return false;
|
||||
if (table_properties == NULL) return false;
|
||||
@ -4397,7 +4415,7 @@ bool DocxConverter::convert(OOX::Logic::CTableProperty *oox_table_pr, odf_writer
|
||||
return true;
|
||||
}
|
||||
|
||||
void DocxConverter::convert(OOX::Logic::CTableProperty *oox_table_pr, odf_writer::style_table_cell_properties * table_cell_properties)
|
||||
void DocxConverter::convert(OOX::Logic::CTableProperty *oox_table_pr, odf_writer::style_table_cell_properties * table_cell_properties)
|
||||
{
|
||||
if (oox_table_pr == NULL || oox_table_pr == NULL) return;
|
||||
|
||||
@ -4450,24 +4468,27 @@ bool DocxConverter::convert(OOX::Logic::CTableProperty *oox_table_pr, bool base_
|
||||
|
||||
return true;
|
||||
}
|
||||
void DocxConverter::convert(OOX::Logic::CTableRowProperties *oox_table_row_pr, odf_writer::style_table_row_properties * table_row_properties)
|
||||
void DocxConverter::convert(OOX::Logic::CTableRowProperties *oox_table_row_pr, odf_writer::style_table_row_properties *table_row_properties)
|
||||
{
|
||||
if (oox_table_row_pr == NULL) return;
|
||||
if (table_row_properties == NULL) return;
|
||||
|
||||
if (oox_table_row_pr->m_oTblHeight.IsInit())
|
||||
if ((oox_table_row_pr->m_oTblHeight.IsInit()) &&
|
||||
(oox_table_row_pr->m_oTblHeight->m_oVal.IsInit()))
|
||||
{
|
||||
_CP_OPT(odf_types::length) length;
|
||||
convert(dynamic_cast<SimpleTypes::CUniversalMeasure *>(oox_table_row_pr->m_oTblHeight->m_oVal.GetPointer()), length);
|
||||
|
||||
odt_context->table_context()->set_row_height(oox_table_row_pr->m_oTblHeight->m_oVal->ToPoints());
|
||||
|
||||
if (oox_table_row_pr->m_oTblHeight->m_oHRule.IsInit())
|
||||
{
|
||||
switch(oox_table_row_pr->m_oTblHeight->m_oHRule->GetValue())
|
||||
{
|
||||
case SimpleTypes::heightruleAtLeast:
|
||||
table_row_properties->style_table_row_properties_attlist_.style_min_row_height_ = odf_types::length(length->get_value_unit(odf_types::length::cm),odf_types::length::cm); break;
|
||||
table_row_properties->style_table_row_properties_attlist_.style_min_row_height_ = odf_types::length(length->get_value_unit(odf_types::length::cm), odf_types::length::cm); break;
|
||||
case SimpleTypes::heightruleExact:
|
||||
table_row_properties->style_table_row_properties_attlist_.style_row_height_ = odf_types::length(length->get_value_unit(odf_types::length::cm),odf_types::length::cm); break;
|
||||
table_row_properties->style_table_row_properties_attlist_.style_row_height_ = odf_types::length(length->get_value_unit(odf_types::length::cm), odf_types::length::cm); break;
|
||||
case SimpleTypes::heightruleAuto:
|
||||
table_row_properties->style_table_row_properties_attlist_.style_use_optimal_row_height_ = true; break;
|
||||
}
|
||||
@ -4481,7 +4502,7 @@ void DocxConverter::convert(OOX::Logic::CTableRowProperties *oox_table_row_pr)
|
||||
{
|
||||
if (oox_table_row_pr == NULL) return;
|
||||
|
||||
odf_writer::style_table_row_properties * table_row_properties = odt_context->styles_context()->last_state()->get_table_row_properties();
|
||||
odf_writer::style_table_row_properties *table_row_properties = odt_context->styles_context()->last_state()->get_table_row_properties();
|
||||
|
||||
if (oox_table_row_pr->m_oCnfStyle.IsInit())
|
||||
{
|
||||
|
||||
@ -686,7 +686,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CRow *oox_row, OOX::Spreadsheet::C
|
||||
level = oox_row->m_oOutlineLevel->GetValue();
|
||||
}
|
||||
|
||||
ods_context->start_row(row_number,1,level,_default);
|
||||
ods_context->start_row(row_number, 1, level,_default);
|
||||
|
||||
if (oox_row->m_oHidden.IsInit()) ods_context->current_table().set_row_hidden(true);
|
||||
if (oox_row->m_oCollapsed.IsInit()) ods_context->current_table().set_row_hidden(true);
|
||||
|
||||
@ -40,6 +40,8 @@
|
||||
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Shape.h"
|
||||
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/SpTree.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
CStylesWriter::CStylesWriter() : m_pTheme(NULL) {}
|
||||
CStylesWriter::CStylesWriter(NSPresentationEditor::CTheme* pTheme) : m_pTheme(pTheme) {}
|
||||
|
||||
@ -889,6 +891,208 @@ void NSPresentationEditor::CShapeWriter::WriteShapeInfo()
|
||||
std::wstring str2 = _T("</p:nvSpPr>");
|
||||
m_oWriter.WriteString(str2);
|
||||
}
|
||||
void NSPresentationEditor::CShapeWriter::Write3dShape()
|
||||
{
|
||||
CShapeElement* pShapeElement = dynamic_cast<CShapeElement*>(m_pElement.get());
|
||||
if (!pShapeElement) return;
|
||||
|
||||
CPPTShape *pPPTShape = dynamic_cast<CPPTShape *>(pShapeElement->m_pShape->getBaseShape().get());
|
||||
if (!pPPTShape) return;
|
||||
|
||||
if (!pPPTShape->m_o3dOptions.bEnabled) return;
|
||||
|
||||
//{
|
||||
// std::cout << "........................................................................\n";
|
||||
// std::wcout << pShapeElement->m_sName << L"\n";
|
||||
// if (pPPTShape->m_o3dOptions.dSpecularAmt)
|
||||
// {
|
||||
// std::cout << "SpecularAmt\t" << (*pPPTShape->m_o3dOptions.dSpecularAmt) << "\n";
|
||||
// }
|
||||
// if (pPPTShape->m_o3dOptions.dDiffuseAmt)
|
||||
// {
|
||||
// std::cout << "iffuseAmt\t" << (*pPPTShape->m_o3dOptions.dDiffuseAmt) << "\n";
|
||||
// }
|
||||
// if (pPPTShape->m_o3dOptions.dShininess)
|
||||
// {
|
||||
// std::cout << "Shininess\t" << (*pPPTShape->m_o3dOptions.dShininess) << "\n";
|
||||
// }
|
||||
// if (pPPTShape->m_o3dOptions.dXRotationAngle)
|
||||
// {
|
||||
// std::cout << "XRotationAngle\t" << (*pPPTShape->m_o3dOptions.dXRotationAngle) << "\n";
|
||||
// }
|
||||
// if (pPPTShape->m_o3dOptions.dYRotationAngle)
|
||||
// {
|
||||
// std::cout << "YRotationAngle\t" << (*pPPTShape->m_o3dOptions.dYRotationAngle) << "\n";
|
||||
// }
|
||||
// if (pPPTShape->m_o3dOptions.dRotationAxisX)
|
||||
// {
|
||||
// std::cout << "RotationAxisX\t" << (*pPPTShape->m_o3dOptions.dRotationAxisX) << "\n";
|
||||
// }
|
||||
// if (pPPTShape->m_o3dOptions.dRotationAxisY)
|
||||
// {
|
||||
// std::cout << "RotationAxisY\t" << (*pPPTShape->m_o3dOptions.dRotationAxisY) << "\n";
|
||||
// }
|
||||
// if (pPPTShape->m_o3dOptions.dRotationAxisZ)
|
||||
// {
|
||||
// std::cout << "RotationAxisZ\t" << (*pPPTShape->m_o3dOptions.dRotationAxisZ) << "\n";
|
||||
// }
|
||||
// if (pPPTShape->m_o3dOptions.dRotationAngle)
|
||||
// {
|
||||
// std::cout << "RotationAngle\t" << (*pPPTShape->m_o3dOptions.dRotationAngle) << "\n";
|
||||
// }
|
||||
// if (pPPTShape->m_o3dOptions.dRotationCenterX)
|
||||
// {
|
||||
// std::cout << "RotationCenterX\t" << (*pPPTShape->m_o3dOptions.dRotationCenterX) << "\n";
|
||||
// }
|
||||
// if (pPPTShape->m_o3dOptions.dRotationCenterY)
|
||||
// {
|
||||
// std::cout << "RotationCenterY\t" << (*pPPTShape->m_o3dOptions.dRotationCenterY) << "\n";
|
||||
// }
|
||||
// if (pPPTShape->m_o3dOptions.dRotationCenterZ)
|
||||
// {
|
||||
// std::cout << "RotationCenterZ\t" << (*pPPTShape->m_o3dOptions.dRotationCenterZ) << "\n";
|
||||
// }
|
||||
// if (pPPTShape->m_o3dOptions.dTolerance)
|
||||
// {
|
||||
// std::cout << "Tolerance\t" << (*pPPTShape->m_o3dOptions.dTolerance) << "\n";
|
||||
// }
|
||||
// std::cout << "XViewpoint\t" << (pPPTShape->m_o3dOptions.dXViewpoint) << "\n";
|
||||
// std::cout << "YViewpoint\t" << (pPPTShape->m_o3dOptions.dYViewpoint) << "\n";
|
||||
// if (pPPTShape->m_o3dOptions.dZViewpoint)
|
||||
// {
|
||||
// std::cout << "ZViewpoint\t" << (*pPPTShape->m_o3dOptions.dZViewpoint) << "\n";
|
||||
// }
|
||||
// std::cout << "OriginX\t" << (pPPTShape->m_o3dOptions.dOriginX) << "\n";
|
||||
// std::cout << "OriginY\t" << (pPPTShape->m_o3dOptions.dOriginY) << "\n";
|
||||
// std::cout << "SkewAngle\t" << (pPPTShape->m_o3dOptions.dSkewAngle) << "\n";
|
||||
// std::cout << "SkewAmount\t" << (pPPTShape->m_o3dOptions.nSkewAmount) << "\n";
|
||||
|
||||
// if (pPPTShape->m_o3dOptions.dAmbientIntensity)
|
||||
// {
|
||||
// std::cout << "AmbientIntensity\t" << (*pPPTShape->m_o3dOptions.dAmbientIntensity) << "\n";
|
||||
// }
|
||||
// if (pPPTShape->m_o3dOptions.dKeyIntensity)
|
||||
// {
|
||||
// std::cout << "KeyIntensity\t" << (*pPPTShape->m_o3dOptions.dKeyIntensity) << "\n";
|
||||
// }
|
||||
// std::cout << "KeyX\t" << (pPPTShape->m_o3dOptions.dKeyX) << "\n";
|
||||
// std::cout << "KeyY\t" << (pPPTShape->m_o3dOptions.dKeyY) << "\n";
|
||||
// if (pPPTShape->m_o3dOptions.dKeyZ)
|
||||
// {
|
||||
// std::cout << "KeyZ\t" << (*pPPTShape->m_o3dOptions.dKeyZ) << "\n";
|
||||
// }
|
||||
// std::cout << "FillIntensity\t" << (pPPTShape->m_o3dOptions.dFillIntensity) << "\n";
|
||||
// std::cout << "FillX\t" << (pPPTShape->m_o3dOptions.dFillX) << "\n";
|
||||
// std::cout << "FillY\t" << (pPPTShape->m_o3dOptions.dFillY) << "\n";
|
||||
// if (pPPTShape->m_o3dOptions.dFillZ)
|
||||
// {
|
||||
// std::cout << "FillZ\t" << (*pPPTShape->m_o3dOptions.dFillZ) << "\n";
|
||||
// }
|
||||
// std::cout << "........................................................................\n";
|
||||
//}
|
||||
|
||||
m_oWriter.WriteString(std::wstring(L"<a:scene3d>"));
|
||||
m_oWriter.WriteString(std::wstring(L"<a:camera"));
|
||||
|
||||
std::wstring sAngle;
|
||||
if (pPPTShape->m_o3dOptions.dSkewAngle < 10) sAngle = L"Left";
|
||||
else if (pPPTShape->m_o3dOptions.dSkewAngle >= 10 && pPPTShape->m_o3dOptions.dSkewAngle < 80) sAngle = L"BottomLeft";
|
||||
else if (pPPTShape->m_o3dOptions.dSkewAngle >= 80 && pPPTShape->m_o3dOptions.dSkewAngle < 100) sAngle = L"Bottom";
|
||||
else if (pPPTShape->m_o3dOptions.dSkewAngle >= 100 && pPPTShape->m_o3dOptions.dSkewAngle < 145) sAngle = L"BottomRight";
|
||||
else if (pPPTShape->m_o3dOptions.dSkewAngle >= 145 && pPPTShape->m_o3dOptions.dSkewAngle < 190) sAngle = L"Right";
|
||||
else if (pPPTShape->m_o3dOptions.dSkewAngle >= 190 && pPPTShape->m_o3dOptions.dSkewAngle < 235) sAngle = L"TopRight";
|
||||
else if (pPPTShape->m_o3dOptions.dSkewAngle >= 235 && pPPTShape->m_o3dOptions.dSkewAngle < 280) sAngle = L"Top";
|
||||
else if (pPPTShape->m_o3dOptions.dSkewAngle >= 280 && pPPTShape->m_o3dOptions.dSkewAngle < 325) sAngle = L"TopLeft";
|
||||
else sAngle = L"Front";
|
||||
|
||||
if (pPPTShape->m_o3dOptions.bParallel)
|
||||
m_oWriter.WriteString(std::wstring(L" prst=\"legacyOblique" + sAngle + L"\""));
|
||||
else
|
||||
m_oWriter.WriteString(std::wstring(L" prst=\"legacyPerspective" + sAngle + L"\""));
|
||||
m_oWriter.WriteString(std::wstring(L">"));
|
||||
if (pPPTShape->m_o3dOptions.bConstrainRotation)
|
||||
{
|
||||
m_oWriter.WriteString(std::wstring(L"<a:rot"));
|
||||
m_oWriter.WriteString(std::wstring(L" lat=\"" + std::to_wstring((int)(60000 * pPPTShape->m_o3dOptions.dXRotationAngle.get_value_or(0))) + L"\""));
|
||||
m_oWriter.WriteString(std::wstring(L" lon=\"" + std::to_wstring((int)(60000 * pPPTShape->m_o3dOptions.dYRotationAngle.get_value_or(0))) + L"\""));
|
||||
m_oWriter.WriteString(std::wstring(L" rev=\"" + std::to_wstring((int)(60000 * pPPTShape->m_o3dOptions.dRotationAngle.get_value_or(0))) + L"\""));
|
||||
m_oWriter.WriteString(std::wstring(L"/>"));
|
||||
}
|
||||
m_oWriter.WriteString(std::wstring(L"</a:camera>"));
|
||||
|
||||
m_oWriter.WriteString(std::wstring(L"<a:lightRig"));
|
||||
if (pPPTShape->m_o3dOptions.dFillIntensity < 0.3)
|
||||
m_oWriter.WriteString(std::wstring(L" rig=\"legacyHarsh3\""));
|
||||
else if (pPPTShape->m_o3dOptions.dFillIntensity < 0.4)
|
||||
m_oWriter.WriteString(std::wstring(L" rig=\"legacyFlat4\""));
|
||||
else if (pPPTShape->m_o3dOptions.dFillIntensity > 0.6 ||
|
||||
(pPPTShape->m_o3dOptions.dKeyX < 0.1 && pPPTShape->m_o3dOptions.dFillX < 0.1 &&
|
||||
pPPTShape->m_o3dOptions.dKeyY < 0.1 && pPPTShape->m_o3dOptions.dFillY < 0.1))
|
||||
m_oWriter.WriteString(std::wstring(L" rig=\"legacyFlat1\""));
|
||||
else
|
||||
m_oWriter.WriteString(std::wstring(L" rig=\"legacyFlat3\""));
|
||||
|
||||
if (pPPTShape->m_o3dOptions.dKeyX < 0.1 && pPPTShape->m_o3dOptions.dFillX < 0.1)
|
||||
{
|
||||
if (pPPTShape->m_o3dOptions.dKeyY < 0.1 && pPPTShape->m_o3dOptions.dFillY < 0.1)
|
||||
m_oWriter.WriteString(std::wstring(L" dir=\"t\""));
|
||||
else if (pPPTShape->m_o3dOptions.dKeyY < 0) m_oWriter.WriteString(std::wstring(L" dir=\"r\""));
|
||||
else m_oWriter.WriteString(std::wstring(L" dir=\"l\""));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pPPTShape->m_o3dOptions.dKeyX < 0) m_oWriter.WriteString(std::wstring(L" dir=\"t\""));
|
||||
else m_oWriter.WriteString(std::wstring(L" dir=\"b\""));
|
||||
}
|
||||
m_oWriter.WriteString(std::wstring(L"/>"));
|
||||
m_oWriter.WriteString(std::wstring(L"</a:scene3d>"));
|
||||
|
||||
m_oWriter.WriteString(std::wstring(L"<a:sp3d"));
|
||||
m_oWriter.WriteString(std::wstring(L" extrusionH=\"" + std::to_wstring(pPPTShape->m_o3dOptions.nExtrudeBackward) + L"\""));
|
||||
|
||||
switch(pPPTShape->m_o3dOptions.nRenderMode)
|
||||
{
|
||||
case 0x00000000://solid
|
||||
{
|
||||
if (pPPTShape->m_o3dOptions.bMetallic)
|
||||
m_oWriter.WriteString(std::wstring(L" prstMaterial=\"legacyMetal\""));
|
||||
else
|
||||
m_oWriter.WriteString(std::wstring(L" prstMaterial=\"legacyMatte\""));
|
||||
}break;
|
||||
case 0x00000001: m_oWriter.WriteString(std::wstring(L" prstMaterial=\"legacyWireframe\"")); break; //wireframe
|
||||
case 0x00000002: m_oWriter.WriteString(std::wstring(L" prstMaterial=\"legacyWireframe\"")); break; //bounding cube ????
|
||||
}
|
||||
|
||||
m_oWriter.WriteString(std::wstring(L">"));
|
||||
|
||||
m_oWriter.WriteString(std::wstring(L"<a:bevelT w=\"13500\" h=\"13500\" prst=\"angle\"/>"));
|
||||
m_oWriter.WriteString(std::wstring(L"<a:bevelB w=\"13500\" h=\"13500\" prst=\"angle\"/>"));
|
||||
|
||||
std::wstring strExtrusionClr;
|
||||
if (pPPTShape->m_o3dOptions.oExtrusionColor)
|
||||
{
|
||||
strExtrusionClr = ConvertColor(*pPPTShape->m_o3dOptions.oExtrusionColor);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pShapeElement->m_oBrush.Type != c_BrushTypeNoFill)
|
||||
{
|
||||
strExtrusionClr = ConvertColor(pShapeElement->m_oBrush.Color1, pShapeElement->m_oBrush.Alpha1);
|
||||
}
|
||||
else
|
||||
{
|
||||
strExtrusionClr = ConvertColor(pShapeElement->m_oPen.Color, pShapeElement->m_oPen.Alpha);
|
||||
}
|
||||
}
|
||||
m_oWriter.WriteString(std::wstring(L"<a:extrusionClr>"));
|
||||
m_oWriter.WriteString(strExtrusionClr);
|
||||
m_oWriter.WriteString(std::wstring(L"</a:extrusionClr>"));
|
||||
m_oWriter.WriteString(std::wstring(L"<a:contourClr>"));
|
||||
m_oWriter.WriteString(strExtrusionClr);
|
||||
m_oWriter.WriteString(std::wstring(L"</a:contourClr>"));
|
||||
|
||||
m_oWriter.WriteString(std::wstring(L"</a:sp3d>"));
|
||||
}
|
||||
void NSPresentationEditor::CShapeWriter::WriteTextInfo()
|
||||
{
|
||||
//if (false == m_xmlTxBodyAlternative.empty())
|
||||
@ -1552,6 +1756,7 @@ std::wstring NSPresentationEditor::CShapeWriter::ConvertShape()
|
||||
}
|
||||
m_oWriter.WriteString(ConvertShadow(pShapeElement->m_oShadow));
|
||||
}
|
||||
Write3dShape();
|
||||
|
||||
m_oWriter.WriteString(std::wstring(L"</p:spPr>"));
|
||||
|
||||
|
||||
@ -181,7 +181,7 @@ namespace NSPresentationEditor
|
||||
std::wstring ConvertShadow (CShadow & shadow);
|
||||
std::wstring ConvertBrush (CBrush & brush);
|
||||
std::wstring ConvertLineEnd (unsigned char cap, unsigned char length, unsigned char width);
|
||||
static std::wstring ConvertColor (CColor & color, long alpha);
|
||||
static std::wstring ConvertColor (CColor & color, long alpha = 255);
|
||||
|
||||
void ParseXmlAlternative(const std::wstring & xml);
|
||||
// тип рендерера-----------------------------------------------------------------------------
|
||||
@ -453,5 +453,6 @@ namespace NSPresentationEditor
|
||||
void WriteShapeInfo();
|
||||
void WriteImageInfo();
|
||||
void WriteTextInfo();
|
||||
void Write3dShape();
|
||||
};
|
||||
}
|
||||
|
||||
@ -261,7 +261,7 @@ void CPPTElement::SetUpProperties(CElementPtr pElement, CTheme* pTheme, CSlideIn
|
||||
{
|
||||
pElement->m_oBrush.Type = c_BrushTypeNoFill;
|
||||
}
|
||||
else if (pElement->m_oBrush.Type == c_BrushTypeNoFill )
|
||||
else if (pElement->m_oBrush.Type == c_BrushTypeNotSet )
|
||||
{
|
||||
pElement->m_oBrush.Type = c_BrushTypeSolid;
|
||||
}
|
||||
@ -420,7 +420,7 @@ void CPPTElement::SetUpProperty(CElementPtr pElement, CTheme* pTheme, CSlideInfo
|
||||
else
|
||||
oAtom.ToColor(&pElement->m_oBrush.Color1);
|
||||
|
||||
if (pElement->m_oBrush.Type == c_BrushTypeNoFill )
|
||||
if (pElement->m_oBrush.Type == c_BrushTypeNotSet )
|
||||
pElement->m_oBrush.Type = c_BrushTypeSolid;
|
||||
|
||||
}break;
|
||||
@ -434,7 +434,7 @@ void CPPTElement::SetUpProperty(CElementPtr pElement, CTheme* pTheme, CSlideInfo
|
||||
else
|
||||
oAtom.ToColor(&pElement->m_oBrush.Color2);
|
||||
|
||||
if (pElement->m_bIsBackground && pElement->m_oBrush.Type == c_BrushTypeNoFill )
|
||||
if (pElement->m_bIsBackground && pElement->m_oBrush.Type == c_BrushTypeNotSet )
|
||||
{
|
||||
pElement->m_oBrush.Type = c_BrushTypeSolid;
|
||||
}
|
||||
@ -563,23 +563,23 @@ void CPPTElement::SetUpProperty(CElementPtr pElement, CTheme* pTheme, CSlideInfo
|
||||
// line --------------------------------------------------------
|
||||
case lineBoolean: //Line Style Boolean Properties
|
||||
{
|
||||
bool bNoLineDrawDash = GETBIT(pProperty->m_lValue, 0);
|
||||
bool bLineFillShape = GETBIT(pProperty->m_lValue, 1);
|
||||
bool bHitTestLine = GETBIT(pProperty->m_lValue, 2);
|
||||
bool bLine = GETBIT(pProperty->m_lValue, 3);
|
||||
bool bArrowheadsOK = GETBIT(pProperty->m_lValue, 4);
|
||||
bool bInsetPenOK = GETBIT(pProperty->m_lValue, 5);
|
||||
bool bInsetPen = GETBIT(pProperty->m_lValue, 6);
|
||||
bool bLineOpaqueBackColor = GETBIT(pProperty->m_lValue, 9);
|
||||
|
||||
bool bUsefNoLineDrawDash = GETBIT(pProperty->m_lValue, 16);
|
||||
bool bUsefLineFillShape = GETBIT(pProperty->m_lValue, 17);
|
||||
bool bUsefHitTestLine = GETBIT(pProperty->m_lValue, 18);
|
||||
bool bUsefLine = GETBIT(pProperty->m_lValue, 19);
|
||||
bool bUsefArrowheadsOK = GETBIT(pProperty->m_lValue, 20);
|
||||
bool bUsefInsetPenOK = GETBIT(pProperty->m_lValue, 21);
|
||||
bool bUsefInsetPen = GETBIT(pProperty->m_lValue, 22);
|
||||
bool bUsefLineOpaqueBackColor = GETBIT(pProperty->m_lValue, 25);
|
||||
bool bUsefInsetPen = GETBIT(pProperty->m_lValue, 22);
|
||||
bool bUsefInsetPenOK = GETBIT(pProperty->m_lValue, 21);
|
||||
bool bUsefArrowheadsOK = GETBIT(pProperty->m_lValue, 20);
|
||||
bool bUsefLine = GETBIT(pProperty->m_lValue, 19);
|
||||
bool bUsefHitTestLine = GETBIT(pProperty->m_lValue, 18);
|
||||
bool bUsefLineFillShape = GETBIT(pProperty->m_lValue, 17);
|
||||
bool bUsefNoLineDrawDash = GETBIT(pProperty->m_lValue, 16);
|
||||
|
||||
bool bLineOpaqueBackColor = GETBIT(pProperty->m_lValue, 9);
|
||||
bool bInsetPen = GETBIT(pProperty->m_lValue, 6);
|
||||
bool bInsetPenOK = GETBIT(pProperty->m_lValue, 5);
|
||||
bool bArrowheadsOK = GETBIT(pProperty->m_lValue, 4);
|
||||
bool bLine = GETBIT(pProperty->m_lValue, 3);
|
||||
bool bHitTestLine = GETBIT(pProperty->m_lValue, 2);
|
||||
bool bLineFillShape = GETBIT(pProperty->m_lValue, 1);
|
||||
bool bNoLineDrawDash = GETBIT(pProperty->m_lValue, 0);
|
||||
|
||||
if (bUsefLine)
|
||||
pElement->m_bLine = bLine;
|
||||
@ -738,41 +738,63 @@ void CPPTElement::SetUpProperty(CElementPtr pElement, CTheme* pTheme, CSlideInfo
|
||||
pElement->m_oShadow.Visible = fshadowObscured;
|
||||
}
|
||||
}break;
|
||||
case shapeBoolean:
|
||||
{
|
||||
bool fUsefPolicyLabel = GETBIT(pProperty->m_lValue, 25);
|
||||
bool fUsefPolicyBarcode = GETBIT(pProperty->m_lValue, 24);
|
||||
bool fUsefFlipHOverride = GETBIT(pProperty->m_lValue, 23);
|
||||
bool fUsefFlipVOverride = GETBIT(pProperty->m_lValue, 22);
|
||||
bool fUsefOleIcon = GETBIT(pProperty->m_lValue, 21);
|
||||
bool fUsefPreferRelativeResize = GETBIT(pProperty->m_lValue, 20);
|
||||
bool fUsefLockShapeType = GETBIT(pProperty->m_lValue, 19);
|
||||
bool fUsefInitiator = GETBIT(pProperty->m_lValue, 18);
|
||||
bool fUsefBackground = GETBIT(pProperty->m_lValue, 16);
|
||||
|
||||
bool fPolicyLabel = fUsefPolicyLabel ? GETBIT(pProperty->m_lValue, 9) : false;
|
||||
bool fPolicyBarcode = fUsefPolicyBarcode ? GETBIT(pProperty->m_lValue, 8) : false;
|
||||
bool fFlipHOverride = fUsefFlipHOverride ? GETBIT(pProperty->m_lValue, 7) : false;
|
||||
bool fFlipVOverride = fUsefFlipVOverride ? GETBIT(pProperty->m_lValue, 6) : false;
|
||||
bool fOleIcon = fUsefOleIcon ? GETBIT(pProperty->m_lValue, 5) : false;
|
||||
bool fPreferRelativeResize = fUsefPreferRelativeResize ? GETBIT(pProperty->m_lValue, 4) : false;
|
||||
bool fLockShapeType = fUsefLockShapeType ? GETBIT(pProperty->m_lValue, 3) : false;
|
||||
bool fInitiator = fUsefInitiator ? GETBIT(pProperty->m_lValue, 2) : false;
|
||||
bool fBackground = fUsefBackground ? GETBIT(pProperty->m_lValue, 0) : false;
|
||||
}break;
|
||||
case groupShapeBoolean:
|
||||
{
|
||||
bool fUsefLayoutInCell = GETBIT(pProperty->m_lValue, 0);
|
||||
bool fUsefIsBullet = GETBIT(pProperty->m_lValue, 1);
|
||||
bool fUsefStandardHR = GETBIT(pProperty->m_lValue, 2);
|
||||
bool fUsefNoshadeHR = GETBIT(pProperty->m_lValue, 3);
|
||||
bool fUsefHorizRule = GETBIT(pProperty->m_lValue, 4);
|
||||
bool fUsefUserDrawn = GETBIT(pProperty->m_lValue, 5);
|
||||
bool fUsefAllowOverlap = GETBIT(pProperty->m_lValue, 6);
|
||||
bool fUsefReallyHidden = GETBIT(pProperty->m_lValue, 7);
|
||||
bool fUsefScriptAnchor = GETBIT(pProperty->m_lValue, 8);
|
||||
bool fUsefEditedWrap = GETBIT(pProperty->m_lValue, 9);
|
||||
bool fUsefBehindDocument = GETBIT(pProperty->m_lValue, 10);
|
||||
bool fUsefOnDblClickNotify = GETBIT(pProperty->m_lValue, 11);
|
||||
bool fUsefIsButton = GETBIT(pProperty->m_lValue, 12);
|
||||
bool fUsefOneD = GETBIT(pProperty->m_lValue, 13);
|
||||
bool fUsefHidden = GETBIT(pProperty->m_lValue, 14);
|
||||
bool fUsefPrint = GETBIT(pProperty->m_lValue, 15);
|
||||
bool fUsefLayoutInCell = GETBIT(pProperty->m_lValue, 31);
|
||||
bool fUsefIsBullet = GETBIT(pProperty->m_lValue, 30);
|
||||
bool fUsefStandardHR = GETBIT(pProperty->m_lValue, 29);
|
||||
bool fUsefNoshadeHR = GETBIT(pProperty->m_lValue, 28);
|
||||
bool fUsefHorizRule = GETBIT(pProperty->m_lValue, 27);
|
||||
bool fUsefUserDrawn = GETBIT(pProperty->m_lValue, 26);
|
||||
bool fUsefAllowOverlap = GETBIT(pProperty->m_lValue, 25);
|
||||
bool fUsefReallyHidden = GETBIT(pProperty->m_lValue, 24);
|
||||
bool fUsefScriptAnchor = GETBIT(pProperty->m_lValue, 23);
|
||||
bool fUsefEditedWrap = GETBIT(pProperty->m_lValue, 22);
|
||||
bool fUsefBehindDocument = GETBIT(pProperty->m_lValue, 21);
|
||||
bool fUsefOnDblClickNotify = GETBIT(pProperty->m_lValue, 20);
|
||||
bool fUsefIsButton = GETBIT(pProperty->m_lValue, 19);
|
||||
bool fUsefOneD = GETBIT(pProperty->m_lValue, 18);
|
||||
bool fUsefHidden = GETBIT(pProperty->m_lValue, 17);
|
||||
bool fUsefPrint = GETBIT(pProperty->m_lValue, 16);
|
||||
|
||||
bool fLayoutInCell = fUsefLayoutInCell ? GETBIT(pProperty->m_lValue, 16) : true;
|
||||
bool fIsBullet = fUsefIsBullet ? GETBIT(pProperty->m_lValue, 17) : false;
|
||||
bool fStandardHR = fUsefStandardHR ? GETBIT(pProperty->m_lValue, 18) : false;
|
||||
bool fNoshadeHR = fUsefNoshadeHR ? GETBIT(pProperty->m_lValue, 19) : false;
|
||||
bool fHorizRule = fUsefHorizRule ? GETBIT(pProperty->m_lValue, 20) : false;
|
||||
bool fUserDrawn = fUsefUserDrawn ? GETBIT(pProperty->m_lValue, 21) : false;
|
||||
bool fAllowOverlap = fUsefAllowOverlap ? GETBIT(pProperty->m_lValue, 22) : true;
|
||||
bool fReallyHidden = fUsefReallyHidden ? GETBIT(pProperty->m_lValue, 23) : false;
|
||||
bool fScriptAnchor = fUsefScriptAnchor ? GETBIT(pProperty->m_lValue, 24) : false;
|
||||
bool fEditedWrap = fUsefEditedWrap ? GETBIT(pProperty->m_lValue, 25) : false;
|
||||
bool fBehindDocument = fUsefBehindDocument ? GETBIT(pProperty->m_lValue, 26) : false;
|
||||
bool fOnDblClickNotify = fUsefOnDblClickNotify ? GETBIT(pProperty->m_lValue, 27) : false;
|
||||
bool fIsButton = fUsefIsButton ? GETBIT(pProperty->m_lValue, 28) : false;
|
||||
bool fOneD = fUsefOneD ? GETBIT(pProperty->m_lValue, 29) : false;
|
||||
bool fHidden = fUsefHidden ? GETBIT(pProperty->m_lValue, 30) : false;
|
||||
bool fPrint = fUsefPrint ? GETBIT(pProperty->m_lValue, 31) : true;
|
||||
bool fLayoutInCell = fUsefLayoutInCell ? GETBIT(pProperty->m_lValue, 15) : true;
|
||||
bool fIsBullet = fUsefIsBullet ? GETBIT(pProperty->m_lValue, 14) : false;
|
||||
bool fStandardHR = fUsefStandardHR ? GETBIT(pProperty->m_lValue, 13) : false;
|
||||
bool fNoshadeHR = fUsefNoshadeHR ? GETBIT(pProperty->m_lValue, 12) : false;
|
||||
bool fHorizRule = fUsefHorizRule ? GETBIT(pProperty->m_lValue, 11) : false;
|
||||
bool fUserDrawn = fUsefUserDrawn ? GETBIT(pProperty->m_lValue, 10) : false;
|
||||
bool fAllowOverlap = fUsefAllowOverlap ? GETBIT(pProperty->m_lValue, 9) : true;
|
||||
bool fReallyHidden = fUsefReallyHidden ? GETBIT(pProperty->m_lValue, 8) : false;
|
||||
bool fScriptAnchor = fUsefScriptAnchor ? GETBIT(pProperty->m_lValue, 7) : false;
|
||||
bool fEditedWrap = fUsefEditedWrap ? GETBIT(pProperty->m_lValue, 6) : false;
|
||||
bool fBehindDocument = fUsefBehindDocument ? GETBIT(pProperty->m_lValue, 5) : false;
|
||||
bool fOnDblClickNotify = fUsefOnDblClickNotify ? GETBIT(pProperty->m_lValue, 4) : false;
|
||||
bool fIsButton = fUsefIsButton ? GETBIT(pProperty->m_lValue, 3) : false;
|
||||
bool fOneD = fUsefOneD ? GETBIT(pProperty->m_lValue, 2) : false;
|
||||
bool fHidden = fUsefHidden ? GETBIT(pProperty->m_lValue, 1) : false;
|
||||
bool fPrint = fUsefPrint ? GETBIT(pProperty->m_lValue, 0) : true;
|
||||
|
||||
pElement->m_bHidden = fHidden || fIsBullet;
|
||||
//presentation_ticio_20100610.ppt
|
||||
@ -1092,23 +1114,20 @@ void CPPTElement::SetUpPropertyShape(CElementPtr pElement, CTheme* pTheme, CSlid
|
||||
{
|
||||
case NSOfficeDrawing::alignTextLeft:
|
||||
{
|
||||
pParentShape->m_oText.m_oAttributes.m_nTextAlignHorizontal = 0;
|
||||
break;
|
||||
}
|
||||
pParentShape->m_oText.m_oAttributes.m_nTextAlignHorizontal = 0;
|
||||
}break;
|
||||
case NSOfficeDrawing::alignTextCenter:
|
||||
{
|
||||
pParentShape->m_oText.m_oAttributes.m_nTextAlignHorizontal = 1;
|
||||
break;
|
||||
}
|
||||
pParentShape->m_oText.m_oAttributes.m_nTextAlignHorizontal = 1;
|
||||
}break;
|
||||
case NSOfficeDrawing::alignTextRight:
|
||||
{
|
||||
pParentShape->m_oText.m_oAttributes.m_nTextAlignHorizontal = 2;
|
||||
break;
|
||||
}
|
||||
pParentShape->m_oText.m_oAttributes.m_nTextAlignHorizontal = 2;
|
||||
}break;
|
||||
default:
|
||||
{
|
||||
pParentShape->m_oText.m_oAttributes.m_nTextAlignHorizontal = 1;
|
||||
}
|
||||
}break;
|
||||
};
|
||||
break;
|
||||
}
|
||||
@ -1211,9 +1230,239 @@ void CPPTElement::SetUpPropertyShape(CElementPtr pElement, CTheme* pTheme, CSlid
|
||||
pParentShape->m_oText.m_bAutoFit = bFitShapeToText;
|
||||
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DSpecularAmt:
|
||||
{
|
||||
pShape->m_o3dOptions.dSpecularAmt = FixedPointToDouble(pProperty->m_lValue);
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DDiffuseAmt:
|
||||
{
|
||||
pShape->m_o3dOptions.dDiffuseAmt = FixedPointToDouble(pProperty->m_lValue);
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DShininess:
|
||||
{
|
||||
pShape->m_o3dOptions.dShininess = FixedPointToDouble(pProperty->m_lValue);
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DEdgeThickness:
|
||||
{
|
||||
pShape->m_o3dOptions.nEdgeThickness = pProperty->m_lValue;
|
||||
}break;
|
||||
case NSOfficeDrawing::C3DExtrudeForward:
|
||||
{
|
||||
pShape->m_o3dOptions.nExtrudeForward = pProperty->m_lValue;
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DExtrudeBackward:
|
||||
{
|
||||
pShape->m_o3dOptions.nExtrudeBackward = pProperty->m_lValue;
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DExtrudePlane:
|
||||
{
|
||||
//ExtrudePlane = 0;
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DExtrusionColor:
|
||||
{
|
||||
SColorAtom oAtom;
|
||||
oAtom.FromValue(pProperty->m_lValue);
|
||||
|
||||
CColor tmp;
|
||||
if(oAtom.bSysIndex) tmp = CorrectSysColor(pProperty->m_lValue, pElement, pTheme);
|
||||
else oAtom.ToColor(&tmp);
|
||||
|
||||
pShape->m_o3dOptions.oExtrusionColor = tmp;
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DCrMod:
|
||||
{
|
||||
SColorAtom oAtom;
|
||||
oAtom.FromValue(pProperty->m_lValue);
|
||||
|
||||
CColor tmp;
|
||||
if(oAtom.bSysIndex) tmp = CorrectSysColor(pProperty->m_lValue, pElement, pTheme);
|
||||
else oAtom.ToColor(&tmp);
|
||||
|
||||
pShape->m_o3dOptions.oCrMod = tmp;
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DExtrusionColorExt:
|
||||
{
|
||||
SColorAtom oAtom;
|
||||
oAtom.FromValue(pProperty->m_lValue);
|
||||
|
||||
CColor tmp;
|
||||
if(oAtom.bSysIndex) tmp = CorrectSysColor(pProperty->m_lValue, pElement, pTheme);
|
||||
else oAtom.ToColor(&tmp);
|
||||
pShape->m_o3dOptions.oExtrusionColorExt = tmp;
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DExtrusionColorExtMod:
|
||||
{
|
||||
pShape->m_o3dOptions.nTypeExtrusionColorExt = (pProperty->m_lValue & 0x00000300) >> 8;
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DBottomBevelWidth:
|
||||
{
|
||||
pShape->m_o3dOptions.dBottomBevelWidth = FixedPointToDouble(pProperty->m_lValue);
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DBottomBevelHeight:
|
||||
{
|
||||
pShape->m_o3dOptions.dBottomBevelHeight = FixedPointToDouble(pProperty->m_lValue);
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DBottomBevelType:
|
||||
{
|
||||
pShape->m_o3dOptions.nBottomBevelType = pProperty->m_lValue;
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DTopBevelWidth:
|
||||
{
|
||||
pShape->m_o3dOptions.dTopBevelWidth = FixedPointToDouble(pProperty->m_lValue);
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DTopBevelHeight:
|
||||
{
|
||||
pShape->m_o3dOptions.dTopBevelHeight = FixedPointToDouble(pProperty->m_lValue);
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DTopBevelType:
|
||||
{
|
||||
pShape->m_o3dOptions.nTopBevelType = pProperty->m_lValue;
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DBoolean:
|
||||
{
|
||||
bool fUsef3D = GETBIT(pProperty->m_lValue, 19);
|
||||
bool fUsefc3DMetallic = GETBIT(pProperty->m_lValue, 18);
|
||||
bool fUsefc3DUseExtrusionColor = GETBIT(pProperty->m_lValue, 17);
|
||||
bool fUsefc3DLightFace = GETBIT(pProperty->m_lValue, 16);
|
||||
|
||||
pShape->m_o3dOptions.bEnabled = fUsef3D ? GETBIT(pProperty->m_lValue, 3) : false;
|
||||
pShape->m_o3dOptions.bMetallic = fUsefc3DMetallic ? GETBIT(pProperty->m_lValue, 2) : false;
|
||||
pShape->m_o3dOptions.bExtrusionColor= fUsefc3DUseExtrusionColor ? GETBIT(pProperty->m_lValue, 1) : false;
|
||||
pShape->m_o3dOptions.bLightFace = fUsefc3DLightFace ? GETBIT(pProperty->m_lValue, 0) : true;
|
||||
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DYRotationAngle:
|
||||
{
|
||||
double val = FixedPointToDouble(pProperty->m_lValue);
|
||||
if (val < 0) val += 360;
|
||||
pShape->m_o3dOptions.dYRotationAngle = val;
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DXRotationAngle:
|
||||
{
|
||||
double val = FixedPointToDouble(pProperty->m_lValue);
|
||||
if (val < 0) val += 360;
|
||||
pShape->m_o3dOptions.dXRotationAngle = val;
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DRotationAxisX:
|
||||
{
|
||||
pShape->m_o3dOptions.dRotationAxisX = FixedPointToDouble(pProperty->m_lValue);
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DRotationAxisY:
|
||||
{
|
||||
pShape->m_o3dOptions.dRotationAxisY = FixedPointToDouble(pProperty->m_lValue);
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DRotationAxisZ:
|
||||
{
|
||||
pShape->m_o3dOptions.dRotationAxisZ = FixedPointToDouble(pProperty->m_lValue);
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DRotationAngle:
|
||||
{
|
||||
pShape->m_o3dOptions.dRotationAngle = FixedPointToDouble(pProperty->m_lValue);
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DRotationCenterX:
|
||||
{
|
||||
pShape->m_o3dOptions.dRotationCenterX = FixedPointToDouble(pProperty->m_lValue);
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DRotationCenterY:
|
||||
{
|
||||
pShape->m_o3dOptions.dRotationCenterY = FixedPointToDouble(pProperty->m_lValue);
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DRotationCenterZ:
|
||||
{
|
||||
pShape->m_o3dOptions.dRotationCenterZ = FixedPointToDouble(pProperty->m_lValue);
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DRenderMode:
|
||||
{
|
||||
pShape->m_o3dOptions.nRenderMode = pProperty->m_lValue;
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DTolerance:
|
||||
{
|
||||
pShape->m_o3dOptions.dTolerance = FixedPointToDouble(pProperty->m_lValue);
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DXViewpoint:
|
||||
{
|
||||
pShape->m_o3dOptions.dXViewpoint = FixedPointToDouble(pProperty->m_lValue);
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DYViewpoint:
|
||||
{
|
||||
pShape->m_o3dOptions.dYViewpoint = FixedPointToDouble(pProperty->m_lValue);
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DZViewpoint:
|
||||
{
|
||||
pShape->m_o3dOptions.dZViewpoint = FixedPointToDouble(pProperty->m_lValue);
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DOriginX:
|
||||
{
|
||||
pShape->m_o3dOptions.dOriginX = FixedPointToDouble(pProperty->m_lValue);
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DOriginY:
|
||||
{
|
||||
pShape->m_o3dOptions.dOriginY = FixedPointToDouble(pProperty->m_lValue);
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DSkewAngle:
|
||||
{
|
||||
double val = FixedPointToDouble(pProperty->m_lValue);
|
||||
if (val <= 0) val += 360;
|
||||
pShape->m_o3dOptions.dSkewAngle = val;
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DSkewAmount:
|
||||
{
|
||||
pShape->m_o3dOptions.nSkewAmount = pProperty->m_lValue;
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DAmbientIntensity:
|
||||
{
|
||||
pShape->m_o3dOptions.dAmbientIntensity = FixedPointToDouble(pProperty->m_lValue);
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DKeyX:
|
||||
{
|
||||
pShape->m_o3dOptions.dKeyX = FixedPointToDouble(pProperty->m_lValue);
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DKeyY:
|
||||
{
|
||||
pShape->m_o3dOptions.dKeyY = FixedPointToDouble(pProperty->m_lValue);
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DKeyZ:
|
||||
{
|
||||
pShape->m_o3dOptions.dKeyZ = FixedPointToDouble(pProperty->m_lValue);
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DKeyIntensity:
|
||||
{
|
||||
pShape->m_o3dOptions.dKeyIntensity = FixedPointToDouble(pProperty->m_lValue);
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DFillX:
|
||||
{
|
||||
pShape->m_o3dOptions.dFillX = FixedPointToDouble(pProperty->m_lValue);
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DFillY:
|
||||
{
|
||||
pShape->m_o3dOptions.dFillY = FixedPointToDouble(pProperty->m_lValue);
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DFillZ:
|
||||
{
|
||||
pShape->m_o3dOptions.dFillZ = FixedPointToDouble(pProperty->m_lValue);
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DFillIntensity:
|
||||
{
|
||||
pShape->m_o3dOptions.dFillIntensity = FixedPointToDouble(pProperty->m_lValue);
|
||||
}break;
|
||||
case NSOfficeDrawing::c3DStyleBoolean:
|
||||
{
|
||||
bool fUsefc3DConstrainRotation = GETBIT(pProperty->m_lValue, 20);
|
||||
bool fUsefc3DRotationCenterAuto = GETBIT(pProperty->m_lValue, 19);
|
||||
bool fUsefc3DParallel = GETBIT(pProperty->m_lValue, 18);
|
||||
bool fUsefc3DKeyHarsh = GETBIT(pProperty->m_lValue, 17);
|
||||
bool fUsefc3DFillHarsh = GETBIT(pProperty->m_lValue, 16);
|
||||
|
||||
pShape->m_o3dOptions.bConstrainRotation = fUsefc3DConstrainRotation ? GETBIT(pProperty->m_lValue, 4) : true;
|
||||
pShape->m_o3dOptions.bRotationCenterAuto= fUsefc3DRotationCenterAuto? GETBIT(pProperty->m_lValue, 3) : false;
|
||||
pShape->m_o3dOptions.bParallel = fUsefc3DParallel ? GETBIT(pProperty->m_lValue, 2) : true;
|
||||
pShape->m_o3dOptions.bKeyHarsh = fUsefc3DKeyHarsh ? GETBIT(pProperty->m_lValue, 1) : true;
|
||||
pShape->m_o3dOptions.bFillHarsh = fUsefc3DFillHarsh ? GETBIT(pProperty->m_lValue, 0) : true;
|
||||
}break;
|
||||
default:
|
||||
{
|
||||
int unknown_value = pProperty->m_lValue;
|
||||
unknown_value = unknown_value;
|
||||
}break;
|
||||
}
|
||||
}
|
||||
@ -2203,7 +2452,7 @@ void CRecordShapeContainer::SetUpTextStyle(std::wstring& strText, CTheme* pTheme
|
||||
pShape->m_pShape->m_oText.m_oAttributes.m_oTextBrush = pShape->m_oBrush;
|
||||
|
||||
pShape->m_pShape->m_oText.m_oAttributes.m_nTextAlignHorizontal = 1;
|
||||
pShape->m_pShape->m_oText.m_oAttributes.m_nTextAlignVertical = 1;
|
||||
pShape->m_pShape->m_oText.m_oAttributes.m_nTextAlignVertical = 1;
|
||||
|
||||
pShape->m_pShape->m_lDrawType = c_ShapeDrawType_Text;
|
||||
break;
|
||||
|
||||
@ -63,14 +63,6 @@ using namespace NSPresentationEditor;
|
||||
class CPPTElement
|
||||
{
|
||||
public:
|
||||
inline double FixedPointToDouble(unsigned int op)
|
||||
{
|
||||
short Integral = op >> 16;
|
||||
unsigned short Fractional = op - (Integral << 16);
|
||||
|
||||
return Integral + (Fractional / 65536.0);
|
||||
}
|
||||
|
||||
bool ChangeBlack2ColorImage(std::wstring image_path, int rgbColor1, int rgbColor2);
|
||||
CColor CorrectSysColor(int nColorCode, CElementPtr pElement, CTheme* pTheme);
|
||||
|
||||
|
||||
@ -735,7 +735,7 @@ namespace NSPresentationEditor
|
||||
|
||||
void SetDefaultParams()
|
||||
{
|
||||
Type = c_BrushTypeNoFill;
|
||||
Type = c_BrushTypeNotSet;
|
||||
|
||||
Color1 = 0xFFFFFFFF;
|
||||
Alpha1 = 255;
|
||||
|
||||
@ -1239,19 +1239,24 @@ namespace NSOfficeDrawing
|
||||
perspectiveBoolean=639,
|
||||
|
||||
//3D Object
|
||||
c3DSpecularAmt=640,
|
||||
c3DDiffuseAmt=641,
|
||||
c3DShininess=642,
|
||||
c3DEdgeThickness=643,
|
||||
C3DExtrudeForward=644,
|
||||
c3DExtrudeBackward=645,
|
||||
c3DExtrudePlane=646,
|
||||
c3DExtrusionColor=647,
|
||||
c3DCrMod=648,
|
||||
f3D=700,
|
||||
fc3DMetallic=701,
|
||||
fc3DUseExtrusionColor=702,
|
||||
fc3DLightFace=703,
|
||||
c3DSpecularAmt = 640,
|
||||
c3DDiffuseAmt = 641,
|
||||
c3DShininess = 642,
|
||||
c3DEdgeThickness = 643,
|
||||
C3DExtrudeForward = 644,
|
||||
c3DExtrudeBackward = 645,
|
||||
c3DExtrudePlane = 646,
|
||||
c3DExtrusionColor = 647,
|
||||
c3DCrMod = 648,
|
||||
c3DExtrusionColorExt = 649,
|
||||
c3DExtrusionColorExtMod = 651,
|
||||
c3DBottomBevelWidth = 661,
|
||||
c3DBottomBevelHeight = 662,
|
||||
c3DBottomBevelType = 663,
|
||||
c3DTopBevelWidth = 664,
|
||||
c3DTopBevelHeight = 665,
|
||||
c3DTopBevelType = 666,
|
||||
c3DBoolean = 703,
|
||||
|
||||
//3D Style
|
||||
c3DYRotationAngle=704,
|
||||
@ -1280,52 +1285,34 @@ namespace NSOfficeDrawing
|
||||
c3DFillX=727,
|
||||
c3DFillY=728,
|
||||
c3DFillZ=729,
|
||||
c3DFillIntensity=730,
|
||||
fc3DConstrainRotation=763,
|
||||
fc3DRotationCenterAuto=764,
|
||||
fc3DParallel=765,
|
||||
fc3DKeyHarsh=766,
|
||||
fc3DFillHarsh=767,
|
||||
c3DFillIntensity = 730,
|
||||
c3DStyleBoolean = 767,
|
||||
|
||||
//Shape
|
||||
hspMaster=769,
|
||||
cxstyle=771,
|
||||
bWMode=772,
|
||||
bWModePureBW=773,
|
||||
bWModeBW=774,
|
||||
idDiscussAnchor=775,
|
||||
dgmLayout=777,
|
||||
dgmNodeKind=778,
|
||||
dgmLayoutMRU=779,
|
||||
wzEquationXML=780,
|
||||
fPolicyLabel=822,
|
||||
fPolicyBarcode=823,
|
||||
fFlipHQFE5152=824,
|
||||
fFlipVQFE5152=825,
|
||||
fPreferRelativeResize=827,
|
||||
fLockShapeType=828,
|
||||
fInitiator=829,
|
||||
fDeleteAttachedObject=830,
|
||||
fBackground=831,
|
||||
hspMaster = 769,
|
||||
cxstyle = 771,
|
||||
bWMode = 772,
|
||||
bWModePureBW = 773,
|
||||
bWModeBW = 774,
|
||||
idDiscussAnchor = 775,
|
||||
dgmLayout = 777,
|
||||
dgmNodeKind = 778,
|
||||
dgmLayoutMRU = 779,
|
||||
wzEquationXML = 780,
|
||||
shapeBoolean = 831,
|
||||
|
||||
//Callout
|
||||
spcot=832,
|
||||
dxyCalloutGap=833,
|
||||
spcoa=834,
|
||||
spcod=835,
|
||||
dxyCalloutDropSpecified=836,
|
||||
dxyCalloutLengthSpecified=837,
|
||||
fCallout=889,
|
||||
fCalloutAccentBar=890,
|
||||
fCalloutTextBorder=891,
|
||||
fCalloutMinusX=892,
|
||||
fCalloutMinusY=893,
|
||||
fCalloutDropAuto=894,
|
||||
fCalloutLengthSpecified=895,
|
||||
spcot = 832,
|
||||
dxyCalloutGap = 833,
|
||||
spcoa = 834,
|
||||
spcod = 835,
|
||||
dxyCalloutDropSpecified = 836,
|
||||
dxyCalloutLengthSpecified = 837,
|
||||
calloutBoolean = 895,
|
||||
|
||||
//Groupe Shape
|
||||
wzName=896,
|
||||
wzDescription=897,
|
||||
wzName = 896,
|
||||
wzDescription = 897,
|
||||
pihlShape=898,
|
||||
pWrapPolygonVertices=899,
|
||||
dxWrapDistLeft=900,
|
||||
@ -1363,9 +1350,9 @@ namespace NSOfficeDrawing
|
||||
wzWebBot=933,
|
||||
wzAppletArg=934,
|
||||
wzAccessBlob=936,
|
||||
metroBlob=937,
|
||||
dhgt=938,
|
||||
groupShapeBoolean=959,
|
||||
metroBlob = 937,
|
||||
dhgt = 938,
|
||||
groupShapeBoolean = 959,
|
||||
|
||||
//Unknown HTML
|
||||
wzLineId=1026,
|
||||
|
||||
@ -38,15 +38,110 @@
|
||||
using namespace NSOfficeDrawing;
|
||||
using namespace NSPresentationEditor;
|
||||
|
||||
static double FixedPointToDouble(unsigned int op)
|
||||
{
|
||||
short Integral = op >> 16;
|
||||
unsigned short Fractional = op - (Integral << 16);
|
||||
|
||||
return Integral + (Fractional / 65536.0);
|
||||
}
|
||||
|
||||
namespace PPTShapes
|
||||
{
|
||||
struct _3dOptions
|
||||
{
|
||||
_3dOptions() : bEnabled(false), bMetallic(false), bExtrusionColor(false), bLightFace(true),
|
||||
bConstrainRotation(true), bRotationCenterAuto(false), bParallel(true), bFillHarsh(true), bKeyHarsh(true),
|
||||
nRenderMode(0), dSpecularAmt(0), nEdgeThickness(0x0000319C), nExtrudeForward(0), nExtrudeBackward(0x0006F9F0),
|
||||
nSkewAmount(0x32)
|
||||
{
|
||||
dFillIntensity = FixedPointToDouble(0x00009470);
|
||||
dKeyX = FixedPointToDouble(0x0000C350);
|
||||
dKeyY = FixedPointToDouble(0x00000000);
|
||||
dFillX = FixedPointToDouble(0xFFFF3CB0);
|
||||
dFillY = FixedPointToDouble(0x00000000);
|
||||
dOriginX = FixedPointToDouble(0x00008000);
|
||||
dOriginY = FixedPointToDouble(0xFFFF8000);
|
||||
dSkewAngle = 225;//FixedPointToDouble(0xFF790000);
|
||||
dXViewpoint = FixedPointToDouble(0x001312D0);
|
||||
dYViewpoint = FixedPointToDouble(0xFFECED30);
|
||||
}
|
||||
|
||||
bool bEnabled;
|
||||
bool bMetallic;
|
||||
bool bExtrusionColor;
|
||||
bool bLightFace;
|
||||
|
||||
bool bConstrainRotation;
|
||||
bool bRotationCenterAuto;
|
||||
bool bParallel;
|
||||
bool bKeyHarsh;
|
||||
bool bFillHarsh;
|
||||
|
||||
boost::optional<double> dSpecularAmt;
|
||||
boost::optional<double> dDiffuseAmt;
|
||||
boost::optional<double> dShininess;
|
||||
_INT32 nEdgeThickness;
|
||||
_INT32 nExtrudeForward;
|
||||
_INT32 nExtrudeBackward;
|
||||
|
||||
boost::optional<double> dBottomBevelWidth;
|
||||
boost::optional<double> dBottomBevelHeight;
|
||||
boost::optional<_INT32> nBottomBevelType;
|
||||
|
||||
boost::optional<double> dTopBevelWidth;
|
||||
boost::optional<double> dTopBevelHeight;
|
||||
boost::optional<_INT32> nTopBevelType;
|
||||
|
||||
boost::optional<double> dXRotationAngle;
|
||||
boost::optional<double> dYRotationAngle;
|
||||
boost::optional<double> dRotationAxisX;
|
||||
boost::optional<double> dRotationAxisY;
|
||||
boost::optional<double> dRotationAxisZ;
|
||||
boost::optional<double> dRotationAngle;
|
||||
boost::optional<double> dRotationCenterX;
|
||||
boost::optional<double> dRotationCenterY;
|
||||
boost::optional<double> dRotationCenterZ;
|
||||
|
||||
boost::optional<double> dTolerance;
|
||||
double dXViewpoint;
|
||||
double dYViewpoint;
|
||||
boost::optional<double> dZViewpoint;
|
||||
|
||||
boost::optional<CColor> oExtrusionColor;
|
||||
boost::optional<CColor> oCrMod;
|
||||
boost::optional<CColor> oExtrusionColorExt;
|
||||
boost::optional<_INT32> nTypeExtrusionColorExt;
|
||||
|
||||
_INT32 nRenderMode;
|
||||
|
||||
double dOriginX;
|
||||
double dOriginY;
|
||||
double dSkewAngle;
|
||||
_INT32 nSkewAmount;
|
||||
|
||||
boost::optional<double> dAmbientIntensity;
|
||||
boost::optional<double> dKeyIntensity;
|
||||
double dKeyX;
|
||||
double dKeyY;
|
||||
double dFillIntensity;
|
||||
double dFillX;
|
||||
double dFillY;
|
||||
boost::optional<double> dKeyZ;
|
||||
boost::optional<double> dFillZ;
|
||||
};
|
||||
}
|
||||
|
||||
class CPPTShape : public CBaseShape
|
||||
{
|
||||
public:
|
||||
PPTShapes::ShapeType m_eType;
|
||||
PPTShapes::ShapeType m_eType;
|
||||
NSGuidesVML::CFormulasManager m_oManager;
|
||||
NSCustomVML::CCustomVML m_oCustomVML;
|
||||
|
||||
NSCustomVML::CCustomVML m_oCustomVML;
|
||||
PPTShapes::_3dOptions m_o3dOptions;
|
||||
|
||||
std::wstring m_strPathLimoX;
|
||||
std::wstring m_strPathLimoX;
|
||||
std::wstring m_strPathLimoY;
|
||||
|
||||
std::vector<std::wstring> m_arStringTextRects;
|
||||
@ -54,6 +149,7 @@ public:
|
||||
|
||||
bool m_bIsFilled;
|
||||
bool m_bIsStroked;
|
||||
|
||||
nullable<OOX::VmlOffice::CSignatureLine> m_oSignatureLine;
|
||||
|
||||
CPPTShape();
|
||||
|
||||
@ -278,6 +278,9 @@ namespace NSPresentationEditor
|
||||
{
|
||||
m_oStyles.m_pLevels[i] = pTheme->m_pStyles[0].m_pLevels[i];
|
||||
}
|
||||
|
||||
if (m_oStyles.m_pLevels[i].is_init() == false) continue;
|
||||
|
||||
if (m_oRuler.tabsStops.size() > 0)
|
||||
{
|
||||
m_oStyles.m_pLevels[i]->m_oPFRun.tabStops = m_oRuler.tabsStops;
|
||||
|
||||
@ -128,7 +128,7 @@ void PtgRef3d::assemble(AssemblerStack& ptg_stack, PtgQueue& extra_data, bool fu
|
||||
}
|
||||
if (ixti != 0xffff)
|
||||
{
|
||||
std::wstring link = global_info->arXti_External[ixti].link;
|
||||
std::wstring link = ixti < global_info->arXti_External.size() ? global_info->arXti_External[ixti].link : L"";
|
||||
if (!link.empty() && !cell_ref.empty())
|
||||
link += L"!";
|
||||
|
||||
|
||||
@ -1 +1 @@
|
||||
2.5.556.0
|
||||
2.5.561.0
|
||||
@ -2390,6 +2390,39 @@ namespace NSEditorApi
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
namespace NSEditorApi
|
||||
{
|
||||
class CAscMath : public IMenuEventDataBase
|
||||
{
|
||||
private:
|
||||
js_wrapper<int> m_nType;
|
||||
js_wrapper<int> m_nAction;
|
||||
js_wrapper<bool> m_bCanIncreaseArgumentSize;
|
||||
js_wrapper<bool> m_bCanDecreaseArgumentSize;
|
||||
js_wrapper<bool> m_bCanInsertForcedBreak;
|
||||
js_wrapper<bool> m_bCanDeleteForcedBreak;
|
||||
js_wrapper<bool> m_bCanAlignToCharacter;
|
||||
|
||||
public:
|
||||
CAscMath()
|
||||
{
|
||||
}
|
||||
virtual ~CAscMath()
|
||||
{
|
||||
}
|
||||
|
||||
LINK_PROPERTY_INT_JS(Type)
|
||||
LINK_PROPERTY_INT_JS(Action)
|
||||
LINK_PROPERTY_BOOL_JS(CanIncreaseArgumentSize)
|
||||
LINK_PROPERTY_BOOL_JS(CanDecreaseArgumentSize);
|
||||
LINK_PROPERTY_BOOL_JS(CanInsertForcedBreak);
|
||||
LINK_PROPERTY_BOOL_JS(CanDeleteForcedBreak);
|
||||
LINK_PROPERTY_BOOL_JS(CanAlignToCharacter);
|
||||
};
|
||||
}
|
||||
|
||||
namespace NSEditorApi
|
||||
{
|
||||
class CAscMenuEvent : public IMenuEventDataBase
|
||||
|
||||
@ -491,6 +491,7 @@
|
||||
#define c_oAscTypeSelectElement_Shape 6
|
||||
#define c_oAscTypeSelectElement_Slide 7
|
||||
#define c_oAscTypeSelectElement_Chart 8
|
||||
#define c_oAscTypeSelectElement_Math 9
|
||||
|
||||
#define c_oAscTableBordersType_LEFT 0
|
||||
#define c_oAscTableBordersType_TOP 1
|
||||
@ -695,6 +696,7 @@
|
||||
#define ASC_MENU_EVENT_TYPE_SHAPE 18
|
||||
#define ASC_MENU_EVENT_TYPE_SLIDE 20
|
||||
#define ASC_MENU_EVENT_TYPE_CHART 21
|
||||
#define ASC_MENU_EVENT_TYPE_MATH 22
|
||||
|
||||
// insert commands
|
||||
#define ASC_MENU_EVENT_TYPE_INSERT_IMAGE 50
|
||||
|
||||
@ -97,6 +97,7 @@ const long c_BrushTypePattern = 3009;
|
||||
const long c_BrushTypeHatch1 = 4009;
|
||||
const long c_BrushTypeHatch53 = 4061;
|
||||
const long c_BrushTypeNoFill = 5000;
|
||||
const long c_BrushTypeNotSet = 5001;
|
||||
|
||||
const long c_BrushTextureModeStretch = 0;
|
||||
const long c_BrushTextureModeTile = 1;
|
||||
|
||||
2
Makefile
2
Makefile
@ -224,10 +224,8 @@ ARTIFACTS += Common/3dParty/*/$(TARGET)/build/*
|
||||
|
||||
ifeq ($(OS),Windows_NT)
|
||||
ARTIFACTS += Common/3dParty/v8/v8/out.gn/$(TARGET)/release/*.dat
|
||||
ARTIFACTS += Common/3dParty/v8/v8/out.gn/$(TARGET)/release/obj/*
|
||||
else
|
||||
ARTIFACTS += Common/3dParty/v8/v8/out.gn/$(TARGET)/*.dat
|
||||
ARTIFACTS += Common/3dParty/v8/v8/out.gn/$(TARGET)/obj/*
|
||||
endif
|
||||
|
||||
EXT_TARGET += $(DOCBUILDER)
|
||||
|
||||
@ -29,13 +29,8 @@ core_windows {
|
||||
QMAKE_CXXFLAGS += -Wall -Wno-ignored-qualifiers
|
||||
}
|
||||
|
||||
#CONFIG += build_for_centos6
|
||||
build_for_centos6 {
|
||||
core_linux_64 {
|
||||
QMAKE_LFLAGS += -Wl,--dynamic-linker=./ld-linux-x86-64.so.2
|
||||
} else {
|
||||
QMAKE_LFLAGS += -Wl,--dynamic-linker=./ld-linux.so.2
|
||||
}
|
||||
core_linux {
|
||||
QMAKE_LFLAGS += -Wl,--rpath=./:./system
|
||||
}
|
||||
|
||||
DEFINES += UNICODE \
|
||||
|
||||
Reference in New Issue
Block a user