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

Stephan Bergmann sbergman at redhat.com
Thu Jun 29 09:27:06 UTC 2017


 connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx |   10 ++++------
 connectivity/source/drivers/evoab2/NTables.cxx           |    4 +---
 2 files changed, 5 insertions(+), 9 deletions(-)

New commits:
commit f9509e7da32e3aa8e99c668f9f3f6d1b2c57fcb9
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Jun 29 11:26:39 2017 +0200

    loplugin:oncevar
    
    Change-Id: I5ee54b458b85581cf49ab39a7b1dc0cae6abed00

diff --git a/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx b/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx
index 01493a95588b..0511b17e9a99 100644
--- a/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx
@@ -27,6 +27,7 @@
 #include <com/sun/star/sdbc/ColumnValue.hpp>
 #include <com/sun/star/sdbc/ColumnSearch.hpp>
 
+#include <cstddef>
 #include <vector>
 #include <string.h>
 #include "EApi.h"
@@ -160,10 +161,9 @@ namespace connectivity
     {
         initFields();
 
-        sal_Int32 nType = G_TYPE_STRING;
         if ( nCol < nFields )
             return (pFields[nCol]->pField)->value_type;
-        return nType;
+        return G_TYPE_STRING;
     }
 
     sal_Int32
@@ -448,8 +448,7 @@ OUString SAL_CALL OEvoabDatabaseMetaData::getCatalogTerm(  )
 OUString OEvoabDatabaseMetaData::impl_getIdentifierQuoteString_throw(  )
 {
     // normally this is "
-    OUString aVal("\"");
-    return aVal;
+    return OUString("\"");
 }
 
 OUString SAL_CALL OEvoabDatabaseMetaData::getExtraNameCharacters(  )
@@ -1004,9 +1003,8 @@ Reference< XResultSet > SAL_CALL OEvoabDatabaseMetaData::getTableTypes(  )
     Reference< XResultSet > xRef = pResult;
 
     // here we fill the rows which should be visible when ask for data from the resultset returned here
-    sal_Int32  nSize = SAL_N_ELEMENTS(sTableTypes);
     ODatabaseMetaDataResultSet::ORows aRows;
-    for(sal_Int32 i=0;i < nSize;++i)
+    for(std::size_t i=0;i < SAL_N_ELEMENTS(sTableTypes);++i)
     {
         ODatabaseMetaDataResultSet::ORow aRow;
         aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
diff --git a/connectivity/source/drivers/evoab2/NTables.cxx b/connectivity/source/drivers/evoab2/NTables.cxx
index 587cdc632b05..652ac07030e1 100644
--- a/connectivity/source/drivers/evoab2/NTables.cxx
+++ b/connectivity/source/drivers/evoab2/NTables.cxx
@@ -47,11 +47,9 @@ using namespace dbtools;
 
 ObjectType OEvoabTables::createObject(const OUString& aName)
 {
-    OUString aSchema(  "%" );
-
     Sequence< OUString > aTypes { "TABLE" };
 
-    Reference< XResultSet > xResult = m_xMetaData->getTables(Any(),aSchema,aName,aTypes);
+    Reference< XResultSet > xResult = m_xMetaData->getTables(Any(),"%",aName,aTypes);
 
     ObjectType xRet = nullptr;
     if(xResult.is())


More information about the Libreoffice-commits mailing list