summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-07-18 11:55:01 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-07-18 15:56:34 +0200
commitcad0d8df38cf390d0615668ce2ab7c8f7ee42cde (patch)
tree20199e09f15213cdd6899eb75e568d1a2a8e9f76 /connectivity
parenta93c89894feb663df37609c95d4db523120c0bc1 (diff)
connectivity writer driver: add Statement implementation
Gets rid of the OWriterConnection::createStatement() stub warning. This is the last interface which was not supported by the writer driver, as far as I see. Change-Id: I5d1e6835d30b704d6866f2cc4cd9e82ea0f2139e Reviewed-on: https://gerrit.libreoffice.org/40134 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/Library_writer.mk1
-rw-r--r--connectivity/source/drivers/writer/WConnection.cxx5
-rw-r--r--connectivity/source/drivers/writer/WStatement.cxx40
-rw-r--r--connectivity/source/inc/writer/WStatement.hxx45
4 files changed, 88 insertions, 3 deletions
diff --git a/connectivity/Library_writer.mk b/connectivity/Library_writer.mk
index 99db1f98529f..95d6f28bf8d1 100644
--- a/connectivity/Library_writer.mk
+++ b/connectivity/Library_writer.mk
@@ -44,6 +44,7 @@ $(eval $(call gb_Library_add_exception_objects,writer,\
connectivity/source/drivers/writer/WDriver \
connectivity/source/drivers/writer/WPreparedStatement \
connectivity/source/drivers/writer/WResultSet \
+ connectivity/source/drivers/writer/WStatement \
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 aea1fd2c12ab..ff2710cedb59 100644
--- a/connectivity/source/drivers/writer/WConnection.cxx
+++ b/connectivity/source/drivers/writer/WConnection.cxx
@@ -28,6 +28,7 @@
#include <com/sun/star/text/XTextDocument.hpp>
#include <tools/urlobj.hxx>
#include "writer/WPreparedStatement.hxx"
+#include "writer/WStatement.hxx"
#include <unotools/pathoptions.hxx>
#include <connectivity/dbexception.hxx>
#include <cppuhelper/exc_hlp.hxx>
@@ -224,9 +225,7 @@ uno::Reference< sdbc::XStatement > SAL_CALL OWriterConnection::createStatement()
::osl::MutexGuard aGuard(m_aMutex);
checkDisposed(OConnection_BASE::rBHelper.bDisposed);
-
- uno::Reference< sdbc::XStatement > xReturn;
- SAL_WARN("connectivity.writer", "TODO implement OWriterConnection::createStatement()");
+ uno::Reference<sdbc::XStatement> xReturn = new OWriterStatement(this);
m_aStatements.push_back(uno::WeakReferenceHelper(xReturn));
return xReturn;
}
diff --git a/connectivity/source/drivers/writer/WStatement.cxx b/connectivity/source/drivers/writer/WStatement.cxx
new file mode 100644
index 000000000000..b64579f87ea9
--- /dev/null
+++ b/connectivity/source/drivers/writer/WStatement.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/WStatement.hxx"
+#include "writer/WResultSet.hxx"
+
+using namespace com::sun::star;
+
+namespace connectivity
+{
+namespace writer
+{
+
+file::OResultSet* OWriterStatement::createResultSet()
+{
+ return new OWriterResultSet(this, m_aSQLIterator);
+}
+
+IMPLEMENT_SERVICE_INFO(OWriterStatement, "com.sun.star.sdbc.driver.writer.Statement", "com.sun.star.sdbc.Statement");
+
+} // namespace writer
+} // namespace connectivity
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/writer/WStatement.hxx b/connectivity/source/inc/writer/WStatement.hxx
new file mode 100644
index 000000000000..3781cb5eb8c3
--- /dev/null
+++ b/connectivity/source/inc/writer/WStatement.hxx
@@ -0,0 +1,45 @@
+/* -*- 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_WSTATEMENT_HXX
+#define INCLUDED_CONNECTIVITY_SOURCE_INC_WRITER_WSTATEMENT_HXX
+
+#include "file/FStatement.hxx"
+
+namespace connectivity
+{
+namespace writer
+{
+
+class OConnection;
+class OWriterStatement : public file::OStatement
+{
+protected:
+ virtual file::OResultSet* createResultSet() override;
+public:
+ OWriterStatement(file::OConnection* _pConnection) : file::OStatement(_pConnection) {}
+ DECLARE_SERVICE_INFO();
+};
+
+} // namespace writer
+} // namespace connectivity
+
+#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_WRITER_WSTATEMENT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */