summaryrefslogtreecommitdiffstats
path: root/dbaccess/source/core/dataaccess/databasecontext.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'dbaccess/source/core/dataaccess/databasecontext.cxx')
-rw-r--r--dbaccess/source/core/dataaccess/databasecontext.cxx42
1 files changed, 12 insertions, 30 deletions
diff --git a/dbaccess/source/core/dataaccess/databasecontext.cxx b/dbaccess/source/core/dataaccess/databasecontext.cxx
index 703553913fcc..54c2ae37f356 100644
--- a/dbaccess/source/core/dataaccess/databasecontext.cxx
+++ b/dbaccess/source/core/dataaccess/databasecontext.cxx
@@ -58,7 +58,7 @@
#include <rtl/uri.hxx>
#include <sal/log.hxx>
#include <svl/filenotation.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <tools/urlobj.hxx>
#include <ucbhelper/content.hxx>
#include <rtl/ref.hxx>
@@ -74,7 +74,6 @@ using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::registry;
using namespace ::com::sun::star;
using namespace ::cppu;
using namespace ::osl;
@@ -177,12 +176,7 @@ ODatabaseContext::ODatabaseContext( const Reference< XComponentContext >& _rxCon
#endif
osl_atomic_increment( &m_refCount );
- {
- m_xDBRegistrationAggregate.set( createDataSourceRegistrations( m_aContext ), UNO_SET_THROW );
- m_xDatabaseRegistrations.set( m_xDBRegistrationAggregate, UNO_QUERY_THROW );
-
- m_xDBRegistrationAggregate->setDelegator( *this );
- }
+ m_xDatabaseRegistrations = createDataSourceRegistrations( m_aContext );
osl_atomic_decrement( &m_refCount );
}
@@ -193,8 +187,6 @@ ODatabaseContext::~ODatabaseContext()
#endif
m_xDatabaseDocumentLoader.clear();
- m_xDBRegistrationAggregate->setDelegator( nullptr );
- m_xDBRegistrationAggregate.clear();
m_xDatabaseRegistrations.clear();
}
@@ -314,10 +306,11 @@ Reference< XInterface > ODatabaseContext::loadObjectFromURL(const OUString& _rNa
OUString sErrorMessage( DBA_RES( RID_STR_FILE_DOES_NOT_EXIST ) );
::svt::OFileNotation aTransformer( _sURL );
- SQLException aError;
- aError.Message = sErrorMessage.replaceAll( "$file$", aTransformer.get( ::svt::OFileNotation::N_SYSTEM ) );
+ SQLException aError(sErrorMessage.replaceAll(
+ "$file$", aTransformer.get(::svt::OFileNotation::N_SYSTEM)),
+ {}, {}, 0, {});
- throw WrappedTargetException( _sURL, *this, makeAny( aError ) );
+ throw WrappedTargetException( _sURL, *this, Any( aError ) );
}
throw WrappedTargetException( _sURL, *this, ::cppu::getCaughtException() );
}
@@ -440,7 +433,7 @@ void ODatabaseContext::registerObject(const OUString& _rName, const Reference< X
}
// notify our container listeners
- ContainerEvent aEvent(static_cast<XContainer*>(this), makeAny(_rName), makeAny(_rxObject), Any());
+ ContainerEvent aEvent(static_cast<XContainer*>(this), Any(_rName), Any(_rxObject), Any());
m_aContainerListeners.notifyEach( &XContainerListener::elementInserted, aEvent );
}
@@ -459,7 +452,7 @@ void ODatabaseContext::storeTransientProperties( ODatabaseModelImpl& _rModelImpl
if (xSetInfo.is())
aProperties = xSetInfo->getProperties();
- for ( const Property& rProperty : std::as_const(aProperties) )
+ for (const Property& rProperty : aProperties)
{
if ( ( ( rProperty.Attributes & PropertyAttribute::TRANSIENT) != 0 )
&& ( ( rProperty.Attributes & PropertyAttribute::READONLY) == 0 )
@@ -528,7 +521,7 @@ void ODatabaseContext::revokeObject(const OUString& _rName)
m_aDatabaseObjects.erase( aExistent );
// notify our container listeners
- ContainerEvent aEvent( *this, makeAny( _rName ), Any(), Any() );
+ ContainerEvent aEvent( *this, Any( _rName ), Any(), Any() );
aGuard.clear();
m_aContainerListeners.notifyEach( &XContainerListener::elementRemoved, aEvent );
}
@@ -611,7 +604,7 @@ Any ODatabaseContext::getByName(const OUString& _rName)
{
Reference< XInterface > xExistent = getObject( _rName );
if ( xExistent.is() )
- return makeAny( xExistent );
+ return Any( xExistent );
// see whether this is a registered name
OUString sURL;
@@ -628,7 +621,7 @@ Any ODatabaseContext::getByName(const OUString& _rName)
if ( !xExistent.is() )
// try to load this as URL
xExistent = loadObjectFromURL( _rName, sURL );
- return makeAny( xExistent );
+ return Any( xExistent );
}
catch (const NoSuchElementException&)
{ // let these exceptions through
@@ -707,17 +700,6 @@ void ODatabaseContext::databaseDocumentURLChange( const OUString& _rOldURL, cons
m_aDatabaseObjects.erase( oldPos );
}
-sal_Int64 SAL_CALL ODatabaseContext::getSomething( const Sequence< sal_Int8 >& rId )
-{
- return comphelper::getSomethingImpl(rId, this);
-}
-
-Sequence< sal_Int8 > ODatabaseContext::getUnoTunnelId()
-{
- static const comphelper::UnoIdInit implId;
- return implId.getSeq();
-}
-
void ODatabaseContext::onBasicManagerCreated( const Reference< XModel >& _rxForDocument, BasicManager& _rBasicManager )
{
#if !HAVE_FEATURE_SCRIPTING
@@ -736,7 +718,7 @@ void ODatabaseContext::onBasicManagerCreated( const Reference< XModel >& _rxForD
// ... whose BasicManager has just been created, then add the global DatabaseDocument variable to its scope.
if ( xDatabaseDocument.is() )
- _rBasicManager.SetGlobalUNOConstant( "ThisDatabaseDocument", makeAny( xDatabaseDocument ) );
+ _rBasicManager.SetGlobalUNOConstant( "ThisDatabaseDocument", Any( xDatabaseDocument ) );
#endif
}