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

Miklos Vajna vmiklos at collabora.co.uk
Wed Jul 19 17:51:22 UTC 2017


 connectivity/Library_calc.mk                         |    1 
 connectivity/Library_file.mk                         |    1 
 connectivity/Library_writer.mk                       |    1 
 connectivity/source/drivers/calc/CConnection.cxx     |    4 -
 connectivity/source/drivers/component/CStatement.cxx |    8 +--
 connectivity/source/drivers/writer/WConnection.cxx   |    6 --
 connectivity/source/drivers/writer/WStatement.cxx    |   40 ----------------
 connectivity/source/inc/component/CStatement.hxx     |   13 ++---
 connectivity/source/inc/writer/WStatement.hxx        |   45 -------------------
 9 files changed, 16 insertions(+), 103 deletions(-)

New commits:
commit 4073bc15d1aa1b46b2e0953d6316f2ab6a23dc87
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed Jul 19 14:31:13 2017 +0200

    connectivity: merge OCalcStatement and OWriterStatement
    
    Into a single OComponentStatement, as both of them just provide statement
    functionality based on a file loaded into an LO component, so they can share
    code.
    
    Change-Id: Iad2852f93783ec3c4a672f4b86424b4aa0ae8eaf
    Reviewed-on: https://gerrit.libreoffice.org/40181
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/connectivity/Library_calc.mk b/connectivity/Library_calc.mk
index 441f0305de9e..5a3a206b12b7 100644
--- a/connectivity/Library_calc.mk
+++ b/connectivity/Library_calc.mk
@@ -39,7 +39,6 @@ $(eval $(call gb_Library_use_libraries,calc,\
 ))
 
 $(eval $(call gb_Library_add_exception_objects,calc,\
-	connectivity/source/drivers/calc/CStatement \
 	connectivity/source/drivers/calc/CPreparedStatement \
 	connectivity/source/drivers/calc/CDatabaseMetaData \
 	connectivity/source/drivers/calc/CCatalog \
diff --git a/connectivity/Library_file.mk b/connectivity/Library_file.mk
index 57f9ff733166..fec48e2e966c 100644
--- a/connectivity/Library_file.mk
+++ b/connectivity/Library_file.mk
@@ -42,6 +42,7 @@ $(eval $(call gb_Library_use_libraries,file,\
 
 $(eval $(call gb_Library_add_exception_objects,file,\
 	connectivity/source/drivers/component/CResultSet \
+	connectivity/source/drivers/component/CStatement \
 	connectivity/source/drivers/file/FCatalog \
 	connectivity/source/drivers/file/FColumns \
 	connectivity/source/drivers/file/FConnection \
diff --git a/connectivity/Library_writer.mk b/connectivity/Library_writer.mk
index dd74110c824a..c5cd2ddf3979 100644
--- a/connectivity/Library_writer.mk
+++ b/connectivity/Library_writer.mk
@@ -43,7 +43,6 @@ $(eval $(call gb_Library_add_exception_objects,writer,\
 	connectivity/source/drivers/writer/WDatabaseMetaData \
 	connectivity/source/drivers/writer/WDriver \
 	connectivity/source/drivers/writer/WPreparedStatement \
-	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/calc/CConnection.cxx b/connectivity/source/drivers/calc/CConnection.cxx
index 17c50c4c0c95..8ae8ca2be690 100644
--- a/connectivity/source/drivers/calc/CConnection.cxx
+++ b/connectivity/source/drivers/calc/CConnection.cxx
@@ -28,7 +28,7 @@
 #include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
 #include <tools/urlobj.hxx>
 #include "calc/CPreparedStatement.hxx"
-#include "calc/CStatement.hxx"
+#include "component/CStatement.hxx"
 #include <unotools/pathoptions.hxx>
 #include <connectivity/dbexception.hxx>
 #include <cppuhelper/exc_hlp.hxx>
@@ -237,7 +237,7 @@ Reference< XStatement > SAL_CALL OCalcConnection::createStatement(  )
     checkDisposed(OConnection_BASE::rBHelper.bDisposed);
 
 
-    Reference< XStatement > xReturn = new OCalcStatement(this);
+    Reference< XStatement > xReturn = new connectivity::component::OComponentStatement(this);
     m_aStatements.push_back(WeakReferenceHelper(xReturn));
     return xReturn;
 }
diff --git a/connectivity/source/drivers/calc/CStatement.cxx b/connectivity/source/drivers/component/CStatement.cxx
similarity index 82%
rename from connectivity/source/drivers/calc/CStatement.cxx
rename to connectivity/source/drivers/component/CStatement.cxx
index f826642f566d..a83ff8587e20 100644
--- a/connectivity/source/drivers/calc/CStatement.cxx
+++ b/connectivity/source/drivers/component/CStatement.cxx
@@ -17,18 +17,18 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include "calc/CStatement.hxx"
+#include "component/CStatement.hxx"
 #include "component/CResultSet.hxx"
 
-using namespace connectivity::calc;
+using namespace connectivity::component;
 using namespace connectivity::file;
 using namespace com::sun::star::uno;
 
-OResultSet* OCalcStatement::createResultSet()
+OResultSet* OComponentStatement::createResultSet()
 {
     return new connectivity::component::OComponentResultSet(this,m_aSQLIterator);
 }
 
-IMPLEMENT_SERVICE_INFO(OCalcStatement,"com.sun.star.sdbc.driver.calc.Statement","com.sun.star.sdbc.Statement");
+IMPLEMENT_SERVICE_INFO(OComponentStatement,"com.sun.star.sdbc.driver.component.Statement","com.sun.star.sdbc.Statement");
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/writer/WConnection.cxx b/connectivity/source/drivers/writer/WConnection.cxx
index ff2710cedb59..cede5fe96b93 100644
--- a/connectivity/source/drivers/writer/WConnection.cxx
+++ b/connectivity/source/drivers/writer/WConnection.cxx
@@ -28,14 +28,12 @@
 #include <com/sun/star/text/XTextDocument.hpp>
 #include <tools/urlobj.hxx>
 #include "writer/WPreparedStatement.hxx"
-#include "writer/WStatement.hxx"
+#include "component/CStatement.hxx"
 #include <unotools/pathoptions.hxx>
 #include <connectivity/dbexception.hxx>
 #include <cppuhelper/exc_hlp.hxx>
 #include <comphelper/processfactory.hxx>
 
-using namespace connectivity::file;
-
 typedef connectivity::file::OConnection OConnection_BASE;
 
 using namespace ::com::sun::star;
@@ -225,7 +223,7 @@ uno::Reference< sdbc::XStatement > SAL_CALL OWriterConnection::createStatement()
     ::osl::MutexGuard aGuard(m_aMutex);
     checkDisposed(OConnection_BASE::rBHelper.bDisposed);
 
-    uno::Reference<sdbc::XStatement> xReturn = new OWriterStatement(this);
+    uno::Reference<sdbc::XStatement> xReturn = new component::OComponentStatement(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
deleted file mode 100644
index fcb9c8a4f28a..000000000000
--- a/connectivity/source/drivers/writer/WStatement.cxx
+++ /dev/null
@@ -1,40 +0,0 @@
-/* -*- 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 "component/CResultSet.hxx"
-
-using namespace com::sun::star;
-
-namespace connectivity
-{
-namespace writer
-{
-
-file::OResultSet* OWriterStatement::createResultSet()
-{
-    return new component::OComponentResultSet(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/calc/CStatement.hxx b/connectivity/source/inc/component/CStatement.hxx
similarity index 71%
rename from connectivity/source/inc/calc/CStatement.hxx
rename to connectivity/source/inc/component/CStatement.hxx
index e9a3d552eab0..695d92a4e225 100644
--- a/connectivity/source/inc/calc/CStatement.hxx
+++ b/connectivity/source/inc/component/CStatement.hxx
@@ -17,27 +17,28 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_CALC_CSTATEMENT_HXX
-#define INCLUDED_CONNECTIVITY_SOURCE_INC_CALC_CSTATEMENT_HXX
+#ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_COMPONENT_CSTATEMENT_HXX
+#define INCLUDED_CONNECTIVITY_SOURCE_INC_COMPONENT_CSTATEMENT_HXX
 
 #include "file/FStatement.hxx"
 
 namespace connectivity
 {
-    namespace calc
+    namespace component
     {
         class OConnection;
-        class OCalcStatement : public file::OStatement
+        /// Statement implementation for Writer tables and Calc sheets.
+        class OOO_DLLPUBLIC_FILE OComponentStatement : public file::OStatement
         {
         protected:
             virtual file::OResultSet* createResultSet() override;
         public:
-            OCalcStatement( file::OConnection* _pConnection) : file::OStatement( _pConnection){}
+            OComponentStatement( file::OConnection* _pConnection) : file::OStatement( _pConnection){}
             DECLARE_SERVICE_INFO();
         };
     }
 }
 
-#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_CALC_CSTATEMENT_HXX
+#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_COMPONENT_CSTATEMENT_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/inc/writer/WStatement.hxx b/connectivity/source/inc/writer/WStatement.hxx
deleted file mode 100644
index 3781cb5eb8c3..000000000000
--- a/connectivity/source/inc/writer/WStatement.hxx
+++ /dev/null
@@ -1,45 +0,0 @@
-/* -*- 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