diff options
author | Noel Grandin <noel@peralex.com> | 2012-05-29 17:17:28 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-06-06 10:01:22 +0200 |
commit | d08578912f2c9ef42d4349079422e25b951e544e (patch) | |
tree | d029b5a9110bcdc255e72ef9c98887f3f8521ea6 /xmlhelp | |
parent | 7d2a5b5114987f1ab415e32ebb5bb9a46b98dc17 (diff) |
fdo#46808, Adapt UNO services to new style, Part 7, updating ::create
Update calls to factories to use new SimpleFileAccess::create method
Change-Id: Ie5b0696fe2228a9033b19969245a53c21a61aa14
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>, added some tweaks.
Diffstat (limited to 'xmlhelp')
-rw-r--r-- | xmlhelp/source/cxxhelp/provider/databases.cxx | 10 | ||||
-rw-r--r-- | xmlhelp/source/cxxhelp/provider/databases.hxx | 6 | ||||
-rw-r--r-- | xmlhelp/source/cxxhelp/provider/db.hxx | 6 | ||||
-rw-r--r-- | xmlhelp/source/treeview/tvread.cxx | 17 | ||||
-rw-r--r-- | xmlhelp/source/treeview/tvread.hxx | 4 |
5 files changed, 14 insertions, 29 deletions
diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx index 7d9c7e50334f..2abd91bb77f2 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.cxx +++ b/xmlhelp/source/cxxhelp/provider/databases.cxx @@ -52,6 +52,7 @@ #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/beans/NamedValue.hpp> #include <com/sun/star/frame/XConfigManager.hpp> +#include <com/sun/star/ucb/SimpleFileAccess.hpp> #include <com/sun/star/util/XMacroExpander.hpp> #include <com/sun/star/uri/XUriReferenceFactory.hpp> #include <com/sun/star/uri/XVndSunStarExpandUrl.hpp> @@ -181,9 +182,7 @@ Databases::Databases( sal_Bool showBasic, setInstallPath( instPath ); - m_xSFA = Reference< ucb::XSimpleFileAccess >( - m_xSMgr->createInstanceWithContext( rtl::OUString( "com.sun.star.ucb.SimpleFileAccess" ), - m_xContext ), UNO_QUERY_THROW ); + m_xSFA = ucb::SimpleFileAccess::create(m_xContext); } Databases::~Databases() @@ -1449,10 +1448,7 @@ void ExtensionIteratorBase::init() Reference< XInterface >() ); } - Reference< XMultiComponentFactory > xSMgr( m_xContext->getServiceManager(), UNO_QUERY ); - m_xSFA = Reference< ucb::XSimpleFileAccess >( - xSMgr->createInstanceWithContext( rtl::OUString( "com.sun.star.ucb.SimpleFileAccess" ), - m_xContext ), UNO_QUERY_THROW ); + m_xSFA = ucb::SimpleFileAccess::create(m_xContext); m_bUserPackagesLoaded = false; m_bSharedPackagesLoaded = false; diff --git a/xmlhelp/source/cxxhelp/provider/databases.hxx b/xmlhelp/source/cxxhelp/provider/databases.hxx index 028fad1931bf..f3153283e136 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.hxx +++ b/xmlhelp/source/cxxhelp/provider/databases.hxx @@ -44,7 +44,7 @@ #include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/i18n/XCollator.hpp> #include <com/sun/star/deployment/XPackage.hpp> -#include "com/sun/star/ucb/XSimpleFileAccess.hpp" +#include "com/sun/star/ucb/XSimpleFileAccess2.hpp" // Forward declaration @@ -293,7 +293,7 @@ namespace chelp { osl::Mutex m_aMutex; com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > m_xContext; com::sun::star::uno::Reference< com::sun::star::lang::XMultiComponentFactory > m_xSMgr; - com::sun::star::uno::Reference< com::sun::star::ucb::XSimpleFileAccess > m_xSFA; + com::sun::star::uno::Reference< com::sun::star::ucb::XSimpleFileAccess2 > m_xSFA; sal_Bool m_bShowBasic; int m_nErrorDocLength; @@ -436,7 +436,7 @@ namespace chelp { com::sun::star::uno::Reference< com::sun::star::deployment::XPackage > xPackage ); com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > m_xContext; - com::sun::star::uno::Reference< com::sun::star::ucb::XSimpleFileAccess > m_xSFA; + com::sun::star::uno::Reference< com::sun::star::ucb::XSimpleFileAccess2 > m_xSFA; Databases& m_rDatabases; IteratorState m_eState; diff --git a/xmlhelp/source/cxxhelp/provider/db.hxx b/xmlhelp/source/cxxhelp/provider/db.hxx index 402a734fc7d9..f961f96ae161 100644 --- a/xmlhelp/source/cxxhelp/provider/db.hxx +++ b/xmlhelp/source/cxxhelp/provider/db.hxx @@ -34,7 +34,7 @@ #include <berkeleydb/db.h> #endif -#include "com/sun/star/ucb/XSimpleFileAccess.hpp" +#include "com/sun/star/ucb/XSimpleFileAccess2.hpp" #include <boost/unordered_map.hpp> #include <rtl/string.hxx> @@ -120,7 +120,7 @@ namespace berkeleydbproxy { rtl::OUString m_aFileURL; StringToDataMap* m_pStringToDataMap; StringToValPosMap* m_pStringToValPosMap; - com::sun::star::uno::Reference< com::sun::star::ucb::XSimpleFileAccess > + com::sun::star::uno::Reference< com::sun::star::ucb::XSimpleFileAccess2 > m_xSFA; com::sun::star::uno::Sequence< sal_Int8 > @@ -136,7 +136,7 @@ namespace berkeleydbproxy { //SimpleFileAccess requires file URLs as arguments. Passing file path may work but fails //for example when using long file paths on Windows, which start with "\\?\" DBHelp( const rtl::OUString& rFileURL, - com::sun::star::uno::Reference< com::sun::star::ucb::XSimpleFileAccess > xSFA ) + com::sun::star::uno::Reference< com::sun::star::ucb::XSimpleFileAccess2 > xSFA ) : m_aFileURL( rFileURL ) , m_pStringToDataMap( NULL ) , m_pStringToValPosMap( NULL ) diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx index 8679fa520abe..c61b41226651 100644 --- a/xmlhelp/source/treeview/tvread.cxx +++ b/xmlhelp/source/treeview/tvread.cxx @@ -35,11 +35,11 @@ #include <expat.h> #include <osl/file.hxx> #include <unotools/configmgr.hxx> +#include <com/sun/star/ucb/SimpleFileAccess.hpp> #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> #include "com/sun/star/deployment/thePackageManagerFactory.hpp" #include <com/sun/star/util/XMacroExpander.hpp> #include <com/sun/star/uri/XUriReferenceFactory.hpp> @@ -966,15 +966,7 @@ ExtensionIteratorBase::ExtensionIteratorBase( const rtl::OUString& aLanguage ) void ExtensionIteratorBase::init() { - Reference< XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory(); - Reference< XPropertySet > xProps( xFactory, UNO_QUERY ); - OSL_ASSERT( xProps.is() ); - if (xProps.is()) - { - xProps->getPropertyValue( - ::rtl::OUString( "DefaultContext" ) ) >>= m_xContext; - OSL_ASSERT( m_xContext.is() ); - } + m_xContext = ::comphelper::getProcessComponentContext(); if( !m_xContext.is() ) { throw RuntimeException( @@ -982,10 +974,7 @@ void ExtensionIteratorBase::init() Reference< XInterface >() ); } - Reference< XMultiComponentFactory > xSMgr( m_xContext->getServiceManager(), UNO_QUERY ); - m_xSFA = Reference< ucb::XSimpleFileAccess >( - xSMgr->createInstanceWithContext( rtl::OUString( "com.sun.star.ucb.SimpleFileAccess" ), - m_xContext ), UNO_QUERY_THROW ); + m_xSFA = ucb::SimpleFileAccess::create(m_xContext); m_bUserPackagesLoaded = false; m_bSharedPackagesLoaded = false; diff --git a/xmlhelp/source/treeview/tvread.hxx b/xmlhelp/source/treeview/tvread.hxx index a6bd75135c71..48e22b22fe30 100644 --- a/xmlhelp/source/treeview/tvread.hxx +++ b/xmlhelp/source/treeview/tvread.hxx @@ -43,7 +43,7 @@ #include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/deployment/XPackage.hpp> -#include "com/sun/star/ucb/XSimpleFileAccess.hpp" +#include "com/sun/star/ucb/XSimpleFileAccess2.hpp" namespace treeview { @@ -354,7 +354,7 @@ namespace treeview { osl::Mutex m_aMutex; com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > m_xContext; - com::sun::star::uno::Reference< com::sun::star::ucb::XSimpleFileAccess > m_xSFA; + com::sun::star::uno::Reference< com::sun::star::ucb::XSimpleFileAccess2 > m_xSFA; IteratorState m_eState; rtl::OUString m_aLanguage; |