connectivity/source/drivers/mysqlc/mysqlc_tables.cxx |    2 +-
 connectivity/source/drivers/mysqlc/mysqlc_tables.hxx |    1 -
 connectivity/source/drivers/mysqlc/mysqlc_views.cxx  |   16 +---------------
 connectivity/source/drivers/mysqlc/mysqlc_views.hxx  |   10 +++++-----
 4 files changed, 7 insertions(+), 22 deletions(-)

New commits:
commit 3366b529bbb51de725d5341bf25f9ea961fd0c0b
Author:     Julien Nabet <serval2...@yahoo.fr>
AuthorDate: Sun Jan 23 11:45:27 2022 +0100
Commit:     Julien Nabet <serval2...@yahoo.fr>
CommitDate: Sun Jan 23 20:42:06 2022 +0100

    Mysql/MariaDB: Fix slight bug in Tables::createObject:
    
    unescape scatalog before converting it in aCatalog
    
    In Views, remove connectivity::mysqlc::Views::disposing which seems more 
cargo cult
    
    Remove useless XConnection.hpp in tables (how come I didn't spot it in 
cleaning process?)
    
    Change-Id: I28863dcd93baae923877dbd431b6807226c0a548
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128799
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <serval2...@yahoo.fr>

diff --git a/connectivity/source/drivers/mysqlc/mysqlc_tables.cxx 
b/connectivity/source/drivers/mysqlc/mysqlc_tables.cxx
index f30c5316036f..eb3995160422 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_tables.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_tables.cxx
@@ -54,8 +54,8 @@ connectivity::sdbcx::ObjectType 
connectivity::mysqlc::Tables::createObject(const
     css::uno::Any aCatalog;
     if (!sCatalog.isEmpty())
     {
-        aCatalog <<= sCatalog;
         lcl_unescape(sCatalog);
+        aCatalog <<= sCatalog;
     }
 
     lcl_unescape(sSchema);
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_tables.hxx 
b/connectivity/source/drivers/mysqlc/mysqlc_tables.hxx
index a49138be31bf..42723659d91c 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_tables.hxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_tables.hxx
@@ -9,7 +9,6 @@
 
 #pragma once
 
-#include <com/sun/star/sdbc/XConnection.hpp>
 #include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
 
 #include <connectivity/sdbcx/VCollection.hxx>
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_views.cxx 
b/connectivity/source/drivers/mysqlc/mysqlc_views.cxx
index 53d23235ea29..a75a25317f8d 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_views.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_views.cxx
@@ -47,12 +47,6 @@ void connectivity::mysqlc::Views::impl_refresh()
     static_cast<Catalog&>(m_rParent).refreshViews();
 }
 
-void connectivity::mysqlc::Views::disposing()
-{
-    m_xMetaData.clear();
-    OCollection::disposing();
-}
-
 css::uno::Reference<css::beans::XPropertySet> 
connectivity::mysqlc::Views::createDescriptor()
 {
     return new connectivity::sdbcx::OView(true, m_xMetaData);
@@ -116,15 +110,7 @@ void connectivity::mysqlc::Views::createView(
         xStmt->execute(aSql);
         ::comphelper::disposeComponent(xStmt);
     }
-    /*  TODO find a way to refresh view to make the new one appear right away
-    // insert the new view also in the tables collection
-    Tables* pTables = 
static_cast<Tables*>(static_cast<Catalog&>(m_rParent).getPrivateTables());
-    if ( pTables)
-    {
-        OUString sName = ::dbtools::composeTableName( m_xMetaData, descriptor, 
::dbtools::EComposeRule::InDataManipulation, false );
-        pTables->appendNew(sName);
-    }
-*/
+    //  TODO find a way to refresh view to make the new one appear right away
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_views.hxx 
b/connectivity/source/drivers/mysqlc/mysqlc_views.hxx
index 708e1b24eec5..2924111284bf 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_views.hxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_views.hxx
@@ -22,19 +22,19 @@
 #include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
 namespace connectivity::mysqlc
 {
-class Views final : public sdbcx::OCollection
+class Views final : public connectivity::sdbcx::OCollection
 {
     css::uno::Reference<css::sdbc::XConnection> m_xConnection;
     css::uno::Reference<css::sdbc::XDatabaseMetaData> m_xMetaData;
     bool m_bInDrop;
 
-    virtual sdbcx::ObjectType createObject(const OUString& _rName) override;
+    // OCollection
+    virtual connectivity::sdbcx::ObjectType createObject(const OUString& 
_rName) override;
     virtual void impl_refresh() override;
     virtual css::uno::Reference<css::beans::XPropertySet> createDescriptor() 
override;
     virtual sdbcx::ObjectType
     appendObject(const OUString& _rForName,
                  const css::uno::Reference<css::beans::XPropertySet>& 
descriptor) override;
-    virtual void dropObject(sal_Int32 _nPos, const OUString& _sElementName) 
override;
 
     void createView(const css::uno::Reference<css::beans::XPropertySet>& 
descriptor);
 
@@ -43,8 +43,8 @@ public:
           ::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex,
           const ::std::vector<OUString>& _rVector);
 
-    // only the name is identical to ::cppu::OComponentHelper
-    virtual void disposing() override;
+    // XDrop
+    virtual void dropObject(sal_Int32 _nPos, const OUString& _sElementName) 
override;
 
     void dropByNameImpl(const OUString& elementName);
 };

Reply via email to