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

Stephan Bergmann sbergman at redhat.com
Tue Mar 7 18:54:49 UTC 2017


 forms/source/runtime/formoperations.cxx |   11 +++++------
 forms/source/runtime/formoperations.hxx |    2 +-
 2 files changed, 6 insertions(+), 7 deletions(-)

New commits:
commit 6551a14138d8b0626837debdc00924402df9ac23
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Mar 7 19:54:08 2017 +0100

    loplugin:loopvartoosmall
    
    Change-Id: Ic85cce722a0c1702ffbb7a45001fdf869ca6accf

diff --git a/forms/source/runtime/formoperations.cxx b/forms/source/runtime/formoperations.cxx
index cf05713..a0c48f5 100644
--- a/forms/source/runtime/formoperations.cxx
+++ b/forms/source/runtime/formoperations.cxx
@@ -1364,10 +1364,9 @@ namespace frm
         if ( xGrid.is() )
         {
             Reference< XIndexAccess > xColumns( xControl->getModel(), UNO_QUERY_THROW );
-            sal_Int16 nCurrentPos = xGrid->getCurrentColumnPosition();
-            nCurrentPos = impl_gridView2ModelPos_nothrow( xColumns, nCurrentPos );
+            sal_Int32 nCurrentPos = impl_gridView2ModelPos_nothrow( xColumns, xGrid->getCurrentColumnPosition() );
 
-            if ( nCurrentPos != (sal_Int16)-1 )
+            if ( nCurrentPos != -1 )
                 xColumns->getByIndex( nCurrentPos ) >>= xControlModel;
         }
         else if ( xControl.is() )
@@ -1402,13 +1401,13 @@ namespace frm
     }
 
 
-    sal_Int16 FormOperations::impl_gridView2ModelPos_nothrow( const Reference< XIndexAccess >& _rxColumns, sal_Int16 _nViewPos )
+    sal_Int32 FormOperations::impl_gridView2ModelPos_nothrow( const Reference< XIndexAccess >& _rxColumns, sal_Int16 _nViewPos )
     {
         OSL_PRECOND( _rxColumns.is(), "FormOperations::impl_gridView2ModelPos_nothrow: invalid columns container!" );
         try
         {
             // loop through all columns
-            sal_Int16 col = 0;
+            sal_Int32 col = 0;
             Reference< XPropertySet > xCol;
             bool bHidden( false );
             for ( col = 0; col < _rxColumns->getCount(); ++col )
@@ -1432,7 +1431,7 @@ namespace frm
         {
             DBG_UNHANDLED_EXCEPTION();
         }
-        return (sal_Int16)-1;
+        return -1;
     }
 
 
diff --git a/forms/source/runtime/formoperations.hxx b/forms/source/runtime/formoperations.hxx
index 0f09ba2..233d59c 100644
--- a/forms/source/runtime/formoperations.hxx
+++ b/forms/source/runtime/formoperations.hxx
@@ -235,7 +235,7 @@ namespace frm
             A grid control can have columns which are currently hidden, so the index of a
             column in the view is not necessarily the same as its index in the model.
         */
-        static sal_Int16   impl_gridView2ModelPos_nothrow( const css::uno::Reference< css::container::XIndexAccess >& _rxColumns, sal_Int16 _nViewPos );
+        static sal_Int32   impl_gridView2ModelPos_nothrow( const css::uno::Reference< css::container::XIndexAccess >& _rxColumns, sal_Int16 _nViewPos );
 
         /** moves our cursor one position to the left, caring for different possible
             cursor states.


More information about the Libreoffice-commits mailing list