[Libreoffice-commits] core.git: connectivity/Library_writer.mk connectivity/source

Miklos Vajna vmiklos at collabora.co.uk
Tue Jul 18 13:57:20 UTC 2017


 connectivity/Library_writer.mk                     |    1 
 connectivity/source/drivers/writer/WConnection.cxx |    5 --
 connectivity/source/drivers/writer/WStatement.cxx  |   40 ++++++++++++++++++
 connectivity/source/inc/writer/WStatement.hxx      |   45 +++++++++++++++++++++
 4 files changed, 88 insertions(+), 3 deletions(-)

New commits:
commit cad0d8df38cf390d0615668ce2ab7c8f7ee42cde
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Tue Jul 18 11:55:01 2017 +0200

    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 at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

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: */


More information about the Libreoffice-commits mailing list