mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-10 18:05:41 +08:00
fix bug #74740
This commit is contained in:
@ -130,6 +130,7 @@ public:
|
||||
oox_chart_context & current_chart();
|
||||
math_context & get_math_context() { return math_context_; }
|
||||
pptx_text_context & get_text_context() { return pptx_text_context_; }
|
||||
forms_context & get_forms_context() { return forms_context_; }
|
||||
|
||||
pptx_table_context & get_table_context() { return pptx_table_context_; }
|
||||
|
||||
@ -166,7 +167,8 @@ private:
|
||||
pptx_table_context pptx_table_context_;
|
||||
pptx_comments_context pptx_comments_context_;
|
||||
math_context math_context_;
|
||||
|
||||
forms_context forms_context_;
|
||||
|
||||
std::vector<oox_chart_context_ptr> charts_;
|
||||
|
||||
std::vector<pptx_xml_slide_ptr> slides_;
|
||||
|
||||
@ -444,7 +444,44 @@ void pptx_serialize_table(std::wostream & strm, _pptx_drawing & val)
|
||||
} // p:graphicFrame
|
||||
} // CP_XML_WRITER
|
||||
}
|
||||
void pptx_serialize_control(std::wostream& strm, _pptx_drawing& val)
|
||||
{
|
||||
val.fill.type = 0;
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"p:sp")
|
||||
{
|
||||
CP_XML_NODE(L"p:nvSpPr")
|
||||
{
|
||||
CP_XML_NODE(L"p:cNvPr")
|
||||
{
|
||||
CP_XML_ATTR(L"id", val.id);//числовое значение val.rId
|
||||
CP_XML_ATTR(L"name", val.name);
|
||||
if (val.hidden) CP_XML_ATTR(L"hidden", true);
|
||||
|
||||
oox_serialize_action(CP_XML_STREAM(), val.action);
|
||||
}
|
||||
CP_XML_NODE(L"p:cNvSpPr")//non visual properies (собственно тока 1 там)
|
||||
{
|
||||
CP_XML_ATTR(L"txBox", 1);
|
||||
}
|
||||
CP_XML_NODE(L"p:nvPr")
|
||||
{
|
||||
}
|
||||
}
|
||||
CP_XML_NODE(L"p:spPr")
|
||||
{
|
||||
val.serialize_xfrm(CP_XML_STREAM(), L"a", true);
|
||||
val.serialize_shape(CP_XML_STREAM());
|
||||
|
||||
oox_serialize_ln(CP_XML_STREAM(), val.additional);
|
||||
oox_serialize_effects(CP_XML_STREAM(), val.additional);
|
||||
}
|
||||
pptx_serialize_text(CP_XML_STREAM(), val);
|
||||
}
|
||||
} // CP_XML_WRITER
|
||||
}
|
||||
|
||||
void pptx_serialize_object(std::wostream & strm, _pptx_drawing & val)
|
||||
{
|
||||
@ -490,7 +527,36 @@ void pptx_serialize_object(std::wostream & strm, _pptx_drawing & val)
|
||||
} // CP_XML_WRITER
|
||||
}
|
||||
|
||||
|
||||
//void _xlsx_drawing::serialize_control(std::wostream& strm)
|
||||
//{
|
||||
// if (type != typeControl) return;
|
||||
// CP_XML_WRITER(strm)
|
||||
// {
|
||||
// CP_XML_NODE(L"control")
|
||||
// {
|
||||
// CP_XML_ATTR(L"r:id", objectId);
|
||||
// CP_XML_ATTR(L"shapeId", id);
|
||||
// //CP_XML_ATTR(L"name", objectProgId);
|
||||
//
|
||||
// CP_XML_NODE(L"controlPr")
|
||||
// {
|
||||
// CP_XML_ATTR(L"defaultSize", 0);
|
||||
// if (fill.bitmap)
|
||||
// {
|
||||
// CP_XML_ATTR(L"r:id", fill.bitmap->rId);
|
||||
// }
|
||||
// CP_XML_NODE(L"anchor")
|
||||
// {
|
||||
// CP_XML_ATTR(L"moveWithCells", 1);
|
||||
//
|
||||
// from_.serialize(CP_XML_STREAM(), L"", L"xdr");
|
||||
// to_.serialize(CP_XML_STREAM(), L"", L"xdr");
|
||||
//
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
void _pptx_drawing::serialize(std::wostream & strm)
|
||||
{
|
||||
if (type == typeShape)
|
||||
@ -516,6 +582,10 @@ void _pptx_drawing::serialize(std::wostream & strm)
|
||||
{
|
||||
pptx_serialize_object(strm, *this);
|
||||
}
|
||||
else if (type == typeControl)
|
||||
{
|
||||
pptx_serialize_control(strm, *this);
|
||||
}
|
||||
else if (type == typeMedia || type == typeAudio || type == typeVideo )
|
||||
{
|
||||
pptx_serialize_media(strm, *this);
|
||||
|
||||
@ -142,7 +142,8 @@ public:
|
||||
if (pptx_drawing_rels_[i].type == typeUnknown ||
|
||||
pptx_drawing_rels_[i].type == typeTable ||
|
||||
pptx_drawing_rels_[i].type == typeShape ||
|
||||
pptx_drawing_rels_[i].type == typeGroupShape) continue;
|
||||
pptx_drawing_rels_[i].type == typeGroupShape ||
|
||||
pptx_drawing_rels_[i].type == typeControl) continue;
|
||||
|
||||
if (pptx_drawing_rels_[i].type == typeComment)
|
||||
{
|
||||
|
||||
@ -181,6 +181,7 @@ private:
|
||||
void process_table (drawing_object_description& obj, _pptx_drawing & drawing);
|
||||
void process_object (drawing_object_description& obj, _pptx_drawing & drawing);
|
||||
void process_media (drawing_object_description& obj, _pptx_drawing & drawing);
|
||||
void process_control(drawing_object_description& obj, _pptx_drawing& drawing);
|
||||
|
||||
size_t rId_;
|
||||
mediaitems_ptr mediaitems_;
|
||||
@ -209,6 +210,7 @@ void pptx_slide_context::Impl::process_drawings()
|
||||
case typeShape: process_shape(objects_[i], drawing); break;
|
||||
case typeTable: process_table(objects_[i], drawing); break;
|
||||
case typeMedia: process_media(objects_[i], drawing); break;
|
||||
case typeControl: process_control(objects_[i], drawing); break;
|
||||
case typePDF:
|
||||
case typeMsObject:
|
||||
case typeOleObject: process_object(objects_[i], drawing); break;
|
||||
@ -687,7 +689,7 @@ bool pptx_slide_context::start_frame()
|
||||
|
||||
void pptx_slide_context::set_chart(const std::wstring & path)
|
||||
{
|
||||
impl_->object_description_.type_ = typeChart;
|
||||
impl_->object_description_.type_ = typeChart;
|
||||
impl_->object_description_.xlink_href_ = path;
|
||||
}
|
||||
|
||||
@ -701,7 +703,18 @@ void pptx_slide_context::end_frame()
|
||||
default_set();
|
||||
}
|
||||
}
|
||||
void pptx_slide_context::start_control(const std::wstring& ctrlPropId, int type)
|
||||
{
|
||||
impl_->object_description_.type_ = typeControl;
|
||||
impl_->object_description_.shape_type_ = type; // object type for vml
|
||||
|
||||
impl_->object_description_.xlink_href_ = ctrlPropId;
|
||||
}
|
||||
void pptx_slide_context::end_control()
|
||||
{
|
||||
impl_->objects_.push_back(impl_->object_description_);
|
||||
default_set();
|
||||
}
|
||||
|
||||
void pptx_slide_context::end_shape()
|
||||
{
|
||||
@ -792,7 +805,25 @@ void pptx_slide_context::Impl::process_table(drawing_object_description & obj, _
|
||||
add_drawing(drawing, isMediaInternal, rId, ref, drawing.type);
|
||||
|
||||
}
|
||||
void pptx_slide_context::Impl::process_control(drawing_object_description& obj, _pptx_drawing& drawing)
|
||||
{
|
||||
std::wstring ref;
|
||||
bool isMediaInternal = true;
|
||||
if (drawing.fill.bitmap)
|
||||
{
|
||||
drawing.fill.bitmap->rId = get_mediaitems()->add_or_find(drawing.fill.bitmap->xlink_href_, typeImage, isMediaInternal, ref, oox::document_place);
|
||||
|
||||
add_additional_rels(isMediaInternal, drawing.fill.bitmap->rId, ref, typeImage);
|
||||
|
||||
std::wstring fileName = odfPacket_ + FILE_SEPARATOR_STR + drawing.fill.bitmap->xlink_href_;
|
||||
process_crop(obj, drawing, fileName);
|
||||
}
|
||||
|
||||
std::wstring rId = get_mediaitems()->add_or_find(L"", obj.type_, isMediaInternal, ref, oox::document_place);
|
||||
|
||||
add_drawing(drawing, isMediaInternal, rId, ref, drawing.type);
|
||||
|
||||
}
|
||||
void pptx_slide_context::Impl::process_shape(drawing_object_description & obj, _pptx_drawing & drawing)
|
||||
{
|
||||
int PlaceHolderIndex = 1;
|
||||
|
||||
@ -102,6 +102,9 @@ public:
|
||||
void set_media_param(std::wstring name, std::wstring value);
|
||||
void end_frame();
|
||||
|
||||
void start_control(const std::wstring& ctrlPropId, int type);
|
||||
void end_control();
|
||||
|
||||
void start_action (std::wstring action);
|
||||
void set_link (std::wstring link, _rels_type typeRels = typeHyperlink);
|
||||
void end_action ();
|
||||
|
||||
@ -49,6 +49,7 @@
|
||||
#include "odfcontext.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#include "../../../DesktopEditor/raster/ImageFileFormatChecker.h"
|
||||
#include "../../../DesktopEditor/raster/BgraFrame.h"
|
||||
#include "../../../DesktopEditor/graphics/pro/Image.h"
|
||||
#include "../../../OOXML/Base/Unit.h"
|
||||
@ -56,28 +57,39 @@
|
||||
namespace _image_file_
|
||||
{
|
||||
bool GetResolution(const wchar_t* fileName, _CP_OPT(int)& Width, _CP_OPT(int)&Height, NSFonts::IApplicationFonts* appFonts)
|
||||
{
|
||||
CBgraFrame image;
|
||||
MetaFile::IMetaFile* meta_file = MetaFile::Create(appFonts);
|
||||
{ /// todooo fast detect resolutions
|
||||
CImageFileFormatChecker image_checker;
|
||||
|
||||
bool bRet = false;
|
||||
if ( appFonts && meta_file->LoadFromFile(fileName))
|
||||
bool bRet = false;
|
||||
if (image_checker.isImageFile(fileName))
|
||||
{
|
||||
double dX = 0, dY = 0, dW = 0, dH = 0;
|
||||
meta_file->GetBounds(&dX, &dY, &dW, &dH);
|
||||
|
||||
Width = dW;
|
||||
Height = dH;
|
||||
}
|
||||
else if ( image.OpenFile(fileName, 0 ))
|
||||
{
|
||||
Width = image.get_Width();
|
||||
Height = image.get_Height();
|
||||
if (image_checker.eFileType == _CXIMAGE_FORMAT_WMF || image_checker.eFileType == _CXIMAGE_FORMAT_EMF
|
||||
|| image_checker.eFileType == _CXIMAGE_FORMAT_SVM)
|
||||
{
|
||||
MetaFile::IMetaFile* meta_file = MetaFile::Create(appFonts);
|
||||
|
||||
bRet = true;
|
||||
}
|
||||
if (appFonts && meta_file->LoadFromFile(fileName))
|
||||
{
|
||||
double dX = 0, dY = 0, dW = 0, dH = 0;
|
||||
meta_file->GetBounds(&dX, &dY, &dW, &dH);
|
||||
|
||||
RELEASEOBJECT(meta_file);
|
||||
Width = dW;
|
||||
Height = dH;
|
||||
}
|
||||
RELEASEOBJECT(meta_file);
|
||||
}
|
||||
else
|
||||
{
|
||||
CBgraFrame image;
|
||||
if (image.OpenFile(fileName, 0))
|
||||
{
|
||||
Width = image.get_Width();
|
||||
Height = image.get_Height();
|
||||
|
||||
bRet = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return bRet;
|
||||
}
|
||||
|
||||
|
||||
@ -70,10 +70,18 @@ const wchar_t * draw_page::name = L"page";
|
||||
|
||||
void draw_page::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
{
|
||||
if CP_CHECK_NAME(L"anim", L"par")
|
||||
if CP_CHECK_NAME(L"anim", L"par")
|
||||
{
|
||||
CP_CREATE_ELEMENT(animation_);
|
||||
else if (L"presentation" == Ns && L"notes" == Name)
|
||||
CP_CREATE_ELEMENT(presentation_notes_);
|
||||
}
|
||||
else if (L"presentation" == Ns && L"notes" == Name)
|
||||
{
|
||||
CP_CREATE_ELEMENT(presentation_notes_);
|
||||
}
|
||||
else if CP_CHECK_NAME(L"office", L"forms")
|
||||
{
|
||||
CP_CREATE_ELEMENT(office_forms_);
|
||||
}
|
||||
else
|
||||
CP_CREATE_ELEMENT(content_);
|
||||
}
|
||||
@ -138,6 +146,10 @@ void draw_page::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
|
||||
Context.start_page(pageName, pageStyleName, layoutName, masterName);
|
||||
|
||||
if (office_forms_)
|
||||
{
|
||||
office_forms_->pptx_convert(Context);
|
||||
}
|
||||
if (attlist_.draw_style_name_)
|
||||
{
|
||||
style_instance * style_inst = Context.root()->odf_context().styleContainer().style_by_name(pageStyleName,style_family::DrawingPage, false);
|
||||
|
||||
@ -74,6 +74,7 @@ public:
|
||||
office_element_ptr_array content_;
|
||||
office_element_ptr animation_;
|
||||
office_element_ptr presentation_notes_;
|
||||
office_element_ptr office_forms_;
|
||||
|
||||
draw_page_attr attlist_;
|
||||
private:
|
||||
|
||||
@ -713,7 +713,7 @@ public:
|
||||
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context);
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
|
||||
virtual void pptx_convert(oox::pptx_conversion_context& Context);
|
||||
|
||||
_CP_OPT(std::wstring) xml_id_;
|
||||
_CP_OPT(std::wstring) caption_id_;
|
||||
|
||||
@ -43,6 +43,7 @@
|
||||
#include <xml/xmlchar.h>
|
||||
#include "odf_document.h"
|
||||
|
||||
#include "office_forms.h"
|
||||
#include "serialize_elements.h"
|
||||
|
||||
#include "style_graphic_properties.h"
|
||||
@ -189,7 +190,7 @@ void draw_shape::common_pptx_convert(oox::pptx_conversion_context & Context)
|
||||
|
||||
if (!text_content_.empty())
|
||||
{
|
||||
Context.get_slide_context().set_property(_property(L"text-content",text_content_));
|
||||
Context.get_slide_context().set_property(_property(L"text-content", text_content_));
|
||||
}
|
||||
}
|
||||
void draw_rect::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
@ -425,5 +426,128 @@ void dr3d_sphere::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
{
|
||||
Context.get_slide_context().start_shape(sub_type_); //reset type
|
||||
}
|
||||
void draw_control::pptx_convert(oox::pptx_conversion_context& Context)
|
||||
{
|
||||
if (!control_id_) return;
|
||||
|
||||
oox::forms_context::_state& state = Context.get_forms_context().get_state_element(*control_id_);
|
||||
if (state.id.empty()) return;
|
||||
|
||||
form_element* control = dynamic_cast<form_element*>(state.element);
|
||||
if (!control) return;
|
||||
|
||||
if (state.ctrlPropId.empty())
|
||||
{
|
||||
std::wstring target;
|
||||
state.ctrlPropId = Context.get_mediaitems()->add_control_props(target);
|
||||
|
||||
//std::wstringstream strm;
|
||||
//control->serialize_control_props(strm);
|
||||
|
||||
//Context.add_control_props(state.ctrlPropId, target, strm.str());
|
||||
}
|
||||
|
||||
Context.get_slide_context().start_control(state.ctrlPropId, control->object_type_);
|
||||
|
||||
common_pptx_convert(Context);
|
||||
|
||||
if (control->linked_cell_)
|
||||
{
|
||||
Context.get_slide_context().set_property(_property(L"linked_cell", control->linked_cell_.get()));
|
||||
}
|
||||
if (control->disabled_)
|
||||
{
|
||||
Context.get_slide_context().set_property(_property(L"disabled", control->disabled_->get()));
|
||||
}
|
||||
if (control->value_)
|
||||
{
|
||||
Context.get_slide_context().set_property(_property(L"value", control->value_.get()));
|
||||
}
|
||||
else if (control->current_value_)
|
||||
{
|
||||
Context.get_slide_context().set_property(_property(L"value", control->current_value_.get()));
|
||||
}
|
||||
if (control->label_)
|
||||
{
|
||||
Context.get_slide_context().set_property(_property(L"label", control->label_.get()));
|
||||
|
||||
Context.get_text_context().start_object();
|
||||
Context.get_text_context().add_text(control->label_.get());
|
||||
|
||||
std::wstring text_content_ = Context.get_text_context().end_object();
|
||||
|
||||
if (!text_content_.empty())
|
||||
{
|
||||
Context.get_slide_context().set_property(_property(L"text-content", text_content_));
|
||||
}
|
||||
}
|
||||
//if (control->name_)
|
||||
//{
|
||||
// Context.get_drawing_context().set_name(control->name_.get());
|
||||
//}
|
||||
form_value_range* value_range = dynamic_cast<form_value_range*>(control);
|
||||
|
||||
if (value_range)
|
||||
{
|
||||
if (value_range->min_value_)
|
||||
{
|
||||
Context.get_slide_context().set_property(_property(L"min_value", value_range->min_value_.get()));
|
||||
}
|
||||
if (value_range->max_value_)
|
||||
{
|
||||
Context.get_slide_context().set_property(_property(L"max_value", value_range->max_value_.get()));
|
||||
}
|
||||
if (value_range->step_size_)
|
||||
{
|
||||
Context.get_slide_context().set_property(_property(L"step", value_range->step_size_.get()));
|
||||
}
|
||||
if (value_range->page_step_size_)
|
||||
{
|
||||
Context.get_slide_context().set_property(_property(L"page_step", value_range->page_step_size_.get()));
|
||||
}
|
||||
if (value_range->orientation_)
|
||||
{
|
||||
Context.get_slide_context().set_property(_property(L"orientation", value_range->orientation_.get()));
|
||||
}
|
||||
}
|
||||
form_combobox* combobox = dynamic_cast<form_combobox*>(control);
|
||||
|
||||
if (combobox)
|
||||
{
|
||||
//items_;
|
||||
if (combobox->source_cell_range_)
|
||||
{
|
||||
Context.get_slide_context().set_property(_property(L"cell_range", combobox->source_cell_range_.get()));
|
||||
}
|
||||
if (combobox->list_source_)
|
||||
{
|
||||
Context.get_slide_context().set_property(_property(L"list_source", combobox->list_source_.get()));
|
||||
}
|
||||
}
|
||||
form_listbox* listbox = dynamic_cast<form_listbox*>(control);
|
||||
if (listbox)
|
||||
{
|
||||
if (listbox->source_cell_range_)
|
||||
{
|
||||
Context.get_slide_context().set_property(_property(L"cell_range", listbox->source_cell_range_.get()));
|
||||
}
|
||||
if (listbox->list_source_)
|
||||
{
|
||||
Context.get_slide_context().set_property(_property(L"list_source", listbox->list_source_.get()));
|
||||
}
|
||||
}
|
||||
form_checkbox* checkbox = dynamic_cast<form_checkbox*>(control);
|
||||
if (checkbox)
|
||||
{
|
||||
Context.get_slide_context().set_property(_property(L"checkbox_state", checkbox->current_state_));
|
||||
}
|
||||
|
||||
//_CP_OPT(std::wstring) label_;
|
||||
//_CP_OPT(std::wstring) title_;
|
||||
//_CP_OPT(odf_types::Bool) dropdown_;
|
||||
|
||||
Context.get_slide_context().end_control();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -96,6 +96,13 @@ void office_forms::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
content_[i]->xlsx_convert(Context);
|
||||
}
|
||||
}
|
||||
void office_forms::pptx_convert(oox::pptx_conversion_context& Context)
|
||||
{
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
content_[i]->pptx_convert(Context);
|
||||
}
|
||||
}
|
||||
// form:form
|
||||
//----------------------------------------------------------------------------------
|
||||
const wchar_t * form_form::ns = L"form";
|
||||
@ -155,6 +162,13 @@ void form_form::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
content_[i]->xlsx_convert(Context);
|
||||
}
|
||||
}
|
||||
void form_form::pptx_convert(oox::pptx_conversion_context& Context)
|
||||
{
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
content_[i]->pptx_convert(Context);
|
||||
}
|
||||
}
|
||||
// form:properties
|
||||
//----------------------------------------------------------------------------------
|
||||
const wchar_t * form_properties::ns = L"form";
|
||||
@ -174,6 +188,10 @@ void form_properties::docx_convert(oox::docx_conversion_context & Context)
|
||||
void form_properties::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
|
||||
}
|
||||
void form_properties::pptx_convert(oox::pptx_conversion_context& Context)
|
||||
{
|
||||
|
||||
}
|
||||
// form:property
|
||||
//----------------------------------------------------------------------------------
|
||||
@ -214,6 +232,13 @@ void form_list_property::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
content_[i]->xlsx_convert(Context);
|
||||
}
|
||||
}
|
||||
void form_list_property::pptx_convert(oox::pptx_conversion_context& Context)
|
||||
{
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
content_[i]->pptx_convert(Context);
|
||||
}
|
||||
}
|
||||
// form:list-value
|
||||
//----------------------------------------------------------------------------------
|
||||
const wchar_t * form_list_value::ns = L"form";
|
||||
@ -289,6 +314,22 @@ void form_element::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
|
||||
Context.get_forms_context().end_element();
|
||||
}
|
||||
void form_element::pptx_convert(oox::pptx_conversion_context& Context)
|
||||
{
|
||||
std::wstring id = id_ ? *id_ : (xml_id_ ? *xml_id_ : L"");
|
||||
Context.get_forms_context().set_id(id);
|
||||
|
||||
if (name_) Context.get_forms_context().set_name(*name_);
|
||||
if (label_) Context.get_forms_context().set_label(*label_);
|
||||
|
||||
if (current_value_) Context.get_forms_context().set_value(*current_value_);
|
||||
else if (value_) Context.get_forms_context().set_value(*value_);
|
||||
|
||||
if (control_implementation_) Context.get_forms_context().set_uuid(*control_implementation_);
|
||||
|
||||
Context.get_forms_context().end_element();
|
||||
}
|
||||
|
||||
// form:frame
|
||||
//----------------------------------------------------------------------------------
|
||||
const wchar_t * form_frame::ns = L"form";
|
||||
@ -312,6 +353,13 @@ void form_frame::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
|
||||
form_element::xlsx_convert(Context);
|
||||
}
|
||||
void form_frame::pptx_convert(oox::pptx_conversion_context& Context)
|
||||
{
|
||||
Context.get_forms_context().start_element(oox::formFrame);
|
||||
Context.get_forms_context().set_element(dynamic_cast<form_element*>(this));
|
||||
|
||||
form_element::pptx_convert(Context);
|
||||
}
|
||||
void form_frame::serialize_control_props(std::wostream & strm)
|
||||
{
|
||||
formulasconvert::odf2oox_converter converter;
|
||||
@ -351,6 +399,13 @@ void form_button::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
|
||||
form_element::xlsx_convert(Context);
|
||||
}
|
||||
void form_button::pptx_convert(oox::pptx_conversion_context& Context)
|
||||
{
|
||||
Context.get_forms_context().start_element(oox::formButton);
|
||||
Context.get_forms_context().set_element(dynamic_cast<form_element*>(this));
|
||||
|
||||
form_element::pptx_convert(Context);
|
||||
}
|
||||
void form_button::serialize_control_props(std::wostream & strm)
|
||||
{
|
||||
formulasconvert::odf2oox_converter converter;
|
||||
@ -391,6 +446,13 @@ void form_text::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
|
||||
form_element::xlsx_convert(Context);
|
||||
}
|
||||
void form_text::pptx_convert(oox::pptx_conversion_context& Context)
|
||||
{
|
||||
Context.get_forms_context().start_element(oox::formLabel);
|
||||
Context.get_forms_context().set_element(dynamic_cast<form_element*>(this));
|
||||
|
||||
form_element::pptx_convert(Context);
|
||||
}
|
||||
void form_text::serialize_control_props(std::wostream & strm)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
@ -489,6 +551,13 @@ void form_fixed_text::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
|
||||
form_element::xlsx_convert(Context);
|
||||
}
|
||||
void form_fixed_text::pptx_convert(oox::pptx_conversion_context& Context)
|
||||
{
|
||||
Context.get_forms_context().start_element(oox::formLabel);
|
||||
Context.get_forms_context().set_element(dynamic_cast<form_element*>(this));
|
||||
|
||||
form_element::pptx_convert(Context);
|
||||
}
|
||||
void form_fixed_text::serialize_control_props(std::wostream & strm)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
@ -590,6 +659,13 @@ void form_checkbox::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
|
||||
form_element::xlsx_convert(Context);
|
||||
}
|
||||
void form_checkbox::pptx_convert(oox::pptx_conversion_context& Context)
|
||||
{
|
||||
Context.get_forms_context().start_element(oox::formCheckbox);
|
||||
Context.get_forms_context().set_element(dynamic_cast<form_element*>(this));
|
||||
|
||||
form_element::pptx_convert(Context);
|
||||
}
|
||||
void form_checkbox::serialize_control_props(std::wostream & strm)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
@ -709,6 +785,13 @@ void form_radio::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
|
||||
form_element::xlsx_convert(Context);
|
||||
}
|
||||
void form_radio::pptx_convert(oox::pptx_conversion_context& Context)
|
||||
{
|
||||
Context.get_forms_context().start_element(oox::formCheckbox);
|
||||
Context.get_forms_context().set_element(dynamic_cast<form_element*>(this));
|
||||
|
||||
form_element::pptx_convert(Context);
|
||||
}
|
||||
void form_radio::serialize_control_props(std::wostream & strm)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
@ -772,6 +855,13 @@ void form_combobox::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
|
||||
form_element::xlsx_convert(Context);
|
||||
}
|
||||
void form_combobox::pptx_convert(oox::pptx_conversion_context& Context)
|
||||
{
|
||||
Context.get_forms_context().start_element(oox::formCombobox);
|
||||
Context.get_forms_context().set_element(dynamic_cast<form_element*>(this));
|
||||
|
||||
form_element::pptx_convert(Context);
|
||||
}
|
||||
void form_combobox::serialize_control_props(std::wostream & strm)
|
||||
{
|
||||
formulasconvert::odf2oox_converter converter;
|
||||
@ -893,6 +983,13 @@ void form_listbox::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
|
||||
form_element::xlsx_convert(Context);
|
||||
}
|
||||
void form_listbox::pptx_convert(oox::pptx_conversion_context& Context)
|
||||
{
|
||||
Context.get_forms_context().start_element(oox::formListbox);
|
||||
Context.get_forms_context().set_element(dynamic_cast<form_element*>(this));
|
||||
|
||||
form_element::pptx_convert(Context);
|
||||
}
|
||||
void form_listbox::serialize_control_props(std::wostream & strm)
|
||||
{
|
||||
formulasconvert::odf2oox_converter converter;
|
||||
@ -955,6 +1052,13 @@ void form_date::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
|
||||
form_element::xlsx_convert(Context);
|
||||
}
|
||||
void form_date::pptx_convert(oox::pptx_conversion_context& Context)
|
||||
{
|
||||
Context.get_forms_context().start_element(oox::formDateTime);
|
||||
Context.get_forms_context().set_element(dynamic_cast<form_element*>(this));
|
||||
|
||||
form_element::pptx_convert(Context);
|
||||
}
|
||||
void form_date::serialize_control_props(std::wostream & strm)
|
||||
{
|
||||
}
|
||||
@ -1030,6 +1134,13 @@ void form_time::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
|
||||
form_element::xlsx_convert(Context);
|
||||
}
|
||||
void form_time::pptx_convert(oox::pptx_conversion_context& Context)
|
||||
{
|
||||
Context.get_forms_context().start_element(oox::formDateTime);
|
||||
Context.get_forms_context().set_element(dynamic_cast<form_element*>(this));
|
||||
|
||||
form_element::pptx_convert(Context);
|
||||
}
|
||||
void form_time::serialize_control_props(std::wostream & strm)
|
||||
{
|
||||
}
|
||||
@ -1107,6 +1218,13 @@ void form_image_frame::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
|
||||
form_element::xlsx_convert(Context);
|
||||
}
|
||||
void form_image_frame::pptx_convert(oox::pptx_conversion_context& Context)
|
||||
{
|
||||
Context.get_forms_context().start_element(oox::formImage);
|
||||
Context.get_forms_context().set_element(dynamic_cast<form_element*>(this));
|
||||
|
||||
form_element::pptx_convert(Context);
|
||||
}
|
||||
void form_image_frame::serialize_control_props(std::wostream & strm)
|
||||
{
|
||||
}
|
||||
@ -1171,6 +1289,19 @@ void form_value_range::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
|
||||
form_element::xlsx_convert(Context);
|
||||
}
|
||||
void form_value_range::pptx_convert(oox::pptx_conversion_context& Context)
|
||||
{
|
||||
if (!control_implementation_) return;
|
||||
|
||||
if (control_implementation_->find(L"SpinButton") != std::wstring::npos)
|
||||
Context.get_forms_context().start_element(oox::formSpin);
|
||||
else
|
||||
Context.get_forms_context().start_element(oox::formScroll);
|
||||
|
||||
Context.get_forms_context().set_element(dynamic_cast<form_element*>(this));
|
||||
|
||||
form_element::pptx_convert(Context);
|
||||
}
|
||||
void form_value_range::serialize_control_props(std::wostream & strm)
|
||||
{
|
||||
if (!control_implementation_) return;
|
||||
|
||||
@ -54,9 +54,9 @@ public:
|
||||
static const ElementType type = typeOfficeForms;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context) ;
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context);
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
|
||||
virtual void pptx_convert(oox::pptx_conversion_context& Context);
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
@ -79,9 +79,9 @@ public:
|
||||
static const ElementType type = typeFormForm;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context) ;
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context);
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
|
||||
virtual void pptx_convert(oox::pptx_conversion_context& Context);
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
@ -129,9 +129,9 @@ public:
|
||||
static const ElementType type = typeFormProperties;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context) ;
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context);
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
|
||||
virtual void pptx_convert(oox::pptx_conversion_context& Context);
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes ){}
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
@ -171,9 +171,9 @@ public:
|
||||
static const ElementType type = typeFormListProperty;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context) ;
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context);
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
|
||||
virtual void pptx_convert(oox::pptx_conversion_context& Context);
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
@ -222,7 +222,7 @@ public:
|
||||
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context);
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
|
||||
virtual void pptx_convert(oox::pptx_conversion_context& Context);
|
||||
|
||||
virtual void docx_convert_sdt (oox::docx_conversion_context & Context, draw_control* draw) {}
|
||||
virtual void docx_convert_field (oox::docx_conversion_context & Context, draw_control* draw) {}
|
||||
@ -267,7 +267,7 @@ public:
|
||||
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context);
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
|
||||
virtual void pptx_convert(oox::pptx_conversion_context& Context);
|
||||
|
||||
virtual void serialize_control_props(std::wostream & strm);
|
||||
private:
|
||||
@ -287,7 +287,7 @@ public:
|
||||
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context);
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
|
||||
virtual void pptx_convert(oox::pptx_conversion_context& Context);
|
||||
|
||||
virtual void serialize_control_props(std::wostream & strm);
|
||||
private:
|
||||
@ -322,7 +322,7 @@ public:
|
||||
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context);
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
|
||||
virtual void pptx_convert(oox::pptx_conversion_context& Context);
|
||||
|
||||
virtual void docx_convert_sdt (oox::docx_conversion_context & Context, draw_control* draw);
|
||||
virtual void docx_convert_field (oox::docx_conversion_context & Context, draw_control* draw);
|
||||
@ -350,7 +350,7 @@ public:
|
||||
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context);
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
|
||||
virtual void pptx_convert(oox::pptx_conversion_context& Context);
|
||||
|
||||
virtual void docx_convert_sdt (oox::docx_conversion_context & Context, draw_control* draw);
|
||||
virtual void docx_convert_field (oox::docx_conversion_context & Context, draw_control* draw);
|
||||
@ -387,7 +387,7 @@ public:
|
||||
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context);
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
|
||||
virtual void pptx_convert(oox::pptx_conversion_context& Context);
|
||||
|
||||
virtual void docx_convert_sdt (oox::docx_conversion_context & Context, draw_control *draw);
|
||||
virtual void docx_convert_field (oox::docx_conversion_context & Context, draw_control* draw);
|
||||
@ -418,7 +418,7 @@ public:
|
||||
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context);
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
|
||||
virtual void pptx_convert(oox::pptx_conversion_context& Context);
|
||||
|
||||
virtual void docx_convert_sdt (oox::docx_conversion_context & Context, draw_control *draw);
|
||||
virtual void docx_convert_field (oox::docx_conversion_context & Context, draw_control* draw);
|
||||
@ -441,7 +441,7 @@ public:
|
||||
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context);
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
|
||||
virtual void pptx_convert(oox::pptx_conversion_context& Context);
|
||||
|
||||
virtual void docx_convert_sdt (oox::docx_conversion_context & Context, draw_control *draw){}
|
||||
virtual void docx_convert_field (oox::docx_conversion_context & Context, draw_control* draw){}
|
||||
@ -473,7 +473,7 @@ public:
|
||||
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context);
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
|
||||
virtual void pptx_convert(oox::pptx_conversion_context& Context);
|
||||
|
||||
virtual void docx_convert_sdt (oox::docx_conversion_context & Context, draw_control* draw);
|
||||
|
||||
@ -508,7 +508,7 @@ public:
|
||||
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context);
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
|
||||
virtual void pptx_convert(oox::pptx_conversion_context& Context);
|
||||
virtual void serialize_control_props(std::wostream & strm);
|
||||
|
||||
private:
|
||||
@ -541,7 +541,7 @@ public:
|
||||
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context);
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
|
||||
virtual void pptx_convert(oox::pptx_conversion_context& Context);
|
||||
|
||||
virtual void docx_convert_sdt (oox::docx_conversion_context & Context, draw_control* draw);
|
||||
|
||||
@ -567,7 +567,7 @@ public:
|
||||
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context);
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
|
||||
virtual void pptx_convert(oox::pptx_conversion_context& Context);
|
||||
|
||||
virtual void docx_convert_sdt (oox::docx_conversion_context & Context, draw_control* draw);
|
||||
|
||||
@ -593,7 +593,7 @@ public:
|
||||
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context);
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
|
||||
virtual void pptx_convert(oox::pptx_conversion_context& Context);
|
||||
|
||||
virtual void docx_convert_sdt (oox::docx_conversion_context & Context, draw_control* draw);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user