Kaydet (Commit) 48f2b7a7 authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Stephan Bergmann

fdo#46808, convert ucbhelper::ResultSet to XComponentContext

Along the way, remove the XMultiServiceFactory member from
a few classes that were not using it.

Change-Id: I9ee2c2ebc01144301ed8e489bd92b4695ff263d0
üst f96db7d0
......@@ -78,15 +78,12 @@ struct DataSupplier_Impl
osl::Mutex m_aMutex;
ResultList m_aResults;
rtl::Reference< ODocumentContainer > m_xContent;
Reference< XMultiServiceFactory > m_xSMgr;
sal_Int32 m_nOpenMode;
sal_Bool m_bCountFinal;
DataSupplier_Impl( const Reference< XMultiServiceFactory >& rxSMgr,
const rtl::Reference< ODocumentContainer >& rContent,
DataSupplier_Impl( const rtl::Reference< ODocumentContainer >& rContent,
sal_Int32 nOpenMode )
: m_xContent(rContent)
, m_xSMgr( rxSMgr )
, m_nOpenMode( nOpenMode )
, m_bCountFinal( sal_False ) {}
~DataSupplier_Impl();
......@@ -114,10 +111,9 @@ DataSupplier_Impl::~DataSupplier_Impl()
//=========================================================================
DBG_NAME(DataSupplier)
DataSupplier::DataSupplier( const Reference< XMultiServiceFactory >& rxSMgr,
const rtl::Reference< ODocumentContainer >& rContent,
DataSupplier::DataSupplier( const rtl::Reference< ODocumentContainer >& rContent,
sal_Int32 nOpenMode )
: m_pImpl( new DataSupplier_Impl( rxSMgr, rContent,nOpenMode ) )
: m_pImpl( new DataSupplier_Impl( rContent,nOpenMode ) )
{
DBG_CTOR(DataSupplier,NULL);
......
......@@ -34,9 +34,7 @@ class DataSupplier : public ucbhelper::ResultSetDataSupplier
::std::auto_ptr<DataSupplier_Impl> m_pImpl;
public:
DataSupplier( const com::sun::star::uno::Reference<
com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
const rtl::Reference< ODocumentContainer >& rxContent,
DataSupplier( const rtl::Reference< ODocumentContainer >& rxContent,
sal_Int32 nOpenMode );
virtual ~DataSupplier();
......
......@@ -29,6 +29,7 @@
#include "myucp_datasupplier.hxx"
#include "myucp_resultset.hxx"
#include <comphelper/processfactory.hxx>
using namespace ::com::sun::star::uno;
......@@ -66,10 +67,9 @@ DynamicResultSet::DynamicResultSet(
void DynamicResultSet::initStatic()
{
m_xResultSet1
= new ::ucbhelper::ResultSet( m_xSMgr,
= new ::ucbhelper::ResultSet( comphelper::getComponentContext(m_xSMgr),
m_aCommand.Properties,
new DataSupplier( m_xSMgr,
m_xContent,
new DataSupplier( m_xContent,
m_aCommand.Mode ),
m_xEnv );
}
......@@ -77,10 +77,9 @@ void DynamicResultSet::initStatic()
void DynamicResultSet::initDynamic()
{
m_xResultSet1
= new ::ucbhelper::ResultSet( m_xSMgr,
= new ::ucbhelper::ResultSet( comphelper::getComponentContext(m_xSMgr),
m_aCommand.Properties,
new DataSupplier( m_xSMgr,
m_xContent,
new DataSupplier( m_xContent,
m_aCommand.Mode ),
m_xEnv );
m_xResultSet2 = m_xResultSet1;
......
......@@ -32,6 +32,7 @@ $(eval $(call gb_Library_set_componentfile,ucpgio1,ucb/source/ucp/gio/ucpgio))
$(eval $(call gb_Library_use_sdk_api,ucpgio1))
$(eval $(call gb_Library_use_libraries,ucpgio1,\
comphelper \
cppu \
cppuhelper \
sal \
......
......@@ -28,9 +28,8 @@ namespace cmis
typedef std::vector< ResultListEntry* > ResultList;
DataSupplier::DataSupplier( const uno::Reference< lang::XMultiServiceFactory >& rxSMgr,
ChildrenProvider* pChildrenProvider, sal_Int32 nOpenMode )
: m_pChildrenProvider( pChildrenProvider ), m_xSMgr(rxSMgr), mnOpenMode(nOpenMode), mbCountFinal(false)
DataSupplier::DataSupplier( ChildrenProvider* pChildrenProvider, sal_Int32 nOpenMode )
: m_pChildrenProvider( pChildrenProvider ), mnOpenMode(nOpenMode), mbCountFinal(false)
{
}
......
......@@ -41,15 +41,13 @@ namespace cmis
{
private:
ChildrenProvider* m_pChildrenProvider;
com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xSMgr;
sal_Int32 mnOpenMode;
bool mbCountFinal;
bool getData();
ResultList maResults;
public:
DataSupplier( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
ChildrenProvider* pChildrenProvider, sal_Int32 nOpenMode );
DataSupplier( ChildrenProvider* pChildrenProvider, sal_Int32 nOpenMode );
virtual ~DataSupplier();
......
......@@ -9,6 +9,7 @@
#include "cmis_datasupplier.hxx"
#include "cmis_resultset.hxx"
#include <comphelper/processfactory.hxx>
using namespace com::sun::star::lang;
using namespace com::sun::star::ucb;
......@@ -30,8 +31,8 @@ namespace cmis
void DynamicResultSet::initStatic()
{
m_xResultSet1 = new ::ucbhelper::ResultSet(
m_xSMgr, m_aCommand.Properties,
new DataSupplier( m_xSMgr, m_pChildrenProvider, m_aCommand.Mode ), m_xEnv );
comphelper::getComponentContext(m_xSMgr), m_aCommand.Properties,
new DataSupplier( m_pChildrenProvider, m_aCommand.Mode ), m_xEnv );
}
void DynamicResultSet::initDynamic()
......
......@@ -22,6 +22,7 @@
#include "ucpext_datasupplier.hxx"
#include <ucbhelper/resultset.hxx>
#include <comphelper/processfactory.hxx>
//......................................................................................................................
namespace ucb { namespace ucp { namespace ext
......@@ -67,7 +68,7 @@ namespace ucb { namespace ucp { namespace ext
m_aCommand.Mode
) );
m_xResultSet1 = new ::ucbhelper::ResultSet(
m_xSMgr,
comphelper::getComponentContext(m_xSMgr),
m_aCommand.Properties,
pDataSupplier.get(),
m_xEnvironment
......
......@@ -19,6 +19,7 @@
#include "gio_datasupplier.hxx"
#include "gio_resultset.hxx"
#include "comphelper/processfactory.hxx"
using namespace com::sun::star::lang;
using namespace com::sun::star::ucb;
......@@ -40,7 +41,7 @@ DynamicResultSet::DynamicResultSet(
void DynamicResultSet::initStatic()
{
m_xResultSet1 = new ::ucbhelper::ResultSet(
m_xSMgr, m_aCommand.Properties,
comphelper::getComponentContext(m_xSMgr), m_aCommand.Properties,
new DataSupplier( m_xSMgr, m_xContent, m_aCommand.Mode ), m_xEnv );
}
......
......@@ -31,6 +31,7 @@
#include <libgnomevfs/gnome-vfs-utils.h>
#include <libgnomevfs/gnome-vfs-directory.h>
#include <comphelper/processfactory.hxx>
using namespace com::sun::star;
using namespace gvfs;
......@@ -50,10 +51,9 @@ DynamicResultSet::DynamicResultSet(
void DynamicResultSet::initStatic()
{
m_xResultSet1
= new ::ucbhelper::ResultSet( m_xSMgr,
= new ::ucbhelper::ResultSet( comphelper::getComponentContext(m_xSMgr),
m_aCommand.Properties,
new DataSupplier( m_xSMgr,
m_xContent,
new DataSupplier( m_xContent,
m_aCommand.Mode ),
m_xEnv );
}
......@@ -108,15 +108,13 @@ struct gvfs::DataSupplier_Impl
osl::Mutex m_aMutex;
ResultList m_aResults;
rtl::Reference< Content > m_xContent;
uno::Reference< lang::XMultiServiceFactory > m_xSMgr;
sal_Int32 m_nOpenMode;
sal_Bool m_bCountFinal;
DataSupplier_Impl(
const uno::Reference< lang::XMultiServiceFactory >& rxSMgr,
const rtl::Reference< Content >& rContent,
sal_Int32 nOpenMode )
: m_xContent( rContent ), m_xSMgr( rxSMgr ),
: m_xContent( rContent ),
m_nOpenMode( nOpenMode ), m_bCountFinal( sal_False ) {}
~DataSupplier_Impl()
{
......@@ -132,10 +130,9 @@ struct gvfs::DataSupplier_Impl
};
DataSupplier::DataSupplier(
const uno::Reference< lang::XMultiServiceFactory >& rxSMgr,
const rtl::Reference< Content >& rContent,
sal_Int32 nOpenMode )
: m_pImpl( new DataSupplier_Impl( rxSMgr, rContent, nOpenMode ) )
: m_pImpl( new DataSupplier_Impl( rContent, nOpenMode ) )
{
}
......
......@@ -54,9 +54,7 @@ private:
sal_Bool getData();
public:
DataSupplier( const com::sun::star::uno::Reference<
com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
const rtl::Reference< Content >& rContent,
DataSupplier(const rtl::Reference< Content >& rContent,
sal_Int32 nOpenMode);
virtual ~DataSupplier();
......
......@@ -28,6 +28,7 @@
*************************************************************************/
#include "hierarchydatasupplier.hxx"
#include "dynamicresultset.hxx"
#include <comphelper/processfactory.hxx>
using namespace com::sun::star;
using namespace hierarchy_ucp;
......@@ -59,7 +60,7 @@ void DynamicResultSet::initStatic()
{
m_xResultSet1
= new ::ucbhelper::ResultSet(
m_xSMgr,
comphelper::getComponentContext(m_xSMgr),
m_aCommand.Properties,
new HierarchyResultSetDataSupplier( m_xSMgr,
m_xContent,
......@@ -71,7 +72,7 @@ void DynamicResultSet::initDynamic()
{
m_xResultSet1
= new ::ucbhelper::ResultSet(
m_xSMgr,
comphelper::getComponentContext(m_xSMgr),
m_aCommand.Properties,
new HierarchyResultSetDataSupplier( m_xSMgr,
m_xContent,
......
......@@ -32,6 +32,7 @@
*************************************************************************/
#include "odma_datasupplier.hxx"
#include "odma_resultset.hxx"
#include "comphelper/processfactory.hxx"
using namespace com::sun::star::lang;
using namespace com::sun::star::ucb;
......@@ -67,7 +68,7 @@ DynamicResultSet::DynamicResultSet(
void DynamicResultSet::initStatic()
{
m_xResultSet1
= new ::ucbhelper::ResultSet( m_xSMgr,
= new ::ucbhelper::ResultSet( comphelper::getComponentContext(m_xSMgr),
m_aCommand.Properties,
new DataSupplier( m_xSMgr,
m_xContent,
......@@ -79,7 +80,7 @@ void DynamicResultSet::initStatic()
void DynamicResultSet::initDynamic()
{
m_xResultSet1
= new ::ucbhelper::ResultSet( m_xSMgr,
= new ::ucbhelper::ResultSet( comphelper::getComponentContext(m_xSMgr),
m_aCommand.Properties,
new DataSupplier( m_xSMgr,
m_xContent,
......
......@@ -28,6 +28,7 @@
*************************************************************************/
#include "pkgdatasupplier.hxx"
#include "pkgresultset.hxx"
#include <comphelper/processfactory.hxx>
using namespace com::sun::star;
......@@ -61,7 +62,7 @@ DynamicResultSet::DynamicResultSet(
void DynamicResultSet::initStatic()
{
m_xResultSet1
= new ::ucbhelper::ResultSet( m_xSMgr,
= new ::ucbhelper::ResultSet( comphelper::getComponentContext(m_xSMgr),
m_aCommand.Properties,
new DataSupplier( m_xSMgr,
m_xContent,
......@@ -73,7 +74,7 @@ void DynamicResultSet::initStatic()
void DynamicResultSet::initDynamic()
{
m_xResultSet1
= new ::ucbhelper::ResultSet( m_xSMgr,
= new ::ucbhelper::ResultSet( comphelper::getComponentContext(m_xSMgr),
m_aCommand.Properties,
new DataSupplier( m_xSMgr,
m_xContent,
......
......@@ -32,6 +32,7 @@
#include "tdoc_datasupplier.hxx"
#include "tdoc_resultset.hxx"
#include "tdoc_content.hxx"
#include <comphelper/processfactory.hxx>
using namespace com::sun::star;
using namespace tdoc_ucp;
......@@ -63,7 +64,7 @@ void DynamicResultSet::initStatic()
{
m_xResultSet1
= new ::ucbhelper::ResultSet(
m_xSMgr,
comphelper::getComponentContext(m_xSMgr),
m_aCommand.Properties,
new ResultSetDataSupplier( m_xSMgr,
m_xContent,
......@@ -75,7 +76,7 @@ void DynamicResultSet::initDynamic()
{
m_xResultSet1
= new ::ucbhelper::ResultSet(
m_xSMgr,
comphelper::getComponentContext(m_xSMgr),
m_aCommand.Properties,
new ResultSetDataSupplier( m_xSMgr,
m_xContent,
......
......@@ -37,6 +37,7 @@
*************************************************************************/
#include "webdavresultset.hxx"
#include "DAVSession.hxx"
#include <comphelper/processfactory.hxx>
using namespace com::sun::star;
using namespace webdav_ucp;
......@@ -69,7 +70,7 @@ DynamicResultSet::DynamicResultSet(
void DynamicResultSet::initStatic()
{
m_xResultSet1
= new ::ucbhelper::ResultSet( m_xSMgr,
= new ::ucbhelper::ResultSet( comphelper::getComponentContext(m_xSMgr),
m_aCommand.Properties,
new DataSupplier( m_xSMgr,
m_xContent,
......@@ -81,7 +82,7 @@ void DynamicResultSet::initStatic()
void DynamicResultSet::initDynamic()
{
m_xResultSet1
= new ::ucbhelper::ResultSet( m_xSMgr,
= new ::ucbhelper::ResultSet( comphelper::getComponentContext(m_xSMgr),
m_aCommand.Properties,
new DataSupplier( m_xSMgr,
m_xContent,
......
......@@ -30,6 +30,8 @@
#include "DAVSession.hxx"
#endif
#include "comphelper/processfactory.hxx"
using namespace com::sun::star;
using namespace http_dav_ucp;
......@@ -61,7 +63,7 @@ DynamicResultSet::DynamicResultSet(
void DynamicResultSet::initStatic()
{
m_xResultSet1
= new ::ucbhelper::ResultSet( m_xSMgr,
= new ::ucbhelper::ResultSet( comphelper::getComponentContext(m_xSMgr),
m_aCommand.Properties,
new DataSupplier( m_xSMgr,
m_xContent,
......@@ -73,7 +75,7 @@ void DynamicResultSet::initStatic()
void DynamicResultSet::initDynamic()
{
m_xResultSet1
= new ::ucbhelper::ResultSet( m_xSMgr,
= new ::ucbhelper::ResultSet( comphelper::getComponentContext(m_xSMgr),
m_aCommand.Properties,
new DataSupplier( m_xSMgr,
m_xContent,
......
......@@ -83,7 +83,7 @@ public:
*/
ResultSet(
const com::sun::star::uno::Reference<
com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
com::sun::star::uno::XComponentContext >& rxContext,
const com::sun::star::uno::Sequence<
com::sun::star::beans::Property >& rProperties,
const rtl::Reference< ResultSetDataSupplier >& rDataSupplier );
......@@ -99,7 +99,7 @@ public:
*/
ResultSet(
const com::sun::star::uno::Reference<
com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
com::sun::star::uno::XComponentContext >& rxContext,
const com::sun::star::uno::Sequence<
com::sun::star::beans::Property >& rProperties,
const rtl::Reference< ResultSetDataSupplier >& rDataSupplier,
......
......@@ -86,7 +86,6 @@ class PropertySetInfo :
public lang::XTypeProvider,
public beans::XPropertySetInfo
{
uno::Reference< lang::XMultiServiceFactory > m_xSMgr;
uno::Sequence< beans::Property >* m_pProps;
private:
......@@ -95,7 +94,6 @@ private:
public:
PropertySetInfo(
const uno::Reference< lang::XMultiServiceFactory >& rxSMgr,
const PropertyInfo* pProps,
sal_Int32 nProps );
virtual ~PropertySetInfo();
......@@ -173,7 +171,7 @@ namespace ucbhelper
struct ResultSet_Impl
{
uno::Reference< lang::XMultiServiceFactory > m_xSMgr;
uno::Reference< uno::XComponentContext > m_xContext;
uno::Reference< com::sun::star::ucb::XCommandEnvironment > m_xEnv;
uno::Reference< beans::XPropertySetInfo > m_xPropSetInfo;
uno::Reference< sdbc::XResultSetMetaData > m_xMetaData;
......@@ -187,7 +185,7 @@ struct ResultSet_Impl
sal_Bool m_bAfterLast;
inline ResultSet_Impl(
const uno::Reference< lang::XMultiServiceFactory >& rxSMgr,
const uno::Reference< uno::XComponentContext >& rxContext,
const uno::Sequence< beans::Property >& rProperties,
const rtl::Reference< ResultSetDataSupplier >& rDataSupplier,
const uno::Reference< com::sun::star::ucb::XCommandEnvironment >&
......@@ -196,11 +194,11 @@ struct ResultSet_Impl
};
inline ResultSet_Impl::ResultSet_Impl(
const uno::Reference< lang::XMultiServiceFactory >& rxSMgr,
const uno::Reference< uno::XComponentContext >& rxContext,
const uno::Sequence< beans::Property >& rProperties,
const rtl::Reference< ResultSetDataSupplier >& rDataSupplier,
const uno::Reference< com::sun::star::ucb::XCommandEnvironment >& rxEnv )
: m_xSMgr( rxSMgr ),
: m_xContext( rxContext ),
m_xEnv( rxEnv ),
m_aProperties( rProperties ),
m_xDataSupplier( rDataSupplier ),
......@@ -228,11 +226,11 @@ inline ResultSet_Impl::~ResultSet_Impl()
//=========================================================================
ResultSet::ResultSet(
const uno::Reference< lang::XMultiServiceFactory >& rxSMgr,
const uno::Reference< uno::XComponentContext >& rxContext,
const uno::Sequence< beans::Property >& rProperties,
const rtl::Reference< ResultSetDataSupplier >& rDataSupplier )
: m_pImpl( new ResultSet_Impl(
rxSMgr,
rxContext,
rProperties,
rDataSupplier,
uno::Reference< com::sun::star::ucb::XCommandEnvironment >() ) )
......@@ -242,11 +240,11 @@ ResultSet::ResultSet(
//=========================================================================
ResultSet::ResultSet(
const uno::Reference< lang::XMultiServiceFactory >& rxSMgr,
const uno::Reference< uno::XComponentContext >& rxContext,
const uno::Sequence< beans::Property >& rProperties,
const rtl::Reference< ResultSetDataSupplier >& rDataSupplier,
const uno::Reference< com::sun::star::ucb::XCommandEnvironment >& rxEnv )
: m_pImpl( new ResultSet_Impl( rxSMgr, rProperties, rDataSupplier, rxEnv ) )
: m_pImpl( new ResultSet_Impl( rxContext, rProperties, rDataSupplier, rxEnv ) )
{
rDataSupplier->m_pResultSet = this;
}
......@@ -372,7 +370,7 @@ uno::Reference< sdbc::XResultSetMetaData > SAL_CALL ResultSet::getMetaData()
osl::MutexGuard aGuard( m_pImpl->m_aMutex );
if ( !m_pImpl->m_xMetaData.is() )
m_pImpl->m_xMetaData = new ResultSetMetaData( ucbhelper::getComponentContext(m_pImpl->m_xSMgr),
m_pImpl->m_xMetaData = new ResultSetMetaData( m_pImpl->m_xContext,
m_pImpl->m_aProperties );
return m_pImpl->m_xMetaData;
......@@ -1328,8 +1326,7 @@ ResultSet::getPropertySetInfo()
if ( !m_pImpl->m_xPropSetInfo.is() )
m_pImpl->m_xPropSetInfo
= new PropertySetInfo( m_pImpl->m_xSMgr,
aPropertyTable,
= new PropertySetInfo( aPropertyTable,
RESULTSET_PROPERTY_COUNT );
return m_pImpl->m_xPropSetInfo;
}
......@@ -1575,10 +1572,8 @@ namespace ucbhelper_impl {
//=========================================================================
PropertySetInfo::PropertySetInfo(
const uno::Reference< lang::XMultiServiceFactory >& rxSMgr,
const PropertyInfo* pProps,
sal_Int32 nProps )
: m_xSMgr( rxSMgr )
{
m_pProps = new uno::Sequence< beans::Property >( nProps );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment