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

стили таблиц, объединеные и разделенные ячейки

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@53227 954022d7-b5bf-4e40-9824-e11837661b57
parent 95479c2c
......@@ -80,19 +80,6 @@ void styles_context::docx_serialize_text_style(std::wostream & strm)
}
}
}
void styles_context::pptx_serialize_table_style(std::wostream & strm)
{
if (!table_style_.str().empty())
{
CP_XML_WRITER(strm)
{
CP_XML_NODE(L"a:tblPr")
{
CP_XML_STREAM() << table_style_.str();
}
}
}
}
void styles_context::docx_serialize_table_style(std::wostream & strm)
{
......
......@@ -86,22 +86,16 @@ bool pptx_table_state::start_covered_cell(pptx_conversion_context & Context)
if (columns_spanned_num_ == 0 && rows_spanned_[current_table_column_].num() > 0)
{
closeTag = true;
_Wostream << L"<w:tc>";
_Wostream << L"<w:tcPr>";
_Wostream << L"<w:vMerge w:val=\"continue\" />";
//_Wostream << L"<w:tcW w:w=\"0\" w:type=\"auto\" />";
_Wostream << L"<a:tc vMerge=\"1\"";
if (rows_spanned_[current_table_column_].column_spanned() > 0)
_Wostream << L"<w:gridSpan w:val=\"" << rows_spanned_[current_table_column_].column_spanned() + 1 << "\" />";
if (rows_spanned_[current_table_column_].column_spanned() > 0)
_Wostream << L" gridSpan=\"" << rows_spanned_[current_table_column_].column_spanned() + 1 << "\"";
_Wostream << L">";
odf::style_instance * inst =
context_.root()->odf_context().styleContainer().style_by_name(
rows_spanned_[current_table_column_].style() , odf::style_family::TableCell,false);
if (inst && inst->content())
inst->content()->pptx_convert(context_);
_Wostream << L"</w:tcPr>";
}
// ,
......@@ -123,8 +117,9 @@ void pptx_table_state::end_covered_cell()
std::wostream & _Wostream = context_.get_table_context().tableData();
if (close_table_covered_cell_)
{
_Wostream << L"<a:tcPr/>";
//
_Wostream << L"</w:tc>";
_Wostream << L"</a:tc>";
close_table_covered_cell_ = false;
}
}
......@@ -138,9 +133,7 @@ void pptx_table_state::set_columns_spanned(unsigned int Val)
{
if ( current_columns_spaned() > 0 )
{
#ifdef _DEBUG
_CP_LOG(info) << L"[warning] set_columns_spanned warning\n";
#endif
}
columns_spanned_num_ = Val;
......@@ -159,10 +152,6 @@ void pptx_table_state::set_rows_spanned(unsigned int Column, unsigned int Val, u
}
else
{
if (rows_spanned_[Column].num() > 0)
{
_CP_LOG(info) << L"[warning] set_rows_spanned warning\n";
}
rows_spanned_[Column].num(Val);
rows_spanned_[Column].set_style(Style);
rows_spanned_[Column].column_spanned(ColumnsSpanned);
......@@ -182,7 +171,6 @@ unsigned int pptx_table_state::current_rows_spanned(unsigned int Column) const
}
}
/**/
}
}
......@@ -148,7 +148,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
const graphic_format_properties & content() const { return graphic_format_properties_; }
const graphic_format_properties & content() const { return graphic_format_properties_; }
private:
......
......@@ -32,7 +32,6 @@ public:
bool add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name, document_context * Context);
void docx_convert(oox::docx_conversion_context & Context);
void pptx_convert(oox::pptx_conversion_context & Context);
private:
// 15.8.1 style:width
......@@ -110,7 +109,6 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
virtual void docx_convert(oox::docx_conversion_context & Context) ;
virtual void pptx_convert(oox::pptx_conversion_context & Context) ;
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
......@@ -198,7 +196,6 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
virtual void docx_convert(oox::docx_conversion_context & Context) ;
virtual void pptx_convert(oox::pptx_conversion_context & Context) ;
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
......@@ -219,7 +216,7 @@ public:
void add_attributes( const xml::attributes_wc_ptr & Attributes );
void docx_convert(oox::docx_conversion_context & Context);
void pptx_convert(oox::pptx_conversion_context & Context);
void pptx_serialize(oox::pptx_conversion_context & Context, std::wostream & strm);
void apply_from(const style_table_cell_properties_attlist & Other);
......@@ -316,7 +313,6 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
virtual void docx_convert(oox::docx_conversion_context & Context) ;
virtual void pptx_convert(oox::pptx_conversion_context & Context) ;
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
......
......@@ -42,6 +42,10 @@ style_graphic_properties * style_content::get_style_graphic_properties() const
{
return dynamic_cast<style_graphic_properties *>(style_graphic_properties_.get());
}
style_table_properties * style_content::get_style_table_properties() const
{
return dynamic_cast<style_table_properties *>(style_table_properties_.get());
}
style_section_properties * style_content::get_style_section_properties() const
{
......@@ -129,30 +133,30 @@ void style_content::docx_convert(oox::docx_conversion_context & Context)
Context.end_process_style_content();
}
void style_content::pptx_convert(oox::pptx_conversion_context & Context)
{
Context.get_text_context().get_styles_context().start();
if (style_text_properties_)
style_text_properties_->pptx_convert(Context);
if (style_paragraph_properties_)
style_paragraph_properties_->pptx_convert(Context);
if (style_table_properties_)
style_table_properties_->pptx_convert(Context);
if (style_table_column_properties_)
style_table_column_properties_->pptx_convert(Context);
if (style_table_row_properties_)
style_table_row_properties_->pptx_convert(Context);
if (style_table_cell_properties_)
style_table_cell_properties_->pptx_convert(Context);
//Context.get_text_context().get_styles_context().end();
}
//void style_content::pptx_convert(oox::pptx_conversion_context & Context)
//{
// Context.get_text_context().get_styles_context().start();
//
// if (style_text_properties_)
// style_text_properties_->pptx_convert(Context);
//
// if (style_paragraph_properties_)
// style_paragraph_properties_->pptx_convert(Context);
//
// if (style_table_properties_)
// style_table_properties_->pptx_convert(Context);
//
// if (style_table_column_properties_)
// style_table_column_properties_->pptx_convert(Context);
//
// if (style_table_row_properties_)
// style_table_row_properties_->pptx_convert(Context);
//
// if (style_table_cell_properties_)
// style_table_cell_properties_->pptx_convert(Context);
//
// //Context.get_text_context().get_styles_context().end();
//}
void style_content::add_child_element( xml::sax * Reader, const ::std::wstring & Ns, const ::std::wstring & Name, document_context * Context)
{
......
......@@ -48,6 +48,7 @@ class style_table_cell_properties;
class style_table_row_properties;
class style_table_column_properties;
class style_chart_properties;
class style_table_properties;
class style_content : noncopyable
{
......@@ -56,11 +57,12 @@ public:
void docx_convert(oox::docx_conversion_context & Context);
void xlsx_convert(oox::xlsx_conversion_context & Context);
void pptx_convert(oox::pptx_conversion_context & Context);
//void pptx_convert(oox::pptx_conversion_context & Context);
style_text_properties * get_style_text_properties() const;
style_paragraph_properties * get_style_paragraph_properties() const;
style_graphic_properties * get_style_graphic_properties() const;
style_table_properties * get_style_table_properties() const;
style_section_properties * get_style_section_properties() const;
style_table_cell_properties * get_style_table_cell_properties() const;
style_table_row_properties * get_style_table_row_properties() const;
......
......@@ -26,6 +26,12 @@ void table_table_attlist::add_attributes( const xml::attributes_wc_ptr & Attribu
CP_APPLY_ATTR(L"table:protection-key", table_protection_key_);
CP_APPLY_ATTR(L"table:print", table_print_, true);
CP_APPLY_ATTR(L"table:print-ranges", table_print_ranges_);
CP_APPLY_ATTR(L"table:use-first-row-styles", table_use_first_row_styles_,false);
CP_APPLY_ATTR(L"table:use-banding-rows-styles", table_use_banding_rows_styles_,false);
CP_APPLY_ATTR(L"table:use-banding-columns-styles", table_use_banding_columns_styles_,false);
CP_APPLY_ATTR(L"table:use-first-column-styles", table_use_first_column_styles_,false);
}
// table-table-row-attlist
......
......@@ -29,6 +29,11 @@ public:
bool table_print_; // default true
_CP_OPT(std::wstring) table_print_ranges_;
bool table_use_first_row_styles_; // default false;
bool table_use_banding_rows_styles_; //defualt false;
bool table_use_first_column_styles_;//defualt false;
bool table_use_banding_columns_styles_; //defualt false;
friend class table_table;
};
......
This diff is collapsed.
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