summaryrefslogtreecommitdiffstats
path: root/dbaccess
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-12-03 11:10:46 +0200
committerNoel Grandin <noel@peralex.com>2012-12-06 13:35:36 +0200
commit495111b249e1ef17be96dbdfbc5a13de6d5dd5f9 (patch)
tree07c2b5972b0786ae8ff970855574c4915078c09d /dbaccess
parentTranslate German comments in tbcontrl.cxx (diff)
downloadcore-495111b249e1ef17be96dbdfbc5a13de6d5dd5f9.tar.gz
core-495111b249e1ef17be96dbdfbc5a13de6d5dd5f9.zip
fdo#46808, use service constructor for sdb::DatabaseContext
Change-Id: I4d845f289f324912b0fc4d8e26a2947e2d2f889e
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/core/dataaccess/databasecontext.cxx2
-rw-r--r--dbaccess/source/inc/stringconstants.hrc1
-rw-r--r--dbaccess/source/inc/stringconstants.inc1
-rw-r--r--dbaccess/source/ui/browser/genericcontroller.cxx8
-rw-r--r--dbaccess/source/ui/dlg/DbAdminImpl.cxx8
5 files changed, 6 insertions, 14 deletions
diff --git a/dbaccess/source/core/dataaccess/databasecontext.cxx b/dbaccess/source/core/dataaccess/databasecontext.cxx
index 798262f941a6..c4c625fde1d4 100644
--- a/dbaccess/source/core/dataaccess/databasecontext.cxx
+++ b/dbaccess/source/core/dataaccess/databasecontext.cxx
@@ -218,7 +218,7 @@ Reference< XInterface > ODatabaseContext::Create(const Reference< XComponentCont
Sequence< rtl::OUString > ODatabaseContext::getSupportedServiceNames_static(void) throw( RuntimeException )
{
Sequence< ::rtl::OUString > aSNS( 1 );
- aSNS[0] = SERVICE_SDB_DATABASECONTEXT;
+ aSNS[0] = "com.sun.star.sdb.DatabaseContext";
return aSNS;
}
diff --git a/dbaccess/source/inc/stringconstants.hrc b/dbaccess/source/inc/stringconstants.hrc
index d8a9ceb6ff8d..6926f607788e 100644
--- a/dbaccess/source/inc/stringconstants.hrc
+++ b/dbaccess/source/inc/stringconstants.hrc
@@ -355,7 +355,6 @@ DECLARE_CONSTASCII_USTRING(SERVICE_SDB_COLUMNSETTINGS);
DECLARE_CONSTASCII_USTRING(SERVICE_SDB_RESULTCOLUMN);
DECLARE_CONSTASCII_USTRING(SERVICE_SDB_DATACOLUMN);
DECLARE_CONSTASCII_USTRING(SERVICE_SDB_DATAACCESSCONNECTION);
-DECLARE_CONSTASCII_USTRING(SERVICE_SDB_DATABASECONTEXT);
DECLARE_CONSTASCII_USTRING(SERVICE_SDB_DATASOURCE);
DECLARE_CONSTASCII_USTRING(SERVICE_SDB_ROWSET);
DECLARE_CONSTASCII_USTRING(SERVICE_SDB_RESULTSET);
diff --git a/dbaccess/source/inc/stringconstants.inc b/dbaccess/source/inc/stringconstants.inc
index 9d6e79e872cb..010fd637e952 100644
--- a/dbaccess/source/inc/stringconstants.inc
+++ b/dbaccess/source/inc/stringconstants.inc
@@ -193,7 +193,6 @@ IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDBCX_COLUMNDESCRIPTOR, "com.sun.star.sdbcx
IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDB_COLUMNSETTINGS, "com.sun.star.sdb.ColumnSettings");
IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDB_RESULTCOLUMN, "com.sun.star.sdb.ResultColumn");
IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDB_DATACOLUMN, "com.sun.star.sdb.DataColumn");
-IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDB_DATABASECONTEXT, "com.sun.star.sdb.DatabaseContext");
IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDB_DATASOURCE, "com.sun.star.sdb.DataSource");
IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDB_RESULTSET, "com.sun.star.sdb.ResultSet");
IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDB_ROWSET, "com.sun.star.sdb.RowSet");
diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx
index 58345e6cf9d2..76df18a7c9cf 100644
--- a/dbaccess/source/ui/browser/genericcontroller.cxx
+++ b/dbaccess/source/ui/browser/genericcontroller.cxx
@@ -258,15 +258,13 @@ sal_Bool OGenericUnoController::Construct(Window* /*pParent*/)
{
m_xDatabaseContext = DatabaseContext::create(comphelper::getComponentContext(getORB()));
}
- catch(Exception&)
+ catch(const Exception&)
{
OSL_FAIL("OGenericUnoController::Construct: could not create (or start listening at) the database context!");
+ // at least notify the user. Though the whole component does not make any sense without the database context ...
+ ShowServiceNotAvailableError(getView(), String("com.sun.star.sdb.DatabaseContext"), sal_True);
}
- if (!m_xDatabaseContext.is())
- { // at least notify the user. Though the whole component does not make any sense without the database context ...
- ShowServiceNotAvailableError(getView(), String(SERVICE_SDB_DATABASECONTEXT), sal_True);
- }
return sal_True;
}
//------------------------------------------------------------------------------
diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
index 9082417c97ca..2b5cbfe36d2b 100644
--- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx
+++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
@@ -210,13 +210,9 @@ ODbDataSourceAdministrationHelper::ODbDataSourceAdministrationHelper(const Refer
{
m_xDatabaseContext = DatabaseContext::create(comphelper::getComponentContext(m_xORB));
}
- catch(Exception&)
- {
- }
-
- if ( !m_xDatabaseContext.is() )
+ catch(const Exception&)
{
- ShowServiceNotAvailableError(_pParent->GetParent(), String(SERVICE_SDB_DATABASECONTEXT), sal_True);
+ ShowServiceNotAvailableError(_pParent->GetParent(), String("com.sun.star.sdb.DatabaseContext"), sal_True);
}
}
//-------------------------------------------------------------------------