Compare commits

...

2 Commits

Author SHA1 Message Date
5f7288f66f . 2019-04-19 17:41:29 +03:00
b308f53e76 . 2019-04-19 14:45:55 +03:00
8 changed files with 429 additions and 48 deletions

View File

@ -77,22 +77,22 @@ void xlsx_drawing_position::serialize(std::wostream & strm, const std::wstring &
{
CP_XML_NODE( ns + (ns.empty() ? L"" : L":") + (type == xlsx_drawing_position::from ? L"from" : L"to") )
{
CP_XML_NODE(ns + L":col")
CP_XML_NODE(ns + (ns.empty() ? L"" : L":") + L"col")
{
CP_XML_CONTENT(position.col);
}
CP_XML_NODE(ns + L":colOff")
CP_XML_NODE(ns + (ns.empty() ? L"" : L":") + L"colOff")
{
CP_XML_CONTENT(static_cast<size_t>(position.colOff));
}
CP_XML_NODE(ns + L":row")
CP_XML_NODE(ns + (ns.empty() ? L"" : L":") + L"row")
{
CP_XML_CONTENT(position.row);
}
CP_XML_NODE(ns + L":rowOff")
CP_XML_NODE(ns + (ns.empty() ? L"" : L":") + L"rowOff")
{
CP_XML_CONTENT(static_cast<size_t>(position.rowOff));
}

View File

@ -207,7 +207,7 @@ const wchar_t * form_element::name = L"element";
void form_element::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"form:control_implementation", control_implementation_);
CP_APPLY_ATTR(L"form:control-implementation", control_implementation_);
CP_APPLY_ATTR(L"form:data-field", data_field_);
CP_APPLY_ATTR(L"form:linked-cell", linked_cell_);
CP_APPLY_ATTR(L"form:disabled", disabled_);
@ -302,7 +302,8 @@ void form_button::serialize_control_props(std::wostream & strm)
CP_XML_ATTR(L"dx", L"20");
CP_XML_ATTR(L"noThreeD", L"1");
}
}}
}
}
// form:text
//----------------------------------------------------------------------------------
const wchar_t * form_text::ns = L"form";
@ -342,7 +343,8 @@ void form_text::serialize_control_props(std::wostream & strm)
if (value_)
CP_XML_ATTR(L"val", *value_);
}
}}
}
}
void form_text::docx_convert_sdt(oox::docx_conversion_context & Context, draw_control *draw)
{
if (!draw) return;
@ -397,6 +399,106 @@ void form_text::docx_convert_field(oox::docx_conversion_context & Context, draw_
Context.finish_run();
Context.output_stream() << L"<w:r><w:fldChar w:fldCharType=\"end\"/></w:r>";
}
// form:fixed-text
//----------------------------------------------------------------------------------
const wchar_t * form_textarea::ns = L"form";
const wchar_t * form_textarea::name = L"textarea";
// form:fixed-text
//----------------------------------------------------------------------------------
const wchar_t * form_fixed_text::ns = L"form";
const wchar_t * form_fixed_text::name = L"fixed-text";
void form_fixed_text::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
form_element::add_attributes(Attributes);
}
void form_fixed_text::docx_convert(oox::docx_conversion_context & Context)
{
Context.get_forms_context().start_element(2);
Context.get_forms_context().set_element(dynamic_cast<form_element*>(this));
form_element::docx_convert(Context);
}
void form_fixed_text::xlsx_convert(oox::xlsx_conversion_context & Context)
{
Context.get_forms_context().start_element(2);
Context.get_forms_context().set_element(dynamic_cast<form_element*>(this));
form_element::xlsx_convert(Context);
}
void form_fixed_text::serialize_control_props(std::wostream & strm)
{
CP_XML_WRITER(strm)
{
CP_XML_NODE(L"formControlPr")
{
CP_XML_ATTR(L"xmlns", L"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main");
CP_XML_ATTR(L"objectType", L"EditBox");
CP_XML_ATTR(L"dx", L"20");
CP_XML_ATTR(L"noThreeD", L"1");
if (value_)
CP_XML_ATTR(L"val", *value_);
}
}
}
void form_fixed_text::docx_convert_sdt(oox::docx_conversion_context & Context, draw_control *draw)
{
if (!draw) return;
Context.output_stream() << L"<w:sdt>";
Context.output_stream() << L"<w:sdtPr>";
{
if (name_)
{
Context.output_stream() << L"<w:alias w:val=\"" + xml::utils::replace_text_to_xml(*name_) + L"\"/>";
}
Context.output_stream() << L"<w:id w:val=\"" + std::to_wstring(Context.get_drawing_context().get_current_shape_id()) + L"\"/>";
//<w:lock w:val="sdtLocked"/>
//<w:placeholder>
// <w:docPart w:val="DefaultPlaceholder_-1854013440"/>
//</w:placeholder>
}
Context.output_stream() << L"</w:sdtPr>";
Context.output_stream() << L"<w:sdtContent>";
{
Context.add_new_run(L"");
if (current_value_)
{
Context.output_stream() << L"<w:t xml:space=\"preserve\">";
Context.output_stream() << xml::utils::replace_text_to_xml(*current_value_ );
Context.output_stream() << L"</w:t>";
}
Context.finish_run();
}
Context.output_stream() << L"</w:sdtContent>";
Context.output_stream() << L"</w:sdt>";
}
void form_fixed_text::docx_convert_field(oox::docx_conversion_context & Context, draw_control *draw)
{
if (!draw) return;
XmlUtils::replace_all( *name_, L" ", L"_");
Context.add_new_run(L"");
Context.output_stream() << L"<w:fldChar w:fldCharType=\"begin\"><w:ffData><w:name w:val=\"" << *name_ << L"\"/><w:enabled/>";
Context.output_stream() << L"</w:ffData></w:fldChar>";
Context.finish_run();
Context.add_new_run(L"");
Context.output_stream() << L"<w:instrText>FORMTEXT</w:instrText>";
Context.finish_run();
Context.output_stream() << L"<w:r><w:fldChar w:fldCharType=\"separate\"/></w:r>";
Context.add_new_run(L"");
Context.output_stream() << L"<w:t>" << *current_value_ << L"</w:t>";
Context.finish_run();
Context.output_stream() << L"<w:r><w:fldChar w:fldCharType=\"end\"/></w:r>";
}
// form:checkbox
//----------------------------------------------------------------------------------
const wchar_t * form_checkbox::ns = L"form";
@ -628,9 +730,6 @@ void form_combobox::docx_convert_sdt(oox::docx_conversion_context & Context, dra
Context.finish_run();
}
}
// form:listbox
//----------------------------------------------------------------------------------
const wchar_t * form_listbox::ns = L"form";
@ -693,7 +792,7 @@ void form_listbox::serialize_control_props(std::wostream & strm)
}
}
}
// form:button
// form:date
//----------------------------------------------------------------------------------
const wchar_t * form_date::ns = L"form";
const wchar_t * form_date::name = L"date";
@ -767,6 +866,164 @@ void form_date::docx_convert_sdt(oox::docx_conversion_context & Context, draw_co
Context.finish_run();
}
}
// form:time
//----------------------------------------------------------------------------------
const wchar_t * form_time::ns = L"form";
const wchar_t * form_time::name = L"time";
void form_time::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
form_element::add_attributes(Attributes);
}
void form_time::docx_convert(oox::docx_conversion_context & Context)
{
Context.get_forms_context().start_element(6);
Context.get_forms_context().set_element(dynamic_cast<form_element*>(this));
form_element::docx_convert(Context);
}
void form_time::xlsx_convert(oox::xlsx_conversion_context & Context)
{
Context.get_forms_context().start_element(6);
Context.get_forms_context().set_element(dynamic_cast<form_element*>(this));
form_element::xlsx_convert(Context);
}
void form_time::serialize_control_props(std::wostream & strm)
{
}
void form_time::docx_convert_sdt(oox::docx_conversion_context & Context, draw_control *draw)
{
Context.finish_run();
Context.output_stream() << L"<w:sdt>";
Context.output_stream() << L"<w:sdtPr>";
{
if (name_)
{
Context.output_stream() << L"<w:alias w:val=\"" + xml::utils::replace_text_to_xml(*name_) + L"\"/>";
}
Context.output_stream() << L"<w:id w:val=\"" + std::to_wstring(Context.get_drawing_context().get_current_shape_id()) + L"\"/>";
Context.output_stream() << L"<w:date>";
Context.output_stream() << L"<w:dateFormat w:val=\"\"/>";
Context.output_stream() << L"<w:lid w:val=\"en-US\"/>";
Context.output_stream() << L"<w:storeMappedDataAs w:val=\"dateTime\"/>";
Context.output_stream() << L"<w:calendar w:val=\"gregorian\"/>";
Context.output_stream() << L"</w:date>";
}
Context.output_stream() << L"</w:sdtPr>";
Context.output_stream() << L"<w:sdtContent>";
{
Context.add_new_run(L"");
Context.output_stream() << L"<w:t xml:space=\"preserve\">";
if (current_value_)
{
Context.output_stream() << xml::utils::replace_text_to_xml(*current_value_ );
}
else
{
Context.output_stream() << L"[Insert time]";
}
Context.output_stream() << L"</w:t>";
Context.finish_run();
}
Context.output_stream() << L"</w:sdtContent>";
Context.output_stream() << L"</w:sdt>";
if (label_)
{
Context.add_new_run(L"");
Context.output_stream() << L"<w:t xml:space=\"preserve\">";
Context.output_stream() << xml::utils::replace_text_to_xml(*label_ );
Context.output_stream() << L"</w:t>";
Context.finish_run();
}
}
// form:listbox
//----------------------------------------------------------------------------------
const wchar_t * form_value_range::ns = L"form";
const wchar_t * form_value_range::name = L"value-range";
void form_value_range::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
form_element::add_attributes(Attributes);
CP_APPLY_ATTR(L"form:min-value", min_value_);
CP_APPLY_ATTR(L"form:max-value", max_value_);
CP_APPLY_ATTR(L"form:step-size", step_size_);
CP_APPLY_ATTR(L"form:page-step-size", page_step_size_);
CP_APPLY_ATTR(L"form:orientation", orientation_);
CP_APPLY_ATTR(L"form:delay-for-repeat", delay_for_repeat_);
}
void form_value_range::docx_convert(oox::docx_conversion_context & Context)
{
if (!control_implementation_) return;
if (control_implementation_->find(L"SpinButton") != std::wstring::npos)
Context.get_forms_context().start_element(7); //spin
else
Context.get_forms_context().start_element(8); //scroll
Context.get_forms_context().set_element(dynamic_cast<form_element*>(this));
form_element::docx_convert(Context);
}
void form_value_range::xlsx_convert(oox::xlsx_conversion_context & Context)
{
if (!control_implementation_) return;
if (control_implementation_->find(L"SpinButton") != std::wstring::npos)
Context.get_forms_context().start_element(7); //spin
else
Context.get_forms_context().start_element(8); //scroll
Context.get_forms_context().set_element(dynamic_cast<form_element*>(this));
form_element::xlsx_convert(Context);
}
void form_value_range::serialize_control_props(std::wostream & strm)
{
if (!control_implementation_) return;
std::wstring object_type;
if (control_implementation_->find(L"SpinButton") != std::wstring::npos)
object_type = L"Spin";
else
object_type = L"Scroll";
formulasconvert::odf2oox_converter converter;
CP_XML_WRITER(strm)
{
CP_XML_NODE(L"formControlPr")
{
CP_XML_ATTR(L"xmlns", L"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main");
CP_XML_ATTR(L"objectType", object_type);
CP_XML_ATTR(L"noThreeD", L"1");
if (linked_cell_)
{
std::wstring fmla = converter.convert_named_expr(*linked_cell_);
CP_XML_ATTR(L"fmlaLink", fmla);
}
if (value_) CP_XML_ATTR(L"val", *value_);
if (min_value_) CP_XML_ATTR(L"min", *min_value_);
if (max_value_) CP_XML_ATTR(L"max", *max_value_);
if (step_size_) CP_XML_ATTR(L"inc", *step_size_);
if (page_step_size_)CP_XML_ATTR(L"page",*page_step_size_);
if (orientation_)
{
if (*orientation_ == L"horizontal")
CP_XML_ATTR(L"horiz", 1);
else
CP_XML_ATTR(L"verticalBar", 1);
}
}
}
}
// form:item
//----------------------------------------------------------------------------------
const wchar_t * form_item::ns = L"form";

