Commit 7ae68b53 authored by ElenaSubbotina's avatar ElenaSubbotina

OdfFormatReader - fix same small bags

parent 57bd7a0d
......@@ -276,25 +276,6 @@ void paragraph_format_properties::pptx_convert(oox::pptx_conversion_context & Co
{
std::wstringstream & _pPr = Context.get_text_context().get_styles_context().paragraph_attr();
//сначала аттрибуты к самому pPr или defPPr
if (fo_text_align_)
{
std::wstring jc;
switch(fo_text_align_->get_type())
{
case text_align::Start:
case text_align::Left:
jc = L"l"; break;
case text_align::End:
case text_align::Right:
jc = L"r"; break;
case text_align::Center:
jc = L"ctr"; break;
case text_align::Justify:
jc = L"just"; break;
}
if (jc.length()>0) _pPr << L"algn=\"" << jc << "\" ";
}
if (fo_margin_left_ || fo_margin_right_ || fo_text_indent_ )
{
// TODO auto indent
......@@ -315,6 +296,26 @@ void paragraph_format_properties::pptx_convert(oox::pptx_conversion_context & Co
if (!w_firstLine.empty())
_pPr << L"indent=\"" << w_firstLine << "\" ";
}
if (fo_text_align_)
{
std::wstring jc;
switch(fo_text_align_->get_type())
{
case text_align::Start:
case text_align::Left:
jc = L"l"; break;
case text_align::End:
case text_align::Right:
jc = L"r"; break;
case text_align::Center:
jc = L"ctr"; break;
case text_align::Justify:
jc = L"just"; break;
}
if (jc.length()>0) _pPr << L"algn=\"" << jc << "\" ";
}
if (style_vertical_align_)
{
std::wstring w_val;
......@@ -329,7 +330,6 @@ void paragraph_format_properties::pptx_convert(oox::pptx_conversion_context & Co
if (!w_val.empty())
_pPr << L"fontAlgn=\"" << w_val << "\" ";
}
//if (style_writing_mode_)
//{
......
......@@ -343,6 +343,17 @@ void text_format_properties_content::pptx_convert(oox::pptx_conversion_context &
CP_XML_ATTR(L"cap", "small");
}
}
if (fo_text_transform_)
{
if (fo_font_variant_->get_type() == text_transform::Uppercase)
{
CP_XML_ATTR(L"cap", "all");
}
else if (fo_font_variant_->get_type() == text_transform::Lowercase)
{
CP_XML_ATTR(L"cap", "small");
}
}
// underline
line_width under = style_text_underline_width_.get_value_or(line_width::Auto);
bool underlineBold = under.get_type() == line_width::Bold ||
......@@ -363,7 +374,7 @@ void text_format_properties_content::pptx_convert(oox::pptx_conversion_context &
switch (style_text_underline_type_->get_type())
{
case line_type::Single: underline = L"sng"; break;
case line_type::Double: underline = L"double"; break;
case line_type::Double: underline = L"dbl"; break;
}
}
else if (style_text_underline_style_)
......@@ -397,8 +408,8 @@ void text_format_properties_content::pptx_convert(oox::pptx_conversion_context &
case line_style::Wave:
if (underlineBold) underline = L"wavyHeavy";
else if (style_text_underline_type_.get_value_or( line_type(line_type::Single) ).get_type() == line_type::Double)
underline = L"wavyDouble";
else underline = L"wave";
underline = L"wavyDbl";
else underline = L"wavy";
break;
}
}
......@@ -427,8 +438,8 @@ void text_format_properties_content::pptx_convert(oox::pptx_conversion_context &
std::wstring w_val;
if (fo_language_) w_val = *fo_language_;
else if (fo_country_) w_val = *fo_country_;
else if (style_country_asian_)w_val = *style_country_asian_;
else if (style_language_asian_)w_val = *style_language_asian_;
else if (style_country_asian_) w_val = *style_country_asian_;
else if (style_language_asian_) w_val = *style_language_asian_;
else if (style_language_complex_)w_val = *style_language_complex_;
else if (style_country_complex_)w_val = *style_country_complex_;
......@@ -619,7 +630,7 @@ void text_format_properties_content::docx_convert(oox::docx_conversion_context &
underline = L"single";
break;
case line_type::Double:
underline = L"double";
underline = L"dbl";
break;
}
}
......@@ -666,9 +677,9 @@ void text_format_properties_content::docx_convert(oox::docx_conversion_context &
if (underlineBold)
underline = L"wavyHeavy";
else if (style_text_underline_type_.get_value_or( line_type(line_type::Single) ).get_type() == line_type::Double)
underline = L"wavyDouble";
underline = L"wavyDbl";
else
underline = L"wave";
underline = L"wavy";
break;
}
}
......@@ -1109,7 +1120,7 @@ void text_format_properties_content::oox_convert (std::wostream & _rPr, bool gra
underline = L"single";
break;
case line_type::Double:
underline = L"double";
underline = L"dbl";
break;
}
}
......@@ -1156,9 +1167,9 @@ void text_format_properties_content::oox_convert (std::wostream & _rPr, bool gra
if (underlineBold)
underline = L"wavyHeavy";
else if (style_text_underline_type_.get_value_or( line_type(line_type::Single) ).get_type() == line_type::Double)
underline = L"wavyDouble";
underline = L"wavyDbl";
else
underline = L"wave";
underline = L"wavy";
break;
}
}
......
......@@ -1455,39 +1455,42 @@ void style_master_page::pptx_convert(oox::pptx_conversion_context & Context)
////////////////
const wchar_t * hdrHeader = L"<w:hdr \
xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" \
xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \
xmlns:o=\"urn:schemas-microsoft-com:office:office\" \
xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" \
xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" \
xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" \
xmlns:v=\"urn:schemas-microsoft-com:vml\" \
xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" \
xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" \
xmlns:w10=\"urn:schemas-microsoft-com:office:word\" \
xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" \
xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" \
xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" \
xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" \
xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" \
xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" \
xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" \
xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" \
xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \
xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" \
xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" \
xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" \
xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" \
xmlns:v=\"urn:schemas-microsoft-com:vml\" \
mc:Ignorable=\"w14 wp14\">";
const wchar_t * ftrHeader = L"<w:ftr \
xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" \
xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \
xmlns:o=\"urn:schemas-microsoft-com:office:office\" \
xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" \
xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" \
xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" \
xmlns:v=\"urn:schemas-microsoft-com:vml\" \
xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" \
xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" \
xmlns:w10=\"urn:schemas-microsoft-com:office:word\" \
xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" \
xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" \
xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" \
xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" \
xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" \
xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" \
xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" \
xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" \
xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \
xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" \
xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" \
xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" \
xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" \
xmlns:v=\"urn:schemas-microsoft-com:vml\" \
mc:Ignorable=\"w14 wp14\">";
void style_header::docx_convert(oox::docx_conversion_context & Context)
......
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