[Libreoffice-commits] core.git: dbaccess/source include/tools

Noel Grandin noel.grandin at collabora.co.uk
Fri Dec 15 11:49:50 UTC 2017


 dbaccess/source/ui/inc/WCopyTable.hxx  |    2 +-
 dbaccess/source/ui/misc/DExport.cxx    |    4 ++--
 dbaccess/source/ui/misc/RowSetDrop.cxx |    2 +-
 include/tools/contnr.hxx               |    1 -
 4 files changed, 4 insertions(+), 5 deletions(-)

New commits:
commit f388d1dbb2edc1d678a658572bef6af4046728ff
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Fri Dec 15 09:34:24 2017 +0200

    CONTAINER_ENTRY_NOTFOUND not needed anymore
    
    after we make dbaccess consistently use COLUMN_POSITION_NOT_FOUND
    
    Change-Id: Ia22c17196e8d651201c04239505d28e54369a8a4
    Reviewed-on: https://gerrit.libreoffice.org/46501
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/dbaccess/source/ui/inc/WCopyTable.hxx b/dbaccess/source/ui/inc/WCopyTable.hxx
index db3dfbe38e98..b6d77f199be7 100644
--- a/dbaccess/source/ui/inc/WCopyTable.hxx
+++ b/dbaccess/source/ui/inc/WCopyTable.hxx
@@ -331,7 +331,7 @@ namespace dbaui
         void                CheckButtons(); // checks which button can be disabled, enabled
 
         // returns a vector where the position of a column and if the column is in the selection
-        // when not the value is COLUMN_POSITION_NOT_FOUND == (sal_uInt32)-1
+        // when not the value is COLUMN_POSITION_NOT_FOUND.
         const ODatabaseExport::TPositions& GetColumnPositions()    const { return m_vColumnPositions; }
         const std::vector<sal_Int32>&    GetColumnTypes()        const { return m_vColumnTypes; }
         bool                        UseHeaderLine()         const { return m_bUseHeaderLine; }
diff --git a/dbaccess/source/ui/misc/DExport.cxx b/dbaccess/source/ui/misc/DExport.cxx
index 81afc5b43bc7..b9c7998a8d4c 100644
--- a/dbaccess/source/ui/misc/DExport.cxx
+++ b/dbaccess/source/ui/misc/DExport.cxx
@@ -766,7 +766,7 @@ void ODatabaseExport::adjustFormat()
         if ( nNewPos < static_cast<sal_Int32>(m_vColumnPositions.size()) )
         {
             sal_Int32 nColPos = m_vColumnPositions[nNewPos].first;
-            if( nColPos != sal::static_int_cast< long >(CONTAINER_ENTRY_NOTFOUND))
+            if( nColPos != COLUMN_POSITION_NOT_FOUND)
             {
                 --nColPos;
                 OSL_ENSURE((nColPos) < static_cast<sal_Int32>(m_vNumberFormat.size()),"m_vFormatKey: Illegal index for vector");
@@ -832,7 +832,7 @@ Reference< XPreparedStatement > ODatabaseExport::createPreparedStatment( const R
         ODatabaseExport::TPositions::const_iterator aFind = std::find_if(_rvColumns.begin(),_rvColumns.end(),
             [j] (const ODatabaseExport::TPositions::value_type& tPos)
                 { return tPos.second == (sal_Int32)(j+1); });
-        if ( _rvColumns.end() != aFind && aFind->second != sal::static_int_cast< long >(CONTAINER_ENTRY_NOTFOUND) && aFind->first != sal::static_int_cast< long >(CONTAINER_ENTRY_NOTFOUND) )
+        if ( _rvColumns.end() != aFind && aFind->second != COLUMN_POSITION_NOT_FOUND && aFind->first != COLUMN_POSITION_NOT_FOUND )
         {
             OSL_ENSURE((aFind->first) < static_cast<sal_Int32>(aInsertList.size()),"aInsertList: Illegal index for vector");
             aInsertList[aFind->first] = ::dbtools::quoteName( aQuote,*(pIter+j));
diff --git a/dbaccess/source/ui/misc/RowSetDrop.cxx b/dbaccess/source/ui/misc/RowSetDrop.cxx
index aa1858a57d1b..c1cba83d2490 100644
--- a/dbaccess/source/ui/misc/RowSetDrop.cxx
+++ b/dbaccess/source/ui/misc/RowSetDrop.cxx
@@ -69,7 +69,7 @@ void ORowSetImportExport::initialize()
     m_aColumnTypes.reserve(nCount);
     for (sal_Int32 i = 1;i <= nCount; ++i)
     {
-        sal_Int32 nPos = -1; // -1 means column is autoincrement or doesn't exist
+        sal_Int32 nPos = COLUMN_POSITION_NOT_FOUND; // means column is autoincrement or doesn't exist
         if(!m_xTargetResultSetMetaData->isAutoIncrement(i))
         {
             try
diff --git a/include/tools/contnr.hxx b/include/tools/contnr.hxx
index 80d7abd6bca0..ba65820f8729 100644
--- a/include/tools/contnr.hxx
+++ b/include/tools/contnr.hxx
@@ -24,7 +24,6 @@
 #include <limits.h>
 
 #define CONTAINER_APPEND            (ULONG_MAX)
-#define CONTAINER_ENTRY_NOTFOUND    (ULONG_MAX)
 
 #define TREELIST_APPEND             (ULONG_MAX)
 #define TREELIST_ENTRY_NOTFOUND     (ULONG_MAX)


More information about the Libreoffice-commits mailing list