connectivity writer driver: add PreparedStatement implementation

Gets rid of the stub warnings in OWriterConnection::prepareStatement().

Change-Id: I05db81898d8117578130e660932608fcc927edf0
Reviewed-on: https://gerrit.libreoffice.org/40092
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
diff --git a/connectivity/Library_writer.mk b/connectivity/Library_writer.mk
index 4fab8bf..c5cd2dd 100644
--- a/connectivity/Library_writer.mk
+++ b/connectivity/Library_writer.mk
@@ -42,6 +42,7 @@ $(eval $(call gb_Library_add_exception_objects,writer,\
	connectivity/source/drivers/writer/WConnection \
	connectivity/source/drivers/writer/WDatabaseMetaData \
	connectivity/source/drivers/writer/WDriver \
	connectivity/source/drivers/writer/WPreparedStatement \
	connectivity/source/drivers/writer/WTable \
	connectivity/source/drivers/writer/WTables \
	connectivity/source/drivers/writer/Wservices \
diff --git a/connectivity/source/drivers/writer/WConnection.cxx b/connectivity/source/drivers/writer/WConnection.cxx
index bec6725..aea1fd2 100644
--- a/connectivity/source/drivers/writer/WConnection.cxx
+++ b/connectivity/source/drivers/writer/WConnection.cxx
@@ -27,6 +27,7 @@
#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/text/XTextDocument.hpp>
#include <tools/urlobj.hxx>
#include "writer/WPreparedStatement.hxx"
#include <unotools/pathoptions.hxx>
#include <connectivity/dbexception.hxx>
#include <cppuhelper/exc_hlp.hxx>
@@ -231,14 +232,16 @@ uno::Reference< sdbc::XStatement > SAL_CALL OWriterConnection::createStatement()
}


uno::Reference< sdbc::XPreparedStatement > SAL_CALL OWriterConnection::prepareStatement(const OUString& /*sql*/)
uno::Reference< sdbc::XPreparedStatement > SAL_CALL OWriterConnection::prepareStatement(const OUString& sql)
{
    ::osl::MutexGuard aGuard(m_aMutex);
    checkDisposed(OConnection_BASE::rBHelper.bDisposed);

    SAL_WARN("connectivity.writer", "TODO implement OWriterConnection::prepareStatement()");

    return nullptr;
    OWriterPreparedStatement* pStmt = new OWriterPreparedStatement(this);
    uno::Reference<sdbc::XPreparedStatement> xHoldAlive = pStmt;
    pStmt->construct(sql);
    m_aStatements.push_back(uno::WeakReferenceHelper(*pStmt));
    return pStmt;
}


diff --git a/connectivity/source/drivers/writer/WPreparedStatement.cxx b/connectivity/source/drivers/writer/WPreparedStatement.cxx
new file mode 100644
index 0000000..5dffe6e
--- /dev/null
+++ b/connectivity/source/drivers/writer/WPreparedStatement.cxx
@@ -0,0 +1,40 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */

#include "writer/WPreparedStatement.hxx"

using namespace com::sun::star;

namespace connectivity
{
namespace writer
{

file::OResultSet* OWriterPreparedStatement::createResultSet()
{
    SAL_WARN("connectivity.writer", "TODO implement OWriterPreparedStatement::createResultSet");
    return nullptr;
}

IMPLEMENT_SERVICE_INFO(OWriterPreparedStatement,"com.sun.star.sdbc.driver.writer.PreparedStatement", "com.sun.star.sdbc.PreparedStatement");

} // namespace writer
} // namespace connectivity

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/writer/WPreparedStatement.hxx b/connectivity/source/inc/writer/WPreparedStatement.hxx
new file mode 100644
index 0000000..00998ca
--- /dev/null
+++ b/connectivity/source/inc/writer/WPreparedStatement.hxx
@@ -0,0 +1,43 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */

#ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_WRITER_WPREPAREDSTATEMENT_HXX
#define INCLUDED_CONNECTIVITY_SOURCE_INC_WRITER_WPREPAREDSTATEMENT_HXX

#include "file/FPreparedStatement.hxx"

namespace connectivity
{
namespace writer
{
class OConnection;
class OWriterPreparedStatement : public file::OPreparedStatement
{
protected:
    virtual file::OResultSet* createResultSet() override;
public:
    OWriterPreparedStatement(file::OConnection* _pConnection) : file::OPreparedStatement(_pConnection) {}
    DECLARE_SERVICE_INFO();
};
} // namespace writer
} // namespace connectivity

#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_WRITER_WPREPAREDSTATEMENT_HXX

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */