summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers/file/FConnection.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'connectivity/source/drivers/file/FConnection.cxx')
-rw-r--r--connectivity/source/drivers/file/FConnection.cxx33
1 files changed, 13 insertions, 20 deletions
diff --git a/connectivity/source/drivers/file/FConnection.cxx b/connectivity/source/drivers/file/FConnection.cxx
index 5c56ce4d5e5d..38ce342cb5e2 100644
--- a/connectivity/source/drivers/file/FConnection.cxx
+++ b/connectivity/source/drivers/file/FConnection.cxx
@@ -21,7 +21,6 @@
#include <comphelper/processfactory.hxx>
#include <comphelper/servicehelper.hxx>
-#include <cppuhelper/typeprovider.hxx>
#include <file/FConnection.hxx>
#include <file/FDatabaseMetaData.hxx>
#include <file/FDriver.hxx>
@@ -33,6 +32,7 @@
#include <com/sun/star/ucb/XContentIdentifier.hpp>
#include <tools/urlobj.hxx>
#include <file/FCatalog.hxx>
+#include <comphelper/configuration.hxx>
#include <unotools/pathoptions.hxx>
#include <ucbhelper/content.hxx>
#include <connectivity/dbcharset.hxx>
@@ -132,6 +132,7 @@ void OConnection::construct(const OUString& url,const Sequence< PropertyValue >&
OUString aFileName = aDSN;
INetURLObject aURL;
aURL.SetSmartProtocol(INetProtocol::File);
+ if (!comphelper::IsFuzzing())
{
SvtPathOptions aPathOptions;
aFileName = aPathOptions.SubstituteVariable(aFileName);
@@ -229,8 +230,7 @@ Reference< XPreparedStatement > SAL_CALL OConnection::prepareStatement( const OU
checkDisposed(OConnection_BASE::rBHelper.bDisposed);
- OPreparedStatement* pStmt = new OPreparedStatement(this);
- Reference< XPreparedStatement > xHoldAlive = pStmt;
+ rtl::Reference<OPreparedStatement> pStmt = new OPreparedStatement(this);
pStmt->construct(sql);
m_aStatements.push_back(WeakReferenceHelper(*pStmt));
return pStmt;
@@ -402,31 +402,24 @@ Reference< XDynamicResultSet > OConnection::getDir() const
sal_Int64 SAL_CALL OConnection::getSomething( const Sequence< sal_Int8 >& rId )
{
- return (isUnoTunnelId<OConnection>(rId))
- ? reinterpret_cast< sal_Int64 >( this )
- : sal_Int64(0);
+ return comphelper::getSomethingImpl(rId, this);
}
-Sequence< sal_Int8 > OConnection::getUnoTunnelId()
+const Sequence< sal_Int8 > & OConnection::getUnoTunnelId()
{
- static ::cppu::OImplementationId implId;
-
- return implId.getImplementationId();
+ static const comphelper::UnoIdInit implId;
+ return implId.getSeq();
}
void OConnection::throwUrlNotValid(const OUString & _rsUrl,const OUString & _rsMessage)
{
- SQLException aError;
- aError.Message = getResources().getResourceStringWithSubstitution(
- STR_NO_VALID_FILE_URL,
- "$URL$", _rsUrl
- );
-
- aError.SQLState = "S1000";
- aError.ErrorCode = 0;
- aError.Context = static_cast< XConnection* >(this);
+ XConnection* context = this;
+ css::uno::Any next;
if (!_rsMessage.isEmpty())
- aError.NextException <<= SQLException(_rsMessage, aError.Context, OUString(), 0, Any());
+ next <<= SQLException(_rsMessage, context, OUString(), 0, Any());
+ SQLException aError(
+ getResources().getResourceStringWithSubstitution(STR_NO_VALID_FILE_URL, "$URL$", _rsUrl),
+ context, "S1000", 0, next);
throw aError;
}