void RecentMasterPagesSelector::Fill (ItemList& rItemList)
{ // Create a set of names of the master pages used by the document.
MasterPageObserver::MasterPageNameSet aCurrentNames;
sal_uInt16 nMasterPageCount = mrDocument.GetMasterSdPageCount(PageKind::Standard); for (sal_uInt16 nIndex=0; nIndex<nMasterPageCount; nIndex++)
{
SdPage* pMasterPage = mrDocument.GetMasterSdPage (nIndex, PageKind::Standard); if (pMasterPage != nullptr)
aCurrentNames.insert (pMasterPage->GetName());
}
// Insert the recently used master pages that are currently not used.
RecentlyUsedMasterPages& rInstance (RecentlyUsedMasterPages::Instance()); int nPageCount = rInstance.GetMasterPageCount(); for (int nIndex=0; nIndex<nPageCount; nIndex++)
{ // Add an entry when a) the page is already known to the // MasterPageContainer, b) the style name is empty, i.e. it has not yet // been loaded (and thus can not be in use) or otherwise c) the // style name is not currently in use.
MasterPageContainer::Token aToken (rInstance.GetTokenForIndex(nIndex)); if (aToken != MasterPageContainer::NIL_TOKEN)
{
OUString sStyleName (mpContainer->GetStyleNameForToken(aToken)); if (sStyleName.isEmpty()
|| aCurrentNames.find(sStyleName) == aCurrentNames.end())
{
rItemList.push_back(aToken);
}
}
}
}
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.