Commit 2326b425 authored by ElenaSubbotina's avatar ElenaSubbotina

OdfFormatWriter - правка багов по результатам тестирования пользовательских файлов

parent 98efbc3f
......@@ -41,11 +41,11 @@ public:
_CP_OPT(odf_types::table_align) table_align_;
_CP_OPT(odf_types::color) tableooo_tab_color_;
odf_types::common_horizontal_margin_attlist common_horizontal_margin_attlist_;
odf_types::common_horizontal_margin_attlist common_horizontal_margin_attlist_;
odf_types::common_vertical_margin_attlist common_vertical_margin_attlist_;
odf_types::common_margin_attlist common_margin_attlist_;
odf_types::common_page_number_attlist common_page_number_attlist_;
odf_types::common_break_attlist common_break_attlist_;
odf_types::common_break_attlist common_break_attlist_;
odf_types::common_background_color_attlist common_background_color_attlist_;
odf_types::common_shadow_attlist common_shadow_attlist_;
odf_types::common_keep_with_next_attlist common_keep_with_next_attlist_;
......@@ -88,8 +88,8 @@ class style_table_column_properties_attlist
public:
void serialize(std::wostream & strm ,const wchar_t * ns, const wchar_t * name );
_CP_OPT(odf_types::length) style_column_width_;
_CP_OPT(odf_types::length) style_rel_column_width_;
_CP_OPT(odf_types::length) style_column_width_;
_CP_OPT(odf_types::length) style_rel_column_width_;
_CP_OPT(odf_types::Bool) style_use_optimal_column_width_;
odf_types::common_break_attlist common_break_attlist_;
......@@ -121,10 +121,10 @@ class style_table_row_properties_attlist
public:
void serialize(std::wostream & strm ,const wchar_t * ns, const wchar_t * name );
_CP_OPT(odf_types::length) style_row_height_;
_CP_OPT(odf_types::length) style_min_row_height_;
_CP_OPT(odf_types::Bool) style_use_optimal_row_height_;
_CP_OPT(odf_types::keep_together) fo_keep_together_;
_CP_OPT(odf_types::length) style_row_height_;
_CP_OPT(odf_types::length) style_min_row_height_;
_CP_OPT(odf_types::Bool) style_use_optimal_row_height_;
_CP_OPT(odf_types::keep_together) fo_keep_together_;
odf_types::common_background_color_attlist common_background_color_attlist_;
odf_types::common_break_attlist common_break_attlist_;
......@@ -145,8 +145,8 @@ public:
virtual void serialize(std::wostream & strm);
public:
style_table_row_properties_attlist style_table_row_properties_attlist_;
office_element_ptr style_background_image_;
style_table_row_properties_attlist style_table_row_properties_attlist_;
office_element_ptr style_background_image_;
};
......@@ -164,26 +164,27 @@ public:
_CP_OPT(odf_types::vertical_align) style_vertical_align_;
_CP_OPT(odf_types::text_align_source) style_text_align_source_;
_CP_OPT(odf_types::direction) style_direction_;
_CP_OPT(std::wstring) style_glyph_orientation_vertical_;
_CP_OPT(std::wstring) style_glyph_orientation_vertical_;
odf_types::common_shadow_attlist common_shadow_attlist_;
odf_types::common_background_color_attlist common_background_color_attlist_;
odf_types::common_background_color_attlist common_background_color_attlist_;
odf_types::common_border_attlist common_border_attlist_;
_CP_OPT(std::wstring) style_diagonal_tl_br_;
_CP_OPT(std::wstring) style_diagonal_tl_br_;
_CP_OPT(odf_types::border_widths) style_diagonal_tl_br_widths_;
_CP_OPT(std::wstring) style_diagonal_bl_tr_;
_CP_OPT(std::wstring) style_diagonal_bl_tr_;
_CP_OPT(odf_types::border_widths) style_diagonal_bl_tr_widths_;
odf_types::common_border_line_width_attlist common_border_line_width_attlist_;
odf_types::common_border_line_width_attlist common_border_line_width_attlist_;
odf_types::common_padding_attlist common_padding_attlist_;
odf_types::common_rotation_angle_attlist common_rotation_angle_attlist_;
_CP_OPT(odf_types::wrap_option) fo_wrap_option_;
_CP_OPT(odf_types::rotation_align) style_rotation_align_;
_CP_OPT(std::wstring) style_cell_protect_;
_CP_OPT(odf_types::wrap_option) fo_wrap_option_;
_CP_OPT(odf_types::rotation_align) style_rotation_align_;
_CP_OPT(std::wstring) style_cell_protect_;
_CP_OPT(odf_types::Bool) style_print_content_;
_CP_OPT(unsigned int) style_decimal_places_;
_CP_OPT(unsigned int) style_decimal_places_;
_CP_OPT(odf_types::Bool) style_repeat_content_;
_CP_OPT(odf_types::Bool) style_shrink_to_fit_;
......@@ -215,7 +216,7 @@ public:
virtual void serialize(std::wostream & strm);
style_table_cell_properties_attlist style_table_cell_properties_attlist_;
office_element_ptr style_background_image_;
office_element_ptr style_background_image_;
};
......
......@@ -1161,34 +1161,37 @@ void DocxConverter::convert(OOX::Logic::CSectionProperty *oox_section_pr, bool r
{
odt_context->add_section(continuous);
double default_space_pt = -1;
if (oox_section_pr->m_oCols->m_oSpace.IsInit()) default_space_pt = oox_section_pr->m_oCols->m_oSpace->ToPoints();
bool separator = oox_section_pr->m_oCols->m_oSep.IsInit() && oox_section_pr->m_oCols->m_oSep->ToBool();
odt_context->add_section_columns(num_columns,
oox_section_pr->m_oCols->m_arrColumns.size() > 0 ? -1 : default_space_pt , separator );
std::vector<std::pair<double,double>> width_space;
for (unsigned int i =0; i< oox_section_pr->m_oCols->m_arrColumns.size(); i++)
if (oox_section_pr->m_oCols.IsInit())
{
if (oox_section_pr->m_oCols->m_arrColumns[i] == NULL) continue;
double space = default_space_pt;
if (oox_section_pr->m_oCols->m_arrColumns[i]->m_oSpace.IsInit())
space = oox_section_pr->m_oCols->m_arrColumns[i]->m_oSpace->ToPoints();
double w = -1;
if (oox_section_pr->m_oCols->m_arrColumns[i]->m_oW.IsInit())
w = oox_section_pr->m_oCols->m_arrColumns[i]->m_oW->ToPoints();
double default_space_pt = -1;
if (oox_section_pr->m_oCols->m_oSpace.IsInit()) default_space_pt = oox_section_pr->m_oCols->m_oSpace->ToPoints();
bool separator = oox_section_pr->m_oCols->m_oSep.IsInit() && oox_section_pr->m_oCols->m_oSep->ToBool();
odt_context->add_section_columns(num_columns,
oox_section_pr->m_oCols->m_arrColumns.size() > 0 ? -1 : default_space_pt , separator );
std::vector<std::pair<double,double>> width_space;
for (unsigned int i =0; i< oox_section_pr->m_oCols->m_arrColumns.size(); i++)
{
if (oox_section_pr->m_oCols->m_arrColumns[i] == NULL) continue;
double space = default_space_pt;
if (oox_section_pr->m_oCols->m_arrColumns[i]->m_oSpace.IsInit())
space = oox_section_pr->m_oCols->m_arrColumns[i]->m_oSpace->ToPoints();
width_space.push_back(std::pair<double,double>(w, space));
double w = -1;
if (oox_section_pr->m_oCols->m_arrColumns[i]->m_oW.IsInit())
w = oox_section_pr->m_oCols->m_arrColumns[i]->m_oW->ToPoints();
width_space.push_back(std::pair<double,double>(w, space));
}
//for (unsigned int i= oox_section_pr->m_oCols->m_arrColumns.size(); i< num_columns; i ++)
//{
// width_space.push_back(std::pair<double,double>(-1, default_space_pt));
//}
odt_context->add_section_column(width_space);
}
//for (unsigned int i= oox_section_pr->m_oCols->m_arrColumns.size(); i< num_columns; i ++)
//{
// width_space.push_back(std::pair<double,double>(-1, default_space_pt));
//}
odt_context->add_section_column(width_space);
if (root) odt_context->flush_section();
}
......
......@@ -914,35 +914,35 @@ void XlsxConverter::convert_styles()
OOX::Spreadsheet::CStyles * xlsx_styles = xlsx_document->GetStyles();
if (!xlsx_styles)return;
//todooo ?? Count ??
////////////
for (unsigned int i=0; xlsx_styles->m_oNumFmts.IsInit() && i< xlsx_styles->m_oNumFmts->m_oCount->GetValue(); i++)
for (unsigned int i = 0; xlsx_styles->m_oNumFmts.IsInit() && i < xlsx_styles->m_oNumFmts->m_arrItems.size(); i++)
{
convert(xlsx_styles->m_oNumFmts->m_arrItems[i]);
}
/////////////
for (unsigned int i=0; xlsx_styles->m_oCellStyleXfs.IsInit() && i< xlsx_styles->m_oCellStyleXfs->m_oCount->GetValue(); i++)
for (unsigned int i = 0; xlsx_styles->m_oCellStyleXfs.IsInit() && i < xlsx_styles->m_oCellStyleXfs->m_arrItems.size(); i++)
{
//automatical, root - noname - named
convert(xlsx_styles->m_oCellStyleXfs->m_arrItems[i] , i, true, true);
}
for (unsigned int i=0; xlsx_styles->m_oCellStyles.IsInit() && i< xlsx_styles->m_oCellStyles->m_oCount->GetValue(); i++)//styles.xml
for (unsigned int i = 0; xlsx_styles->m_oCellStyles.IsInit() && i < xlsx_styles->m_oCellStyles->m_arrItems.size(); i++)//styles.xml
{
//non automatical, root - named
convert(xlsx_styles->m_oCellStyles->m_arrItems[i]);
}
//
for (unsigned int i=0; xlsx_styles->m_oCellXfs.IsInit() && i< xlsx_styles->m_oCellXfs->m_oCount->GetValue(); i++)
for (unsigned int i = 0; xlsx_styles->m_oCellXfs.IsInit() && i < xlsx_styles->m_oCellXfs->m_arrItems.size(); i++)
{
//automatical, non root
convert(xlsx_styles->m_oCellXfs->m_arrItems[i],i, true,false);
convert(xlsx_styles->m_oCellXfs->m_arrItems[i], i, true, false);
}
////////////
for (unsigned int i=0; xlsx_styles->m_oDxfs.IsInit() && i< xlsx_styles->m_oDxfs->m_oCount->GetValue(); i++)
for (unsigned int i=0; xlsx_styles->m_oDxfs.IsInit() && i < xlsx_styles->m_oDxfs->m_arrItems.size(); i++)
{
convert(xlsx_styles->m_oDxfs->m_arrItems[i],i);
convert(xlsx_styles->m_oDxfs->m_arrItems[i], i);
}
}
......@@ -1287,9 +1287,10 @@ void XlsxConverter::convert(OOX::Spreadsheet::CColor *color, _CP_OPT(odf_types::
ucA = color->m_oRgb->Get_A();
result = true;
}
if(color->m_oThemeColor.IsInit())
OOX::CTheme * xlsx_theme= xlsx_document->GetTheme();
if(color->m_oThemeColor.IsInit() && xlsx_theme)
{
OOX::CTheme * xlsx_theme= xlsx_document->GetTheme();
int theme_ind = color->m_oThemeColor->GetValue();
switch(theme_ind)
{
......
......@@ -659,8 +659,8 @@ Global
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.Unicode Release|Win32.Build.0 = Release|Win32
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.Unicode Release|x64.ActiveCfg = Release|x64
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.Unicode Release|x64.Build.0 = Release|x64
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Multithreaded|Win32.ActiveCfg = Debug Multithreaded|Win32
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Multithreaded|Win32.Build.0 = Debug Multithreaded|Win32
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Multithreaded|Win32.ActiveCfg = Debug Multithreaded|x64
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Multithreaded|Win32.Build.0 = Debug Multithreaded|x64
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Multithreaded|x64.ActiveCfg = Debug Multithreaded|x64
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Multithreaded|x64.Build.0 = Debug Multithreaded|x64
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug Singlethreaded|Win32.ActiveCfg = Debug Singlethreaded|Win32
......
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