Commit 253a3069 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@55011 954022d7-b5bf-4e40-9824-e11837661b57
parent 92e97d24
......@@ -19,7 +19,7 @@ void ods_conversion_context::start_document()
{
create_element(L"office", L"spreadsheet", content_, this,true);
current_spreadsheet_ = (office_spreadsheet*)dynamic_cast<office_spreadsheet*>(content_.back().get());
current_spreadsheet_ = dynamic_cast<office_spreadsheet*>(content_.back().get());
}
......@@ -36,8 +36,18 @@ void ods_conversion_context::end_sheet()
ods_table_context_.end_table();
}
void ods_conversion_context::add_column(int repeated, const std::wstring & style_name)
void ods_conversion_context::add_column(int start_column, int repeated, const std::wstring & style_name)
{
if (start_column > ods_table_context_.state().columns_count())
{
//default_columns
int repeated_default = start_column - ods_table_context_.state().columns_count();
office_element_ptr element_column_default;
create_element(L"table", L"table-column",element_column_default,this);
ods_table_context_.add_column(element_column_default,repeated_default,L"");
}
office_element_ptr element_column;
create_element(L"table", L"table-column",element_column,this);
......
......@@ -18,7 +18,7 @@ public:
void start_sheet(std::wstring & name);
void end_sheet();
void add_column(int repeated, const std::wstring & StyleName);
void add_column(int start_column, int repeated, const std::wstring & StyleName);
ods_table_context ods_table_context_;
......
......@@ -17,7 +17,7 @@ ods_table_state::ods_table_state(ods_conversion_context & Context, office_elemen
void ods_table_state::set_name(std::wstring name)
{
table_table* table = (table_table*)dynamic_cast<table_table*>(office_table_.get());
table_table* table = dynamic_cast<table_table*>(office_table_.get());
if (table == NULL)return;
tableName_ = name;
......@@ -34,11 +34,11 @@ void ods_table_state::convert()
void ods_table_state::set_table_style(office_element_ptr & elm)
{
office_table_style_ = (style*)dynamic_cast<style*>(elm.get());
office_table_style_ = dynamic_cast<style*>(elm.get());
if (!office_table_style_)return;
table_table* table = (table_table*)dynamic_cast<table_table*>(office_table_.get());
table_table* table = dynamic_cast<table_table*>(office_table_.get());
if (table == NULL)return;
table->table_table_attlist_.table_style_name_ = office_table_style_->style_name_;
......@@ -46,13 +46,22 @@ void ods_table_state::set_table_style(office_element_ptr & elm)
}
void ods_table_state::add_column(office_element_ptr & elm, int repeated, const std::wstring & StyleName)
void ods_table_state::add_column(office_element_ptr & elm, int repeated, const std::wstring & style_name)
{
office_table_->add_child_element(elm);
ods_column_state state = {elm, repeated,StyleName};
ods_column_state state = {elm, repeated,style_name};
columns_count_ += repeated;
columns_.push_back(state);
///
table_table_column* column = dynamic_cast<table_table_column*>(columns_.back().elm.get());
if (column == NULL)return;
column->table_table_column_attlist_.table_style_name_ = style_ref(style_name);
column->table_table_column_attlist_.table_number_columns_repeated_ = repeated;
}
unsigned int ods_table_state::columns_count() const
......
......@@ -288,7 +288,7 @@ void style::serialize(std::wostream & strm)
CP_XML_ATTR_OPT(L"style:parent-style-name", style_parent_style_name_);
CP_XML_ATTR_OPT(L"style:next-style-name", style_next_style_name_);
CP_XML_ATTR_OPT(L"style:list-style-name", style_list_style_name_);
CP_XML_ATTR(L"style:auto-update", style_auto_update_);
CP_XML_ATTR_OPT(L"style:auto-update", style_auto_update_);
CP_XML_ATTR_OPT(L"style:data-style-name", style_data_style_name_);
CP_XML_ATTR_OPT(L"style:class", style_class_);
CP_XML_ATTR_OPT(L"style:master-page-name", style_master_page_name_);
......
......@@ -259,7 +259,7 @@ public:
static const ElementType type = typeStyleStyle;
CPDOCCORE_DEFINE_VISITABLE();
style() : style_auto_update_(false), style_content_(getContext()) {}
style() : style_content_(getContext()) {}
virtual void create_child_element( const ::std::wstring & Ns, const ::std::wstring & Name);
virtual void add_child_element(office_element_ptr & child);
......@@ -275,10 +275,10 @@ public:
_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
bool style_auto_update_; // optional, default = false
_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_default_outline_level_; // optional
style_content style_content_;
......
This diff is collapsed.
......@@ -113,8 +113,9 @@ void XlsxConverter::convert(OOX::Spreadsheet::CCol *oox_column)
//nullable<SimpleTypes::COnOff<>> m_oPhonetic;
//nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oStyle;
//nullable<SimpleTypes::CDouble> m_oWidth;
int start_column = oox_column->m_oMin.IsInit() ? oox_column->m_oMin->GetValue() : 0 ;
int repeated = (oox_column->m_oMax.IsInit() ? oox_column->m_oMax->GetValue() : 0) -
(oox_column->m_oMin.IsInit() ? oox_column->m_oMin->GetValue() : 0);
(oox_column->m_oMin.IsInit() ? oox_column->m_oMin->GetValue() : 0) + 1;
int oox_style_id = -1;
......@@ -140,7 +141,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CCol *oox_column)
column_properties->style_table_column_properties_attlist_.style_column_width_ = odf::length(width,odf::length::cm);
// !!!
}
ods_context->add_column(repeated, style->style_name_);
ods_context->add_column(start_column, repeated, style->style_name_);
}
void XlsxConverter::convert_styles()
......
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