AddClone()

ISlideCollection::AddClone(System::SharedPtr<ISlide>) method

Adds a copy of a specified slide to the end of the collection.

virtual System::SharedPtr<ISlide> Aspose::Slides::ISlideCollection::AddClone(System::SharedPtr<ISlide> sourceSlide)=0

Arguments

ParameterTypeDescription
sourceSlideSystem::SharedPtr<ISlide>Slide to clone.

Return Value

New slide.

Remarks

When cloning a slide between different presentations slide’s master can be cloned too. Internal registry is used to track automatically cloned masters to prevent creation of multiple clones of the same master slide. Manual cloning of master slides will be neither prevented nor registered. If you need more control over cloning process use AddClone(SharedPtr, SharedPtr) or AddClone(SharedPtr, SharedPtr, bool) for cloning slides, IGlobalLayoutSlideCollection::AddClone(SharedPtr) or IGlobalLayoutSlideCollection::AddClone(SharedPtr, SharedPtr) for cloning layouts and IMasterSlideCollection::AddClone(SharedPtr) for cloning masters.

ISlideCollection::AddClone(System::SharedPtr<ISlide>, System::SharedPtr<ISection>) method

Adds a copy of a specified slide to the end of the specified section.

virtual System::SharedPtr<ISlide> Aspose::Slides::ISlideCollection::AddClone(System::SharedPtr<ISlide> sourceSlide, System::SharedPtr<ISection> section)=0

Arguments

ParameterTypeDescription
sourceSlideSystem::SharedPtr<ISlide>Slide to clone.
sectionSystem::SharedPtr<ISection>Section for a new slide.

Return Value

New slide.

Remarks

auto presentation = MakeObject<Presentation>();
presentation->get_Slides()->idx_get(0)->get_Shapes()->AddAutoShape(ShapeType::Rectangle, 200.0f, 50.0f, 300.0f, 100.0f);
presentation->get_Sections()->AddSection(u"Section 1", presentation->get_Slides()->idx_get(0));
auto section2 = presentation->get_Sections()->AppendEmptySection(u"Section 2");
presentation->get_Slides()->AddClone(presentation->get_Slides()->idx_get(0), section2);
// Now the second section contains a copy of the first slide.

ISlideCollection::AddClone(System::SharedPtr<ISlide>, System::SharedPtr<ILayoutSlide>) method

Adds a copy of a specified slide to the end of the collection.

virtual System::SharedPtr<ISlide> Aspose::Slides::ISlideCollection::AddClone(System::SharedPtr<ISlide> sourceSlide, System::SharedPtr<ILayoutSlide> destLayout)=0

Arguments

ParameterTypeDescription
sourceSlideSystem::SharedPtr<ISlide>Slide to clone.
destLayoutSystem::SharedPtr<ILayoutSlide>Layout slide for a new slide.

Return Value

New slide.

ISlideCollection::AddClone(System::SharedPtr<ISlide>, System::SharedPtr<IMasterSlide>, bool) method

Adds a copy of a specified source slide to the end of the collection. Appropriate layout will be selected automatically from the specified master (appropriate layout is the layout with the same Type or Name as of layout of the source slide). If there is no appropriate layout then layout of the source slide will be cloned (if allowCloneMissingLayout is true) or PptxEditException will be thrown (if allowCloneMissingLayout is false).

virtual System::SharedPtr<ISlide> Aspose::Slides::ISlideCollection::AddClone(System::SharedPtr<ISlide> sourceSlide, System::SharedPtr<IMasterSlide> destMaster, bool allowCloneMissingLayout)=0

Arguments

ParameterTypeDescription
sourceSlideSystem::SharedPtr<ISlide>Slide to clone.
destMasterSystem::SharedPtr<IMasterSlide>Master slide for a new slide.
allowCloneMissingLayoutboolIf there is no appropriate layout in specified master then layout of the source slide will be cloned (if allowCloneMissingLayout is true) or PptxEditException will be thrown (if allowCloneMissingLayout is false).

Return Value

New slide.

See Also