Hello,
I'm using this function to clone the Notes of a Slide.
sourceTabs.size() returns allways "0".
Is there any solution? I found a hint to use "GetEffectiveTabs" for TextFrame, but Notes don't have (in Java).
/**
* Kopiert die Notizen.
*
* @param sourceSlide
* ist das Source-Slide.
* @param destSlide
* ist das Destination-Slide.
* @throws PptEditException
*/
private void cloneNotes(Slide sourceSlide,
Slide destSlide)
throws PptEditException
{
Notes sourceNotes = sourceSlide.getNotes();
if (sourceNotes != null)
{
Paragraphs sourceParagraphs = sourceNotes.getParagraphs();
if (sourceParagraphs != null)
{
Notes destNotes = destSlide.addNotes();
Paragraphs destParagraphs = destNotes.getParagraphs();
destParagraphs.clear();
//----------------------------------------------------------------------------------
{
TextRuler sourceTextRuler = sourceNotes.getTextRuler();
TextRuler destTextRuler = destNotes.getTextRuler();
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{
Tabs sourceTabs = sourceTextRuler.getTabs();
log.debug("Tabs: size: " + sourceTabs.size());
Tabs destTabs = destTextRuler.getTabs();
{
// Default:
Tab destTab = new Tab(10, TabAlignment.LEFT);
destTabs.add(destTab);
}
for (int tabPos = 0; tabPos < sourceTabs.size(); tabPos++)
{
Tab sourceTab = sourceTabs.get(tabPos);
Tab destTab = new Tab(sourceTab.getPosition(),
sourceTab.getAlign());
log.debug("Tab: " + sourceTab.getPosition());
destTabs.add(destTab);
}
}
// ??? For tabulations in this ppt please check
// TextFrame.GetEffectiveTabs function and EffectiveTabs class.
}
//----------------------------------------------------------------------------------
for (int notePos = 0; notePos < sourceParagraphs.size(); notePos++)
{
Paragraph sourceNoteParagraph = sourceParagraphs.get(notePos);
Paragraph destNoteParagraph = new Paragraph(sourceNoteParagraph);
destParagraphs.add(destNoteParagraph);
}
}
}
}
thx,
vland