Commit 26783d51 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@54805 954022d7-b5bf-4e40-9824-e11837661b57
parent f326ac41
...@@ -29,6 +29,9 @@ void header_footer_content::add_child_element(const ::std::wstring & Ns, const : ...@@ -29,6 +29,9 @@ void header_footer_content::add_child_element(const ::std::wstring & Ns, const :
{ {
CP_CREATE_ELEMENT_SIMPLE(content_); CP_CREATE_ELEMENT_SIMPLE(content_);
} }
void header_footer_content::add_child_element(office_element_ptr & child)
{
content_.push_back(child);
}
} }
} }
...@@ -70,8 +70,7 @@ class header_footer_content ...@@ -70,8 +70,7 @@ class header_footer_content
{ {
public: public:
void add_child_element( const ::std::wstring & Ns, const ::std::wstring & Name, odf_conversion_context * Context); void add_child_element( const ::std::wstring & Ns, const ::std::wstring & Name, odf_conversion_context * Context);
virtual void add_child_element(office_element_ptr & child, odf_conversion_context * Context) void add_child_element(office_element_ptr & child);
{}
office_element_ptr_array content_; office_element_ptr_array content_;
......
...@@ -28,6 +28,11 @@ office_element_ptr & odf_style_state::get_office_element() ...@@ -28,6 +28,11 @@ office_element_ptr & odf_style_state::get_office_element()
return odf_style_; return odf_style_;
} }
void odf_style_state::add_child(office_element_ptr & child)
{
odf_style_->add_child_element(child);
}
void odf_style_state::set_name(std::wstring name) void odf_style_state::set_name(std::wstring name)
{ {
style* style_ = dynamic_cast<style*>(odf_style_.get()); style* style_ = dynamic_cast<style*>(odf_style_.get());
......
...@@ -37,6 +37,10 @@ public: ...@@ -37,6 +37,10 @@ public:
office_element_ptr & get_office_element(); office_element_ptr & get_office_element();
void add_child(office_element_ptr & child);
void set_oox_id(int id){style_oox_id_ = id;}
private: private:
int style_oox_id_; int style_oox_id_;
......
...@@ -529,7 +529,7 @@ void style_header::add_child_element( const ::std::wstring & Ns, const ::std::w ...@@ -529,7 +529,7 @@ void style_header::add_child_element( const ::std::wstring & Ns, const ::std::w
} }
void style_header::add_child_element(office_element_ptr & child) void style_header::add_child_element(office_element_ptr & child)
{ {
content().header_footer_content_.add_child_element( child, getContext()); content().header_footer_content_.add_child_element( child);
} }
////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * style_footer::ns = L"style"; const wchar_t * style_footer::ns = L"style";
...@@ -542,7 +542,7 @@ void style_footer::add_child_element( const ::std::wstring & Ns, const ::std::w ...@@ -542,7 +542,7 @@ void style_footer::add_child_element( const ::std::wstring & Ns, const ::std::w
} }
void style_footer::add_child_element(office_element_ptr & child) void style_footer::add_child_element(office_element_ptr & child)
{ {
content().header_footer_content_.add_child_element( child, getContext()); content().header_footer_content_.add_child_element( child);
} }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * style_header_first::ns = L"style"; const wchar_t * style_header_first::ns = L"style";
...@@ -554,7 +554,7 @@ void style_header_first::add_child_element(const ::std::wstring & Ns, const ::st ...@@ -554,7 +554,7 @@ void style_header_first::add_child_element(const ::std::wstring & Ns, const ::st
} }
void style_header_first::add_child_element(office_element_ptr & child) void style_header_first::add_child_element(office_element_ptr & child)
{ {
content().header_footer_content_.add_child_element(child, getContext()); content().header_footer_content_.add_child_element(child);
} }
////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////
...@@ -568,7 +568,7 @@ void style_footer_first::add_child_element( const ::std::wstring & Ns, const ::s ...@@ -568,7 +568,7 @@ void style_footer_first::add_child_element( const ::std::wstring & Ns, const ::s
} }
void style_footer_first::add_child_element( office_element_ptr & child) void style_footer_first::add_child_element( office_element_ptr & child)
{ {
content().header_footer_content_.add_child_element( child, getContext()); content().header_footer_content_.add_child_element( child);
} }
////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * style_header_left::ns = L"style"; const wchar_t * style_header_left::ns = L"style";
...@@ -581,7 +581,7 @@ void style_header_left::add_child_element(const ::std::wstring & Ns, const ::std ...@@ -581,7 +581,7 @@ void style_header_left::add_child_element(const ::std::wstring & Ns, const ::std
} }
void style_header_left::add_child_element(office_element_ptr & child) void style_header_left::add_child_element(office_element_ptr & child)
{ {
content().header_footer_content_.add_child_element( child, getContext()); content().header_footer_content_.add_child_element( child);
} }
////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * style_footer_left::ns = L"style"; const wchar_t * style_footer_left::ns = L"style";
...@@ -591,6 +591,10 @@ void style_footer_left::add_child_element( const ::std::wstring & Ns, const ::s ...@@ -591,6 +591,10 @@ void style_footer_left::add_child_element( const ::std::wstring & Ns, const ::s
{ {
content().header_footer_content_.add_child_element( Ns, Name, getContext()); content().header_footer_content_.add_child_element( Ns, Name, getContext());
} }
void style_footer_left::add_child_element(office_element_ptr & child)
{
content().header_footer_content_.add_child_element(child);
}
/// style:columns /// style:columns
////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////
...@@ -788,7 +792,6 @@ void style_footnote_sep::add_child_element( const ::std::wstring & Ns, const ::s ...@@ -788,7 +792,6 @@ void style_footnote_sep::add_child_element( const ::std::wstring & Ns, const ::s
const wchar_t * style_page_layout_properties::ns = L"style"; const wchar_t * style_page_layout_properties::ns = L"style";
const wchar_t * style_page_layout_properties::name = L"page-layout-properties"; const wchar_t * style_page_layout_properties::name = L"page-layout-properties";
void style_page_layout_properties::add_child_element( const ::std::wstring & Ns, const ::std::wstring & Name) void style_page_layout_properties::add_child_element( const ::std::wstring & Ns, const ::std::wstring & Name)
{ {
style_page_layout_properties_elements_.add_child_element( Ns, Name, getContext()); style_page_layout_properties_elements_.add_child_element( Ns, Name, getContext());
...@@ -800,7 +803,25 @@ void style_page_layout_properties::add_child_element( office_element_ptr & child ...@@ -800,7 +803,25 @@ void style_page_layout_properties::add_child_element( office_element_ptr & child
} }
// style-page-layout-properties-elements // style-page-layout-properties-elements
////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////
void style_page_layout_properties_elements::add_child_element( const ::std::wstring & Ns, const ::std::wstring & Name, odf_conversion_context * Context )
{
if (L"style" == Ns && L"background-image" == Name)
{
CP_CREATE_ELEMENT_SIMPLE(style_background_image_);
}
else if (L"style" == Ns && L"columns" == Name)
{
CP_CREATE_ELEMENT_SIMPLE(style_columns_);
}
else if (L"style" == Ns && L"footnote-sep" == Name)
{
CP_CREATE_ELEMENT_SIMPLE(style_footnote_sep_);
}
else
{
not_applicable_element(L"style-page-layout-properties-elements", Ns, Name);
}
}
void style_page_layout_properties_elements::add_child_element( office_element_ptr & child ) void style_page_layout_properties_elements::add_child_element( office_element_ptr & child )
{ {
if (!child)return; if (!child)return;
......
...@@ -100,6 +100,22 @@ void XlsxConverter::convert_styles() ...@@ -100,6 +100,22 @@ void XlsxConverter::convert_styles()
{ {
ods_context->styles_context().start_style(L"" ,odf::style_family::TableCell,true); // - () - oox ods_context->styles_context().start_style(L"" ,odf::style_family::TableCell,true); // - () - oox
ods_context->styles_context().state().set_oox_id (xlsx_styles->m_oCellXfs->m_arrItems[i]->m_oXfId->GetValue() );
int fill_id = xlsx_styles->m_oCellXfs->m_arrItems[i]->m_oFillId->GetValue();
int numFmt_id = xlsx_styles->m_oCellXfs->m_arrItems[i]->m_oNumFmtId->GetValue();
int font_id = xlsx_styles->m_oCellXfs->m_arrItems[i]->m_oFontId->GetValue();
int border_id = xlsx_styles->m_oCellXfs->m_arrItems[i]->m_oBorderId->GetValue();
odf::office_element_ptr element_font = convert(xlsx_styles->m_oFonts->m_arrItems[font_id]); //text_properties
ods_context->styles_context().state().add_child(element_font);
//xlsx_styles->m_oFills->m_arrItems[fill_id];
//xlsx_styles->m_oNumFmts->m_arrItems[numFmt_id];
//xlsx_styles->m_oBorders->m_arrItems[border_id];
// //
// //find_fill_by_id (xlsx_styles->m_oCellXfs->m_arrItems[i]->m_oFillId); // graphic_properies // //find_fill_by_id (xlsx_styles->m_oCellXfs->m_arrItems[i]->m_oFillId); // graphic_properies
// //find_num_format_by_id (xlsx_styles->m_oCellXfs->m_arrItems[i]->m_oNumFmtId); // // //find_num_format_by_id (xlsx_styles->m_oCellXfs->m_arrItems[i]->m_oNumFmtId); //
...@@ -134,6 +150,10 @@ void XlsxConverter::convert_styles() ...@@ -134,6 +150,10 @@ void XlsxConverter::convert_styles()
} }
odf::office_element_ptr & XlsxConverter::convert(OOX::Spreadsheet::CFont * font)
{
odf::office_element_ptr element;
return element;
}
} // namespace Docx2Odt } // namespace Docx2Odt
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#include "Converter.h" #include "Converter.h"
#include <boost/foreach.hpp> #include <boost/foreach.hpp>
#include <cpdoccore/CPSharedPtr.h>
#include <XlsxFormat\Xlsx.h> #include <XlsxFormat\Xlsx.h>
namespace OOX namespace OOX
...@@ -13,6 +13,9 @@ namespace cpdoccore ...@@ -13,6 +13,9 @@ namespace cpdoccore
{ {
namespace odf namespace odf
{ {
class office_element;
typedef shared_ptr<office_element>::Type office_element_ptr;
namespace package namespace package
{ {
class odf_document; class odf_document;
...@@ -42,5 +45,7 @@ namespace Oox2Odf ...@@ -42,5 +45,7 @@ namespace Oox2Odf
void convert_styles(); void convert_styles();
void convert(OOX::Spreadsheet::CWorksheet *oox_sheet); void convert(OOX::Spreadsheet::CWorksheet *oox_sheet);
cpdoccore::odf::office_element_ptr & convert(OOX::Spreadsheet::CFont * font);
}; };
} }
\ No newline at end of file
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