Commit 5b4c6363 authored by ElenaSubbotina's avatar ElenaSubbotina

OdfFormat - fix layouts

parent 2026d064
...@@ -155,8 +155,11 @@ void pptx_serialize_shape(std::wostream & strm, _pptx_drawing & val) ...@@ -155,8 +155,11 @@ void pptx_serialize_shape(std::wostream & strm, _pptx_drawing & val)
odf_reader::GetProperty(val.additional,L"no_rect",bNoRect); odf_reader::GetProperty(val.additional,L"no_rect",bNoRect);
if (!bNoRect) if (!bNoRect)
{ {
val.serialize_xfrm(CP_XML_STREAM(), L"a", true); if (val.cx != 0 || val.cy != 0) //layout
{
val.serialize_xfrm(CP_XML_STREAM(), L"a", true);
}
val.serialize_shape(CP_XML_STREAM()); val.serialize_shape(CP_XML_STREAM());
oox_serialize_ln(CP_XML_STREAM(), val.additional); oox_serialize_ln(CP_XML_STREAM(), val.additional);
......
...@@ -352,7 +352,7 @@ void PptxConverter::convert_slides() ...@@ -352,7 +352,7 @@ void PptxConverter::convert_slides()
current_slide = slide->Master.operator->(); current_slide = slide->Master.operator->();
if (bShowLayoutMasterSp && bShowMasterSp) if (bShowLayoutMasterSp && bShowMasterSp)
convert_slide(&slide->Master->cSld, current_txStyles, false, true); convert_slide(&slide->Master->cSld, current_txStyles, false, true, 2);
else else
convert(slide->Master->cSld.bg.GetPointer()); convert(slide->Master->cSld.bg.GetPointer());
...@@ -360,7 +360,7 @@ void PptxConverter::convert_slides() ...@@ -360,7 +360,7 @@ void PptxConverter::convert_slides()
current_clrMap = slide->Layout->clrMapOvr->overrideClrMapping.GetPointer(); current_clrMap = slide->Layout->clrMapOvr->overrideClrMapping.GetPointer();
current_slide = slide->Layout.operator->(); current_slide = slide->Layout.operator->();
convert_slide(&slide->Layout->cSld, current_txStyles, true, bShowLayoutMasterSp); convert_slide(&slide->Layout->cSld, current_txStyles, true, bShowLayoutMasterSp, 3);
if (!presentation->notesMasterIdLst.empty()) if (!presentation->notesMasterIdLst.empty())
{ {
...@@ -407,7 +407,7 @@ void PptxConverter::convert_slides() ...@@ -407,7 +407,7 @@ void PptxConverter::convert_slides()
odp_context->current_slide().set_master_page (master_style_name); odp_context->current_slide().set_master_page (master_style_name);
odp_context->current_slide().set_layout_page (layout_style_name); odp_context->current_slide().set_layout_page (layout_style_name);
convert_slide (slide->cSld.GetPointer(), current_txStyles, true, bShowMasterSp); convert_slide (slide->cSld.GetPointer(), current_txStyles, true, bShowMasterSp, 1);
convert (slide->comments.operator->()); convert (slide->comments.operator->());
convert (slide->Note.operator->()); convert (slide->Note.operator->());
...@@ -439,7 +439,7 @@ void PptxConverter::convert(PPTX::NotesMaster *oox_notes) ...@@ -439,7 +439,7 @@ void PptxConverter::convert(PPTX::NotesMaster *oox_notes)
odf_context()->page_layout_context()->set_page_size(width, height); odf_context()->page_layout_context()->set_page_size(width, height);
} }
convert_slide(&oox_notes->cSld, NULL, true, true); convert_slide(&oox_notes->cSld, NULL, true, true, 2);
odp_context->end_note(); odp_context->end_note();
...@@ -472,7 +472,7 @@ void PptxConverter::convert(PPTX::NotesSlide *oox_notes) ...@@ -472,7 +472,7 @@ void PptxConverter::convert(PPTX::NotesSlide *oox_notes)
if (oox_notes->clrMapOvr.IsInit() && oox_notes->clrMapOvr->overrideClrMapping.IsInit()) if (oox_notes->clrMapOvr.IsInit() && oox_notes->clrMapOvr->overrideClrMapping.IsInit())
current_clrMap = oox_notes->clrMapOvr->overrideClrMapping.GetPointer(); current_clrMap = oox_notes->clrMapOvr->overrideClrMapping.GetPointer();
convert_slide(&oox_notes->cSld, NULL, true, true); convert_slide(&oox_notes->cSld, NULL, true, true, 1);
odp_context->end_note(); odp_context->end_note();
...@@ -1021,7 +1021,7 @@ void PptxConverter::convert(PPTX::Logic::Bg *oox_background) ...@@ -1021,7 +1021,7 @@ void PptxConverter::convert(PPTX::Logic::Bg *oox_background)
odp_context->end_drawings(); odp_context->end_drawings();
} }
void PptxConverter::convert_slide(PPTX::Logic::CSld *oox_slide, PPTX::Logic::TxStyles* txStyles, bool bPlaceholders, bool bFillUp) void PptxConverter::convert_slide(PPTX::Logic::CSld *oox_slide, PPTX::Logic::TxStyles* txStyles, bool bPlaceholders, bool bFillUp, int type)
{ {
if (oox_slide == NULL) return; if (oox_slide == NULL) return;
...@@ -1051,6 +1051,9 @@ void PptxConverter::convert_slide(PPTX::Logic::CSld *oox_slide, PPTX::Logic::TxS ...@@ -1051,6 +1051,9 @@ void PptxConverter::convert_slide(PPTX::Logic::CSld *oox_slide, PPTX::Logic::TxS
{ {
int ph_type = pShape->nvSpPr.nvPr.ph->type->GetBYTECode(); int ph_type = pShape->nvSpPr.nvPr.ph->type->GetBYTECode();
if (type == 3 && (ph_type == 5 || ph_type == 6 || ph_type == 7 || ph_type == 12))
continue;
odf_context()->drawing_context()->set_placeholder_type(ph_type); odf_context()->drawing_context()->set_placeholder_type(ph_type);
} }
else else
......
...@@ -108,7 +108,7 @@ namespace Oox2Odf ...@@ -108,7 +108,7 @@ namespace Oox2Odf
void convert(OOX::WritingElement *oox_unknown); void convert(OOX::WritingElement *oox_unknown);
void convert_slide (PPTX::Logic::CSld *oox_slide, PPTX::Logic::TxStyles* txStyles, bool bPlaceholders, bool bFillUp); void convert_slide (PPTX::Logic::CSld *oox_slide, PPTX::Logic::TxStyles* txStyles, bool bPlaceholders, bool bFillUp, int type);
void convert_layout (PPTX::Logic::CSld *oox_slide); void convert_layout (PPTX::Logic::CSld *oox_slide);
void convert (PPTX::Comments *oox_comments); void convert (PPTX::Comments *oox_comments);
void convert (PPTX::NotesSlide *oox_notes); void convert (PPTX::NotesSlide *oox_notes);
......
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