View File

@ -320,6 +320,43 @@ public:
};
CP_REGISTER_OFFICE_ELEMENT2(form_text);
// form:fixed-text
class form_fixed_text : public form_element
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormFixedText;
CPDOCCORE_DEFINE_VISITABLE();
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 docx_convert_sdt (oox::docx_conversion_context & Context, draw_control* draw);
virtual void docx_convert_field (oox::docx_conversion_context & Context, draw_control* draw);
virtual void serialize_control_props(std::wostream & strm);
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
public:
};
CP_REGISTER_OFFICE_ELEMENT2(form_fixed_text);
// form:textarea
class form_textarea : public form_text
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormTextarea;
CPDOCCORE_DEFINE_VISITABLE();
};
CP_REGISTER_OFFICE_ELEMENT2(form_textarea);
// form:checkbox
class form_checkbox : public form_text
{
@ -352,6 +389,38 @@ public:
};
CP_REGISTER_OFFICE_ELEMENT2(form_checkbox);
// form:value-range
class form_value_range : public form_element
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormValueRange;
CPDOCCORE_DEFINE_VISITABLE();
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 docx_convert_sdt (oox::docx_conversion_context & Context, draw_control *draw){}
virtual void docx_convert_field (oox::docx_conversion_context & Context, draw_control* draw){}
virtual void serialize_control_props(std::wostream & strm);
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
public:
_CP_OPT(int) min_value_;
_CP_OPT(int) max_value_;
_CP_OPT(int) step_size_;
_CP_OPT(int) page_step_size_;
_CP_OPT(std::wstring) orientation_;
_CP_OPT(std::wstring) delay_for_repeat_;
};
CP_REGISTER_OFFICE_ELEMENT2(form_value_range);
// form:combobox
class form_combobox : public form_text
{
@ -442,10 +511,34 @@ private:
public:
};
CP_REGISTER_OFFICE_ELEMENT2(form_date);
// form:time
class form_time : public form_element
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormTime;
CPDOCCORE_DEFINE_VISITABLE();
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 docx_convert_sdt (oox::docx_conversion_context & Context, draw_control* draw);
virtual void serialize_control_props(std::wostream & strm);
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
public:
};
CP_REGISTER_OFFICE_ELEMENT2(form_time);
// form:item
class form_item : public office_element_impl<form_item>
{
@ -470,7 +563,6 @@ CP_REGISTER_OFFICE_ELEMENT2(form_item);
}
//<form:connection-resource>7.6.2,
//<form:file> 13.5.5,
//<form:fixed-text> 13.5.10,
//<form:form> 13.3,
//<form:formatted-text> 13.5.6,
//<form:frame> 13.5.19,
@ -481,7 +573,3 @@ CP_REGISTER_OFFICE_ELEMENT2(form_item);
//<form:image-frame> 13.5.20,
//<form:number> 13.5.7,
//<form:password> 13.5.4,
//<form:radio> 13.5.18,
//<form:textarea> 13.5.3,
//<form:time>
//<form:value-range> 13.5.24 and

