void getOwnUpdateInfos(
Reference<uno::XComponentContext> const & xContext,
Reference<deployment::XUpdateInformationProvider > const & updateInformation,
UpdateInfoMap& inout_map, std::vector<std::pair<Reference<deployment::XPackage>, uno::Any> > & out_errors, bool & out_allFound)
{ bool bAllHaveOwnUpdateInformation = true; for (auto & inout : inout_map)
{
OSL_ASSERT(inout.second.extension.is());
Sequence<OUString> urls(inout.second.extension->getUpdateInformationURLs()); if (urls.hasElements())
{ const OUString search_id = dp_misc::getIdentifier(inout.second.extension);
SAL_INFO( "extensions.update", "Searching update for " << search_id );
uno::Any anyError; //It is unclear from the idl if there can be a null reference returned. //However all valid information should be the same const Sequence<Reference< xml::dom::XElement > >
infos(getUpdateInformation(updateInformation, urls, search_id, anyError)); if (anyError.hasValue())
out_errors.emplace_back(inout.second.extension, anyError);
for (const Reference< xml::dom::XElement >& element : infos)
{
dp_misc::DescriptionInfoset infoset(
xContext,
Reference< xml::dom::XNode >(element, UNO_QUERY_THROW)); if (!infoset.hasDescription()) continue;
std::optional< OUString > result_id(infoset.getIdentifier()); if (!result_id) continue;
SAL_INFO( "extensions.update", " found version "
<< infoset.getVersion() << " for " << *result_id ); if (*result_id != search_id) continue;
inout.second.version = infoset.getVersion();
inout.second.info.set(element, UNO_QUERY_THROW); break;
}
} else
{
bAllHaveOwnUpdateInformation = false;
}
}
out_allFound = bAllHaveOwnUpdateInformation;
}
/** Returns true if the list of extensions are bundled extensions and there are no otherextensionswiththesameidentifierinthesharedoruserrepository. IfextensionListisNULL,thenitischeckedifthereareonlybundledextensions.
*/ bool onlyBundledExtensions(
Reference<deployment::XExtensionManager> const & xExtMgr,
std::vector< Reference<deployment::XPackage > > const * extensionList)
{
OSL_ASSERT(xExtMgr.is()); bool bOnlyBundled = true; if (extensionList)
{ for (autoconst& elem : *extensionList)
{
Sequence<Reference<deployment::XPackage> > seqExt = xExtMgr->getExtensionsWithSameIdentifier(
dp_misc::getIdentifier(elem), elem->getName(), Reference<ucb::XCommandEnvironment>());
Reference<deployment::XPackage> greatest;
sal_Int32 len = seqExt.getLength();
for (sal_Int32 i = 0; i < len; i++)
{ if (!greatest.is())
{
greatest = seqExt[i]; continue;
}
Reference<deployment::XPackage> const & current = seqExt[i]; //greatest has a value if (! current.is()) continue;
//Now find the update information for the extensions which provide their own //URLs to update information. bool bAllInfosObtained = false;
getOwnUpdateInfos(xContext, updateInformation, infoMap, out_errors, bAllInfosObtained);
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.