Commit 18393505 authored by ElenaSubbotina's avatar ElenaSubbotina

.

parent d7587e91
...@@ -336,6 +336,7 @@ void odf_drawing_context::set_background_state(bool Val) ...@@ -336,6 +336,7 @@ void odf_drawing_context::set_background_state(bool Val)
impl_->is_background_ = Val; impl_->is_background_ = Val;
impl_->current_graphic_properties = new graphic_format_properties(); impl_->current_graphic_properties = new graphic_format_properties();
start_area_properties();
} }
void odf_drawing_context::check_anchor() void odf_drawing_context::check_anchor()
...@@ -473,6 +474,7 @@ void odf_drawing_context::start_drawing() ...@@ -473,6 +474,7 @@ void odf_drawing_context::start_drawing()
} }
void odf_drawing_context::end_drawing_background(odf_types::common_draw_fill_attlist & common_draw_attlist) void odf_drawing_context::end_drawing_background(odf_types::common_draw_fill_attlist & common_draw_attlist)
{ {
end_area_properties();
if (impl_->current_drawing_state_.elements_.empty() == false) return; if (impl_->current_drawing_state_.elements_.empty() == false) return;
if (!impl_->is_background_ || !impl_->current_graphic_properties) return; if (!impl_->is_background_ || !impl_->current_graphic_properties) return;
...@@ -491,15 +493,13 @@ void odf_drawing_context::end_drawing() ...@@ -491,15 +493,13 @@ void odf_drawing_context::end_drawing()
draw_base* draw = dynamic_cast<draw_base*>(impl_->current_drawing_state_.elements_[0].elm.get()); draw_base* draw = dynamic_cast<draw_base*>(impl_->current_drawing_state_.elements_[0].elm.get());
if (draw) if (draw)
{ {
if (impl_->is_presentation_) if (impl_->current_drawing_state_.presentation_class_ || impl_->current_drawing_state_.presentation_placeholder_)
{ {
_CP_OPT(std::wstring) draw_layer; _CP_OPT(std::wstring) draw_layer;
if (impl_->is_presentation_.get() == true) if (impl_->is_presentation_.get() == true)
{//master {//master
draw_layer = L"backgroundobjects"; draw_layer = L"backgroundobjects";
//if (impl_->current_drawing_state_.presentation_class_)
// draw_layer = L"backgroundobjects";
//else draw_layer = L"layout";
if (!impl_->current_drawing_state_.presentation_class_) if (!impl_->current_drawing_state_.presentation_class_)
impl_->current_drawing_state_.presentation_class_ = presentation_class::outline; impl_->current_drawing_state_.presentation_class_ = presentation_class::outline;
...@@ -1186,10 +1186,14 @@ void odf_drawing_context::set_shadow(int type, std::wstring hexColor, _CP_OPT(do ...@@ -1186,10 +1186,14 @@ void odf_drawing_context::set_shadow(int type, std::wstring hexColor, _CP_OPT(do
void odf_drawing_context::set_placeholder_id (std::wstring val) void odf_drawing_context::set_placeholder_id (std::wstring val)
{ {
if (!impl_->is_presentation_) return;
impl_->current_drawing_state_.presentation_placeholder_ = val; impl_->current_drawing_state_.presentation_placeholder_ = val;
} }
void odf_drawing_context::set_placeholder_type (int val) void odf_drawing_context::set_placeholder_type (int val)
{ {
if (!impl_->is_presentation_) return;
switch(val) switch(val)
{ {
case 0: impl_->current_drawing_state_.presentation_class_ = presentation_class::outline; break; case 0: impl_->current_drawing_state_.presentation_class_ = presentation_class::outline; break;
......
...@@ -433,6 +433,8 @@ void OoxConverter::convert(PPTX::Logic::Shape *oox_shape) ...@@ -433,6 +433,8 @@ void OoxConverter::convert(PPTX::Logic::Shape *oox_shape)
{ {
if (oox_shape == NULL) return; if (oox_shape == NULL) return;
_CP_OPT(bool) bMasterPresentation = odf_context()->drawing_context()->get_presentation();
odf_context()->drawing_context()->start_drawing(); odf_context()->drawing_context()->start_drawing();
int type = 1000; //custom int type = 1000; //custom
...@@ -448,7 +450,8 @@ void OoxConverter::convert(PPTX::Logic::Shape *oox_shape) ...@@ -448,7 +450,8 @@ void OoxConverter::convert(PPTX::Logic::Shape *oox_shape)
type = preset.GetValue(); type = preset.GetValue();
} }
if (type == SimpleTypes::shapetypeRect && oox_shape->txBody.IsInit()) type = 2000; if (type == SimpleTypes::shapetypeRect && oox_shape->txBody.IsInit())
type = 2000;
if (type == 2000 && oox_shape->txBody->bodyPr.IsInit() if (type == 2000 && oox_shape->txBody->bodyPr.IsInit()
&& oox_shape->txBody->bodyPr->fromWordArt.get_value_or(false)) && oox_shape->txBody->bodyPr->fromWordArt.get_value_or(false))
......
...@@ -130,6 +130,8 @@ bool OoxConverter::UpdateProgress(long nComplete) ...@@ -130,6 +130,8 @@ bool OoxConverter::UpdateProgress(long nComplete)
void OoxConverter::set_fonts_directory(const std::wstring &fontsPath) void OoxConverter::set_fonts_directory(const std::wstring &fontsPath)
{ {
if (odf_context() == NULL) return;
odf_context()->set_fonts_directory(fontsPath); odf_context()->set_fonts_directory(fontsPath);
} }
......
...@@ -60,6 +60,17 @@ namespace Oox2Odf ...@@ -60,6 +60,17 @@ namespace Oox2Odf
{ {
PptxConverter::PptxConverter(const std::wstring & path, const ProgressCallback* CallBack) PptxConverter::PptxConverter(const std::wstring & path, const ProgressCallback* CallBack)
{ {
current_clrMap = NULL;
current_slide = NULL;
current_theme = NULL;
current_tableStyles = NULL;
presentation = NULL;
output_document = NULL;
odp_context = NULL;
pCallBack = CallBack;
const OOX::CPath oox_path(std::wstring(path.c_str())); const OOX::CPath oox_path(std::wstring(path.c_str()));
pptx_document = new PPTX::Folder(); pptx_document = new PPTX::Folder();
...@@ -82,13 +93,6 @@ PptxConverter::PptxConverter(const std::wstring & path, const ProgressCallback* ...@@ -82,13 +93,6 @@ PptxConverter::PptxConverter(const std::wstring & path, const ProgressCallback*
output_document = new odf_writer::package::odf_document(L"presentation"); output_document = new odf_writer::package::odf_document(L"presentation");
odp_context = new odf_writer::odp_conversion_context(output_document); odp_context = new odf_writer::odp_conversion_context(output_document);
current_clrMap = NULL;
current_slide = NULL;
current_theme = NULL;
current_tableStyles = NULL;
pCallBack = CallBack;
if (UpdateProgress(290000))return; if (UpdateProgress(290000))return;
} }
PptxConverter::~PptxConverter() PptxConverter::~PptxConverter()
...@@ -339,7 +343,7 @@ void PptxConverter::convert_slides() ...@@ -339,7 +343,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); convert_slide(&slide->Master->cSld, current_txStyles, false, true);
else else
convert(slide->Master->cSld.bg.GetPointer()); convert(slide->Master->cSld.bg.GetPointer());
...@@ -347,7 +351,7 @@ void PptxConverter::convert_slides() ...@@ -347,7 +351,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); convert_slide(&slide->Layout->cSld, current_txStyles, true, bShowLayoutMasterSp);
//add note master //add note master
odp_context->end_master_slide(); odp_context->end_master_slide();
...@@ -387,7 +391,7 @@ void PptxConverter::convert_slides() ...@@ -387,7 +391,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); convert_slide (slide->cSld.GetPointer(), current_txStyles, true, bShowMasterSp);
convert (slide->comments.operator->()); convert (slide->comments.operator->());
convert (slide->Note.operator->()); convert (slide->Note.operator->());
...@@ -943,7 +947,7 @@ void PptxConverter::convert(PPTX::Logic::Bg *oox_background) ...@@ -943,7 +947,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) void PptxConverter::convert_slide(PPTX::Logic::CSld *oox_slide, PPTX::Logic::TxStyles* txStyles, bool bPlaceholders, bool bFillUp)
{ {
if (oox_slide == NULL) return; if (oox_slide == NULL) return;
...@@ -966,14 +970,15 @@ void PptxConverter::convert_slide(PPTX::Logic::CSld *oox_slide, PPTX::Logic::TxS ...@@ -966,14 +970,15 @@ void PptxConverter::convert_slide(PPTX::Logic::CSld *oox_slide, PPTX::Logic::TxS
{ {
if (pShape->nvSpPr.nvPr.ph.is_init()) if (pShape->nvSpPr.nvPr.ph.is_init())
{ {
if (bFillUp)
pShape->FillLevelUp(); pShape->FillLevelUp();
if (pShape->nvSpPr.nvPr.ph->type.IsInit()) if (pShape->nvSpPr.nvPr.ph->type.IsInit())
{ {
int ph_type = pShape->nvSpPr.nvPr.ph->type->GetBYTECode(); int ph_type = pShape->nvSpPr.nvPr.ph->type->GetBYTECode();
if (!bMaster && (ph_type == 5 || ph_type == 6 || ph_type == 7 || ph_type == 12)) //if (!bMaster && (ph_type == 5 || ph_type == 6 || ph_type == 7 || ph_type == 12))
continue; // continue;
odf_context()->drawing_context()->set_placeholder_type(ph_type); odf_context()->drawing_context()->set_placeholder_type(ph_type);
} }
......
...@@ -106,7 +106,7 @@ namespace Oox2Odf ...@@ -106,7 +106,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 = true); void convert_slide (PPTX::Logic::CSld *oox_slide, PPTX::Logic::TxStyles* txStyles, bool bPlaceholders, bool bFillUp);
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_note); void convert (PPTX::NotesSlide *oox_note);
......
...@@ -160,7 +160,8 @@ namespace PPTX ...@@ -160,7 +160,8 @@ namespace PPTX
if (pShape->nvSpPr.nvPr.ph->idx.IsInit()) if (pShape->nvSpPr.nvPr.ph->idx.IsInit())
{ {
//not found in layout !! 100818_건강보험과_보건의료_김용익_최종.pptx //not found in layout !! 100818_건강보험과_보건의료_김용익_최종.pptx
if (Master.IsInit()) bool bShapeMaster = showMasterSp.get_value_or(true);
if (Master.IsInit() && bShapeMaster)
{ {
Master->GetLevelUp(pShape); Master->GetLevelUp(pShape);
} }
......
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