View File

@ -64,7 +64,7 @@ public:
Impl(odf_conversion_context *odf_context) : odf_context_(odf_context)
{
}
std::wstring start_control(int type);
std::wstring start_control(int type, bool items_set);
std::vector<odf_control_state> controls_;
@ -76,7 +76,7 @@ odf_controls_context::odf_controls_context(odf_conversion_context *odf_context)
: impl_(new odf_controls_context::Impl(odf_context))
{
}
std::wstring odf_controls_context::Impl::start_control(int type)
std::wstring odf_controls_context::Impl::start_control(int type, bool items_set)
{
office_element_ptr element;
std::wstring control_implementation;
@ -94,8 +94,16 @@ std::wstring odf_controls_context::Impl::start_control(int type)
}break;
case 2: // objectDrop
{
create_element(L"form", L"combobox", element, odf_context_);
control_implementation = L"ooo:com.sun.star.form.component.ComboBox";
if (items_set)
{
create_element(L"form", L"combobox", element, odf_context_);
control_implementation = L"ooo:com.sun.star.form.component.ComboBox";
}
else
{
create_element(L"form", L"listbox", element, odf_context_);
control_implementation = L"ooo:com.sun.star.form.component.ListBox";
}
}break;
case 3: // objectGBox
{
@ -120,7 +128,7 @@ std::wstring odf_controls_context::Impl::start_control(int type)
case 7: // objectScroll
{
create_element(L"form", L"value-range", element, odf_context_);
control_implementation = L"com.sun.star.awt.UnoControlScrollBar";
control_implementation = L"ooo:com.sun.star.form.component.ScrollBar";
}break;
case 8: // objectSpin
{
@ -155,9 +163,9 @@ std::wstring odf_controls_context::Impl::start_control(int type)
odf_controls_context::~odf_controls_context()
{
}
std::wstring odf_controls_context::start_control(int type)
std::wstring odf_controls_context::start_control(int type, bool items_set)
{
return impl_->start_control(type);
return impl_->start_control(type, items_set);
}
void odf_controls_context::end_control()
{
@ -183,7 +191,7 @@ void odf_controls_context::set_linkedCell (const std::wstring & val)
if (impl_->controls_.empty()) return;
formulasconvert::oox2odf_converter formulas_converter;
impl_->controls_.back().form_elm->linked_cell_ = formulas_converter.convert_ref(val);
impl_->controls_.back().form_elm->linked_cell_ = formulas_converter.convert_named_ref(val);
}
void odf_controls_context::set_listFillRange (const std::wstring & val)
{
@ -194,7 +202,17 @@ void odf_controls_context::set_listFillRange (const std::wstring & val)
if (!listbox) return;
formulasconvert::oox2odf_converter formulas_converter;
listbox->list_source_ = formulas_converter.convert_ref(val);
listbox->source_cell_range_ = formulas_converter.convert_named_ref(val);
}
void odf_controls_context::set_drop_size(int val)
{
if (impl_->controls_.empty()) return;
odf_writer::form_listbox *listbox = dynamic_cast<odf_writer::form_listbox*>(impl_->controls_.back().form_elm);
if (listbox) listbox->size_ = val;
odf_writer::form_combobox *combobox = dynamic_cast<odf_writer::form_combobox*>(impl_->controls_.back().form_elm);
if (combobox ) combobox ->size_ = val;
}
void odf_controls_context::set_macro(const std::wstring & val)
{
@ -268,13 +286,18 @@ void odf_controls_context::set_horiz(bool val)
value_range->orientation_ = val ? odf_types::table_centering::Horizontal : odf_types::table_centering::Vertical;
}
void odf_controls_context::set_drop_down(bool val)
{
if (impl_->controls_.empty()) return;
impl_->controls_.back().form_elm->dropdown_ = val;
}
void odf_controls_context::set_check_state(int val)
{
if (impl_->controls_.empty()) return;
odf_writer::form_checkbox *checkbox = dynamic_cast<odf_writer::form_checkbox*>(impl_->controls_.back().form_elm);
if (checkbox) checkbox->current_state_ = (val == 1);
checkbox->current_state_ = (val == 1);
}
void odf_controls_context::set_value(const std::wstring & val)
{

View File

@ -52,7 +52,7 @@ public:
odf_controls_context(odf_conversion_context *odf_context);
~odf_controls_context();
std::wstring start_control(int type);
std::wstring start_control(int type, bool items_set);
void end_control();
office_element_ptr & get_root_element();
@ -77,6 +77,8 @@ public:
void set_value (const std::wstring & val);
void set_horiz (bool val);
void set_check_state (int val);
void set_drop_down (bool val);
void set_drop_size (int val);
void set_size( _CP_OPT(double) & width_pt, _CP_OPT(double) & height_pt);

View File

@ -241,13 +241,13 @@ const wchar_t * form_element::name = L"element";
void form_element::serialize_attlist(CP_ATTR_NODE)
{
CP_XML_ATTR_OPT(L"form:control_implementation", control_implementation_);
CP_XML_ATTR_OPT(L"form:name", name_);
CP_XML_ATTR_OPT(L"form:control-implementation", control_implementation_);
CP_XML_ATTR_OPT(L"form:data-field", data_field_);
CP_XML_ATTR_OPT(L"form:linked-cell", linked_cell_);
CP_XML_ATTR_OPT(L"form:disabled", disabled_);
CP_XML_ATTR_OPT(L"form:id", id_);
CP_XML_ATTR_OPT(L"form:label", label_);
CP_XML_ATTR_OPT(L"form:name", name_);
CP_XML_ATTR_OPT(L"form:printable", printable_);
CP_XML_ATTR_OPT(L"form:tab-index", tab_index_);
CP_XML_ATTR_OPT(L"form:tab-stop", tab_stop_);
@ -386,10 +386,10 @@ void form_checkbox::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE()
{
form_element::serialize_attlist(CP_GET_XML_NODE());
if (current_state_)
CP_XML_ATTR(L"form:current-state", L"checked" );
form_element::serialize_attlist(CP_GET_XML_NODE());
if (properties_) properties_->serialize(CP_XML_STREAM());
if (office_event_listeners_) office_event_listeners_->serialize(CP_XML_STREAM());
@ -516,14 +516,14 @@ void form_value_range::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR_OPT(L"form:min-value", min_value_);
CP_XML_ATTR_OPT(L"form:max-value", max_value_);
CP_XML_ATTR_OPT(L"form:step-size", step_size_);
CP_XML_ATTR_OPT(L"form:page-step-size", page_step_size_);
CP_XML_ATTR_OPT(L"form:orientation", orientation_);
CP_XML_ATTR_OPT(L"form:delay-for-repeat", delay_for_repeat_);
form_element::serialize_attlist(CP_GET_XML_NODE());
CP_XML_ATTR_OPT (L"form:min-value", min_value_);
CP_XML_ATTR_OPT (L"form:max-value", max_value_);
CP_XML_ATTR_OPT (L"form:step-size", step_size_);
CP_XML_ATTR_OPT (L"form:page-step-size", page_step_size_);
CP_XML_ATTR_OPT (L"form:orientation", orientation_);
CP_XML_ATTR (L"form:delay-for-repeat", delay_for_repeat_);
if (properties_) properties_->serialize(CP_XML_STREAM());
if (office_event_listeners_) office_event_listeners_->serialize(CP_XML_STREAM());

View File

@ -399,6 +399,7 @@ public:
_CP_OPT(std::wstring) source_cell_range_;
_CP_OPT(std::wstring) list_source_;
_CP_OPT(std::wstring) list_source_type_;
_CP_OPT(int) size_;
office_element_ptr_array options_;
@ -429,7 +430,9 @@ CP_REGISTER_OFFICE_ELEMENT2(form_date);
class form_value_range : public form_element
{
public:
static const wchar_t * ns;
form_value_range() {delay_for_repeat_ = L"PT0.05000000S";}
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormValueRange;
@ -442,9 +445,7 @@ public:
_CP_OPT(int) step_size_;
_CP_OPT(int) page_step_size_;
_CP_OPT(odf_types::table_centering) orientation_;
_CP_OPT(std::wstring) delay_for_repeat_;
//form:delay-for-repeat="PT0.023000000S"
std::wstring delay_for_repeat_;
};
CP_REGISTER_OFFICE_ELEMENT2(form_value_range);
//-----------------------------------------------------------------------------------------

View File

@ -2426,7 +2426,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CControls *oox_controls, OOX::Spre
continue;
}
//---------------------------------------------
std::wstring id = ods_context->current_table().controls_context()->start_control((int)oFormControlPr->m_oObjectType->GetValue());
std::wstring id = ods_context->current_table().controls_context()->start_control((int)oFormControlPr->m_oObjectType->GetValue(), oFormControlPr->m_oItemLst.IsInit());
if (false == id.empty())
{
@ -2479,7 +2479,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CControls *oox_controls, OOX::Spre
}
if (oFormControlPr->m_oMax.IsInit())
{
ods_context->current_table().controls_context()->set_max_value(oFormControlPr->m_oMin->GetValue());
ods_context->current_table().controls_context()->set_max_value(oFormControlPr->m_oMax->GetValue());
}
if (oFormControlPr->m_oPage.IsInit())
{
@ -2497,6 +2497,10 @@ void XlsxConverter::convert(OOX::Spreadsheet::CControls *oox_controls, OOX::Spre
{
ods_context->current_table().controls_context()->set_horiz(*oFormControlPr->m_oHoriz);
}
if (oFormControlPr->m_oVerticalBar.IsInit())
{
ods_context->current_table().controls_context()->set_horiz(*oFormControlPr->m_oVerticalBar == false);
}
if (oFormControlPr->m_oFmlaLink.IsInit())
{
ods_context->current_table().controls_context()->set_linkedCell(*oFormControlPr->m_oFmlaLink);
@ -2509,8 +2513,14 @@ void XlsxConverter::convert(OOX::Spreadsheet::CControls *oox_controls, OOX::Spre
{
ods_context->current_table().controls_context()->set_check_state(oFormControlPr->m_oChecked->GetValue());
}
//nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oDropLines;
//nullable<SimpleTypes::Spreadsheet::CDropStyle<>> m_oDropStyle;
if (oFormControlPr->m_oDropStyle.IsInit())
{
ods_context->current_table().controls_context()->set_drop_down(true);
}
if (oFormControlPr->m_oDropLines.IsInit())
{
ods_context->current_table().controls_context()->set_drop_size(oFormControlPr->m_oDropLines->GetValue());
}
//nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oDx;
//nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oSel;
//nullable<SimpleTypes::Spreadsheet::CSelType<>> m_oSelType;