summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-02-04 13:20:48 +0200
committerNoel Grandin <noel@peralex.com>2013-02-12 10:14:43 +0200
commita6a8a8707b6ae111f94bac094d3c2909f523ca6f (patch)
tree402b668480b3106df0d3055cff037c8a768a419c /dbaccess
parentf1204419af34b1d2f0ecaa69ceeb1f8c8a7d87df (diff)
fdo#46808, convert xmloff module code to use XComponentContext
with lots of repurcussions in other modules Change-Id: I6982671eecc701b06cf85d93533e1fe618044fea
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx2
-rw-r--r--dbaccess/source/filter/xml/xmlTable.cxx4
-rw-r--r--dbaccess/source/filter/xml/xmlfilter.cxx23
-rw-r--r--dbaccess/source/filter/xml/xmlfilter.hxx2
4 files changed, 21 insertions, 10 deletions
diff --git a/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx b/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx
index 5afe4c9a86f7..67f2dd8db641 100644
--- a/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx
+++ b/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx
@@ -100,7 +100,7 @@ OXMLFileBasedDatabase::OXMLFileBasedDatabase( ODBFilter& rImport,
}
if ( !(sLocation.isEmpty() || sMediaType.isEmpty()) )
{
- ::dbaccess::ODsnTypeCollection aTypeCollection(comphelper::getComponentContext(rImport.getServiceFactory()));
+ ::dbaccess::ODsnTypeCollection aTypeCollection(rImport.GetComponentContext());
::rtl::OUString sURL(aTypeCollection.getDatasourcePrefixFromMediaType(sMediaType,sFileTypeExtension));
sURL += sLocation;
try
diff --git a/dbaccess/source/filter/xml/xmlTable.cxx b/dbaccess/source/filter/xml/xmlTable.cxx
index ca8ffd19ead7..994d1cfaddb8 100644
--- a/dbaccess/source/filter/xml/xmlTable.cxx
+++ b/dbaccess/source/filter/xml/xmlTable.cxx
@@ -99,7 +99,9 @@ OXMLTable::OXMLTable( ODBFilter& _rImport
aValue.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Parent"));
aValue.Value <<= m_xParentContainer;
aArguments[1] <<= aValue;
- m_xTable.set(GetOwnImport().getServiceFactory()->createInstanceWithArguments(m_sServiceName,aArguments),UNO_QUERY);
+ m_xTable.set(
+ GetOwnImport().GetComponentContext()->getServiceManager()->createInstanceWithArgumentsAndContext(m_sServiceName,aArguments, GetOwnImport().GetComponentContext()),
+ UNO_QUERY);
}
// -----------------------------------------------------------------------------
diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx b/dbaccess/source/filter/xml/xmlfilter.cxx
index 0187a0b2158d..183d58b6abc9 100644
--- a/dbaccess/source/filter/xml/xmlfilter.cxx
+++ b/dbaccess/source/filter/xml/xmlfilter.cxx
@@ -357,8 +357,8 @@ sal_Int32 ReadThroughComponent(
// -------------
DBG_NAME(ODBFilter)
-ODBFilter::ODBFilter( const uno::Reference< XMultiServiceFactory >& _rxMSF )
- :SvXMLImport(_rxMSF)
+ODBFilter::ODBFilter( const uno::Reference< XComponentContext >& _rxContext )
+ :SvXMLImport(_rxContext)
,m_bNewFormat(false)
{
DBG_CTOR(ODBFilter,NULL);
@@ -382,7 +382,16 @@ ODBFilter::~ODBFilter() throw()
DBG_DTOR(ODBFilter,NULL);
}
// -----------------------------------------------------------------------------
-IMPLEMENT_SERVICE_INFO1_STATIC( ODBFilter, "com.sun.star.comp.sdb.DBFilter", "com.sun.star.document.ImportFilter")
+IMPLEMENT_SERVICE_INFO_IMPLNAME_STATIC(ODBFilter, "com.sun.star.comp.sdb.DBFilter")
+IMPLEMENT_SERVICE_INFO_SUPPORTS(ODBFilter)
+IMPLEMENT_SERVICE_INFO_GETSUPPORTED1_STATIC(ODBFilter, "com.sun.star.document.ImportFilter")
+
+::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
+ SAL_CALL ODBFilter::Create(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB)
+{
+ return static_cast< XServiceInfo* >(new ODBFilter( comphelper::getComponentContext(_rxORB)));
+}
+
// -----------------------------------------------------------------------------
sal_Bool SAL_CALL ODBFilter::filter( const Sequence< PropertyValue >& rDescriptor )
throw (RuntimeException)
@@ -446,7 +455,7 @@ sal_Bool ODBFilter::implImport( const Sequence< PropertyValue >& rDescriptor )
uno::Reference<sdb::XOfficeDatabaseDocument> xOfficeDoc(GetModel(),UNO_QUERY_THROW);
m_xDataSource.set(xOfficeDoc->getDataSource(),UNO_QUERY_THROW);
- uno::Reference<beans::XPropertyChangeListener> xListener = new DatasourceURLListener( comphelper::getComponentContext(getServiceFactory()));
+ uno::Reference<beans::XPropertyChangeListener> xListener = new DatasourceURLListener( GetComponentContext());
m_xDataSource->addPropertyChangeListener(PROPERTY_URL,xListener);
uno::Reference< XNumberFormatsSupplier > xNum(m_xDataSource->getPropertyValue(PROPERTY_NUMBERFORMATSSUPPLIER),UNO_QUERY);
SetNumberFormatsSupplier(xNum);
@@ -456,7 +465,7 @@ sal_Bool ODBFilter::implImport( const Sequence< PropertyValue >& rDescriptor )
,xModel
,"settings.xml"
,"Settings.xml"
- ,comphelper::getComponentContext(getServiceFactory())
+ ,GetComponentContext()
,this
);
@@ -465,7 +474,7 @@ sal_Bool ODBFilter::implImport( const Sequence< PropertyValue >& rDescriptor )
,xModel
,"content.xml"
,"Content.xml"
- ,comphelper::getComponentContext(getServiceFactory())
+ ,GetComponentContext()
,this
);
@@ -871,7 +880,7 @@ void ODBFilter::setPropertyInfo()
if ( !xDataSource.is() )
return;
- ::connectivity::DriversConfig aDriverConfig(comphelper::getComponentContext(getServiceFactory()));
+ ::connectivity::DriversConfig aDriverConfig(GetComponentContext());
const ::rtl::OUString sURL = ::comphelper::getString(xDataSource->getPropertyValue(PROPERTY_URL));
::comphelper::NamedValueCollection aDataSourceSettings = aDriverConfig.getProperties( sURL );
diff --git a/dbaccess/source/filter/xml/xmlfilter.hxx b/dbaccess/source/filter/xml/xmlfilter.hxx
index 4b8303667aa4..1b9e65595ab2 100644
--- a/dbaccess/source/filter/xml/xmlfilter.hxx
+++ b/dbaccess/source/filter/xml/xmlfilter.hxx
@@ -112,7 +112,7 @@ protected:
virtual ~ODBFilter() throw();
public:
- ODBFilter( const Reference< XMultiServiceFactory >& _rxMSF );
+ ODBFilter( const Reference< XComponentContext >& _rxContext );
// XFilter
virtual sal_Bool SAL_CALL filter( const Sequence< PropertyValue >& rDescriptor ) throw(RuntimeException);