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

(1.2.0.155): ASCOfficeOdfFileW


git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@58139 954022d7-b5bf-4e40-9824-e11837661b57
parent a317b307
......@@ -30,7 +30,8 @@ public:
void clear();
void set_styles_context(odf_style_context* styles_context);// embedded
void set_footer_header_state(bool Val);
void set_header_state(bool Val);
void set_footer_state(bool Val);
void set_margin_left (double valPt);
void set_margin_right (double valPt);
......@@ -152,10 +153,11 @@ public:
void set_textarea_font(_CP_OPT(std::wstring) & latin, _CP_OPT(std::wstring) & cs, _CP_OPT(std::wstring) & ea);
//////////////////////////////////////////////////////////////////////////////////////
void start_gradient_style();
void set_gradient_type(gradient_style style);
void set_gradient_type(gradient_style::type style);
void set_gradient_start(std::wstring hexColor, _CP_OPT(double) & intensiv);
void set_gradient_end (std::wstring hexColor, _CP_OPT(double) & intensiv);
void set_gradient_rect(double l, double t, double r,double b);
void set_gradient_center(double cx, double cy);
void set_gradient_angle(double angle);
void end_gradient_style();
////////////////////////////////////////////////////////////////////////////////////////
......
......@@ -59,9 +59,8 @@ public:
std::wstring get_style_name(int oox_style_num);
std::wstring get_style_name1(int oox_style_num);
private:
std::vector<list_format_state> lists_format_array_;
boost::unordered_map<int, std::wstring> link_format_map_;
std::vector<list_format_state> lists_format_array_;
boost::unordered_map<int, std::wstring> link_format_map_;
//void create(int oox_num_fmt, std::wstring formatCode = L"");
//void create_default(int oox_num_fmt, std::wstring formatCode = L"");
......@@ -71,9 +70,6 @@ private:
////////////////
odf_conversion_context *odf_context_;
//std::vector<office_element_ptr> styles_elments;
};
}
}
......@@ -306,7 +306,7 @@ void odf_table_context::change_current_column_width(double width)
else
{
double old_width = properties->style_table_column_properties_attlist_.style_column_width_->get_value_unit(length::pt);
if (old_width < width/* && width < impl_->odf_context_->page_layout_context()->current_page_width_*/)
if (old_width < width/* && width < impl_->odf_context_->page_layout_context()->current_page_width_*/ && old_width < 9)
properties->style_table_column_properties_attlist_.style_column_width_ = length_;
}
}
......
......@@ -534,7 +534,11 @@ void odf_text_context::set_type_break(int type, int clear)
//brclearLeft = 1,
//brclearNone = 2,
//brclearRight = 3
if (type == 0)//brtypeColumn
if (type == -1)
{
need_break_= boost::none;
}
else if (type == 0)//brtypeColumn
{
need_break_= fo_break(fo_break::Column);
}
......
......@@ -43,7 +43,9 @@ odt_conversion_context::odt_conversion_context(package::odf_document * outputDoc
current_field_.in_span = false;
is_hyperlink_ = false;
is_footer_header_ = false;
is_header_ = false;
is_footer_ = false;
drop_cap_state_.clear();
}
......@@ -183,7 +185,9 @@ void odt_conversion_context::start_drawings()
if (!new_drawing_context_)return;
new_drawing_context_->set_styles_context(styles_context());
new_drawing_context_->set_footer_header_state(is_footer_header_);
new_drawing_context_->set_footer_state(is_footer_);
new_drawing_context_->set_header_state(is_header_);
drawing_context_.push_back(new_drawing_context_);
}
......@@ -862,7 +866,7 @@ bool odt_conversion_context::start_header(int type)
text_context()->start_element(page_layout_context()->last_master().get_last_element());
is_footer_header_ = true;
is_header_ = true;
return true;
}
......@@ -872,7 +876,8 @@ void odt_conversion_context::end_header_footer()
text_context()->end_element();
end_text_context();
is_footer_header_ = false;
is_header_ = false;
is_footer_ = false;
}
void odt_conversion_context::set_background(_CP_OPT(color) & color, int type)
......@@ -891,7 +896,7 @@ bool odt_conversion_context::start_footer(int type)
text_context()->start_element(page_layout_context()->last_master().get_last_element());
is_footer_header_ = true;
is_footer_ = true;
return true;
}
......
......@@ -120,7 +120,8 @@ private:
odf_table_context table_context_;
odf_comment_context comment_context_;
bool is_footer_header_;
bool is_header_;
bool is_footer_;
std::vector<odf_drawing_context_ptr> drawing_context_;
std::vector<odf_text_context_ptr> text_context_;//for embedded
......
......@@ -237,6 +237,59 @@ void style_paragraph_properties::apply_from(style_paragraph_properties * Other)
style_paragraph_properties_content_.apply_from(Other->content());
}
void paragraph_format_properties::clear()
{
fo_line_height_ = boost::none;
style_line_height_at_least_ = boost::none;
style_line_spacing_ = boost::none;
style_font_independent_line_spacing_= boost::none;
fo_text_align_ = boost::none;
fo_text_align_last_ = boost::none;
style_justify_single_word_ = boost::none;
fo_keep_together_ = boost::none;
fo_widows_ = boost::none;
fo_orphans_ = boost::none;
style_tab_stop_distance_ = boost::none;
fo_hyphenation_keep_ = boost::none;
fo_hyphenation_ladder_count_= boost::none;
style_register_true_ = boost::none;
fo_margin_left_ = boost::none;
fo_margin_right_ = boost::none;
//fo_text_indent_ = boost::none;//
style_auto_text_indent_ = boost::none;
fo_margin_top_ = boost::none;
fo_margin_bottom_ = boost::none;
fo_margin_ = boost::none;
fo_break_before_ = boost::none;
fo_break_after_ = boost::none;
fo_background_color_ = boost::none;
fo_padding_ = boost::none;
fo_padding_top_ = boost::none;
fo_padding_bottom_ = boost::none;
fo_padding_left_ = boost::none;
fo_padding_right_ = boost::none;
outline_level_ = boost::none;
style_page_number_ = boost::none;
style_snap_to_layout_grid_= boost::none;
style_join_border_ = boost::none;
style_text_autospace_ = boost::none;
fo_keep_with_next_ = boost::none;
fo_background_color_ = boost::none;
style_vertical_align_ = boost::none;
style_writing_mode_ = boost::none;
style_writing_mode_automatic_= boost::none;
style_line_break_ = boost::none;
style_background_transparency_= boost::none;
style_text_autospace_= boost::none;
text_line_number_ = boost::none;
style_line_break_ = boost::none;
text_number_lines_ = boost::none;
style_shadow_ = boost::none;
//todo borders !!!
}
void paragraph_format_properties::apply_from(paragraph_format_properties & Other)
{
apply_line_width(fo_line_height_, Other.fo_line_height_);
......@@ -248,35 +301,26 @@ void paragraph_format_properties::apply_from(paragraph_format_properties & Other
_CP_APPLY_PROP(style_justify_single_word_, Other.style_justify_single_word_);
_CP_APPLY_PROP(fo_keep_together_, Other.fo_keep_together_);
_CP_APPLY_PROP(fo_widows_, Other.fo_widows_);
_CP_APPLY_PROP(fo_orphans_, Other.fo_orphans_);
// TODO
_CP_APPLY_PROP(style_tab_stops_, Other.style_tab_stops_);
_CP_APPLY_PROP(fo_orphans_, Other.fo_orphans_);
_CP_APPLY_PROP(style_tab_stop_distance_, Other.style_tab_stop_distance_);
_CP_APPLY_PROP(fo_hyphenation_keep_, Other.fo_hyphenation_keep_);
_CP_APPLY_PROP(fo_hyphenation_ladder_count_, Other.fo_hyphenation_ladder_count_);
// TODO
_CP_APPLY_PROP(style_drop_cap_, Other.style_drop_cap_);
_CP_APPLY_PROP(style_tab_stops_, Other.style_tab_stops_);
_CP_APPLY_PROP(style_register_true_, Other.style_register_true_);
apply_length_or_percent(fo_margin_left_, Other.fo_margin_left_);
apply_length_or_percent(fo_margin_right_, Other.fo_margin_right_);
apply_length_or_percent(fo_text_indent_, Other.fo_text_indent_);
_CP_APPLY_PROP(style_auto_text_indent_, Other.style_auto_text_indent_);
apply_length_or_percent(fo_margin_top_, Other.fo_margin_top_);
apply_length_or_percent(fo_margin_bottom_, Other.fo_margin_bottom_);
apply_length_or_percent(fo_margin_, Other.fo_margin_);
apply_length_or_percent(fo_margin_, Other.fo_margin_);
_CP_APPLY_PROP(fo_break_before_, Other.fo_break_before_);
_CP_APPLY_PROP(fo_break_after_, Other.fo_break_after_);
_CP_APPLY_PROP(fo_break_after_, Other.fo_break_after_)
_CP_APPLY_PROP(fo_background_color_, Other.fo_background_color_);
// TODO
_CP_APPLY_PROP(style_background_image_, Other.style_background_image_);
common_border_attlist_.apply_from(Other.common_border_attlist_);
......
......@@ -167,6 +167,8 @@ public:
void apply_from( paragraph_format_properties & Other);
void clear();
public:
// 15.5.1 fo:line-height
_CP_OPT(line_width) fo_line_height_; // +
......
......@@ -799,7 +799,7 @@ void OoxConverter::convert(OOX::Drawing::CGradientFillProperties *oox_grad_fill,
odf_context()->drawing_context()->start_gradient_style();
{
odf::gradient_style grad_style = odf::gradient_style::linear;
odf::gradient_style::type grad_style = odf::gradient_style::linear;
if (oox_grad_fill->m_eGradType == OOX::Drawing::gradfilltypeLinear && oox_grad_fill->m_oLin->m_oAng.IsInit())
{
......
......@@ -2,6 +2,6 @@
//1
//2
//0
//153
#define INTVER 1,2,0,153
#define STRVER "1,2,0,153\0"
//155
#define INTVER 1,2,0,155
#define STRVER "1,2,0,155\0"
......@@ -1943,9 +1943,18 @@ namespace SimpleTypes
{
if ( -1 == nPos )
{
// 12.1.2.2 (Part4)
int nValue = _wtoi( sValue );
m_dValue = nValue / 1000.0;
//test
double dValue = _wtof(sValue);
if (dValue >= 0 && dValue <=1 )
{
m_dValue = dValue ;
}
else
{
// 12.1.2.2 (Part4)
int nValue = _wtoi( sValue );
m_dValue = nValue / 1000.0;
}
}
else
m_dValue = 0;
......
......@@ -3776,10 +3776,13 @@ namespace SimpleTypes
}
void ReadValue_MsoPosVerRel(CString& sValue)
{
//bottom-margin-area ????
if ( _T("margin") == sValue ) m_oValue.eMsoPosVerRel = cssmsoposverrelMargin;
else if ( _T("page") == sValue ) m_oValue.eMsoPosVerRel = cssmsoposverrelPage;
else if ( _T("text") == sValue ) m_oValue.eMsoPosVerRel = cssmsoposverrelText;
else if ( _T("line") == sValue ) m_oValue.eMsoPosVerRel = cssmsoposverrelLine;
else if (sValue.Find(_T("margin")) >=0)
m_oValue.eMsoPosVerRel = cssmsoposverrelMargin;
else
m_oValue.eMsoPosVerRel = cssmsoposverrelText;
}
......
......@@ -402,15 +402,11 @@ namespace OOX
if ( SimpleTypes::booleanTrue != m_oOn.GetValue() )
sResult += _T("on=\"false\" ");
if ( SimpleTypes::colortypeWhite != m_oColor.GetValue() )
sResult += _T("color=\"") + m_oColor.ToString() + _T("\" ");
if ( m_oOpacity.IsInit() )
sResult += _T("opacity=\"") + m_oOpacity->ToString() + _T("\" ");
if ( SimpleTypes::colortypeWhite != m_oColor2.GetValue() )
sResult += _T("color2=\"") + m_oColor2.ToString() + _T("\" ");
ComplexTypes_WriteAttribute (_T("color=\""), m_oColor);
ComplexTypes_WriteAttribute (_T("color2=\""), m_oColor2);
ComplexTypes_WriteAttribute2( _T("src=\""), m_sSrc );
ComplexTypes_WriteAttribute2( _T("o:href=\""), m_sHref );
ComplexTypes_WriteAttribute2( _T("o:althref=\""), m_sAltHref );
......@@ -573,8 +569,8 @@ namespace OOX
nullable<CString> m_sAltHref;
nullable<SimpleTypes::CDecimalNumber<>> m_oAngle;
SimpleTypes::CImageAspect<SimpleTypes::imageaspectIgnore> m_oAspect;
SimpleTypes::CColorType<SimpleTypes::colortypeWhite> m_oColor;
SimpleTypes::CColorType<SimpleTypes::colortypeWhite> m_oColor2;
nullable<SimpleTypes::CColorType<>> m_oColor;
nullable<SimpleTypes::CColorType<>> m_oColor2;
std::vector<TIntermediateColor*> m_arrColors;
nullable<SimpleTypes::CTrueFalse<>> m_oDetectMouseClick;
SimpleTypes::CFixedPercentage m_oFocus;
......
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