Commit bdc9547e authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

git-svn-id:...

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@55077 954022d7-b5bf-4e40-9824-e11837661b57
parent 811446bb
......@@ -386,6 +386,14 @@
RelativePath=".\src\odf\datatypes\backgroundcolor.h"
>
</File>
<File
RelativePath=".\src\odf\datatypes\bool.cpp"
>
</File>
<File
RelativePath=".\src\odf\datatypes\bool.h"
>
</File>
<File
RelativePath=".\src\odf\datatypes\bordermodel.cpp"
>
......
......@@ -5,6 +5,7 @@
#include <cpdoccore/CPOptional.h>
#include <cpdoccore/xml/simple_xml_writer.h>
#include "bool.h"
#include "lengthorpercent.h"
#include "fobreak.h"
#include "backgroundcolor.h"
......@@ -62,7 +63,7 @@ public:
_CP_OPT(std::wstring) draw_fill_hatch_name_;
_CP_OPT(std::wstring) draw_opacity_name_;
_CP_OPT(bool) draw_fill_hatch_solid_;
_CP_OPT(Bool) draw_fill_hatch_solid_;
_CP_OPT(style_repeat) style_repeat_;
};
......@@ -318,7 +319,7 @@ public:
public:
std::wstring style_num_format_;
_CP_OPT(bool) style_num_letter_sync_;
_CP_OPT(Bool) style_num_letter_sync_;
};
......@@ -564,7 +565,7 @@ public:
_CP_OPT(std::wstring) table_end_cell_address_;
_CP_OPT(length) table_end_x_;
_CP_OPT(length) table_end_y_;
_CP_OPT(bool) table_table_background_;
_CP_OPT(Bool) table_table_background_;
common_text_anchor_attlist common_text_anchor_attlist_;
};
......@@ -638,8 +639,8 @@ public:
public:
_CP_OPT(std::wstring) presentation_class_;
_CP_OPT(bool) presentation_placeholder_;
_CP_OPT(bool) presentation_user_transformed_;
_CP_OPT(Bool) presentation_placeholder_;
_CP_OPT(Bool) presentation_user_transformed_;
};
......@@ -655,7 +656,7 @@ public:
_CP_OPT(std::wstring) number_language_;
_CP_OPT(std::wstring) number_country_;
_CP_OPT(std::wstring) number_title_;
_CP_OPT(bool) number_volatile_;
_CP_OPT(Bool) number_volatile_;
_CP_OPT(std::wstring) number_transliteration_format_;
_CP_OPT(std::wstring) number_transliteration_language_;
_CP_OPT(std::wstring) number_transliteration_country_;
......@@ -683,7 +684,7 @@ public:
public:
_CP_OPT(presentation_class) presentation_class_;
_CP_OPT(std::wstring) style_name_;
_CP_OPT(bool) presentation_placeholder_;
_CP_OPT(Bool) presentation_placeholder_;
};
......
......@@ -4,7 +4,7 @@
/* File created by MIDL compiler version 7.00.0555 */
/* at Tue Feb 18 20:02:30 2014
/* at Sat Mar 22 13:04:59 2014
*/
/* Compiler settings for .\ASCOfficeOdfFileW.idl:
Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555
......
......@@ -166,6 +166,14 @@
RelativePath="..\..\ASCOfficeOdfFile\src\odf\datatypes\backgroundcolor.h"
>
</File>
<File
RelativePath="..\..\ASCOfficeOdfFile\src\odf\datatypes\bool.cpp"
>
</File>
<File
RelativePath="..\..\ASCOfficeOdfFile\src\odf\datatypes\bool.h"
>
</File>
<File
RelativePath="..\..\ASCOfficeOdfFile\src\odf\datatypes\bordermodel.cpp"
>
......
......@@ -30,7 +30,7 @@ public:
common_padding_attlist common_padding_attlist_;
common_background_color_attlist common_background_color_attlist_;
common_shadow_attlist common_shadow_attlist_;
_CP_OPT(bool) style_dynamic_spacing_;
_CP_OPT(Bool) style_dynamic_spacing_;
};
......
......@@ -92,14 +92,15 @@ std::wstring odf_style_context::find_odf_style_name(int oox_id_style, const styl
}
return L"";
}
office_element_ptr odf_style_context::find_odf_style(int oox_id_style, const style_family family)
office_element_ptr odf_style_context::find_odf_style(int oox_id_style, const style_family family, bool root)
{
//for (std::list<odf_style_state>::iterator it = style_state_list_.begin(); it != style_state_list_.end(); it++)
for (int i=0;i<style_state_list_.size(); i++)
{
if (style_state_list_[i].odf_style_)
{
if (style_state_list_[i].style_family_ == family)
if (style_state_list_[i].style_family_ == family &&
style_state_list_[i].root_ == root)
{
if (oox_id_style >=0 && style_state_list_[i].style_oox_id_ == oox_id_style) return style_state_list_[i].get_office_element();
}
......@@ -108,14 +109,15 @@ office_element_ptr odf_style_context::find_odf_style(int oox_id_style, const sty
}
return office_element_ptr();
}
bool odf_style_context::find_odf_style_state(int oox_id_style, const style_family family, odf_style_state *& state)
bool odf_style_context::find_odf_style_state(int oox_id_style, const style_family family, odf_style_state *& state, bool root)
{
//for (std::list<odf_style_state>::iterator it = style_state_list_.begin(); it != style_state_list_.end(); it++)
for (int i=0;i<style_state_list_.size(); i++)
{
if (style_state_list_[i].odf_style_)
{
if (style_state_list_[i].style_family_ == family)
if (style_state_list_[i].style_family_ == family &&
style_state_list_[i].root_ == root)
{
if (oox_id_style >=0 && style_state_list_[i].style_oox_id_ == oox_id_style)
{
......@@ -133,13 +135,25 @@ office_element_ptr odf_style_context::find_odf_style_default(const style_family
//for (std::list<odf_style_state>::iterator it = default_styles_.begin(); it != default_styles_.end(); it++)
for (int i=0;i<default_styles_.size(); i++)
{
if (style_state_list_[i].odf_style_)
if (default_styles_[i].odf_style_)
{
if (style_state_list_[i].style_family_ == family)return default_styles_[i].get_office_element();
if (default_styles_[i].style_family_ == family)return default_styles_[i].get_office_element();
}
}
return office_element_ptr();
}
std::wstring odf_style_context::find_odf_style_name_default(const style_family family)
{
//for (std::list<odf_style_state>::iterator it = default_styles_.begin(); it != default_styles_.end(); it++)
for (int i=0;i<default_styles_.size(); i++)
{
if (default_styles_[i].odf_style_)
{
if (default_styles_[i].style_family_ == family)return default_styles_[i].get_name();
}
}
return L"";
}
std::wstring odf_style_context::get_name_family(const style_family & family)
{
switch(family.get_type())
......
......@@ -34,10 +34,12 @@ public:
void add_default(odf_style_state & state) {default_styles_.push_back(state);}
std::wstring find_odf_style_name (int oox_id_style, const style_family family);
office_element_ptr find_odf_style (int oox_id_style, const style_family family);
office_element_ptr find_odf_style (int oox_id_style, const style_family family, bool root = false);
std::wstring find_odf_style_name_default(const style_family family);
office_element_ptr find_odf_style_default (const style_family family);
bool find_odf_style_state(int oox_id_style, const style_family family, odf_style_state *& state);
bool find_odf_style_state(int oox_id_style, const style_family family, odf_style_state *& state, bool root = false);
//void start_cell(const std::wstring & formula,
......
......@@ -5,6 +5,9 @@
#include "office_spreadsheet.h"
#include "styles.h"
#include "style_table_properties.h"
namespace cpdoccore {
namespace odf {
......@@ -56,6 +59,14 @@ void ods_conversion_context::start_row(int _start_row, int repeated, bool _defau
{
styles_context().create_style(L"",style_family::TableRow, true, false, -1);
style_elm = styles_context().last_state().get_office_element();
style* _style = dynamic_cast<style*>(style_elm.get());
if (!_style)return;
style_table_row_properties * row_properties = _style->style_content_.get_style_table_row_properties();
if (row_properties == NULL)return; //error ????
row_properties->style_table_row_properties_attlist_.common_break_attlist_.fo_break_before_ = fo_break(fo_break::Auto);
}
office_element_ptr row_elm;
......@@ -151,6 +162,8 @@ void ods_conversion_context::start_cell(std::wstring & ref, int xfd_style)
office_element_ptr style_elm;
int number_format =0;
std::wstring style_cell_name;
if ( xfd_style >=0)
{
odf_style_state *style_state=NULL;
......@@ -159,16 +172,20 @@ void ods_conversion_context::start_cell(std::wstring & ref, int xfd_style)
{
style_elm = style_state->get_office_element();
number_format = style_state->get_number_format();
style_cell_name = style_state->get_name();
}
else
{//error
}
}
office_element_ptr cell_elm;
create_element(L"table", L"table-cell",cell_elm,this);
ods_table_context_.state().start_cell(cell_elm, style_elm);
current_table().start_cell(cell_elm, style_elm);
ods_table_context_.state().set_cell_ref(ref,col,row);
ods_table_context_.state().set_cell_format_value(number_format);
current_table().set_cell_ref(ref,col,row);
current_table().set_cell_format_value(number_format);
}
void ods_conversion_context::start_columns()
......@@ -176,8 +193,10 @@ void ods_conversion_context::start_columns()
}
void ods_conversion_context::end_columns()
{
//add default last column
add_column(ods_table_context_.state().columns_count()+1,1024,true);
//add default last column - (1024 - )
// - ???
if (ods_table_context_.state().columns_count() < 1024)
add_column(ods_table_context_.state().columns_count()+1,1024,true);
}
void ods_conversion_context::start_rows()
{
......@@ -203,14 +222,30 @@ void ods_conversion_context::add_column(int start_column, int repeated, bool _de
}
else
{
// .. - , .
// 2 ( , )
styles_context().create_style(L"",style_family::TableColumn, true, false, -1);
style_elm = styles_context().last_state().get_office_element();
style* _style = dynamic_cast<style*>(style_elm.get());
if (!_style)return;
style_table_column_properties * column_properties = _style->style_content_.get_style_table_column_properties();
if (column_properties == NULL)return; //error ????
column_properties->style_table_column_properties_attlist_.common_break_attlist_.fo_break_before_ = fo_break(fo_break::Auto);
}
office_element_ptr column_elm;
create_element(L"table", L"table-column",column_elm,this);
ods_table_context_.state().add_column(column_elm, repeated, style_elm);
current_table().add_column(column_elm, repeated, style_elm);
if (_default)
{
std::wstring style_cell_name= styles_context().find_odf_style_name_default(odf::style_family::TableCell);
current_table().set_column_default_cell_style(style_cell_name);
}
}
......
......@@ -24,23 +24,21 @@ void ods_table_context::start_table(office_element_ptr & elm, std::wstring & nam
{
table_state_list_.push_back( ods_table_state(context_, elm) );
state().set_name(name);
state().set_table_name(name);
std::wstring style_name_new = L"ta" + boost::lexical_cast<std::wstring>(table_state_list_.size());
office_element_ptr & style = context_.styles_context().add_or_find(style_name_new, style_family::Table, true);
style->create_child_element(L"style", L"table-properties");
state().set_table_style(style);
state().set_table_hidden(false);
// , - master-page c page layout
// , .. . ..
//todooo
//????
}
void ods_table_context::end_table()
......
......@@ -25,23 +25,35 @@ ods_table_state::ods_table_state(ods_conversion_context & Context, office_elemen
current_table_column_ =0;
}
void ods_table_state::set_name(std::wstring name)
void ods_table_state::set_table_name(std::wstring name)
{
table_table* table = dynamic_cast<table_table*>(office_table_.get());
if (table == NULL)return;
tableName_ = name;
table->table_table_attlist_.table_name_ = name;
}
void ods_table_state::convert()
void ods_table_state::set_table_hidden(bool Val)
{
if (office_table_ == NULL)return;
if (!office_table_style_)return;
style_table_properties *table_properties = office_table_style_->style_content_.get_style_table_properties();
if (table_properties == NULL)return;
//???
table_properties->table_format_properties_.table_display_ = !Val;
}
void ods_table_state::set_table_tab_color(_CP_OPT(color) & _color)
{
if (!office_table_style_)return;
style_table_properties *table_properties = office_table_style_->style_content_.get_style_table_properties();
if (table_properties == NULL)return;
table_properties->table_format_properties_.tableooo_tab_color_ = _color;
}
void ods_table_state::set_table_style(office_element_ptr & elm)
{
office_table_style_ = dynamic_cast<style*>(elm.get());
......@@ -79,6 +91,8 @@ void ods_table_state::add_column(office_element_ptr & elm, int repeated,office_e
}
void ods_table_state::set_column_default_cell_style(std::wstring & style_name)
{
if (style_name.length() < 1)return;
table_table_column* column = dynamic_cast<table_table_column*>(columns_.back().elm.get());
if (column == NULL)return;
......@@ -93,7 +107,7 @@ void ods_table_state::set_column_width(int width)//cm, pt ???
style_table_column_properties * column_properties = style->style_content_.get_style_table_column_properties();
if (column_properties == NULL)return; //error ????
column_properties->style_table_column_properties_attlist_.style_column_width_ = length(width/2.,length::cm);
column_properties->style_table_column_properties_attlist_.style_column_width_ = length(width/4.35,length::cm);
}
void ods_table_state::set_column_optimal_width(bool val)
{
......@@ -106,6 +120,7 @@ void ods_table_state::set_column_optimal_width(bool val)
column_properties->style_table_column_properties_attlist_.style_use_optimal_column_width_ = val;
}
unsigned int ods_table_state::columns_count() const
{
return columns_count_;
......@@ -132,6 +147,8 @@ void ods_table_state::add_row(office_element_ptr & elm, int repeated,office_elem
if (style_name.length()>0) row->table_table_row_attlist_.table_style_name_ = style_ref(style_name);
row->table_table_row_attlist_.table_number_rows_repeated_ = repeated;
row_default_cell_style_name_= L"";
}
void ods_table_state::set_row_hidden(bool Val)
{
......@@ -149,7 +166,6 @@ void ods_table_state::set_row_optimal_height(bool val)
if (row_properties == NULL)return; //error ????
row_properties->style_table_row_properties_attlist_.style_use_optimal_row_height_ = val;
}
void ods_table_state::set_row_height(double height)
......@@ -160,7 +176,8 @@ void ods_table_state::set_row_height(double height)
style_table_row_properties * row_properties = style->style_content_.get_style_table_row_properties();
if (row_properties == NULL)return; //error ????
row_properties->style_table_row_properties_attlist_.style_row_height_ = length(height,length::pt);
row_properties->style_table_row_properties_attlist_.style_row_height_ = length(height/4.85,length::cm);
}
int ods_table_state::current_column() const
{
......@@ -178,6 +195,7 @@ void ods_table_state::set_row_default_cell_style(std::wstring & style_name)
if (row == NULL)return;
row->table_table_row_attlist_.table_default_cell_style_name_ = style_ref(style_name);
row_default_cell_style_name_= style_name;
}
office_element_ptr & ods_table_state::current_row_element()
......@@ -230,15 +248,19 @@ void ods_table_state::start_cell(office_element_ptr & elm, office_element_ptr &
if (cell == NULL)return;
std::wstring style_name;
odf::style* style = dynamic_cast<odf::style*>(style_elm.get());
if (style)style_name = style->style_name_;
else style_name = row_default_cell_style_name_;
if (style) cell->table_table_cell_attlist_.table_style_name_= style_name;
if (style_name.length() > 0)
cell->table_table_cell_attlist_.table_style_name_= style_name;
ods_cell_state state;
state.elm = elm; state.repeated = 1; state.style_name = style_name; state.style_elm = style_elm;
state.row=0; state.col =0;
current_table_column_++;
cells_.push_back(state);
}
......@@ -361,8 +383,13 @@ void ods_table_state::add_default_cell(office_element_ptr & elm, int repeated)
table_table_cell* cell = dynamic_cast<table_table_cell*>(elm.get());
if (cell == NULL)return;
current_table_column_+=repeated;
cell->table_table_cell_attlist_.table_number_columns_repeated_ = repeated;
if (row_default_cell_style_name_.length() > 0)
cell->table_table_cell_attlist_.table_style_name_ = row_default_cell_style_name_;
}
}
}
......@@ -19,6 +19,7 @@ namespace odf {
class ods_conversion_context;
class table_table;
class style;
class color;
struct ods_element_state
{
......@@ -40,9 +41,10 @@ class ods_table_state
{
public:
ods_table_state(ods_conversion_context & Context, office_element_ptr & elm);
void set_name(std::wstring);
void set_table_style(office_element_ptr & style);
void set_table_name(std::wstring);
void set_table_style(office_element_ptr & _style);
void set_table_hidden(bool Val);
void set_table_tab_color(_CP_OPT(color) & _color);
void add_column(office_element_ptr & elm, int repeated ,office_element_ptr & style);
void set_column_width(int width);
......@@ -105,19 +107,17 @@ public:
// int level;
// bool collapsed;
//}group_row_;
void convert();
private:
ods_conversion_context & context_;
office_element_ptr office_table_;
style* office_table_style_;
office_element_ptr office_table_;
style* office_table_style_;//??? office_element_ptr ???
//std::wstring table_style_;
std::wstring tableName_;
//std::wstring tableName_;
// std::wstring table_row_style_;
// std::vector<std::wstring> column_default_cell_style_name_;
// std::wstring row_default_cell_style_name_;
std::wstring row_default_cell_style_name_;
// std::wstring cell_style_;
int current_table_column_;
int current_table_row_;
......
......@@ -28,29 +28,29 @@ public:
void serialize(std::wostream & strm, const wchar_t * ns, const wchar_t * name );
_CP_OPT(bool) chart_scale_text_;
_CP_OPT(bool) chart_three_dimensional_;
_CP_OPT(bool) chart_vertical_;
_CP_OPT(bool) chart_stacked_;
_CP_OPT(bool) chart_visible_;
_CP_OPT(bool) chart_logarithmic_;
_CP_OPT(bool) chart_percentage_;
_CP_OPT(bool) chart_connect_bars_;
_CP_OPT(bool) chart_deep_;
_CP_OPT(bool) chart_tick_marks_major_outer_;
_CP_OPT(bool) chart_tick_marks_minor_inner_;
_CP_OPT(bool) chart_tick_marks_minor_outer_;
_CP_OPT(bool) chart_lines_;
_CP_OPT(bool) chart_display_label_;
_CP_OPT(bool) chart_reverse_direction_;
_CP_OPT(bool) text_line_break_;
_CP_OPT(bool) chart_text_overlap_;
_CP_OPT(bool) chart_link_data_style_to_source_;
_CP_OPT(bool) chart_data_label_symbol_;
_CP_OPT(bool) chart_data_label_text_;
_CP_OPT(bool) chart_mean_value_;
_CP_OPT(bool) chart_error_upper_indicator_;
_CP_OPT(bool) chart_error_lower_indicator_;
_CP_OPT(Bool) chart_scale_text_;
_CP_OPT(Bool) chart_three_dimensional_;
_CP_OPT(Bool) chart_vertical_;
_CP_OPT(Bool) chart_stacked_;
_CP_OPT(Bool) chart_visible_;
_CP_OPT(Bool) chart_logarithmic_;
_CP_OPT(Bool) chart_percentage_;
_CP_OPT(Bool) chart_connect_bars_;
_CP_OPT(Bool) chart_deep_;
_CP_OPT(Bool) chart_tick_marks_major_outer_;
_CP_OPT(Bool) chart_tick_marks_minor_inner_;
_CP_OPT(Bool) chart_tick_marks_minor_outer_;
_CP_OPT(Bool) chart_lines_;
_CP_OPT(Bool) chart_display_label_;
_CP_OPT(Bool) chart_reverse_direction_;
_CP_OPT(Bool) text_line_break_;
_CP_OPT(Bool) chart_text_overlap_;
_CP_OPT(Bool) chart_link_data_style_to_source_;
_CP_OPT(Bool) chart_data_label_symbol_;
_CP_OPT(Bool) chart_data_label_text_;
_CP_OPT(Bool) chart_mean_value_;
_CP_OPT(Bool) chart_error_upper_indicator_;
_CP_OPT(Bool) chart_error_lower_indicator_;
_CP_OPT(chart_symbol_type) chart_symbol_type_;
_CP_OPT(chart_symbol_name) chart_symbol_name_;
......
......@@ -65,7 +65,7 @@ public:
common_margin_attlist common_margin_attlist_;
_CP_OPT(bool) style_print_content_;
_CP_OPT(Bool) style_print_content_;
_CP_OPT(std::wstring) style_protect_;
......@@ -91,7 +91,7 @@ public:
common_background_color_attlist common_background_color_attlist_;
_CP_OPT(bool) style_editable_;
_CP_OPT(Bool) style_editable_;
_CP_OPT(style_wrap) style_wrap_;
......@@ -99,13 +99,13 @@ public:
_CP_OPT(integer_or_nolimit) style_number_wrapped_paragraphs_;
_CP_OPT(bool) style_wrap_contour_;
_CP_OPT(Bool) style_wrap_contour_;
_CP_OPT(wrap_contour_mode) style_wrap_contour_mode_;
_CP_OPT(run_through) style_run_through_;
_CP_OPT(bool) style_flow_with_text_;
_CP_OPT(Bool) style_flow_with_text_;
_CP_OPT(std::wstring) style_overflow_behavior_;
......
......@@ -280,7 +280,7 @@ void paragraph_format_properties::apply_from(const paragraph_format_properties &
_CP_APPLY_PROP(style_writing_mode_automatic_, Other.style_writing_mode_automatic_);
_CP_APPLY_PROP(style_snap_to_layout_grid_, Other.style_snap_to_layout_grid_);
_CP_APPLY_PROP(style_page_number_, Other.style_page_number_);
_CP_APPLY_PROP(style_background_transparency_, Other.style_join_border_);
_CP_APPLY_PROP(style_background_transparency_, Other.style_background_transparency_);
_CP_APPLY_PROP(style_join_border_, Other.style_join_border_);
}
......
......@@ -179,7 +179,7 @@ public:
_CP_OPT(length) style_line_spacing_; // +
// 15.5.4 style:font-independent-line-spacing
_CP_OPT(bool) style_font_independent_line_spacing_; // ???
_CP_OPT(Bool) style_font_independent_line_spacing_; // ???
// 15.5.5 fo:text-align
_CP_OPT(text_align) fo_text_align_; // +
......@@ -188,7 +188,7 @@ public:
_CP_OPT(text_align) fo_text_align_last_;
// 15.5.7 style:justify-single-word
_CP_OPT(bool) style_justify_single_word_;
_CP_OPT(Bool) style_justify_single_word_;
// 15.5.8 fo:keep-together
_CP_OPT(keep_together) fo_keep_together_; // +
......@@ -215,7 +215,7 @@ public:
office_element_ptr style_drop_cap_;
// 15.5.16 style:register-true
_CP_OPT(bool) style_register_true_;
_CP_OPT(Bool) style_register_true_;
// 15.5.17 fo:margin-left
_CP_OPT(length_or_percent) fo_margin_left_; // +
......@@ -227,7 +227,7 @@ public:
_CP_OPT(length_or_percent) fo_text_indent_; // +
// 15.5.19 style:auto-text-indent
_CP_OPT(bool) style_auto_text_indent_; // ???
_CP_OPT(Bool) style_auto_text_indent_; // ???
// 15.5.20 fo:margin-top
_CP_OPT(length_or_percent) fo_margin_top_; // +
......@@ -301,7 +301,7 @@ public:
_CP_OPT(keep_together) fo_keep_with_next_; // +
// 15.5.30 text:number-lines
_CP_OPT(bool) text_number_lines_;
_CP_OPT(Bool) text_number_lines_;
// 15.5.31 text:line-number
_CP_OPT(unsigned int) text_line_number_;
......@@ -322,10 +322,10 @@ public:
_CP_OPT(writing_mode) style_writing_mode_;
// 15.5.37 style:writing-mode-automatic
_CP_OPT(bool) style_writing_mode_automatic_;
_CP_OPT(Bool) style_writing_mode_automatic_;
// 15.5.38 style:snap-to-layout-grid
_CP_OPT(bool) style_snap_to_layout_grid_;
_CP_OPT(Bool) style_snap_to_layout_grid_;
// 15.5.39 style:page-number
_CP_OPT(unsigned int) style_page_number_;
......@@ -334,7 +334,7 @@ public:
_CP_OPT(percent) style_background_transparency_;
//
_CP_OPT(bool) style_join_border_;
_CP_OPT(Bool) style_join_border_;
};
/// \class style_paragraph_properties
......
......@@ -31,13 +31,13 @@ void table_format_properties::serialize(std::wostream & _Wostream,const wchar_t
{
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR_OPT(L"style:width", style_width_);
CP_XML_ATTR_OPT(L"style:rel-width", style_rel_width_);
CP_XML_ATTR_OPT(L"table:align", table_align_);
CP_XML_ATTR_OPT(L"style:may-break-between-rows", style_may_break_between_rows_);
CP_XML_ATTR_OPT(L"table:border-model", table_border_model_);
CP_XML_ATTR_OPT(L"table:display", table_display_);
CP_XML_ATTR_OPT(L"tableooo:tab-color", tableooo_tab_color_);
common_writing_mode_attlist_.serialize(CP_GET_XML_NODE());
common_horizontal_margin_attlist_.serialize(CP_GET_XML_NODE());
......
......@@ -22,6 +22,7 @@
#include "direction.h"
#include "wrapoption.h"
#include "rotationalign.h"
#include "bool.h"
namespace cpdoccore {
namespace odf {
......@@ -32,13 +33,14 @@ public:
bool create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name, odf_conversion_context * Context);
void serialize(std::wostream & strm ,const wchar_t * ns, const wchar_t * name );
private:
_CP_OPT(length) style_width_;
_CP_OPT(percent) style_rel_width_;
_CP_OPT(bool) style_may_break_between_rows_;
_CP_OPT(border_model) table_border_model_;
_CP_OPT(bool) table_display_;
_CP_OPT(table_align) table_align_;
_CP_OPT(length) style_width_;
_CP_OPT(percent) style_rel_width_;
_CP_OPT(Bool) style_may_break_between_rows_;
_CP_OPT(border_model) table_border_model_;
_CP_OPT(Bool) table_display_;
_CP_OPT(table_align) table_align_;
_CP_OPT(color) tableooo_tab_color_;
common_horizontal_margin_attlist common_horizontal_margin_attlist_;
common_vertical_margin_attlist common_vertical_margin_attlist_;
......@@ -47,8 +49,8 @@ private:
common_break_attlist common_break_attlist_;
common_background_color_attlist common_background_color_attlist_;
common_shadow_attlist common_shadow_attlist_;
common_keep_with_next_attlist common_keep_with_next_attlist_;
common_writing_mode_attlist common_writing_mode_attlist_;
common_keep_with_next_attlist common_keep_with_next_attlist_;
common_writing_mode_attlist common_writing_mode_attlist_;
office_element_ptr style_background_image_;
......@@ -85,7 +87,7 @@ public:
_CP_OPT(length) style_column_width_;
_CP_OPT(length) style_rel_column_width_;
_CP_OPT(bool) style_use_optimal_column_width_;
_CP_OPT(Bool) style_use_optimal_column_width_;
common_break_attlist common_break_attlist_;
......@@ -120,7 +122,7 @@ public:
_CP_OPT(length) style_row_height_;
_CP_OPT(length) style_min_row_height_;
_CP_OPT(bool) style_use_optimal_row_height_;
_CP_OPT(Bool) style_use_optimal_row_height_;
_CP_OPT(keep_together) fo_keep_together_;
common_background_color_attlist common_background_color_attlist_;
......@@ -182,10 +184,10 @@ public:
_CP_OPT(wrap_option) fo_wrap_option_;
_CP_OPT(rotation_align) style_rotation_align_;
_CP_OPT(std::wstring) style_cell_protect_;
_CP_OPT(bool) style_print_content_;
_CP_OPT(Bool) style_print_content_;
_CP_OPT(unsigned int) style_decimal_places_;
_CP_OPT(bool) style_repeat_content_;
_CP_OPT(bool) style_shrink_to_fit_;
_CP_OPT(Bool) style_repeat_content_;
_CP_OPT(Bool) style_shrink_to_fit_;
};
......
......@@ -9,6 +9,7 @@
#include "office_elements.h"
#include "office_elements_create.h"
#include "bool.h"
#include "style_ref.h"
#include "fontvariant.h"
#include "texttransform.h"
......@@ -66,10 +67,10 @@ public:
_CP_OPT(color) fo_color_; // +
// 15.4.4 style:use-window-font-color
_CP_OPT(bool) style_use_window_font_color_;
_CP_OPT(Bool) style_use_window_font_color_;
// 15.4.5 style:text-outline
_CP_OPT(bool) style_text_outline_; // +
_CP_OPT(Bool) style_text_outline_; // +
// 15.4.6 style:text-line-through-type
_CP_OPT(line_type) style_text_line_through_type_; // +
......@@ -207,10 +208,10 @@ public:
_CP_OPT(line_mode) style_text_line_through_mode_;
// 15.4.35 style:letter-kerning
_CP_OPT(bool) style_letter_kerning_;
_CP_OPT(Bool) style_letter_kerning_;
// 15.4.36 style:text-blinking
_CP_OPT(bool) style_text_blinking_;
_CP_OPT(Bool) style_text_blinking_;
// 15.4.37 fo:background-color
_CP_OPT(background_color) fo_background_color_;
......@@ -237,7 +238,7 @@ public:
_CP_OPT(text_rotation_scale) style_text_rotation_scale_;
// 15.4.44 fo:hyphenate
_CP_OPT(bool) fo_hyphenate_;
_CP_OPT(Bool) fo_hyphenate_;
// 15.4.45 fo:hyphenation-remain-char-count
_CP_OPT(unsigned int) fo_hyphenation_remain_char_count_;
......
......@@ -267,18 +267,18 @@ public:
virtual void serialize(std::wostream & strm);
// attr
std::wstring style_name_;
_CP_OPT( std::wstring ) style_display_name_; // optional
style_family style_family_;
std::wstring style_name_;
_CP_OPT( std::wstring ) style_display_name_;
style_family style_family_;
_CP_OPT( std::wstring ) style_parent_style_name_; // optional
_CP_OPT( std::wstring ) style_next_style_name_; // optional
_CP_OPT( std::wstring ) style_list_style_name_; // optional, may be empty
_CP_OPT( std::wstring ) style_master_page_name_; // optional
_CP_OPT( bool) style_auto_update_; // optional, default = false
_CP_OPT( std::wstring ) style_data_style_name_; // // optional
_CP_OPT( std::wstring ) style_class_; // optional
_CP_OPT(std::wstring) style_default_outline_level_; // optional
_CP_OPT( std::wstring ) style_parent_style_name_;
_CP_OPT( std::wstring ) style_next_style_name_;
_CP_OPT( std::wstring ) style_list_style_name_; // may be empty
_CP_OPT( std::wstring ) style_master_page_name_;
_CP_OPT( bool) style_auto_update_; // default = false
_CP_OPT( std::wstring ) style_data_style_name_;
_CP_OPT( std::wstring ) style_class_;
_CP_OPT(std::wstring) style_default_outline_level_;
style_content style_content_;
......@@ -727,7 +727,7 @@ public:
bool style_protect_; // default false
_CP_OPT(bool) text_dont_balance_text_columns_;
_CP_OPT(Bool) text_dont_balance_text_columns_;
common_writing_mode_attlist common_writing_mode_attlist_;
......@@ -879,13 +879,13 @@ public:
_CP_OPT(color) style_layout_grid_color_;
// 15.2.26
_CP_OPT(bool) style_layout_grid_ruby_below_;
_CP_OPT(Bool) style_layout_grid_ruby_below_;
// 15.2.27
_CP_OPT(bool) style_layout_grid_print_;
_CP_OPT(Bool) style_layout_grid_print_;
// 15.2.28
_CP_OPT(bool) style_layout_grid_display_;
_CP_OPT(Bool) style_layout_grid_display_;
};
......
......@@ -30,14 +30,20 @@ void table_table_attlist::serialize(CP_ATTR_NODE)
}
void table_table_row_attlist::serialize(CP_ATTR_NODE)
{
CP_XML_ATTR(L"table:number-rows-repeated", table_number_rows_repeated_);
if (table_number_rows_repeated_ > 1)
{
CP_XML_ATTR(L"table:number-rows-repeated", table_number_rows_repeated_);
}
CP_XML_ATTR_OPT(L"table:style-name", table_style_name_);
CP_XML_ATTR_OPT(L"table:default-cell-style-name", table_default_cell_style_name_);
CP_XML_ATTR_OPT(L"table:visibility", table_visibility_);
}
void table_table_cell_attlist::serialize(CP_ATTR_NODE)
{
CP_XML_ATTR(L"table:number-columns-repeated", table_number_columns_repeated_);
if (table_number_columns_repeated_ > 1)
{
CP_XML_ATTR(L"table:number-columns-repeated", table_number_columns_repeated_);
}
CP_XML_ATTR_OPT(L"table:style-name", table_style_name_);
CP_XML_ATTR_OPT(L"table:content-validation-name", table_content_validation_name_);
CP_XML_ATTR_OPT(L"table:formula", table_formula_);
......@@ -71,7 +77,10 @@ void table_linked_source_attlist::serialize(CP_ATTR_NODE)
}
void table_table_column_attlist::serialize(CP_ATTR_NODE)
{
CP_XML_ATTR(L"table:number-columns-repeated", table_number_columns_repeated_);
if (table_number_columns_repeated_ > 1)
{
CP_XML_ATTR(L"table:number-columns-repeated", table_number_columns_repeated_);
}
CP_XML_ATTR_OPT(L"table:style-name", table_style_name_);
CP_XML_ATTR_OPT(L"table:visibility", table_visibility_);
CP_XML_ATTR_OPT(L"table:default-cell-style-name", table_default_cell_style_name_);
......
......@@ -38,7 +38,7 @@ public:
_CP_OPT(std::wstring) table_protection_key_;
_CP_OPT(std::wstring) table_print_ranges_;
_CP_OPT(bool) table_protected_; // default false
_CP_OPT(Bool) table_protected_; // default false
bool table_print_; // default true
bool table_use_first_row_styles_; // default false;
......@@ -58,7 +58,8 @@ public:
table_table_row_attlist() : table_number_rows_repeated_(1){}
unsigned int table_number_rows_repeated_; // default 1
_CP_OPT(style_ref) table_style_name_;
_CP_OPT(style_ref) table_style_name_;
_CP_OPT(style_ref) table_default_cell_style_name_;
_CP_OPT(table_visibility) table_visibility_; // default Visible
......@@ -78,7 +79,7 @@ public:
_CP_OPT(common_value_and_type_attlist) common_value_and_type_attlist_;
_CP_OPT(bool) table_protect_; // default false
_CP_OPT(Bool) table_protect_; // default false
void serialize(CP_ATTR_NODE);
};
......
......@@ -58,8 +58,8 @@ namespace Oox2Odf
void convert(OOX::Spreadsheet::CRow *oox_row);
void convert(OOX::Spreadsheet::CCell *oox_cell);
void convert(OOX::Spreadsheet::CSheetFormatPr *oox_sheet_format);
//void convert(OOX::Spreadsheet::CSheetPr *oox_sheet_format);
void convert(OOX::Spreadsheet::CSheetFormatPr *oox_sheet_format_pr);
void convert(OOX::Spreadsheet::CSheetPr *oox_sheet_pr);
void convert(OOX::Spreadsheet::CFill * fill, odf::office_element_ptr & odf_style_);
void convert(OOX::Spreadsheet::CFont * font, odf::office_element_ptr & odf_style_);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment