diff options
Diffstat (limited to 'xmlhelp/source/treeview/tvread.cxx')
-rw-r--r-- | xmlhelp/source/treeview/tvread.cxx | 51 |
1 files changed, 34 insertions, 17 deletions
diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx index 77bf3bf490ad..29e01cb06ea8 100644 --- a/xmlhelp/source/treeview/tvread.cxx +++ b/xmlhelp/source/treeview/tvread.cxx @@ -38,14 +38,10 @@ #include <vos/diagnose.hxx> #endif #include "tvread.hxx" -#ifdef SYSTEM_EXPAT #include <expat.h> -#else -#include <expat/xmlparse.h> -#endif #include <osl/file.hxx> -#include <unotools/configmgr.hxx> #include <com/sun/star/frame/XConfigManager.hpp> +#include <com/sun/star/beans/PropertyValue.hpp> #include <comphelper/processfactory.hxx> #include <com/sun/star/beans/XPropertySet.hpp> @@ -690,11 +686,32 @@ ConfigData TVChildTarget::init( const Reference< XMultiServiceFactory >& xSMgr ) rtl::OUString productName( getKey( xHierAccess,"Product/ooName" ) ); rtl::OUString setupversion( getKey( xHierAccess,"Product/ooSetupVersion" ) ); rtl::OUString setupextension; - utl::ConfigManager * mgr = utl::ConfigManager::GetConfigManager(); - if (mgr != NULL) { - mgr->GetDirectConfigProperty(utl::ConfigManager::PRODUCTEXTENSION) >>= - setupextension; + + try + { + uno::Reference< lang::XMultiServiceFactory > xConfigProvider( + xSMgr ->createInstance(::rtl::OUString::createFromAscii("com.sun.star.configuration.ConfigurationProvider")), uno::UNO_QUERY_THROW); + + uno::Sequence < uno::Any > lParams(1); + beans::PropertyValue aParam ; + aParam.Name = ::rtl::OUString::createFromAscii("nodepath"); + aParam.Value <<= ::rtl::OUString::createFromAscii("/org.openoffice.Setup/Product"); + lParams[0] = uno::makeAny(aParam); + + // open it + uno::Reference< uno::XInterface > xCFG( xConfigProvider->createInstanceWithArguments( + ::rtl::OUString::createFromAscii("com.sun.star.configuration.ConfigurationAccess"), + lParams) ); + + uno::Reference< container::XNameAccess > xDirectAccess(xCFG, uno::UNO_QUERY); + uno::Any aRet = xDirectAccess->getByName(::rtl::OUString::createFromAscii("ooSetupExtension")); + + aRet >>= setupextension; } + catch ( uno::Exception& ) + { + } + rtl::OUString productVersion( setupversion + rtl::OUString::createFromAscii( " " ) + setupextension ); @@ -1099,7 +1116,7 @@ void ExtensionIteratorBase::implGetLanguageVectorFromPackage( ::std::vector< ::r { rv.clear(); rtl::OUString aExtensionPath = xPackage->getURL(); - Sequence< rtl::OUString > aEntrySeq = m_xSFA->getFolderContents( aExtensionPath, true );
+ Sequence< rtl::OUString > aEntrySeq = m_xSFA->getFolderContents( aExtensionPath, true ); const rtl::OUString* pSeq = aEntrySeq.getConstArray(); sal_Int32 nCount = aEntrySeq.getLength(); @@ -1123,7 +1140,7 @@ void ExtensionIteratorBase::implGetLanguageVectorFromPackage( ::std::vector< ::r rv.push_back( aPureEntry ); } } - }
+ } } @@ -1239,14 +1256,14 @@ rtl::OUString TreeFileIterator::implGetTreeFileFromPackage ::std::vector< ::rtl::OUString > av; implGetLanguageVectorFromPackage( av, xPackage ); ::std::vector< ::rtl::OUString >::const_iterator pFound = av.end(); - try
- {
- pFound = ::comphelper::Locale::getFallback( av, m_aLanguage );
- }
+ try + { + pFound = ::comphelper::Locale::getFallback( av, m_aLanguage ); + } catch( ::comphelper::Locale::MalFormedLocaleException& ) {} - if( pFound != av.end() )
- aLanguage = *pFound;
+ if( pFound != av.end() ) + aLanguage = *pFound; } } |