// first: get current XTextSection
Reference<XPropertySet> xPropSet(rNextSectionContent, UNO_QUERY); if (xPropSet.is())
{ if (xPropSet->getPropertySetInfo()->hasPropertyByName(gsTextSection))
{
xPropSet->getPropertyValue(gsTextSection) >>= xNextSection;
} // else: no current section
}
void XMLTextParagraphExport::exportListAndSectionChange(
Reference<XTextSection> & rPrevSection, const Reference<XTextSection> & rNextSection, const XMLTextNumRuleInfo& rPrevRule, const XMLTextNumRuleInfo& rNextRule, bool bAutoStyles)
{ // old != new? -> maybe we have to start or end a new section if (rPrevSection != rNextSection)
{ // a new section started, or an old one gets closed!
// close old list
XMLTextNumRuleInfo aEmptyNumRuleInfo; if ( !bAutoStyles )
exportListChange(rPrevRule, aEmptyNumRuleInfo);
// Build stacks of old and new sections // Sections on top of mute sections should not be on the stack
std::vector< Reference<XTextSection> > aOldStack;
Reference<XTextSection> aCurrent(rPrevSection); while(aCurrent.is())
{ // if we have a mute section, ignore all its children // (all previous ones) if (m_pSectionExport->IsMuteSection(aCurrent))
aOldStack.clear();
std::vector< Reference<XTextSection> > aNewStack;
aCurrent.set(rNextSection); bool bMute = false; while(aCurrent.is())
{ // if we have a mute section, ignore all its children // (all previous ones) if (m_pSectionExport->IsMuteSection(aCurrent))
{
aNewStack.clear();
bMute = true;
}
// close all elements of aOld ... // (order: newest to oldest) if (aOld != aOldStack.rend())
{
std::vector<Reference<XTextSection> > ::iterator aOldForward(
aOldStack.begin()); while ((aOldForward != aOldStack.end()) &&
(*aOldForward != *aOld))
{ if ( !bAutoStyles && (nullptr != m_pRedlineExport) )
m_pRedlineExport->ExportStartOrEndRedline(*aOldForward, false);
m_pSectionExport->ExportSectionEnd(*aOldForward, bAutoStyles);
++aOldForward;
} if (aOldForward != aOldStack.end())
{ if ( !bAutoStyles && (nullptr != m_pRedlineExport) )
m_pRedlineExport->ExportStartOrEndRedline(*aOldForward, false);
m_pSectionExport->ExportSectionEnd(*aOldForward, bAutoStyles);
}
}
// ...then open all of aNew // (order: oldest to newest) while (aNew != aNewStack.rend())
{ if ( !bAutoStyles && (nullptr != m_pRedlineExport) )
m_pRedlineExport->ExportStartOrEndRedline(*aNew, true);
m_pSectionExport->ExportSectionStart(*aNew, bAutoStyles);
++aNew;
}
// start new list if ( !bAutoStyles && !bMute )
exportListChange(aEmptyNumRuleInfo, rNextRule);
} else
{ // list change, if sections have not changed if ( !bAutoStyles )
exportListChange(rPrevRule, rNextRule);
}
// save old section (old numRule gets saved in calling method)
rPrevSection.set(rNextSection);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.