main/desktop/source/pkgchk/unopkg/unopkg_app.cxx
// If a package had been installed with a pre OOo 2.2, it could not normally be
// found via its identifier; similarly (and for ease of use), a package
// installed with OOo 2.2 or later could not normally be found via its file
// name.
If a package had been installed with a pre OOo 2.2, it could not normally be
found via its identifier; similarly (and for ease of use), a package
installed with OOo 2.2 or later could not normally be found via its file
name.
If a package had been installed with a pre OOo 2 . 2 it could not normally be found via its identifier ; similarly ( and for ease of use ) a package installed with OOo 2 . 2 or later could not normally be found via its file name .
Reference<deployment::XPackage> findPackage(
    OUString const & repository,
    Reference<deployment::XExtensionManager> const & manager,
    Reference<ucb::XCommandEnvironment > const & environment,
    OUString const & idOrFileName )
{
    Sequence< Reference<deployment::XPackage> > ps(
        manager->getDeployedExtensions(repository,
            Reference<task::XAbortChannel>(), environment ) );
    for ( sal_Int32 i = 0; i < ps.getLength(); ++i )
        if ( dp_misc::getIdentifier( ps[i] ) == idOrFileName )
            return ps[i];
    for ( sal_Int32 i = 0; i < ps.getLength(); ++i )
        if ( ps[i]->getName() == idOrFileName )
            return ps[i];
    return Reference<deployment::XPackage>();
}
Reference < deployment :: XPackage > findPackage ( OUString const & repository , Reference < deployment :: XExtensionManager > const & manager , Reference < ucb :: XCommandEnvironment > const & environment , OUString const & idOrFileName ) { Sequence < Reference < deployment :: XPackage > > ps ( manager -> getDeployedExtensions ( repository , Reference < task :: XAbortChannel > ( ) , environment ) ) ; for ( sal_Int32 i = 0 ; i < ps . getLength ( ) ; ++ i ) if ( dp_misc :: getIdentifier ( ps [ i ] ) == idOrFileName ) return ps [ i ] ; for ( sal_Int32 i = 0 ; i < ps . getLength ( ) ; ++ i ) if ( ps [ i ] -> getName ( ) == idOrFileName ) return ps [ i ] ; return Reference < deployment :: XPackage > ( ) ; }
If a package had been installed with a pre OOo 2.2, it could not normally be
found via its identifier; similarly (and for ease of use), a package
installed with OOo 2.2 or later could not normally be found via its file
name.
If a package had been installed with a pre OOo 2 . 2 it could not normally be found via its identifier ; similarly ( and for ease of use ) a package installed with OOo 2 . 2 or later could not normally be found via its file name .