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

Stephan Bergmann sbergman at redhat.com
Tue Mar 7 18:48:16 UTC 2017


 dbaccess/source/core/api/SingleSelectQueryComposer.cxx |    7 +++----
 dbaccess/source/ui/browser/brwctrlr.cxx                |    4 ++--
 dbaccess/source/ui/browser/exsrcbrw.cxx                |    5 ++---
 dbaccess/source/ui/querydesign/QueryDesignView.cxx     |    4 ++--
 4 files changed, 9 insertions(+), 11 deletions(-)

New commits:
commit 5753ac2e281f80e7745c5b6346f1d36b7f90c880
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Mar 7 19:47:34 2017 +0100

    loplugin:loopvartoosmall
    
    Change-Id: Id82051b633050165077deb9a6a88d82707d53e75

diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
index 49515b8..9f4f17e 100644
--- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
+++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
@@ -1124,7 +1124,7 @@ bool OSingleSelectQueryComposer::setComparsionPredicate(OSQLParseNode * pConditi
         if (SQL_ISRULE(pCondition->getChild(0), column_ref))
         {
             nPos = 0;
-            sal_uInt32 i=1;
+            size_t i=1;
 
             aItem.Handle = getPredicateType(pCondition->getChild(i));
 
@@ -1202,14 +1202,13 @@ bool OSingleSelectQueryComposer::setComparsionPredicate(OSQLParseNode * pConditi
         OSQLParseNode *pRhs = pCondition->getChild(2);
 
         // Field names
-        sal_uInt16 i;
-        for (i=0;i< pLhs->count();i++)
+        for (size_t i=0;i< pLhs->count();i++)
              pLhs->getChild(i)->parseNodeToPredicateStr( aName, m_xConnection, xFormatter, m_aLocale, static_cast<sal_Char>( m_sDecimalSep.toChar() ) );
 
         // Criterion
         aItem.Handle = getPredicateType(pCondition->getChild(1));
         aValue       = pCondition->getChild(1)->getTokenValue();
-        for(i=0;i< pRhs->count();i++)
+        for(size_t i=0;i< pRhs->count();i++)
             pRhs->getChild(i)->parseNodeToPredicateStr(aValue, m_xConnection, xFormatter, m_aLocale, static_cast<sal_Char>( m_sDecimalSep.toChar() ) );
 
         aItem.Name = aName;
diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx
index e854c24..1c26dc8 100644
--- a/dbaccess/source/ui/browser/brwctrlr.cxx
+++ b/dbaccess/source/ui/browser/brwctrlr.cxx
@@ -2368,7 +2368,7 @@ IMPL_LINK(SbaXDataBrowserController, OnFoundData, FmFoundRecordInformation&, rIn
 
     // and move to the field
     Reference< css::container::XIndexAccess >  aColumnControls(getBrowserView()->getGridControl()->getPeer(), UNO_QUERY);
-    sal_uInt16 nViewPos;
+    sal_Int32 nViewPos;
 
     for ( nViewPos = 0; nViewPos < aColumnControls->getCount(); ++nViewPos )
     {
@@ -2383,7 +2383,7 @@ IMPL_LINK(SbaXDataBrowserController, OnFoundData, FmFoundRecordInformation&, rIn
     }
 
     Reference< css::form::XGrid >  xGrid(getBrowserView()->getGridControl(), UNO_QUERY);
-    xGrid->setCurrentColumnPosition(nViewPos);
+    xGrid->setCurrentColumnPosition(nViewPos); //TODO: sal_Int32 -> sal_Int16!
 }
 
 IMPL_LINK(SbaXDataBrowserController, OnCanceledNotFound, FmFoundRecordInformation&, rInfo, void)
diff --git a/dbaccess/source/ui/browser/exsrcbrw.cxx b/dbaccess/source/ui/browser/exsrcbrw.cxx
index 9b0b559..19832f2 100644
--- a/dbaccess/source/ui/browser/exsrcbrw.cxx
+++ b/dbaccess/source/ui/browser/exsrcbrw.cxx
@@ -138,8 +138,7 @@ void SAL_CALL SbaExternalSourceBrowser::dispatch(const css::util::URL& aURL, con
         OUString sControlType;
         sal_Int32 nControlPos = -1;
         Sequence< css::beans::PropertyValue> aControlProps;
-        sal_uInt16 i;
-        for ( i = 0; i < aArgs.getLength(); ++i, ++pArguments )
+        for ( sal_Int32 i = 0; i < aArgs.getLength(); ++i, ++pArguments )
         {
             if ( pArguments->Name == "ColumnType" )
             {
@@ -183,7 +182,7 @@ void SAL_CALL SbaExternalSourceBrowser::dispatch(const css::util::URL& aURL, con
         if (xNewColProperties.is())
         {
             const css::beans::PropertyValue* pControlProps = aControlProps.getConstArray();
-            for (i=0; i<aControlProps.getLength(); ++i, ++pControlProps)
+            for (sal_Int32 i=0; i<aControlProps.getLength(); ++i, ++pControlProps)
             {
                 try
                 {
diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
index f601556..fadd63d 100644
--- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
@@ -2114,7 +2114,7 @@ namespace
             Reference< XConnection> xConnection = rController.getConnection();
 
             OUString aColumnName,aTableRange;
-            for (sal_uInt32 i = 0; i < pParseTree->count() && eOk == eErrorCode ; ++i)
+            for (size_t i = 0; i < pParseTree->count() && eOk == eErrorCode ; ++i)
             {
                 ::connectivity::OSQLParseNode * pColumnRef = pParseTree->getChild(i);
 
@@ -2361,7 +2361,7 @@ namespace
             OQueryController& rController = static_cast<OQueryController&>(_pView->getController());
             ::connectivity::OSQLParseNode* pGroupBy = pSelectRoot->getChild(3)->getChild(2)->getChild(2);
 
-            for( sal_uInt32 i=0 ; i < pGroupBy->count() && eOk == eErrorCode; ++i )
+            for( size_t i=0 ; i < pGroupBy->count() && eOk == eErrorCode; ++i )
             {
                 OTableFieldDescRef aDragInfo = new OTableFieldDesc();
                 ::connectivity::OSQLParseNode* pParamRef = nullptr;


More information about the Libreoffice-commits mailing list