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