summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-01-16 15:16:05 +0200
committerNoel Grandin <noel@peralex.com>2013-02-11 08:02:10 +0200
commit9a36294079a13d713490ed754be441d9dbc214ce (patch)
tree6bd7c23e2cdfba1d03dedf689646e67bae0cca54 /dbaccess
parent7841fd1536e018defaf9cbeb283cb82b687f95e1 (diff)
fdo#46808, Adapt java::JavaVirtualMachine UNO service to new style
Change-Id: Ib0329b9cdc4290ce98c4182e8466c1b44b408341
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx2
-rw-r--r--dbaccess/source/filter/xml/xmlTable.cxx2
-rw-r--r--dbaccess/source/filter/xml/xmlfilter.cxx22
-rw-r--r--dbaccess/source/filter/xml/xmlfilter.hxx1
-rw-r--r--dbaccess/source/ui/dlg/ConnectionPage.cxx2
-rw-r--r--dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx4
-rw-r--r--dbaccess/source/ui/dlg/detailpages.cxx2
7 files changed, 17 insertions, 18 deletions
diff --git a/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx b/dbaccess/source/filter/xml/xmlFileBasedDatabase.cxx
index 623bacdd1f5c..5afe4c9a86f7 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.getORB()));
+ ::dbaccess::ODsnTypeCollection aTypeCollection(comphelper::getComponentContext(rImport.getServiceFactory()));
::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 e8a124c5c1b9..ca8ffd19ead7 100644
--- a/dbaccess/source/filter/xml/xmlTable.cxx
+++ b/dbaccess/source/filter/xml/xmlTable.cxx
@@ -99,7 +99,7 @@ OXMLTable::OXMLTable( ODBFilter& _rImport
aValue.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Parent"));
aValue.Value <<= m_xParentContainer;
aArguments[1] <<= aValue;
- m_xTable.set(GetOwnImport().getORB()->createInstanceWithArguments(m_sServiceName,aArguments),UNO_QUERY);
+ m_xTable.set(GetOwnImport().getServiceFactory()->createInstanceWithArguments(m_sServiceName,aArguments),UNO_QUERY);
}
// -----------------------------------------------------------------------------
diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx b/dbaccess/source/filter/xml/xmlfilter.cxx
index 21c2da5eb152..0187a0b2158d 100644
--- a/dbaccess/source/filter/xml/xmlfilter.cxx
+++ b/dbaccess/source/filter/xml/xmlfilter.cxx
@@ -83,8 +83,8 @@ namespace dbaxml
{
public:
typedef enum { E_JAVA, E_CALC } StartType;
- FastLoader(uno::Reference< lang::XMultiServiceFactory > const & _xFactory,StartType _eType)
- :m_xFactory(_xFactory)
+ FastLoader(uno::Reference< uno::XComponentContext > const & _xContext,StartType _eType)
+ :m_xContext(_xContext)
,m_eWhat(_eType)
{}
@@ -95,7 +95,7 @@ namespace dbaxml
virtual void SAL_CALL run();
virtual void SAL_CALL onTerminated();
private:
- uno::Reference< lang::XMultiServiceFactory > m_xFactory;
+ uno::Reference< uno::XComponentContext > m_xContext;
StartType m_eWhat;
};
@@ -109,7 +109,7 @@ namespace dbaxml
s_bFirstTime = false;
try
{
- ::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM(m_xFactory);
+ ::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM(m_xContext);
}
catch (const uno::Exception&)
{
@@ -125,7 +125,7 @@ namespace dbaxml
s_bFirstTime = false;
try
{
- uno::Reference<frame::XDesktop2> xDesktop = frame::Desktop::create( comphelper::getComponentContext(m_xFactory) );
+ uno::Reference<frame::XDesktop2> xDesktop = frame::Desktop::create( m_xContext );
const ::rtl::OUString sTarget(RTL_CONSTASCII_USTRINGPARAM("_blank"));
sal_Int32 nFrameSearchFlag = frame::FrameSearchFlag::TASKS | frame::FrameSearchFlag::CREATE;
uno::Reference< frame::XFrame> xFrame = xDesktop->findFrame(sTarget,nFrameSearchFlag);
@@ -144,7 +144,7 @@ namespace dbaxml
aArgs[nLen].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Hidden"));
aArgs[nLen++].Value <<= sal_True;
- ::comphelper::MimeConfigurationHelper aHelper( comphelper::getComponentContext(m_xFactory) );
+ ::comphelper::MimeConfigurationHelper aHelper( m_xContext );
SvtModuleOptions aModuleOptions;
uno::Reference< frame::XModel > xModel(xFrameLoad->loadComponentFromURL(
aModuleOptions.GetFactoryEmptyDocumentURL( aModuleOptions.ClassifyFactoryByServiceName( aHelper.GetDocServiceNameFromMediaType(MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET) )),
@@ -169,14 +169,14 @@ namespace dbaxml
class DatasourceURLListener : public ::cppu::WeakImplHelper1< beans::XPropertyChangeListener >
{
- uno::Reference< lang::XMultiServiceFactory > m_xFactory;
+ uno::Reference< uno::XComponentContext > m_xContext;
::dbaccess::ODsnTypeCollection m_aTypeCollection;
DatasourceURLListener(const DatasourceURLListener&);
void operator =(const DatasourceURLListener&);
protected:
virtual ~DatasourceURLListener(){}
public:
- DatasourceURLListener(uno::Reference< lang::XMultiServiceFactory > const & _xFactory) : m_xFactory(_xFactory),m_aTypeCollection(comphelper::getComponentContext(_xFactory)){}
+ DatasourceURLListener(uno::Reference< uno::XComponentContext > const & _xContext) : m_xContext(_xContext), m_aTypeCollection(_xContext){}
// XPropertyChangeListener
virtual void SAL_CALL propertyChange( const beans::PropertyChangeEvent& _rEvent ) throw (uno::RuntimeException)
{
@@ -186,11 +186,11 @@ namespace dbaxml
if ( m_aTypeCollection.needsJVM(sURL) )
{
- pCreatorThread = new FastLoader(m_xFactory,FastLoader::E_JAVA);
+ pCreatorThread = new FastLoader(m_xContext, FastLoader::E_JAVA);
}
else if ( sURL.matchIgnoreAsciiCaseAsciiL("sdbc:calc:",10,0) )
{
- pCreatorThread = new FastLoader(m_xFactory,FastLoader::E_CALC);
+ pCreatorThread = new FastLoader(m_xContext, FastLoader::E_CALC);
}
if ( pCreatorThread )
{
@@ -446,7 +446,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(getServiceFactory());
+ uno::Reference<beans::XPropertyChangeListener> xListener = new DatasourceURLListener( comphelper::getComponentContext(getServiceFactory()));
m_xDataSource->addPropertyChangeListener(PROPERTY_URL,xListener);
uno::Reference< XNumberFormatsSupplier > xNum(m_xDataSource->getPropertyValue(PROPERTY_NUMBERFORMATSSUPPLIER),UNO_QUERY);
SetNumberFormatsSupplier(xNum);
diff --git a/dbaccess/source/filter/xml/xmlfilter.hxx b/dbaccess/source/filter/xml/xmlfilter.hxx
index 46237c813507..4b8303667aa4 100644
--- a/dbaccess/source/filter/xml/xmlfilter.hxx
+++ b/dbaccess/source/filter/xml/xmlfilter.hxx
@@ -124,7 +124,6 @@ public:
virtual void SetViewSettings(const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aViewProps);
virtual void SetConfigurationSettings(const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aConfigProps);
- inline Reference< XMultiServiceFactory > getORB() { return getServiceFactory(); }
inline Reference<XPropertySet> getDataSource() const { return m_xDataSource; }
inline const TPropertyNameMap& getQuerySettings() const { return m_aQuerySettings;}
diff --git a/dbaccess/source/ui/dlg/ConnectionPage.cxx b/dbaccess/source/ui/dlg/ConnectionPage.cxx
index 925ac9ecfc49..77cfece9653c 100644
--- a/dbaccess/source/ui/dlg/ConnectionPage.cxx
+++ b/dbaccess/source/ui/dlg/ConnectionPage.cxx
@@ -318,7 +318,7 @@ namespace dbaui
{
if ( !m_aJavaDriver.GetText().isEmpty() )
{
- ::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM( Reference<XMultiServiceFactory>(m_pAdminDialog->getORB()->getServiceManager(), UNO_QUERY_THROW) );
+ ::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM( m_pAdminDialog->getORB() );
bSuccess = ::connectivity::existsJavaClassByName(xJVM,m_aJavaDriver.GetText());
}
}
diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
index b4150effa75e..fa86f15622f0 100644
--- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
+++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
@@ -557,7 +557,7 @@ DBG_NAME(OMySQLIntroPageSetup)
if ( !m_aETDriverClass.GetText().isEmpty() )
{
// TODO change jvmaccess
- ::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM( uno::Reference<lang::XMultiServiceFactory>(m_pAdminDialog->getORB()->getServiceManager(), uno::UNO_QUERY_THROW) );
+ ::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM( m_pAdminDialog->getORB() );
bSuccess = ::connectivity::existsJavaClassByName(xJVM,m_aETDriverClass.GetText());
}
}
@@ -677,7 +677,7 @@ DBG_NAME(OMySQLIntroPageSetup)
if ( !m_aETDriverClass.GetText().isEmpty() )
{
// TODO change jvmaccess
- ::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM( uno::Reference<lang::XMultiServiceFactory>(m_pAdminDialog->getORB()->getServiceManager(), uno::UNO_QUERY_THROW) );
+ ::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM( m_pAdminDialog->getORB() );
bSuccess = xJVM.is() && ::connectivity::existsJavaClassByName(xJVM,m_aETDriverClass.GetText());
}
}
diff --git a/dbaccess/source/ui/dlg/detailpages.cxx b/dbaccess/source/ui/dlg/detailpages.cxx
index f79cab6d354c..0c62704e41c4 100644
--- a/dbaccess/source/ui/dlg/detailpages.cxx
+++ b/dbaccess/source/ui/dlg/detailpages.cxx
@@ -627,7 +627,7 @@ namespace dbaui
if ( !m_aEDDriverClass.GetText().isEmpty() )
{
// TODO change jvmaccess
- ::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM( Reference<XMultiServiceFactory>(m_pAdminDialog->getORB()->getServiceManager(), UNO_QUERY_THROW) );
+ ::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM( m_pAdminDialog->getORB() );
bSuccess = ::connectivity::existsJavaClassByName(xJVM,m_aEDDriverClass.GetText());
}
}