accessibility/inc/accessibility/standard/vclxaccessiblelist.hxx |    6 -
 accessibility/source/standard/vclxaccessiblelist.cxx            |   41 +++-----
 basctl/source/basicide/moduldl2.cxx                             |    8 -
 basctl/source/dlged/managelang.cxx                              |   30 +++---
 chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx    |    2 
 chart2/source/controller/dialogs/tp_AxisPositions.cxx           |    2 
 chart2/source/controller/dialogs/tp_ChartType.cxx               |   12 +-
 chart2/source/controller/dialogs/tp_Scale.cxx                   |    2 
 chart2/source/controller/main/ElementSelector.cxx               |    6 -
 cui/source/customize/cfg.cxx                                    |   19 +--
 cui/source/customize/cfgutil.cxx                                |   11 +-
 cui/source/customize/eventdlg.cxx                               |    5 -
 cui/source/dialogs/cuicharmap.cxx                               |   10 +-
 cui/source/dialogs/cuigaldlg.cxx                                |   18 +--
 cui/source/dialogs/hldocntp.cxx                                 |    2 
 cui/source/dialogs/multipat.cxx                                 |   15 +--
 cui/source/dialogs/plfilter.cxx                                 |   13 +-
 cui/source/dialogs/thesdlg.cxx                                  |    2 
 cui/source/options/optctl.cxx                                   |    2 
 cui/source/options/optgdlg.cxx                                  |   14 +-
 cui/source/options/optgdlg.hxx                                  |    4 
 cui/source/options/optsave.cxx                                  |    8 -
 cui/source/tabpages/align.cxx                                   |    2 
 cui/source/tabpages/autocdlg.cxx                                |    8 -
 cui/source/tabpages/numfmt.cxx                                  |    2 
 cui/source/tabpages/page.cxx                                    |    2 
 dbaccess/source/ui/dlg/dbfindex.cxx                             |    8 -
 dbaccess/source/ui/dlg/generalpage.cxx                          |   20 ++--
 dbaccess/source/ui/dlg/queryfilter.cxx                          |   12 +-
 dbaccess/source/ui/inc/WColumnSelect.hxx                        |    2 
 dbaccess/source/ui/inc/queryfilter.hxx                          |    2 
 dbaccess/source/ui/misc/WColumnSelect.cxx                       |   30 +++---
 dbaccess/source/ui/misc/WTypeSelect.cxx                         |   27 ++---
 dbaccess/source/ui/querydesign/querydlg.cxx                     |   10 +-
 extensions/source/bibliography/datman.cxx                       |    2 
 extensions/source/dbpilots/commonpagesdbp.cxx                   |    3 
 extensions/source/dbpilots/gridwizard.cxx                       |    8 -
 extensions/source/propctrlr/listselectiondlg.cxx                |    4 
 extensions/source/propctrlr/standardcontrol.cxx                 |    8 -
 fpicker/source/office/iodlgimp.cxx                              |    2 
 include/svtools/DocumentInfoPreview.hxx                         |    2 
 include/svtools/PlaceEditDialog.hxx                             |    2 
 include/svtools/svmedit2.hxx                                    |    2 
 include/svx/lboxctrl.hxx                                        |    2 
 sc/source/ui/condformat/condformatdlgentry.cxx                  |    2 
 sc/source/ui/dbgui/consdlg.cxx                                  |   13 +-
 sc/source/ui/dbgui/csvtablebox.cxx                              |    4 
 sc/source/ui/dbgui/dapidata.cxx                                 |    4 
 sc/source/ui/dbgui/dapitype.cxx                                 |    2 
 sc/source/ui/dbgui/filtdlg.cxx                                  |   38 +++----
 sc/source/ui/dbgui/foptmgr.cxx                                  |   28 ++---
 sc/source/ui/dbgui/pfiltdlg.cxx                                 |    2 
 sc/source/ui/dbgui/sfiltdlg.cxx                                 |   28 ++---
 sc/source/ui/dbgui/tpsort.cxx                                   |   14 +-
 sc/source/ui/dbgui/tpsubt.cxx                                   |   14 +-
 sc/source/ui/dbgui/validate.cxx                                 |    4 
 sc/source/ui/inc/consdlg.hxx                                    |    4 
 sc/source/ui/miscdlgs/crnrdlg.cxx                               |   11 +-
 sc/source/ui/miscdlgs/linkarea.cxx                              |    4 
 sc/source/ui/miscdlgs/mvtabdlg.cxx                              |   12 +-
 sc/source/ui/miscdlgs/solveroptions.cxx                         |    2 
 sc/source/ui/optdlg/tpview.cxx                                  |    2 
 sc/source/ui/pagedlg/areasdlg.cxx                               |   34 +++---
 sc/source/ui/pagedlg/scuitphfedit.cxx                           |    9 -
 sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx              |   50 
++--------
 sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx              |    2 
 sc/source/ui/view/tabvwsh3.cxx                                  |    5 -
 sc/source/ui/view/tabvwshf.cxx                                  |    4 
 sd/source/filter/html/pubdlg.cxx                                |    6 -
 sd/source/ui/animations/CustomAnimationPane.cxx                 |    7 -
 sd/source/ui/dlg/PhotoAlbumDialog.cxx                           |    6 -
 sd/source/ui/dlg/dlgass.cxx                                     |   16 +--
 sd/source/ui/dlg/dlgctrls.cxx                                   |    4 
 sd/source/ui/dlg/headerfooterdlg.cxx                            |    2 
 sfx2/source/appl/newhelp.cxx                                    |   22 ++--
 sfx2/source/dialog/templdlg.cxx                                 |    2 
 starmath/source/dialog.cxx                                      |    2 
 starmath/source/utility.cxx                                     |    3 
 svl/source/numbers/zforscan.cxx                                 |    3 
 svl/source/numbers/zforscan.hxx                                 |    1 
 svtools/source/contnr/DocumentInfoPreview.cxx                   |    1 
 svtools/source/dialogs/PlaceEditDialog.cxx                      |    2 
 svtools/source/dialogs/ServerDetailsControls.cxx                |    4 
 svtools/source/edit/svmedit2.cxx                                |    2 
 svx/source/dialog/docrecovery.cxx                               |    2 
 svx/source/dialog/rubydialog.cxx                                |    4 
 svx/source/engine3d/float3d.cxx                                 |    5 -
 svx/source/fmcomp/gridcell.cxx                                  |   16 +--
 svx/source/gallery2/galbrws1.cxx                                |    8 -
 svx/source/gengal/gengal.cxx                                    |    2 
 svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx         |    6 -
 svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx         |    4 
 svx/source/sidebar/text/TextCharacterSpacingControl.cxx         |    2 
 svx/source/tbxctrls/fillctrl.cxx                                |    2 
 svx/source/tbxctrls/lboxctrl.cxx                                |    4 
 svx/source/tbxctrls/tbcontrl.cxx                                |   10 +-
 svx/source/tbxctrls/tbunosearchcontrollers.cxx                  |    8 -
 sw/source/ui/fldui/fldvar.cxx                                   |    2 
 sw/source/uibase/dbui/dbmgr.cxx                                 |    4 
 toolkit/source/awt/vclxwindows.cxx                              |   40 ++++----
 vcl/inc/outfont.hxx                                             |    2 
 vcl/workben/mtfdemo.cxx                                         |    2 
 vcl/workben/vcldemo.cxx                                         |    2 
 103 files changed, 417 insertions(+), 475 deletions(-)

New commits:
commit 3342993a437df435f4640468fd650dfb45d43045
Author: Matteo Casalin <matteo.casa...@yahoo.com>
Date:   Sat Sep 12 14:13:50 2015 +0200

    Avoid getTokenCount in favor of getToken
    
    Order of token extraction is inverted, but since elements are inserted
    in a set their final order won't be affected.
    
    Change-Id: I7f22a518e3d6a9a53951aa89159a36b398af5f46

diff --git a/cui/source/dialogs/plfilter.cxx b/cui/source/dialogs/plfilter.cxx
index 67e35e6..cdb606f 100644
--- a/cui/source/dialogs/plfilter.cxx
+++ b/cui/source/dialogs/plfilter.cxx
@@ -20,7 +20,6 @@
 #include <set>
 #include <map>
 #include <comphelper/processfactory.hxx>
-#include <comphelper/string.hxx>
 
 #include <vcl/stdtext.hxx>
 
@@ -64,16 +63,22 @@ void fillNetscapePluginFilters( Sequence< OUString >& 
rPluginNames, Sequence< OU
     {
         const PluginDescription & rDescr = pDescriptions[nPos];
 
+        // consistency check for the do {} while loop below
+        if (rDescr.Extension.isEmpty())
+            continue;
+
         StrSet& rTypes = aMap[ rDescr.Description ];
         OUString aExtension( rDescr.Extension );
 
-        for ( sal_uInt16 nCnt = comphelper::string::getTokenCount(aExtension,  
';'); nCnt--; )
+        sal_Int32 nIndex = 0;
+        do
         {
             // no default plugins anymore
-            OUString aExt( aExtension.getToken( nCnt, ';' ) );
+            const OUString aExt( aExtension.getToken( 0, ';', nIndex ) );
             if ( aExt != "*.*" )
                 rTypes.insert( aExt );
         }
+        while ( nIndex >= 0 );
     }
 
     rPluginNames = Sequence< OUString >( aMap.size() );
commit d76b979dbdbeefc522f39ef39034cef72f27cfca
Author: Matteo Casalin <matteo.casa...@yahoo.com>
Date:   Wed Sep 9 09:00:00 2015 +0200

    Fix regression from ea2c80bdcd862f91dd7429184aea29d9a77f9774
    
    Change-Id: I7aa236fbfed74dec67ff423d51d7313e7d235e1e

diff --git a/cui/source/dialogs/plfilter.cxx b/cui/source/dialogs/plfilter.cxx
index 386ff69..67e35e6 100644
--- a/cui/source/dialogs/plfilter.cxx
+++ b/cui/source/dialogs/plfilter.cxx
@@ -71,7 +71,7 @@ void fillNetscapePluginFilters( Sequence< OUString >& 
rPluginNames, Sequence< OU
         {
             // no default plugins anymore
             OUString aExt( aExtension.getToken( nCnt, ';' ) );
-            if ( aExt == "*.*" )
+            if ( aExt != "*.*" )
                 rTypes.insert( aExt );
         }
     }
commit 0edb6ea4ff09dc1787e42f6e59a07b190857921d
Author: Matteo Casalin <matteo.casa...@yahoo.com>
Date:   Wed Sep 9 07:56:01 2015 +0200

    sal_uInt16 to sal_Int32, constify/reduce OUStrings
    
    Change-Id: I123274309ecc4ba8d1aa605d3aadc37bb11df9a0

diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx
index 03c4be8..3eb37ba 100644
--- a/cui/source/customize/cfgutil.cxx
+++ b/cui/source/customize/cfgutil.cxx
@@ -1125,12 +1125,11 @@ void SfxConfigGroupListBox::SelectMacro( const 
SfxMacroInfoItem *pItem )
 void SfxConfigGroupListBox::SelectMacro( const OUString& rBasic,
          const OUString& rMacro )
 {
-    OUString aBasicName( rBasic );
-    aBasicName += " ";
-    aBasicName += pImp->m_sMacros;
-    OUString aLib, aModule, aMethod;
-    sal_uInt16 nCount = comphelper::string::getTokenCount(rMacro, '.');
-    aMethod = rMacro.getToken( nCount-1, '.' );
+    const OUString aBasicName( rBasic + " " + pImp->m_sMacros );
+    const sal_Int32 nCount = comphelper::string::getTokenCount(rMacro, '.');
+    const OUString aMethod( rMacro.getToken( nCount-1, '.' ) );
+    OUString aLib;
+    OUString aModule;
     if ( nCount > 2 )
     {
         aLib = rMacro.getToken( 0, '.' );
commit fd8340fbad33c0af045e7034c3c4ddf5c9af1dc5
Author: Matteo Casalin <matteo.casa...@yahoo.com>
Date:   Tue Sep 8 01:43:08 2015 +0200

    Use < instead of <= by not decreasing the number of entries
    
    Change-Id: Ibbc706d1af58e1ecf314edf9c4546a779f510067

diff --git a/sc/source/ui/miscdlgs/mvtabdlg.cxx 
b/sc/source/ui/miscdlgs/mvtabdlg.cxx
index 5f25f2e..a6f2f24 100644
--- a/sc/source/ui/miscdlgs/mvtabdlg.cxx
+++ b/sc/source/ui/miscdlgs/mvtabdlg.cxx
@@ -162,8 +162,8 @@ void ScMoveTableDlg::CheckNewTabName()
 
     bool bMoveInCurrentDoc = (pBtnMove->IsChecked() && IsCurrentDocSelected());
     bool bFound = false;
-    const sal_Int32 nLast = pLbTable->GetEntryCount() - 1;
-    for ( sal_uInt16 i=0; i<=nLast && !bFound; ++i )
+    const sal_Int32 nLast = pLbTable->GetEntryCount();
+    for ( sal_uInt16 i=0; i<nLast && !bFound; ++i )
     {
         if ( aNewName.equals(pLbTable->GetEntry(i)) )
         {
commit 3107b237629cef53619daba32aa110eb229b56cf
Author: Matteo Casalin <matteo.casa...@yahoo.com>
Date:   Tue Sep 8 01:39:37 2015 +0200

    sal_uInt16 and SAL_MAX_UINT16 to sal_Int32 and LISTBOX_APPEND
    
    Change-Id: Id68a8369d0ca907d4afc0d8a22d31d1e4c24133c

diff --git a/extensions/source/dbpilots/gridwizard.cxx 
b/extensions/source/dbpilots/gridwizard.cxx
index 98e9f83..b477bc0 100644
--- a/extensions/source/dbpilots/gridwizard.cxx
+++ b/extensions/source/dbpilots/gridwizard.cxx
@@ -421,7 +421,7 @@ namespace dbp
         // the (original) relative position of the entry
         sal_IntPtr nRelativeIndex = reinterpret_cast<sal_IntPtr>(bMoveRight ? 
m_pExistFields->GetEntryData(nSelected) : 
m_pSelFields->GetEntryData(nSelected));
 
-        sal_uInt16 nInsertPos = SAL_MAX_UINT16;
+        sal_Int32 nInsertPos = LISTBOX_APPEND;
         if (!bMoveRight)
         {   // need to determine an insert pos which reflects the original
             nInsertPos = 0;
commit 67e0d97767044ffe554a60015ac99bd00da97a3c
Author: Matteo Casalin <matteo.casa...@yahoo.com>
Date:   Tue Sep 8 01:35:30 2015 +0200

    Simplify TakeThread::execute()
    
    Change-Id: Ic5c7e5ab2775422720875d117a22338cbfe283d3

diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx
index 0f42f1a..d89872e 100644
--- a/cui/source/dialogs/cuigaldlg.cxx
+++ b/cui/source/dialogs/cuigaldlg.cxx
@@ -302,10 +302,8 @@ TakeThread::~TakeThread()
 
 void TakeThread::execute()
 {
-    INetURLObject       aURL;
     sal_Int32           nEntries;
     GalleryTheme*       pThm = mpBrowser->GetXChgData()->pTheme;
-    sal_Int32           nPos;
     GalleryProgress*    pStatusProgress;
 
     {
@@ -317,10 +315,8 @@ void TakeThread::execute()
 
     for( sal_Int32 i = 0; i < nEntries && schedule(); ++i )
     {
-        if( mpBrowser->bTakeAll )
-            aURL = INetURLObject( mpBrowser->aFoundList[ nPos = i ] );
-        else
-            aURL = INetURLObject( mpBrowser->aFoundList[ nPos = 
mpBrowser->m_pLbxFound->GetSelectEntryPos( i ) ]);
+        const sal_Int32 nPos = mpBrowser->bTakeAll ? i : 
mpBrowser->m_pLbxFound->GetSelectEntryPos( i );
+        const INetURLObject aURL( mpBrowser->aFoundList[ nPos ]);
 
         mrTakenList.push_back( (sal_uLong)nPos );
 
commit 6c292d3150f414e9e16c84caba7c6b106355bf7e
Author: Matteo Casalin <matteo.casa...@yahoo.com>
Date:   Tue Sep 8 01:27:54 2015 +0200

    Simplify: use getToken and just store converted integers
    
    Change-Id: I11e640307ba868b02823a7f7fa4475bc71721b23

diff --git a/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx 
b/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx
index f459711..31a4a06 100644
--- a/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx
+++ b/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx
@@ -249,31 +249,18 @@ void NumberFormatPropertyPanel::NotifyItemUpdate(
             {
                 const SfxStringItem* pItem = static_cast<const 
SfxStringItem*>(pState);
                 OUString aCode = pItem->GetValue();
-                sal_uInt16 aLen = aCode.getLength();
-                OUString* sFormat = new OUString[4];
-                OUString  sTmpStr = "";
-                sal_uInt16 nCount = 0;
-                sal_uInt16 nStrCount = 0;
-                while( nCount < aLen )
+                sal_Int32 nIndex = 0;
+                sal_Int32 aFormat[4] = {0};
+                for (size_t i=0; i<SAL_N_ELEMENTS(aFormat); ++i)
                 {
-                    sal_Unicode cChar = aCode[nCount];
-                    if(cChar == ',')
-                    {
-                        sFormat[nStrCount] = sTmpStr;
-                        sTmpStr.clear();
-                        nStrCount++;
-                    }
-                    else
-                    {
-                        sTmpStr += OUString(cChar);
-                    }
-                    nCount++;
+                    aFormat[i] = aCode.getToken(0, ',', nIndex).toInt32();
+                    if (nIndex<0)
+                        break;
                 }
-                bThousand   =    sFormat[0].toInt32();
-                bNegRed     =    sFormat[1].toInt32();
-                nPrecision  =    (sal_uInt16)sFormat[2].toInt32();
-                nLeadZeroes =    (sal_uInt16)sFormat[3].toInt32();
-                delete[] sFormat;
+                bThousand   = static_cast<bool>(aFormat[0]);
+                bNegRed     = static_cast<bool>(aFormat[1]);
+                nPrecision  = static_cast<sal_uInt16>(aFormat[2]);
+                nLeadZeroes = static_cast<sal_uInt16>(aFormat[3]);
             }
             else
             {
commit c64dc9ab966bf583183aaab79f91dadf852d0ccb
Author: Matteo Casalin <matteo.casa...@yahoo.com>
Date:   Tue Sep 8 01:18:57 2015 +0200

    This code is commented out since file creation, 2013-04-10
    
    Change-Id: I44cba1523c714cb7de38cfcf8131e9191e01476c

diff --git a/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx 
b/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx
index 00b87c7..f459711 100644
--- a/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx
+++ b/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx
@@ -249,21 +249,6 @@ void NumberFormatPropertyPanel::NotifyItemUpdate(
             {
                 const SfxStringItem* pItem = static_cast<const 
SfxStringItem*>(pState);
                 OUString aCode = pItem->GetValue();
-            /*  if(aCode.Equals(String::CreateFromAscii("General")))
-                {
-                    mnCategorySelected = 0;
-                    mpLbCategory->SelectEntryPos(0);
-                    mpBtnThousand->Check(0);
-                    mpBtnNegRed->Check(0);
-                    mpEdDecimals->SetValue(0);
-                    mpEdLeadZeroes->SetValue(1);
-                    break;
-                }
-                else if( mpLbCategory->GetSelectEntryPos() == 0 )
-                {
-                    mnCategorySelected = 1;
-                    mpLbCategory->SelectEntryPos(1);
-                }*/
                 sal_uInt16 aLen = aCode.getLength();
                 OUString* sFormat = new OUString[4];
                 OUString  sTmpStr = "";
commit c02aa9a5a2dadeb7f262484af31a6accc0df41a3
Author: Matteo Casalin <matteo.casa...@yahoo.com>
Date:   Tue Sep 8 01:06:50 2015 +0200

    Simplify calls to SelectEntryPos by early bail-out
    
    Change-Id: Ib21f07835b2e0820bef557dc6c217e5df61dfc2d

diff --git a/sc/source/ui/dbgui/foptmgr.cxx b/sc/source/ui/dbgui/foptmgr.cxx
index b4a49fa..2b1cd62 100644
--- a/sc/source/ui/dbgui/foptmgr.cxx
+++ b/sc/source/ui/dbgui/foptmgr.cxx
@@ -234,23 +234,20 @@ IMPL_LINK( ScFilterOptionsMgr, EdAreaModifyHdl, Edit*, 
pEd )
 
         if ( SCA_VALID == (nResult & SCA_VALID) )
         {
-            bool    bFound  = false;
-            sal_Int32 i = 0;
             const sal_Int32 nCount = pLbCopyArea->GetEntryCount();
 
-            for ( i=2; i<nCount && !bFound; i++ )
+            for ( sal_Int32 i=2; i<nCount; ++i )
             {
                 OUString* pStr = 
static_cast<OUString*>(pLbCopyArea->GetEntryData( i ));
-                bFound = (theCurPosStr == *pStr);
+                if (theCurPosStr == *pStr)
+                {
+                    pLbCopyArea->SelectEntryPos( i );
+                    return 0;
+                }
             }
 
-            if ( bFound )
-                pLbCopyArea->SelectEntryPos( --i );
-            else
-                pLbCopyArea->SelectEntryPos( 0 );
         }
-        else
-            pLbCopyArea->SelectEntryPos( 0 );
+        pLbCopyArea->SelectEntryPos( 0 );
     }
 
     return 0;
diff --git a/sc/source/ui/dbgui/sfiltdlg.cxx b/sc/source/ui/dbgui/sfiltdlg.cxx
index bbc88e0..53e6820 100644
--- a/sc/source/ui/dbgui/sfiltdlg.cxx
+++ b/sc/source/ui/dbgui/sfiltdlg.cxx
@@ -452,20 +452,18 @@ IMPL_LINK( ScSpecialFilterDlg, FilterAreaModHdl, 
formula::RefEdit*, pEd )
 
             if ( SCA_VALID == (nResult & SCA_VALID) )
             {
-                bool    bFound  = false;
-                sal_Int32 i = 0;
                 const sal_Int32 nCount  = pLbFilterArea->GetEntryCount();
 
-                for ( i=1; i<nCount && !bFound; i++ )
+                for ( sal_Int32 i=1; i<nCount; ++i )
                 {
                     OUString* pStr = 
static_cast<OUString*>(pLbFilterArea->GetEntryData( i ));
-                    bFound = (theCurAreaStr == *pStr);
+                    if (theCurAreaStr == *pStr)
+                    {
+                        pLbFilterArea->SelectEntryPos( i );
+                        return 0;
+                    }
                 }
-
-                if ( bFound )
-                    pLbFilterArea->SelectEntryPos( --i );
-                else
-                    pLbFilterArea->SelectEntryPos( 0 );
+                pLbFilterArea->SelectEntryPos( 0 );
             }
         }
         else
commit 9c7edfd5ec231040b0df5c71df6a11080b85daa1
Author: Matteo Casalin <matteo.casa...@yahoo.com>
Date:   Mon Aug 31 23:18:06 2015 +0200

    Use sal_Int32 and LISTBOX_ENTRY_NOTFOUND for GetSelectEntryPos
    
    Change-Id: I07f6f4426e87cd4066663e0ba7c26917bb984cbd

diff --git a/sd/source/ui/dlg/dlgass.cxx b/sd/source/ui/dlg/dlgass.cxx
index 0ac1b70..014d250 100644
--- a/sd/source/ui/dlg/dlgass.cxx
+++ b/sd/source/ui/dlg/dlgass.cxx
@@ -895,9 +895,9 @@ OUString AssistentDlgImpl::GetDocFileName()
     OUString aDocFile;
     if( GetStartType() == ST_TEMPLATE )
     {
-        const sal_uInt16 nEntry = mpPage1TemplateLB->GetSelectEntryPos();
+        const sal_Int32 nEntry = mpPage1TemplateLB->GetSelectEntryPos();
         TemplateEntry* pEntry = NULL;
-        if (mpTemplateRegion && nEntry != (sal_uInt16)-1)
+        if (mpTemplateRegion && nEntry != LISTBOX_ENTRY_NOTFOUND)
             pEntry = mpTemplateRegion->maEntries[nEntry];
 
         if(pEntry)
@@ -911,8 +911,8 @@ OUString AssistentDlgImpl::GetDocFileName()
     }
     else if( GetStartType() == ST_OPEN )
     {
-        const sal_uInt16 nEntry = mpPage1OpenLB->GetSelectEntryPos();
-        if(nEntry != (sal_uInt16)-1 )
+        const sal_Int32 nEntry = mpPage1OpenLB->GetSelectEntryPos();
+        if( nEntry != LISTBOX_ENTRY_NOTFOUND )
             aDocFile = maOpenFilesList[nEntry];
     }
 
@@ -924,9 +924,9 @@ OUString AssistentDlgImpl::GetDocFileName()
 
 OUString AssistentDlgImpl::GetLayoutFileName()
 {
-    const sal_uInt16 nEntry = mpPage2LayoutLB->GetSelectEntryPos();
+    const sal_Int32 nEntry = mpPage2LayoutLB->GetSelectEntryPos();
     TemplateEntry* pEntry = NULL;
-    if(nEntry != (sal_uInt16)-1 && nEntry > 0)
+    if(nEntry != LISTBOX_ENTRY_NOTFOUND && nEntry > 0)
         pEntry = mpLayoutRegion->maEntries[nEntry-1];
 
     if(pEntry)
commit f4c300eae4e9aaaec9e5d1f478ad35161ede2761
Author: Matteo Casalin <matteo.casa...@yahoo.com>
Date:   Mon Aug 31 23:04:00 2015 +0200

    Reduce scope by early bail out
    
    Change-Id: Ia4e1763cc4d70197342be4e5caf6d5c14cd34c80

diff --git a/dbaccess/source/ui/misc/WTypeSelect.cxx 
b/dbaccess/source/ui/misc/WTypeSelect.cxx
index 99ba355..bc20e96 100644
--- a/dbaccess/source/ui/misc/WTypeSelect.cxx
+++ b/dbaccess/source/ui/misc/WTypeSelect.cxx
@@ -372,15 +372,14 @@ void OWizTypeSelectList::dispose()
 bool OWizTypeSelectList::IsPrimaryKeyAllowed() const
 {
     const sal_Int32 nCount = GetSelectEntryCount();
-    sal_Int32 j;
 
-    for( j = 0; m_bPKey && j < nCount; ++j )
+    for( sal_Int32 j = 0; m_bPKey && j < nCount; ++j )
     {
         OFieldDescription* pField = 
static_cast<OFieldDescription*>(GetEntryData(GetSelectEntryPos(j)));
         if(!pField || pField->getTypeInfo()->nSearchType == ColumnSearch::NONE)
-            break;
+            return true;
     }
-    return j == nCount;
+    return false;
 }
 
 void OWizTypeSelectList::setPrimaryKey(OFieldDescription* _pFieldDescr, 
sal_uInt16 _nPos, bool _bSet)
commit b2e6bb75e03386b958d5e7c066e7768e43726f47
Author: Matteo Casalin <matteo.casa...@yahoo.com>
Date:   Sun Aug 30 23:22:36 2015 +0200

    Simplify
    
    Change-Id: I7e93874ed5127c9d674d53b220ba680718bd82ab

diff --git a/cui/source/dialogs/multipat.cxx b/cui/source/dialogs/multipat.cxx
index 4d454c7..cd6dca3 100644
--- a/cui/source/dialogs/multipat.cxx
+++ b/cui/source/dialogs/multipat.cxx
@@ -346,11 +346,7 @@ void SvxPathSelectDialog::SetPath(const OUString& rPath)
         bool bIsSystemPath =
             osl::FileBase::getSystemPathFromFileURL(sPath, sSystemPath) == 
osl::FileBase::E_None;
 
-        sal_Int32 nPos = 0;
-        if ( bIsSystemPath )
-            nPos = m_pPathLB->InsertEntry( sSystemPath );
-        else
-            nPos = m_pPathLB->InsertEntry( sPath );
+        const sal_Int32 nPos = m_pPathLB->InsertEntry( bIsSystemPath ? 
sSystemPath : sPath );
         m_pPathLB->SetEntryData( nPos, new OUString( sPath ) );
     }
 
commit c5909e251871e5a38992fade94a489a9546e11b7
Author: Matteo Casalin <matteo.casa...@yahoo.com>
Date:   Sun Aug 30 23:08:29 2015 +0200

    Update many ListBox users to its sal_Int32 interface
    
    Change-Id: I6469ac5e2d17406bee9bc434930e2471cb3bae9f

diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblelist.hxx 
b/accessibility/inc/accessibility/standard/vclxaccessiblelist.hxx
index 0a42b99..935f4a7 100644
--- a/accessibility/inc/accessibility/standard/vclxaccessiblelist.hxx
+++ b/accessibility/inc/accessibility/standard/vclxaccessiblelist.hxx
@@ -134,7 +134,7 @@ public:
     void UpdateSelection_Acc (const ::rtl::OUString& sTextOfSelectedItem, bool 
b_IsDropDownList);
     void UpdateSelection_Impl_Acc (bool b_IsDropDownList);
 
-    void UpdateFocus_Impl_Acc ( sal_uInt16 nPos, bool b_IsDropDownList) ;
+    void UpdateFocus_Impl_Acc ( sal_Int32 nPos, bool b_IsDropDownList) ;
     static void NotifyListItem(css::uno::Any& val);
 protected:
     BoxType     m_aBoxType;
@@ -201,8 +201,8 @@ private:
 
     void UpdateEntryRange_Impl();
 protected:
-    void UpdateSelection_Impl (sal_uInt16 nPos = 0);
-    bool checkEntrySelected(sal_uInt16 _nPos,
+    void UpdateSelection_Impl(sal_Int32 nPos = 0);
+    bool checkEntrySelected(sal_Int32 _nPos,
                             css::uno::Any& _rNewValue,
                             css::uno::Reference< 
css::accessibility::XAccessible >& _rxNewAcc);
 private:
diff --git a/accessibility/source/standard/vclxaccessiblelist.cxx 
b/accessibility/source/standard/vclxaccessiblelist.cxx
index 7b2dd3e..955eecf 100644
--- a/accessibility/source/standard/vclxaccessiblelist.cxx
+++ b/accessibility/source/standard/vclxaccessiblelist.cxx
@@ -174,10 +174,8 @@ void VCLXAccessibleList::notifyVisibleStates(bool _bSetNew 
)
         VCLXAccessibleListItem* pItem = 
static_cast<VCLXAccessibleListItem*>(xHold.get());
         if ( pItem )
         {
-            sal_uInt16 nTopEntry = 0;
-            if ( m_pListBoxHelper )
-                nTopEntry = m_pListBoxHelper->GetTopEntry();
-            sal_uInt16 nPos = (sal_uInt16)(aIter - 
m_aAccessibleChildren.begin());
+            const sal_Int32 nTopEntry = m_pListBoxHelper ? 
m_pListBoxHelper->GetTopEntry() : 0;
+            const sal_Int32 nPos = static_cast<sal_Int32>(aIter - 
m_aAccessibleChildren.begin());
             bool bVisible = ( nPos>=nTopEntry && nPos<( nTopEntry + 
m_nVisibleLineCount ) );
             pItem->SetVisible( m_bVisible && bVisible );
         }
@@ -215,7 +213,7 @@ void VCLXAccessibleList::UpdateSelection_Impl_Acc(bool 
bHasDropDownList)
             Reference< XAccessible > xNewAcc;
         if ( m_pListBoxHelper )
         {
-            sal_uInt32 i=0;
+            sal_Int32 i=0;
             m_nCurSelectedPos = LISTBOX_ENTRY_NOTFOUND;
             for ( ListItems::iterator aIter = m_aAccessibleChildren.begin();
                   aIter != m_aAccessibleChildren.end(); ++aIter,++i)
@@ -244,7 +242,7 @@ void VCLXAccessibleList::UpdateSelection_Impl_Acc(bool 
bHasDropDownList)
                     checkEntrySelected(i,aNewValue,xNewAcc);
                 }
             }
-            sal_uInt16 nCount = m_pListBoxHelper->GetEntryCount();
+            const sal_Int32 nCount = m_pListBoxHelper->GetEntryCount();
             if ( i < nCount ) // here we have to check the if any other 
listbox entry is selected
             {
                 for (; i < nCount && !checkEntrySelected(i,aNewValue,xNewAcc) 
;++i )
@@ -309,7 +307,7 @@ void VCLXAccessibleList::NotifyListItem(css::uno::Any& val)
     }
 }
 
-void VCLXAccessibleList::UpdateFocus_Impl_Acc (sal_uInt16 nPos ,bool 
b_IsDropDownList)
+void VCLXAccessibleList::UpdateFocus_Impl_Acc (sal_Int32 nPos ,bool 
b_IsDropDownList)
 {
     if (!(m_aBoxType == LISTBOX && !b_IsDropDownList))
     {
@@ -498,17 +496,16 @@ void VCLXAccessibleList::UpdateSelection (const OUString& 
sTextOfSelectedItem)
 
 
 
-Reference<XAccessible> VCLXAccessibleList::CreateChild (sal_Int32 i)
+Reference<XAccessible> VCLXAccessibleList::CreateChild (sal_Int32 nPos)
 {
     Reference<XAccessible> xChild;
 
-    sal_uInt16 nPos = static_cast<sal_uInt16>(i);
-    if ( nPos >= m_aAccessibleChildren.size() )
+    if ( static_cast<size_t>(nPos) >= m_aAccessibleChildren.size() )
     {
         m_aAccessibleChildren.resize(nPos + 1);
 
         // insert into the container
-        xChild = new VCLXAccessibleListItem(m_pListBoxHelper, i, this);
+        xChild = new VCLXAccessibleListItem(m_pListBoxHelper, nPos, this);
         m_aAccessibleChildren[nPos] = xChild;
     }
     else
@@ -517,7 +514,7 @@ Reference<XAccessible> VCLXAccessibleList::CreateChild 
(sal_Int32 i)
         // check if position is empty and can be used else we have to adjust 
all entries behind this
         if (!xChild.is())
         {
-            xChild = new VCLXAccessibleListItem(m_pListBoxHelper, i, this);
+            xChild = new VCLXAccessibleListItem(m_pListBoxHelper, nPos, this);
             m_aAccessibleChildren[nPos] = xChild;
         }
     }
@@ -527,17 +524,15 @@ Reference<XAccessible> VCLXAccessibleList::CreateChild 
(sal_Int32 i)
         // Just add the SELECTED state.
         bool bNowSelected = false;
         if ( m_pListBoxHelper )
-            bNowSelected = m_pListBoxHelper->IsEntryPosSelected 
((sal_uInt16)i);
+            bNowSelected = m_pListBoxHelper->IsEntryPosSelected(nPos);
         if (bNowSelected)
-            m_nCurSelectedPos = sal_uInt16(i);
+            m_nCurSelectedPos = nPos;
         VCLXAccessibleListItem* pItem = static_cast< VCLXAccessibleListItem* 
>(xChild.get());
         pItem->SetSelected( bNowSelected );
 
         // Set the child's VISIBLE state.
         UpdateVisibleLineCount();
-        sal_uInt16 nTopEntry = 0;
-        if ( m_pListBoxHelper )
-            nTopEntry = m_pListBoxHelper->GetTopEntry();
+        const sal_Int32 nTopEntry = m_pListBoxHelper ? 
m_pListBoxHelper->GetTopEntry() : 0;
         bool bVisible = ( nPos>=nTopEntry && nPos<( nTopEntry + 
m_nVisibleLineCount ) );
         pItem->SetVisible( m_bVisible && bVisible );
     }
@@ -693,7 +688,7 @@ void VCLXAccessibleList::UpdateEntryRange_Impl()
     m_nLastTopEntry = nTop;
 }
 
-bool VCLXAccessibleList::checkEntrySelected(sal_uInt16 _nPos,Any& 
_rNewValue,Reference< XAccessible >& _rxNewAcc)
+bool VCLXAccessibleList::checkEntrySelected(sal_Int32 _nPos,Any& 
_rNewValue,Reference< XAccessible >& _rxNewAcc)
 {
     OSL_ENSURE(m_pListBoxHelper,"Helper is not valid!");
     bool bNowSelected = false;
@@ -710,7 +705,7 @@ bool VCLXAccessibleList::checkEntrySelected(sal_uInt16 
_nPos,Any& _rNewValue,Ref
 }
 
 
-void VCLXAccessibleList::UpdateSelection_Impl(sal_uInt16)
+void VCLXAccessibleList::UpdateSelection_Impl(sal_Int32)
 {
     uno::Any aOldValue, aNewValue;
 
@@ -721,7 +716,7 @@ void VCLXAccessibleList::UpdateSelection_Impl(sal_uInt16)
 
         if ( m_pListBoxHelper )
         {
-            sal_uInt16 i=0;
+            sal_Int32 i=0;
             m_nCurSelectedPos = LISTBOX_ENTRY_NOTFOUND;
             for ( ListItems::iterator aIter = m_aAccessibleChildren.begin();
                   aIter != m_aAccessibleChildren.end(); ++aIter,++i)
@@ -750,7 +745,7 @@ void VCLXAccessibleList::UpdateSelection_Impl(sal_uInt16)
                     checkEntrySelected(i,aNewValue,xNewAcc);
                 }
             }
-            sal_uInt16 nCount = m_pListBoxHelper->GetEntryCount();
+            const sal_Int32 nCount = m_pListBoxHelper->GetEntryCount();
             if ( i < nCount ) // here we have to check the if any other 
listbox entry is selected
             {
                 for (; i < nCount && !checkEntrySelected(i,aNewValue,xNewAcc) 
;++i )
@@ -848,8 +843,8 @@ void SAL_CALL 
VCLXAccessibleList::selectAllAccessibleChildren(  ) throw (Runtime
 
         if ( m_pListBoxHelper )
         {
-            sal_uInt16 nCount = m_pListBoxHelper->GetEntryCount();
-            for ( sal_uInt16 i = 0; i < nCount; ++i )
+            const sal_Int32 nCount = m_pListBoxHelper->GetEntryCount();
+            for ( sal_Int32 i = 0; i < nCount; ++i )
                 m_pListBoxHelper->SelectEntryPos( i );
             // call the select handler, don't handle events in this time
             m_bDisableProcessEvent = true;
diff --git a/basctl/source/basicide/moduldl2.cxx 
b/basctl/source/basicide/moduldl2.cxx
index d9ca3cb..1bccb05 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -526,8 +526,8 @@ void LibPage::dispose()
 {
     if (m_pBasicsBox)
     {
-        sal_uInt16 nCount = m_pBasicsBox->GetEntryCount();
-        for ( sal_uInt16 i = 0; i < nCount; ++i )
+        const sal_Int32 nCount = m_pBasicsBox->GetEntryCount();
+        for ( sal_Int32 i = 0; i < nCount; ++i )
         {
             DocumentEntry* pEntry = 
static_cast<DocumentEntry*>(m_pBasicsBox->GetEntryData( i ));
             delete pEntry;
@@ -1397,13 +1397,13 @@ void LibPage::FillListBox()
 void LibPage::InsertListBoxEntry( const ScriptDocument& rDocument, 
LibraryLocation eLocation )
 {
     OUString aEntryText( rDocument.getTitle( eLocation ) );
-    sal_uInt16 nPos = m_pBasicsBox->InsertEntry( aEntryText );
+    const sal_Int32 nPos = m_pBasicsBox->InsertEntry( aEntryText );
     m_pBasicsBox->SetEntryData( nPos, new DocumentEntry(rDocument, eLocation) 
);
 }
 
 void LibPage::SetCurLib()
 {
-    sal_uInt16 nSelPos = m_pBasicsBox->GetSelectEntryPos();
+    const sal_Int32 nSelPos = m_pBasicsBox->GetSelectEntryPos();
     DocumentEntry* pEntry = 
static_cast<DocumentEntry*>(m_pBasicsBox->GetEntryData( nSelPos ));
     if ( pEntry )
     {
diff --git a/basctl/source/dlged/managelang.cxx 
b/basctl/source/dlged/managelang.cxx
index b1b7f8b..47e765b 100644
--- a/basctl/source/dlged/managelang.cxx
+++ b/basctl/source/dlged/managelang.cxx
@@ -125,7 +125,7 @@ void ManageLanguageDialog::FillLanguageBox()
             {
                 sLanguage += " " + m_sDefLangStr;
             }
-            sal_uInt16 nPos = m_pLanguageLB->InsertEntry( sLanguage );
+            const sal_Int32 nPos = m_pLanguageLB->InsertEntry( sLanguage );
             m_pLanguageLB->SetEntryData( nPos, new LanguageEntry( sLanguage, 
pLocale[i], bIsDefault ) );
         }
     }
@@ -135,8 +135,8 @@ void ManageLanguageDialog::FillLanguageBox()
 
 void ManageLanguageDialog::ClearLanguageBox()
 {
-    sal_uInt16 i, nCount = m_pLanguageLB->GetEntryCount();
-    for ( i = 0; i < nCount; ++i )
+    const sal_Int32 nCount = m_pLanguageLB->GetEntryCount();
+    for ( sal_Int32 i = 0; i < nCount; ++i )
     {
         LanguageEntry* pEntry = 
static_cast<LanguageEntry*>(m_pLanguageLB->GetEntryData(i));
         delete pEntry;
@@ -173,13 +173,13 @@ IMPL_LINK_NOARG_TYPED(ManageLanguageDialog, DeleteHdl, 
Button*, void)
     ScopedVclPtrInstance< MessageDialog > aQBox(this, "DeleteLangDialog", 
"modules/BasicIDE/ui/deletelangdialog.ui");
     if ( aQBox->Execute() == RET_OK )
     {
-        sal_uInt16 i, nCount = m_pLanguageLB->GetSelectEntryCount();
-        sal_uInt16 nPos = m_pLanguageLB->GetSelectEntryPos();
+        sal_Int32 nCount = m_pLanguageLB->GetSelectEntryCount();
+        sal_Int32 nPos = m_pLanguageLB->GetSelectEntryPos();
         // remove locales
         Sequence< Locale > aLocaleSeq( nCount );
-        for ( i = 0; i < nCount; ++i )
+        for ( sal_Int32 i = 0; i < nCount; ++i )
         {
-            sal_uInt16 nSelPos = m_pLanguageLB->GetSelectEntryPos(i);
+            const sal_Int32 nSelPos = m_pLanguageLB->GetSelectEntryPos(i);
             LanguageEntry* pEntry = 
static_cast<LanguageEntry*>(m_pLanguageLB->GetEntryData( nSelPos ));
             if ( pEntry )
                 aLocaleSeq[i] = pEntry->m_aLocale;
@@ -199,7 +199,7 @@ IMPL_LINK_NOARG_TYPED(ManageLanguageDialog, DeleteHdl, 
Button*, void)
 
 IMPL_LINK_NOARG_TYPED(ManageLanguageDialog, MakeDefHdl, Button*, void)
 {
-    sal_uInt16 nPos = m_pLanguageLB->GetSelectEntryPos();
+    const sal_Int32 nPos = m_pLanguageLB->GetSelectEntryPos();
     LanguageEntry* pSelectEntry = 
static_cast<LanguageEntry*>(m_pLanguageLB->GetEntryData( nPos ));
     if ( pSelectEntry && !pSelectEntry->m_bIsDefault )
     {
@@ -216,7 +216,7 @@ IMPL_LINK_NOARG_TYPED(ManageLanguageDialog, MakeDefHdl, 
Button*, void)
 
 IMPL_LINK_NOARG(ManageLanguageDialog, SelectHdl)
 {
-    sal_uInt16 nCount = m_pLanguageLB->GetEntryCount();
+    const sal_Int32 nCount = m_pLanguageLB->GetEntryCount();
     bool bEmpty = ( !nCount ||
                     m_pLanguageLB->GetEntryPos( m_sCreateLangStr ) != 
LISTBOX_ENTRY_NOTFOUND );
     bool bSelect = ( m_pLanguageLB->GetSelectEntryPos() != 
LISTBOX_ENTRY_NOTFOUND );
@@ -286,13 +286,13 @@ void SetDefaultLanguageDialog::FillLanguageBox()
         // remove the already localized languages
         Sequence< Locale > aLocaleSeq = 
m_xLocalizationMgr->getStringResourceManager()->getLocales();
         const Locale* pLocale = aLocaleSeq.getConstArray();
-        sal_Int32 i, nCount = aLocaleSeq.getLength();
-        for ( i = 0;  i < nCount;  ++i )
+        const sal_Int32 nCountLoc = aLocaleSeq.getLength();
+        for ( sal_Int32 i = 0;  i < nCountLoc;  ++i )
             m_pLanguageLB->RemoveLanguage( LanguageTag::convertToLanguageType( 
pLocale[i] ) );
 
         // fill checklistbox if not in default mode
-        sal_uInt16 j, nCount_ = m_pLanguageLB->GetEntryCount();
-        for ( j = 0;  j < nCount_;  ++j )
+        const sal_Int32 nCountLang = m_pLanguageLB->GetEntryCount();
+        for ( sal_Int32 j = 0;  j < nCountLang;  ++j )
         {
             m_pCheckLangLB->InsertEntry(
                 m_pLanguageLB->GetEntry(j), LISTBOX_APPEND, 
m_pLanguageLB->GetEntryData(j) );
@@ -315,9 +315,9 @@ Sequence< Locale > SetDefaultLanguageDialog::GetLocales() 
const
     }
     else
     {
-        sal_uInt16 i, nCount = static_cast< sal_uInt16 >( 
m_pCheckLangLB->GetEntryCount() );
+        const sal_Int32 nCount = m_pCheckLangLB->GetEntryCount();
         sal_Int32 j = 0;
-        for ( i = 0; i < nCount; ++i )
+        for ( sal_Int32 i = 0; i < nCount; ++i )
         {
             if ( m_pCheckLangLB->IsChecked(i) )
             {
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx 
b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
index 5dec3ea..0ee4077 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
+++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
@@ -121,7 +121,7 @@ namespace
         rListBox.SelectEntry( rColor );
         if( rListBox.GetSelectEntryCount() == 0 )
         {
-            sal_uInt16 nPos = rListBox.InsertEntry( rColor, lcl_makeColorName( 
rColor ) );
+            const sal_Int32 nPos = rListBox.InsertEntry( rColor, 
lcl_makeColorName( rColor ) );
             rListBox.SelectEntryPos( nPos );
         }
     }
diff --git a/chart2/source/controller/dialogs/tp_AxisPositions.cxx 
b/chart2/source/controller/dialogs/tp_AxisPositions.cxx
index 97fba02..62e6e35 100644
--- a/chart2/source/controller/dialogs/tp_AxisPositions.cxx
+++ b/chart2/source/controller/dialogs/tp_AxisPositions.cxx
@@ -165,7 +165,7 @@ void AxisPositionsTabPage::Reset(const SfxItemSet* rInAttrs)
         for( sal_Int32 nN=0; nN<m_aCategories.getLength() && nN<nMaxCount; 
nN++ )
             m_pED_CrossesAtCategory->InsertEntry( m_aCategories[nN] );
 
-        sal_uInt16 nCount = m_pED_CrossesAtCategory->GetEntryCount();
+        sal_Int32 nCount = m_pED_CrossesAtCategory->GetEntryCount();
         if( nCount>30 )
             nCount=30;
         m_pED_CrossesAtCategory->SetDropDownLineCount( nCount );
diff --git a/chart2/source/controller/dialogs/tp_ChartType.cxx 
b/chart2/source/controller/dialogs/tp_ChartType.cxx
index b638ca4..59e5b9c 100644
--- a/chart2/source/controller/dialogs/tp_ChartType.cxx
+++ b/chart2/source/controller/dialogs/tp_ChartType.cxx
@@ -39,8 +39,10 @@ namespace chart
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::chart2;
 
-#define POS_3DSCHEME_SIMPLE    0
-#define POS_3DSCHEME_REALISTIC 1
+enum {
+    POS_3DSCHEME_SIMPLE    = 0,
+    POS_3DSCHEME_REALISTIC = 1
+};
 
 class Dim3DLookResourceGroup : public ChangingResource
 {
@@ -93,7 +95,7 @@ void Dim3DLookResourceGroup::fillControls( const 
ChartTypeParameter& rParameter
 void Dim3DLookResourceGroup::fillParameter( ChartTypeParameter& rParameter )
 {
     rParameter.b3DLook = m_pCB_3DLook->IsChecked();
-    sal_uInt16 nPos = m_pLB_Scheme->GetSelectEntryPos();
+    const sal_Int32 nPos = m_pLB_Scheme->GetSelectEntryPos();
     if( POS_3DSCHEME_SIMPLE == nPos )
         rParameter.eThreeDLookScheme = ThreeDLookScheme_Simple;
     else if( POS_3DSCHEME_REALISTIC == nPos )
@@ -600,7 +602,7 @@ IMPL_LINK_NOARG_TYPED(SplineResourceGroup, 
SplineDetailsDialogHdl, Button*, void
     ChartTypeParameter aOldParameter;
     getSplinePropertiesDialog().fillParameter( aOldParameter, 
POS_LINETYPE_SMOOTH == m_pLB_LineType->GetSelectEntryPos() );
 
-    sal_uInt16 iOldLineTypePos = m_pLB_LineType->GetSelectEntryPos();
+    const sal_Int32 iOldLineTypePos = m_pLB_LineType->GetSelectEntryPos();
     m_pLB_LineType->SelectEntryPos(POS_LINETYPE_SMOOTH);
     if( RET_OK == getSplinePropertiesDialog().Execute() )
     {
@@ -620,7 +622,7 @@ IMPL_LINK_NOARG_TYPED(SplineResourceGroup, 
SteppedDetailsDialogHdl, Button*, voi
     ChartTypeParameter aOldParameter;
     getSteppedPropertiesDialog().fillParameter( aOldParameter, 
POS_LINETYPE_STEPPED == m_pLB_LineType->GetSelectEntryPos() );
 
-    sal_uInt16 iOldLineTypePos = m_pLB_LineType->GetSelectEntryPos();
+    const sal_Int32 iOldLineTypePos = m_pLB_LineType->GetSelectEntryPos();
     m_pLB_LineType->SelectEntryPos(POS_LINETYPE_STEPPED);
     if( RET_OK == getSteppedPropertiesDialog().Execute() )
     {
diff --git a/chart2/source/controller/dialogs/tp_Scale.cxx 
b/chart2/source/controller/dialogs/tp_Scale.cxx
index 0b9e69e..42639c3 100644
--- a/chart2/source/controller/dialogs/tp_Scale.cxx
+++ b/chart2/source/controller/dialogs/tp_Scale.cxx
@@ -260,7 +260,7 @@ enum AxisTypeListBoxEntry
 
 IMPL_LINK_NOARG(ScaleTabPage, SelectAxisTypeHdl)
 {
-    sal_uInt16 nPos = m_pLB_AxisType->GetSelectEntryPos();
+    const sal_Int32 nPos = m_pLB_AxisType->GetSelectEntryPos();
     if( nPos==TYPE_DATE )
         m_nAxisType = chart2::AxisType::DATE;
     else
diff --git a/chart2/source/controller/main/ElementSelector.cxx 
b/chart2/source/controller/main/ElementSelector.cxx
index 732bf47..894f8a6 100644
--- a/chart2/source/controller/main/ElementSelector.cxx
+++ b/chart2/source/controller/main/ElementSelector.cxx
@@ -160,7 +160,7 @@ void SelectorListBox::UpdateChartElementsListAndSelection()
         if( bSelectionFound )
             SelectEntryPos(nEntryPosToSelect);
 
-        sal_uInt16 nEntryCount = GetEntryCount();
+        sal_Int32 nEntryCount = GetEntryCount();
         if( nEntryCount > 100 )
             nEntryCount = 100;
         SetDropDownLineCount( nEntryCount );
@@ -188,8 +188,8 @@ void SelectorListBox::Select()
 
     if ( !IsTravelSelect() )
     {
-        sal_uInt16 nPos = GetSelectEntryPos();
-        if( nPos < m_aEntries.size() )
+        const sal_Int32 nPos = GetSelectEntryPos();
+        if( static_cast<size_t>(nPos) < m_aEntries.size() )
         {
             ObjectHierarchy::tOID aOID = m_aEntries[nPos].OID;
             Reference< view::XSelectionSupplier > xSelectionSupplier( 
m_xChartController.get(), uno::UNO_QUERY );
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index d6654a8..a69e8a1 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -1590,7 +1590,7 @@ void SvxConfigPage::Reset( const SfxItemSet* )
     // all other open documents of the same module type
     if ( !bInitialised )
     {
-        sal_uInt16 nPos = 0;
+        sal_Int32 nPos = 0;
         uno::Reference < css::ui::XUIConfigurationManager > xCfgMgr;
         uno::Reference < css::ui::XUIConfigurationManager > xDocCfgMgr;
 
@@ -1884,7 +1884,7 @@ IMPL_LINK( SvxConfigPage, SelectSaveInLocation, ListBox 
*, pBox )
 
 void SvxConfigPage::ReloadTopLevelListBox( SvxConfigEntry* pToSelect )
 {
-    sal_uInt16 nSelectionPos = m_pTopLevelListBox->GetSelectEntryPos();
+    sal_Int32 nSelectionPos = m_pTopLevelListBox->GetSelectEntryPos();
     m_pTopLevelListBox->Clear();
 
     if ( GetSaveInData() && GetSaveInData()->GetEntries() )
@@ -1895,7 +1895,7 @@ void SvxConfigPage::ReloadTopLevelListBox( 
SvxConfigEntry* pToSelect )
         for ( ; iter != end; ++iter )
         {
             SvxConfigEntry* pEntryData = *iter;
-            sal_uInt16 nPos = m_pTopLevelListBox->InsertEntry( stripHotKey( 
pEntryData->GetName() ) );
+            const sal_Int32 nPos = m_pTopLevelListBox->InsertEntry( 
stripHotKey( pEntryData->GetName() ) );
             m_pTopLevelListBox->SetEntryData( nPos, pEntryData );
 
             if ( pEntryData == pToSelect )
@@ -1936,7 +1936,7 @@ void SvxConfigPage::AddSubMenusToUI(
             subMenuTitle += aMenuSeparatorStr;
             subMenuTitle += stripHotKey( pEntryData->GetName() );
 
-            sal_uInt16 nPos = m_pTopLevelListBox->InsertEntry( subMenuTitle );
+            const sal_Int32 nPos = m_pTopLevelListBox->InsertEntry( 
subMenuTitle );
             m_pTopLevelListBox->SetEntryData( nPos, pEntryData );
 
             AddSubMenusToUI( subMenuTitle, pEntryData );
@@ -2958,7 +2958,7 @@ void SvxToolbarConfigPage::dispose()
 
 void SvxToolbarConfigPage::DeleteSelectedTopLevel()
 {
-    sal_uInt16 nSelectionPos = m_pTopLevelListBox->GetSelectEntryPos();
+    const sal_Int32 nSelectionPos = m_pTopLevelListBox->GetSelectEntryPos();
     ToolbarSaveInData* pSaveInData = static_cast<ToolbarSaveInData*>( 
GetSaveInData() );
     pSaveInData->RemoveToolbar( GetTopLevelSelection() );
 
@@ -3053,7 +3053,7 @@ void SvxToolbarConfigPage::MoveEntry( bool bMoveUp )
 
 IMPL_LINK_TYPED( SvxToolbarConfigPage, ToolbarSelectHdl, MenuButton *, 
pButton, void )
 {
-    sal_uInt16 nSelectionPos = m_pTopLevelListBox->GetSelectEntryPos();
+    sal_Int32 nSelectionPos = m_pTopLevelListBox->GetSelectEntryPos();
 
     SvxConfigEntry* pToolbar =
         static_cast<SvxConfigEntry*>(m_pTopLevelListBox->GetEntryData( 
nSelectionPos ));
@@ -3424,7 +3424,7 @@ void SvxToolbarConfigPage::Init()
 
     ReloadTopLevelListBox();
 
-    sal_uInt16 nPos = 0;
+    sal_Int32 nPos = 0;
     if ( !m_aURLToSelect.isEmpty() )
     {
         for ( sal_Int32 i = 0 ; i < m_pTopLevelListBox->GetEntryCount(); ++i )
@@ -4411,13 +4411,12 @@ IMPL_LINK_NOARG_TYPED( SvxToolbarConfigPage, 
NewToolbarHdl, Button *, void )
 
     VclPtrInstance< SvxNewToolbarDialog > pNameDialog( nullptr, aNewName );
 
-    sal_uInt16 nInsertPos;
     for ( sal_Int32 i = 0 ; i < m_pSaveInListBox->GetEntryCount(); ++i )
     {
         SaveInData* pData =
             static_cast<SaveInData*>(m_pSaveInListBox->GetEntryData( i ));
 
-        nInsertPos = pNameDialog->m_pSaveInListBox->InsertEntry(
+        const sal_Int32 nInsertPos = 
pNameDialog->m_pSaveInListBox->InsertEntry(
             m_pSaveInListBox->GetEntry( i ) );
 
         pNameDialog->m_pSaveInListBox->SetEntryData( nInsertPos, pData );
@@ -4430,7 +4429,7 @@ IMPL_LINK_NOARG_TYPED( SvxToolbarConfigPage, 
NewToolbarHdl, Button *, void )
     {
         aNewName = pNameDialog->GetName();
 
-        nInsertPos = pNameDialog->m_pSaveInListBox->GetSelectEntryPos();
+        sal_Int32 nInsertPos = 
pNameDialog->m_pSaveInListBox->GetSelectEntryPos();
 
         ToolbarSaveInData* pData = static_cast<ToolbarSaveInData*>(
             pNameDialog->m_pSaveInListBox->GetEntryData( nInsertPos ));
diff --git a/cui/source/customize/eventdlg.cxx 
b/cui/source/customize/eventdlg.cxx
index 4b7d8f8..347d1ab 100644
--- a/cui/source/customize/eventdlg.cxx
+++ b/cui/source/customize/eventdlg.cxx
@@ -83,9 +83,8 @@ SvxEventConfigPage::SvxEventConfigPage(vcl::Window *pParent, 
const SfxItemSet& r
     xSupplier =
         
frame::theGlobalEventBroadcaster::get(::comphelper::getProcessComponentContext());
 
-    sal_uInt16 nPos(0);
     m_xAppEvents = xSupplier->getEvents();
-    nPos = m_pSaveInListBox->InsertEntry(
+    const sal_Int32 nPos = m_pSaveInListBox->InsertEntry(
         utl::ConfigManager::getProductName() );
     m_pSaveInListBox->SetEntryData( nPos, new bool(true) );
     m_pSaveInListBox->SelectEntryPos( nPos );
@@ -154,7 +153,7 @@ void SvxEventConfigPage::ImplInitDocument()
             m_xDocumentModifiable.set(xModel, css::uno::UNO_QUERY);
 
             OUString aTitle = ::comphelper::DocumentInfo::getDocumentTitle( 
xModel );
-            sal_uInt16 nPos = m_pSaveInListBox->InsertEntry( aTitle );
+            const sal_Int32 nPos = m_pSaveInListBox->InsertEntry( aTitle );
 
             m_pSaveInListBox->SetEntryData( nPos, new bool(false) );
             m_pSaveInListBox->SelectEntryPos( nPos );
diff --git a/cui/source/dialogs/cuicharmap.cxx 
b/cui/source/dialogs/cuicharmap.cxx
index 07183e8..fd605cd 100644
--- a/cui/source/dialogs/cuicharmap.cxx
+++ b/cui/source/dialogs/cuicharmap.cxx
@@ -331,7 +331,7 @@ void SvxCharacterMap::init()
         if ( aFontName != aLastName )
         {
             aLastName = aFontName;
-            sal_uInt16 nPos = m_pFontLB->InsertEntry( aFontName );
+            const sal_Int32 nPos = m_pFontLB->InsertEntry( aFontName );
             m_pFontLB->SetEntryData( nPos, reinterpret_cast<void*>(i) );
         }
     }
@@ -426,8 +426,8 @@ void SvxCharacterMap::fillAllSubsets(ListBox &rListBox)
 
 IMPL_LINK_NOARG(SvxCharacterMap, FontSelectHdl)
 {
-    sal_uInt16 nPos = m_pFontLB->GetSelectEntryPos(),
-               nFont = 
(sal_uInt16)reinterpret_cast<sal_uLong>(m_pFontLB->GetEntryData( nPos ));
+    const sal_Int32 nPos = m_pFontLB->GetSelectEntryPos();
+    const sal_uInt16 nFont = 
(sal_uInt16)reinterpret_cast<sal_uLong>(m_pFontLB->GetEntryData( nPos ));
     aFont = GetDevFont( nFont );
     aFont.SetWeight( WEIGHT_DONTKNOW );
     aFont.SetItalic( ITALIC_NONE );
@@ -460,7 +460,7 @@ IMPL_LINK_NOARG(SvxCharacterMap, FontSelectHdl)
         const Subset* s;
         while( NULL != (s = pSubsetMap->GetNextSubset( bFirst ))  )
         {
-            sal_uInt16 nPos_ = m_pSubsetLB->InsertEntry( s->GetName() );
+            const sal_Int32 nPos_ = m_pSubsetLB->InsertEntry( s->GetName() );
             m_pSubsetLB->SetEntryData( nPos_, const_cast<Subset *>(s) );
             // NOTE: subset must live at least as long as the selected font
             if( bFirst )
@@ -481,7 +481,7 @@ IMPL_LINK_NOARG(SvxCharacterMap, FontSelectHdl)
 
 IMPL_LINK_NOARG(SvxCharacterMap, SubsetSelectHdl)
 {
-    sal_uInt16 nPos = m_pSubsetLB->GetSelectEntryPos();
+    const sal_Int32 nPos = m_pSubsetLB->GetSelectEntryPos();
     const Subset* pSubset = static_cast<const Subset*> 
(m_pSubsetLB->GetEntryData(nPos));
     if( pSubset )
     {
diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx
index 5774baa..0f42f1a 100644
--- a/cui/source/dialogs/cuigaldlg.cxx
+++ b/cui/source/dialogs/cuigaldlg.cxx
@@ -92,8 +92,8 @@ void SearchThread::execute()
 
     if( !aFileType.isEmpty() )
     {
-        const sal_uInt16        nFileNumber = 
mpBrowser->m_pCbbFileType->GetEntryPos( aFileType );
-        sal_uInt16              nBeginFormat, nEndFormat;
+        const sal_Int32 nFileNumber = mpBrowser->m_pCbbFileType->GetEntryPos( 
aFileType );
+        sal_Int32 nBeginFormat, nEndFormat;
         ::std::vector< OUString > aFormats;
 
         if( !nFileNumber || ( nFileNumber >= 
mpBrowser->m_pCbbFileType->GetEntryCount() ) )
@@ -104,7 +104,7 @@ void SearchThread::execute()
         else
             nBeginFormat = nEndFormat = nFileNumber;
 
-        for( sal_uInt16 i = nBeginFormat; i <= nEndFormat; ++i )
+        for( sal_Int32 i = nBeginFormat; i <= nEndFormat; ++i )
             aFormats.push_back( mpBrowser->aFilterEntryList[ i 
]->aFilterName.toAsciiLowerCase() );
 
         ImplSearch( maStartURL, aFormats, mpBrowser->bSearchRecursive );
@@ -303,9 +303,9 @@ TakeThread::~TakeThread()
 void TakeThread::execute()
 {
     INetURLObject       aURL;
-    sal_uInt16          nEntries;
+    sal_Int32           nEntries;
     GalleryTheme*       pThm = mpBrowser->GetXChgData()->pTheme;
-    sal_uInt16          nPos;
+    sal_Int32           nPos;
     GalleryProgress*    pStatusProgress;
 
     {
@@ -315,7 +315,7 @@ void TakeThread::execute()
         pThm->LockBroadcaster();
     }
 
-    for( sal_uInt16 i = 0; i < nEntries && schedule(); i++ )
+    for( sal_Int32 i = 0; i < nEntries && schedule(); ++i )
     {
         if( mpBrowser->bTakeAll )
             aURL = INetURLObject( mpBrowser->aFoundList[ nPos = i ] );
diff --git a/cui/source/dialogs/hldocntp.cxx b/cui/source/dialogs/hldocntp.cxx
index 12d98d1..e4d4b0a 100644
--- a/cui/source/dialogs/hldocntp.cxx
+++ b/cui/source/dialogs/hldocntp.cxx
@@ -448,7 +448,7 @@ IMPL_LINK_NOARG_TYPED(SvxHyperlinkNewDocTp, 
ClickNewHdl_Impl, Button*, void)
             m_pLbDocTypes->GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND )
         {
             // get private-url
-            sal_uInt16 nPos = m_pLbDocTypes->GetSelectEntryPos();
+            const sal_Int32 nPos = m_pLbDocTypes->GetSelectEntryPos();
             aNewURL.setExtension( 
static_cast<DocumentTypeData*>(m_pLbDocTypes->GetEntryData( nPos ))->aStrExt );
         }
 
diff --git a/cui/source/dialogs/multipat.cxx b/cui/source/dialogs/multipat.cxx
index 2a66dae..4d454c7 100644
--- a/cui/source/dialogs/multipat.cxx
+++ b/cui/source/dialogs/multipat.cxx
@@ -122,7 +122,7 @@ IMPL_LINK_NOARG_TYPED(SvxPathSelectDialog, AddHdl_Impl, 
Button*, void)
         }
         else
         {
-            sal_uInt16 nPos = m_pPathLB->InsertEntry( sInsPath );
+            const sal_Int32 nPos = m_pPathLB->InsertEntry( sInsPath );
             m_pPathLB->SetEntryData( nPos, new OUString( aURL ) );
         }
 
@@ -158,9 +158,9 @@ IMPL_LINK_NOARG_TYPED(SvxMultiPathDialog, DelHdl_Impl, 
Button*, void)
 
 IMPL_LINK_NOARG_TYPED(SvxPathSelectDialog, DelHdl_Impl, Button*, void)
 {
-    sal_uInt16 nPos = m_pPathLB->GetSelectEntryPos();
+    sal_Int32 nPos = m_pPathLB->GetSelectEntryPos();
     m_pPathLB->RemoveEntry( nPos );
-    sal_uInt16 nCnt = m_pPathLB->GetEntryCount();
+    sal_Int32 nCnt = m_pPathLB->GetEntryCount();
 
     if ( nCnt )
     {
@@ -252,7 +252,7 @@ void SvxPathSelectDialog::dispose()
 {
     if (m_pPathLB)
     {
-        sal_uInt16 nPos = m_pPathLB->GetEntryCount();
+        sal_Int32 nPos = m_pPathLB->GetEntryCount();
         while ( nPos-- )
             delete static_cast<OUString*>(m_pPathLB->GetEntryData(nPos));
     }
@@ -337,7 +337,7 @@ void SvxMultiPathDialog::SetPath( const OUString& rPath )
 void SvxPathSelectDialog::SetPath(const OUString& rPath)
 {
     sal_Unicode cDelim = SVT_SEARCHPATH_DELIMITER;
-    sal_uInt16 nPos, nCount = comphelper::string::getTokenCount(rPath, cDelim);
+    sal_uInt16 nCount = comphelper::string::getTokenCount(rPath, cDelim);
 
     for ( sal_uInt16 i = 0; i < nCount; ++i )
     {
@@ -346,6 +346,7 @@ void SvxPathSelectDialog::SetPath(const OUString& rPath)
         bool bIsSystemPath =
             osl::FileBase::getSystemPathFromFileURL(sPath, sSystemPath) == 
osl::FileBase::E_None;
 
+        sal_Int32 nPos = 0;
         if ( bIsSystemPath )
             nPos = m_pPathLB->InsertEntry( sSystemPath );
         else
diff --git a/cui/source/dialogs/thesdlg.cxx b/cui/source/dialogs/thesdlg.cxx
index 4604ca5..4842aff 100644
--- a/cui/source/dialogs/thesdlg.cxx
+++ b/cui/source/dialogs/thesdlg.cxx
@@ -386,7 +386,7 @@ IMPL_LINK( SvxThesaurusDialog, WordSelectHdl_Impl, ComboBox 
*, pBox )
 {
     if (pBox && !m_pWordCB->IsTravelSelect())  // act only upon return key and 
not when traveling with cursor keys
     {
-        sal_uInt16 nPos = pBox->GetSelectEntryPos();
+        const sal_Int32 nPos = pBox->GetSelectEntryPos();
         OUString aStr( pBox->GetEntry( nPos ) );
         aStr = linguistic::GetThesaurusReplaceText( aStr );
         m_pWordCB->SetText( aStr );
diff --git a/cui/source/options/optctl.cxx b/cui/source/options/optctl.cxx
index 5b8911d..4ef91cb 100644
--- a/cui/source/options/optctl.cxx
+++ b/cui/source/options/optctl.cxx
@@ -115,7 +115,7 @@ bool SvxCTLOptionsPage::FillItemSet( SfxItemSet* )
 
     if ( m_pNumeralsLB->IsValueChangedFromSaved() )
     {
-        sal_uInt16 nPos = m_pNumeralsLB->GetSelectEntryPos();
+        const sal_Int32 nPos = m_pNumeralsLB->GetSelectEntryPos();
         aCTLOptions.SetCTLTextNumerals( (SvtCTLOptions::TextNumerals)nPos );
         bModified = true;
     }
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index e869664e..7f84f2c 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -737,7 +737,7 @@ bool OfaViewTabPage::FillItemSet( SfxItemSet* )
     bool bRepaintWindows(false);
 
     SvtMiscOptions aMiscOptions;
-    sal_uInt16 nSizeLB_NewSelection = m_pIconSizeLB->GetSelectEntryPos();
+    const sal_Int32 nSizeLB_NewSelection = m_pIconSizeLB->GetSelectEntryPos();
     if( nSizeLB_InitialSelection != nSizeLB_NewSelection )
     {
         // from now on it's modified, even if via auto setting the same size 
was set as now selected in the LB
@@ -753,7 +753,7 @@ bool OfaViewTabPage::FillItemSet( SfxItemSet* )
         aMiscOptions.SetSymbolsSize( eSet );
     }
 
-    sal_uInt16 nStyleLB_NewSelection = m_pIconStyleLB->GetSelectEntryPos();
+    const sal_Int32 nStyleLB_NewSelection = 
m_pIconStyleLB->GetSelectEntryPos();
     if( nStyleLB_InitialSelection != nStyleLB_NewSelection )
     {
         // 0 means choose style automatically
@@ -761,7 +761,7 @@ bool OfaViewTabPage::FillItemSet( SfxItemSet* )
             aMiscOptions.SetIconTheme("auto");
         else
         {
-            sal_uInt16 pos = m_pIconStyleLB->GetSelectEntryPos();
+            const sal_Int32 pos = m_pIconStyleLB->GetSelectEntryPos();
             const vcl::IconThemeInfo& iconThemeId = 
mInstalledIconThemes.at(pos-1);
             aMiscOptions.SetIconTheme(iconThemeId.GetThemeId());
         }
@@ -1069,7 +1069,7 @@ OfaLanguagesTabPage::OfaLanguagesTabPage(vcl::Window* 
pParent, const SfxItemSet&
             {
                 //sal_uInt16 p = m_pUserInterfaceLB->InsertLanguage(aLang);
                 OUString aLangStr( SvtLanguageTable::GetLanguageString( aLang, 
true ) );
-                sal_uInt16 p = m_pUserInterfaceLB->InsertEntry(aLangStr);
+                const sal_Int32 p = m_pUserInterfaceLB->InsertEntry(aLangStr);
                 m_pUserInterfaceLB->SetEntryData(p, 
reinterpret_cast<void*>(i+1));
             }
         }
@@ -1129,7 +1129,7 @@ OfaLanguagesTabPage::OfaLanguagesTabPage(vcl::Window* 
pParent, const SfxItemSet&
         aStr_ = ApplyLreOrRleEmbedding( aStr_ ) +
                 aTwoSpace +
                 ApplyLreOrRleEmbedding( SvtLanguageTable::GetLanguageString( 
pCurr->GetLanguage() ) );
-        sal_uInt16 nPos = m_pCurrencyLB->InsertEntry( aStr_ );
+        const sal_Int32 nPos = m_pCurrencyLB->InsertEntry( aStr_ );
         m_pCurrencyLB->SetEntryData( nPos, const_cast<NfCurrencyEntry 
*>(pCurr) );
     }
 
@@ -1485,7 +1485,7 @@ void OfaLanguagesTabPage::Reset( const SfxItemSet* rSet )
         pCurr = SvNumberFormatter::GetCurrencyEntry( aAbbrev, eLang );
     }
     // if pCurr==NULL the SYSTEM entry is selected
-    sal_uInt16 nPos = m_pCurrencyLB->GetEntryPos( static_cast<void const 
*>(pCurr) );
+    const sal_Int32 nPos = m_pCurrencyLB->GetEntryPos( static_cast<void const 
*>(pCurr) );
     m_pCurrencyLB->SelectEntryPos( nPos );
     bReadonly = 
pLangConfig->aSysLocaleOptions.IsReadOnly(SvtSysLocaleOptions::E_CURRENCY);
     m_pCurrencyLB->Enable(!bReadonly);
@@ -1673,7 +1673,7 @@ IMPL_LINK( OfaLanguagesTabPage, LocaleSettingHdl, 
SvxLanguageBox*, pBox )
 
     const NfCurrencyEntry* pCurr = &SvNumberFormatter::GetCurrencyEntry(
             ((eLang == LANGUAGE_USER_SYSTEM_CONFIG) ? 
MsLangId::getSystemLanguage() : eLang));
-    sal_uInt16 nPos = m_pCurrencyLB->GetEntryPos( nullptr );
+    sal_Int32 nPos = m_pCurrencyLB->GetEntryPos( nullptr );
     if (pCurr)
     {
         // Update the "Default ..." currency.
diff --git a/cui/source/options/optgdlg.hxx b/cui/source/options/optgdlg.hxx
index b031e79..b66a628 100644
--- a/cui/source/options/optgdlg.hxx
+++ b/cui/source/options/optgdlg.hxx
@@ -104,8 +104,8 @@ private:
     VclPtr<ListBox>        m_pMousePosLB;
     VclPtr<ListBox>        m_pMouseMiddleLB;
 
-    sal_uInt16      nSizeLB_InitialSelection;
-    sal_uInt16      nStyleLB_InitialSelection;
+    sal_Int32      nSizeLB_InitialSelection;
+    sal_Int32      nStyleLB_InitialSelection;
 
     SvtTabAppearanceCfg*    pAppearanceCfg;
     CanvasSettings*         pCanvasSettings;
diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx
index 1ec6565..eee1ad2 100644
--- a/cui/source/options/optsave.cxx
+++ b/cui/source/options/optsave.cxx
@@ -560,7 +560,7 @@ static OUString lcl_ExtracUIName(const 
Sequence<PropertyValue> &rProperties)
 
 IMPL_LINK( SvxSaveTabPage, FilterHdl_Impl, ListBox *, pBox )
 {
-    sal_uInt16 nCurPos = aDocTypeLB->GetSelectEntryPos();
+    const sal_Int32 nCurPos = aDocTypeLB->GetSelectEntryPos();
 
     sal_IntPtr nData = -1;
     if(nCurPos < APP_COUNT)
@@ -588,7 +588,7 @@ IMPL_LINK( SvxSaveTabPage, FilterHdl_Impl, ListBox *, pBox )
             OUString sSelect;
             for(int i = 0; i < pImpl->aUIFilterArr[nData].getLength(); i++)
             {
-                sal_uInt16 nEntryPos = aSaveAsLB->InsertEntry(pUIFilters[i]);
+                const sal_Int32 nEntryPos = 
aSaveAsLB->InsertEntry(pUIFilters[i]);
                 if ( pImpl->aODFArr[nData][i] )
                     aSaveAsLB->SetEntryData( nEntryPos, 
static_cast<void*>(pImpl) );
                 if(pFilters[i] == pImpl->aDefaultArr[nData])
@@ -629,8 +629,8 @@ IMPL_LINK_NOARG(SvxSaveTabPage, ODFVersionHdl_Impl)
     if ( bShown )
     {
         bool bHasODFFormat = false;
-        sal_uInt16 i = 0, nCount = aSaveAsLB->GetEntryCount();
-        for ( ; i < nCount; ++ i )
+        const sal_Int32 nCount = aSaveAsLB->GetEntryCount();
+        for ( sal_Int32 i = 0; i < nCount; ++i )
         {
             if ( aSaveAsLB->GetEntryData(i) != NULL )
             {
diff --git a/cui/source/tabpages/align.cxx b/cui/source/tabpages/align.cxx
index 343f42d..d3fcb34 100644
--- a/cui/source/tabpages/align.cxx
+++ b/cui/source/tabpages/align.cxx
@@ -381,7 +381,7 @@ void AlignmentTabPage::InitVsRefEgde()
 
 void AlignmentTabPage::UpdateEnableControls()
 {
-    sal_uInt16 nHorAlign = m_pLbHorAlign->GetSelectEntryPos();
+    const sal_Int32 nHorAlign = m_pLbHorAlign->GetSelectEntryPos();
     bool bHorLeft  = (nHorAlign == ALIGNDLG_HORALIGN_LEFT);
     bool bHorBlock = (nHorAlign == ALIGNDLG_HORALIGN_BLOCK);
     bool bHorFill  = (nHorAlign == ALIGNDLG_HORALIGN_FILL);
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index f223f9d..d51c47b 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -2289,13 +2289,13 @@ bool OfaAutoCompleteTabPage::FillItemSet( SfxItemSet* )
     bModified |= nVal != pOpt->nAutoCmpltListLen;
     pOpt->nAutoCmpltListLen = nVal;
 
-    nVal = m_pDCBExpandKey->GetSelectEntryPos();
-    if( nVal < m_pDCBExpandKey->GetEntryCount() )
+    const sal_Int32 nPos = m_pDCBExpandKey->GetSelectEntryPos();
+    if( nPos < m_pDCBExpandKey->GetEntryCount() )
     {
-        sal_uLong nKey = 
reinterpret_cast<sal_uLong>(m_pDCBExpandKey->GetEntryData( nVal ));
+        sal_uLong nKey = 
reinterpret_cast<sal_uLong>(m_pDCBExpandKey->GetEntryData( nPos ));
         bModified |= nKey != pOpt->nAutoCmpltExpandKey;
         pOpt->nAutoCmpltExpandKey = (sal_uInt16)nKey;
-   }
+    }
 
     if (m_pAutoCompleteList && m_nAutoCmpltListCnt != 
m_pLBEntries->GetEntryCount())
     {
diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx
index 1e66ff0..2c2a725 100644
--- a/cui/source/tabpages/numfmt.cxx
+++ b/cui/source/tabpages/numfmt.cxx
@@ -1794,7 +1794,7 @@ void SvxNumberFormatTabPage::SetCategory(sal_uInt16 nPos)
 void SvxNumberFormatTabPage::AddAutomaticLanguage_Impl(LanguageType eAutoLang, 
bool bSelect)
 {
     m_pLbLanguage->RemoveLanguage(LANGUAGE_SYSTEM);
-    sal_uInt16 nPos = m_pLbLanguage->InsertEntry(sAutomaticEntry);
+    const sal_Int32 nPos = m_pLbLanguage->InsertEntry(sAutomaticEntry);
     m_pLbLanguage->SetEntryData(nPos, 
reinterpret_cast<void*>((sal_uLong)eAutoLang));
     if(bSelect)
         m_pLbLanguage->SelectEntryPos(nPos);
diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx
index d1f1e4a..1a7d7b0 100644
--- a/cui/source/tabpages/page.cxx
+++ b/cui/source/tabpages/page.cxx
@@ -525,7 +525,7 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet )
     else
         aBinName = mpDefPrinter->GetPaperBinName( (sal_uInt16)nPaperBin );
 
-    sal_uInt16 nEntryPos = m_pPaperTrayBox->InsertEntry( aBinName );
+    const sal_Int32 nEntryPos = m_pPaperTrayBox->InsertEntry( aBinName );
     m_pPaperTrayBox->SetEntryData( nEntryPos, 
reinterpret_cast<void*>((sal_uLong)nPaperBin) );
     m_pPaperTrayBox->SelectEntry( aBinName );
 
diff --git a/dbaccess/source/ui/dlg/dbfindex.cxx 
b/dbaccess/source/ui/dlg/dbfindex.cxx
index 6bea91f..f86314a 100644
--- a/dbaccess/source/ui/dlg/dbfindex.cxx
+++ b/dbaccess/source/ui/dlg/dbfindex.cxx
@@ -223,10 +223,10 @@ IMPL_LINK_NOARG_TYPED( ODbaseIndexDialog, RemoveClickHdl, 
Button*, void )
 
 IMPL_LINK_NOARG_TYPED( ODbaseIndexDialog, AddAllClickHdl, Button*, void )
 {
-    sal_uInt16 nCnt = m_pLB_FreeIndexes->GetEntryCount();
+    const sal_Int32 nCnt = m_pLB_FreeIndexes->GetEntryCount();
     OUString aTableName = m_pCB_Tables->GetText();
 
-    for( sal_uInt16 nPos = 0; nPos < nCnt; ++nPos )
+    for( sal_Int32 nPos = 0; nPos < nCnt; ++nPos )
         InsertTableIndex( aTableName, RemoveFreeIndex( 
m_pLB_FreeIndexes->GetEntry(0), true ) );
 
     checkButtons();
@@ -234,10 +234,10 @@ IMPL_LINK_NOARG_TYPED( ODbaseIndexDialog, AddAllClickHdl, 
Button*, void )
 
 IMPL_LINK_NOARG_TYPED( ODbaseIndexDialog, RemoveAllClickHdl, Button*, void )
 {
-    sal_uInt16 nCnt = m_pLB_TableIndexes->GetEntryCount();
+    const sal_Int32 nCnt = m_pLB_TableIndexes->GetEntryCount();
     OUString aTableName = m_pCB_Tables->GetText();
 
-    for( sal_uInt16 nPos = 0; nPos < nCnt; ++nPos )
+    for( sal_Int32 nPos = 0; nPos < nCnt; ++nPos )
         InsertFreeIndex( RemoveTableIndex( aTableName, 
m_pLB_TableIndexes->GetEntry(0), true ) );
 
     checkButtons();
diff --git a/dbaccess/source/ui/dlg/generalpage.cxx 
b/dbaccess/source/ui/dlg/generalpage.cxx
index 08bc952..3ed48c8 100644
--- a/dbaccess/source/ui/dlg/generalpage.cxx
+++ b/dbaccess/source/ui/dlg/generalpage.cxx
@@ -364,8 +364,8 @@ namespace dbaui
     void OGeneralPage::insertDatasourceTypeEntryData(const OUString& _sType, 
const OUString& sDisplayName)
     {
         // insert a (temporary) entry
-        sal_uInt16 nPos = m_pDatasourceType->InsertEntry(sDisplayName);
-        if ( nPos >= m_aURLPrefixes.size() )
+        const sal_Int32 nPos = m_pDatasourceType->InsertEntry(sDisplayName);
+        if ( static_cast<size_t>(nPos) >= m_aURLPrefixes.size() )
             m_aURLPrefixes.resize(nPos+1);
         m_aURLPrefixes[nPos] = _sType;
     }
@@ -373,8 +373,8 @@ namespace dbaui
     void OGeneralPageWizard::insertEmbeddedDBTypeEntryData(const OUString& 
_sType, const OUString& sDisplayName)
     {
         // insert a (temporary) entry
-        sal_uInt16 nPos = m_pEmbeddedDBType->InsertEntry(sDisplayName);
-        if ( nPos >= m_aEmbeddedURLPrefixes.size() )
+        const sal_Int32 nPos = m_pEmbeddedDBType->InsertEntry(sDisplayName);
+        if ( static_cast<size_t>(nPos) >= m_aEmbeddedURLPrefixes.size() )
             m_aEmbeddedURLPrefixes.resize(nPos+1);
         m_aEmbeddedURLPrefixes[nPos] = _sType;
     }
@@ -409,8 +409,8 @@ namespace dbaui
     IMPL_LINK( OGeneralPageWizard, OnEmbeddedDBTypeSelected, ListBox*, _pBox )
     {
         // get the type from the entry data
-        sal_uInt16 nSelected = _pBox->GetSelectEntryPos();
-        if (nSelected >= m_aEmbeddedURLPrefixes.size() )
+        const sal_Int32 nSelected = _pBox->GetSelectEntryPos();
+        if (static_cast<size_t>(nSelected) >= m_aEmbeddedURLPrefixes.size() )
         {
             SAL_WARN("dbaccess.ui.OGeneralPage", "Got out-of-range value '" << 
nSelected <<  "' from the DatasourceType selection ListBox's 
GetSelectEntryPos(): no corresponding URL prefix");
             return 0L;
@@ -429,8 +429,8 @@ namespace dbaui
     IMPL_LINK( OGeneralPage, OnDatasourceTypeSelected, ListBox*, _pBox )
     {
         // get the type from the entry data
-        sal_uInt16 nSelected = _pBox->GetSelectEntryPos();
-        if (nSelected >= m_aURLPrefixes.size() )
+        const sal_Int32 nSelected = _pBox->GetSelectEntryPos();
+        if (static_cast<size_t>(nSelected) >= m_aURLPrefixes.size() )
         {
             SAL_WARN("dbaccess.ui.OGeneralPage", "Got out-of-range value '" << 
nSelected <<  "' from the DatasourceType selection ListBox's 
GetSelectEntryPos(): no corresponding URL prefix");
             return 0L;
@@ -477,7 +477,7 @@ namespace dbaui
     {
         bool bChangedSomething = false;
 
-        sal_uInt16 nEntry = m_pDatasourceType->GetSelectEntryPos();
+        const sal_Int32 nEntry = m_pDatasourceType->GetSelectEntryPos();
         OUString sURLPrefix = m_aURLPrefixes[ nEntry ];
 
         if ( m_pDatasourceType->IsValueChangedFromSaved() )
@@ -670,7 +670,7 @@ namespace dbaui
 
         if ( bCommitTypeSelection )
         {
-            sal_uInt16 nEntry = m_pDatasourceType->GetSelectEntryPos();
+            const sal_Int32 nEntry = m_pDatasourceType->GetSelectEntryPos();
             OUString sURLPrefix = m_aURLPrefixes[nEntry];
 
             if  (  m_pDatasourceType->IsValueChangedFromSaved()
diff --git a/dbaccess/source/ui/dlg/queryfilter.cxx 
b/dbaccess/source/ui/dlg/queryfilter.cxx
index eebe5c1..373b6d0 100644
--- a/dbaccess/source/ui/dlg/queryfilter.cxx
+++ b/dbaccess/source/ui/dlg/queryfilter.cxx
@@ -97,8 +97,8 @@ DlgFilterCrit::DlgFilterCrit(vcl::Window * pParent,
     m_pLB_WHERECOMP1->set_width_request(aSize.Width());
     m_pLB_WHERECOMP2->set_width_request(aSize.Width());
     m_pLB_WHERECOMP3->set_width_request(aSize.Width());
-    sal_uInt16 nEntryCount =  m_pLB_WHERECOMP1->GetEntryCount();
-    for (sal_uInt16 i = 0; i < nEntryCount; ++i)
+    const sal_Int32 nEntryCount =  m_pLB_WHERECOMP1->GetEntryCount();
+    for (sal_Int32 i = 0; i < nEntryCount; ++i)
     {
         if (i > 0)
             m_aSTR_COMPARE_OPERATORS += ";";
@@ -265,9 +265,9 @@ sal_Int32 DlgFilterCrit::GetOSQLPredicateType( const 
OUString& _rSelectedPredica
     return nPredicateType;
 }
 
-sal_uInt16 DlgFilterCrit::GetSelectionPos(sal_Int32 eType,const ListBox& 
rListBox)
+sal_Int32 DlgFilterCrit::GetSelectionPos(sal_Int32 eType,const ListBox& 
rListBox)
 {
-    sal_uInt16 nPos;
+    sal_Int32 nPos;
     switch(eType)
     {
         case SQLFilterOperator::EQUAL:
@@ -570,9 +570,9 @@ void DlgFilterCrit::SetLine( sal_uInt16 nIdx,const 
PropertyValue& _rItem,bool _b
 
 void DlgFilterCrit::SelectField( ListBox& rBox, const OUString& rField )
 {
-    sal_uInt16 nCnt = rBox.GetEntryCount();
+    const sal_Int32 nCnt = rBox.GetEntryCount();
 
-    for( sal_uInt16 i=0 ; i<nCnt ; i++ )
+    for( sal_Int32 i=0 ; i<nCnt ; i++ )
     {
         if(rBox.GetEntry(i) == rField)
         {
diff --git a/dbaccess/source/ui/inc/WColumnSelect.hxx 
b/dbaccess/source/ui/inc/WColumnSelect.hxx
index a653d9e..edf527f 100644
--- a/dbaccess/source/ui/inc/WColumnSelect.hxx
+++ b/dbaccess/source/ui/inc/WColumnSelect.hxx
@@ -67,7 +67,7 @@ namespace dbaui
 
         void enableButtons();
 
-        sal_uInt16 adjustColumnPosition(ListBox* _pLeft,
+        sal_Int32 adjustColumnPosition(ListBox* _pLeft,
                                     const OUString&  _sColumnName,
                                     ODatabaseExport::TColumnVector::size_type 
nCurrentPos,
                                     const ::comphelper::UStringMixEqual& 
_aCase);
diff --git a/dbaccess/source/ui/inc/queryfilter.hxx 
b/dbaccess/source/ui/inc/queryfilter.hxx
index dcc7b79..32fb47c 100644
--- a/dbaccess/source/ui/inc/queryfilter.hxx
+++ b/dbaccess/source/ui/inc/queryfilter.hxx
@@ -97,7 +97,7 @@ namespace dbaui
         void            SetLine( sal_uInt16 nIdx,const 
css::beans::PropertyValue& _rItem,bool _bOr );
         void            EnableLines();
         sal_Int32       GetOSQLPredicateType( const OUString& 
_rSelectedPredicate ) const;
-        static sal_uInt16  GetSelectionPos(sal_Int32 eType,const ListBox& 
rListBox);
+        static sal_Int32  GetSelectionPos(sal_Int32 eType,const ListBox& 
rListBox);
         bool            getCondition(const ListBox& _rField,const ListBox& 
_rComp,const Edit& _rValue,css::beans::PropertyValue& _rFilter) const;
         void            fillLines(const css::uno::Sequence< 
css::uno::Sequence< css::beans::PropertyValue > >& _aValues);
 
diff --git a/dbaccess/source/ui/misc/WColumnSelect.cxx 
b/dbaccess/source/ui/misc/WColumnSelect.cxx
index b0b6188..7167141 100644
--- a/dbaccess/source/ui/misc/WColumnSelect.cxx
+++ b/dbaccess/source/ui/misc/WColumnSelect.cxx
@@ -128,7 +128,7 @@ void OWizColumnSelect::Reset()
 
     for(;aIter != aEnd;++aIter)
     {
-        sal_uInt16 nPos = m_pOrgColumnNames->InsertEntry((*aIter)->first);
+        const sal_Int32 nPos = m_pOrgColumnNames->InsertEntry((*aIter)->first);
         m_pOrgColumnNames->SetEntryData(nPos,(*aIter)->second);
     }
 
@@ -152,7 +152,7 @@ void OWizColumnSelect::ActivatePage( )
     ODatabaseExport::TColumnVector::const_iterator aEnd = rDestColumns.end();
     for(;aIter != aEnd;++aIter)
     {
-        sal_uInt16 nPos = m_pNewColumnNames->InsertEntry((*aIter)->first);
+        const sal_Int32 nPos = m_pNewColumnNames->InsertEntry((*aIter)->first);
         m_pNewColumnNames->SetEntryData(nPos,new 
OFieldDescription(*((*aIter)->second)));
         m_pOrgColumnNames->RemoveEntry((*aIter)->first);
     }
@@ -228,16 +228,16 @@ IMPL_LINK_TYPED( OWizColumnSelect, ButtonClickHdl, Button 
*, pButton, void )
         for(sal_Int32 i=0; i < pLeft->GetSelectEntryCount(); ++i)
             
moveColumn(pRight,pLeft,aRightColumns,pLeft->GetSelectEntry(i),sExtraChars,nMaxNameLen,aCase);
 
-        for(sal_uInt16 j=pLeft->GetSelectEntryCount(); j ; --j)
+        for(sal_Int32 j=pLeft->GetSelectEntryCount(); j ; --j)
             pLeft->RemoveEntry(pLeft->GetSelectEntry(j-1));
     }
     else
     {
-        sal_uInt16 nEntries = pLeft->GetEntryCount();
-        for(sal_uInt16 i=0; i < nEntries; ++i)
+        const sal_Int32 nEntries = pLeft->GetEntryCount();
+        for(sal_Int32 i=0; i < nEntries; ++i)
             
moveColumn(pRight,pLeft,aRightColumns,pLeft->GetEntry(i),sExtraChars,nMaxNameLen,aCase);
-        for(sal_uInt16 j=pLeft->GetEntryCount(); j ; --j)
-            pLeft->RemoveEntry(j-1);
+        for(sal_Int32 j=pLeft->GetEntryCount(); j ; )
+            pLeft->RemoveEntry(--j);
     }
 
     enableButtons();
@@ -271,8 +271,8 @@ IMPL_LINK( OWizColumnSelect, ListDoubleClickHdl, ListBox *, 
pListBox )
 
     for(sal_Int32 i=0; i < pLeft->GetSelectEntryCount(); ++i)
         
moveColumn(pRight,pLeft,aRightColumns,pLeft->GetSelectEntry(i),sExtraChars,nMaxNameLen,aCase);
-    for(sal_uInt16 j=pLeft->GetSelectEntryCount(); j ; --j)
-        pLeft->RemoveEntry(pLeft->GetSelectEntry(j-1));
+    for(sal_Int32 j=pLeft->GetSelectEntryCount(); j ; )
+        pLeft->RemoveEntry(pLeft->GetSelectEntry(--j));
 
     enableButtons();
     return 0;
@@ -287,9 +287,9 @@ void OWizColumnSelect::clearListBox(ListBox& _rListBox)
 
 void OWizColumnSelect::fillColumns(ListBox* pRight,::std::vector< OUString> 
&_rRightColumns)
 {
-    sal_uInt16 nCount = pRight->GetEntryCount();
+    const sal_Int32 nCount = pRight->GetEntryCount();
     _rRightColumns.reserve(nCount);
-    for(sal_uInt16 i=0; i < nCount;++i)
+    for(sal_Int32 i=0; i < nCount; ++i)
         _rRightColumns.push_back(pRight->GetEntry(i));
 }
 
@@ -365,21 +365,21 @@ void OWizColumnSelect::moveColumn(  ListBox* _pRight,
 // not enough. We need to take into account what fields have
 // been removed earlier and adjust accordingly. Based on the
 // algorithm employed in moveColumn().
-sal_uInt16 OWizColumnSelect::adjustColumnPosition( ListBox* _pLeft,
+sal_Int32 OWizColumnSelect::adjustColumnPosition( ListBox* _pLeft,
                                                const OUString&   _sColumnName,
                                                
ODatabaseExport::TColumnVector::size_type nCurrentPos,
                                                const 
::comphelper::UStringMixEqual& _aCase)
 {
-    sal_uInt16 nAdjustedPos = 0;
+    sal_Int32 nAdjustedPos = 0;
 
     // if returning all entries to their original position,
     // then there is no need to adjust the positions.
     if (m_pColumns_LH->HasFocus())
         return nAdjustedPos;
 
-    sal_uInt16 nCount = _pLeft->GetEntryCount();
+    const sal_Int32 nCount = _pLeft->GetEntryCount();
     OUString sColumnString;
-    for(sal_uInt16 i=0; i < nCount; ++i)
+    for(sal_Int32 i=0; i < nCount; ++i)
     {
         sColumnString = _pLeft->GetEntry(i);
         if(_sColumnName != sColumnString)
diff --git a/dbaccess/source/ui/misc/WTypeSelect.cxx 
b/dbaccess/source/ui/misc/WTypeSelect.cxx
index f6d06c9..99ba355 100644
--- a/dbaccess/source/ui/misc/WTypeSelect.cxx
+++ b/dbaccess/source/ui/misc/WTypeSelect.cxx
@@ -97,7 +97,7 @@ void OWizTypeSelectControl::CellModified(long nRow, 
sal_uInt16 nColId )
 
     OFieldDescription* pCurFieldDescr = getCurrentFieldDescData();
 
-    sal_uInt16 nPos = pListBox->GetEntryPos( OUString( 
pCurFieldDescr->GetName() ) );
+    const sal_Int32 nPos = pListBox->GetEntryPos( OUString( 
pCurFieldDescr->GetName() ) );
     pCurFieldDescr = static_cast< OFieldDescription* >( 
pListBox->GetEntryData( nPos ) );
     OSL_ENSURE( pCurFieldDescr, "OWizTypeSelectControl::CellModified: 
Columnname/type not found in the listbox!" );
     if ( !pCurFieldDescr )
@@ -121,8 +121,8 @@ void OWizTypeSelectControl::CellModified(long nRow, 
sal_uInt16 nColId )
                 if ( getMetaData().is() && 
!getMetaData()->supportsMixedCaseQuotedIdentifiers() )
                 {
                     bCase = false;
-                    sal_uInt16 nCount = pListBox->GetEntryCount();
-                    for (sal_uInt16 i=0 ; !bDoubleName && i < nCount ; ++i)
+                    const sal_Int32 nCount = pListBox->GetEntryCount();
+                    for (sal_Int32 i=0 ; !bDoubleName && i < nCount ; ++i)
                     {
                         OUString sEntry(pListBox->GetEntry(i));
                         bDoubleName = sNewName.equalsIgnoreAsciiCase(sEntry);
@@ -308,11 +308,9 @@ void OWizTypeSelect::Reset()
     ODatabaseExport::TColumnVector::const_iterator aEnd = rDestColumns.end();
     for(;aIter != aEnd;++aIter)
     {
-        sal_uInt16 nPos;
-        if((*aIter)->second->IsPrimaryKey())
-            nPos = m_pColumnNames->InsertEntry((*aIter)->first, m_imgPKey );
-        else
-            nPos = m_pColumnNames->InsertEntry((*aIter)->first);
+        const sal_Int32 nPos = (*aIter)->second->IsPrimaryKey()
+            ? m_pColumnNames->InsertEntry((*aIter)->first, m_imgPKey )
+            : m_pColumnNames->InsertEntry((*aIter)->first);
         m_pColumnNames->SetEntryData(nPos,(*aIter)->second);
     }
     m_bFirstTime = false;
@@ -373,8 +371,8 @@ void OWizTypeSelectList::dispose()
 
 bool OWizTypeSelectList::IsPrimaryKeyAllowed() const
 {
-    sal_uInt16 nCount = GetSelectEntryCount();
-    sal_uInt16 j;
+    const sal_Int32 nCount = GetSelectEntryCount();
+    sal_Int32 j;
 
     for( j = 0; m_bPKey && j < nCount; ++j )
     {
@@ -432,8 +430,8 @@ bool OWizTypeSelectList::PreNotify( NotifyEvent& rEvt )
             {
                 case SID_TABLEDESIGN_TABED_PRIMARYKEY:
                 {
-                    sal_uInt16 nCount = GetEntryCount();
-                    for(sal_uInt16 j = 0 ; j < nCount ; ++j)
+                    const sal_Int32 nCount = GetEntryCount();
+                    for(sal_Int32 j = 0 ; j < nCount ; ++j)
                     {
                         OFieldDescription* pFieldDescr = 
static_cast<OFieldDescription*>(GetEntryData(j));
                         if( pFieldDescr )
diff --git a/dbaccess/source/ui/querydesign/querydlg.cxx 
b/dbaccess/source/ui/querydesign/querydlg.cxx
index 6d4d2ad..e0a9038 100644
--- a/dbaccess/source/ui/querydesign/querydlg.cxx
+++ b/dbaccess/source/ui/querydesign/querydlg.cxx
@@ -122,8 +122,8 @@ DlgQryJoin::DlgQryJoin( OQueryTableView * pParent,
     }
     else
     {
-        const sal_uInt16 nCount = m_pLB_JoinType->GetEntryCount();
-        for (sal_uInt16 i = 0; i < nCount; ++i)
+        const sal_Int32 nCount = m_pLB_JoinType->GetEntryCount();
+        for (sal_Int32 i = 0; i < nCount; ++i)
         {
             const sal_IntPtr nJoinTyp = 
reinterpret_cast<sal_IntPtr>(m_pLB_JoinType->GetEntryData(i));
             if ( !bSupportFullJoin && nJoinTyp == ID_FULL_JOIN )
@@ -167,7 +167,7 @@ IMPL_LINK( DlgQryJoin, LBChangeHdl, ListBox*, /*pListBox*/ )
     OUString sSecondWinName   = 
m_pConnData->getReferencedTable()->GetWinName();
     const EJoinType eOldJoinType = eJoinType;
     sal_uInt16 nResId = 0;
-    const sal_uInt16 nPos = m_pLB_JoinType->GetSelectEntryPos();
+    const sal_Int32 nPos = m_pLB_JoinType->GetSelectEntryPos();
     const sal_IntPtr nJoinType = 
reinterpret_cast<sal_IntPtr>(m_pLB_JoinType->GetEntryData(nPos));
     bool bAddHint = true;
     switch ( nJoinType )
@@ -322,8 +322,8 @@ void DlgQryJoin::setJoinType(EJoinType _eNewJoinType)
             break;
     }
 
-    const sal_uInt16 nCount = m_pLB_JoinType->GetEntryCount();
-    for (sal_uInt16 i = 0; i < nCount; ++i)
+    const sal_Int32 nCount = m_pLB_JoinType->GetEntryCount();
+    for (sal_Int32 i = 0; i < nCount; ++i)
     {
         if ( nJoinType == 
reinterpret_cast<sal_IntPtr>(m_pLB_JoinType->GetEntryData(i)) )
         {
diff --git a/extensions/source/bibliography/datman.cxx 
b/extensions/source/bibliography/datman.cxx
index 6a6e44d..860ab2d 100644
--- a/extensions/source/bibliography/datman.cxx
+++ b/extensions/source/bibliography/datman.cxx
@@ -424,7 +424,7 @@ void MappingDialog_Impl::dispose()
 
 IMPL_LINK(MappingDialog_Impl, ListBoxSelectHdl, ListBox*, pListBox)
 {
-    sal_uInt16 nEntryPos = pListBox->GetSelectEntryPos();
+    const sal_Int32 nEntryPos = pListBox->GetSelectEntryPos();
     if(0 < nEntryPos)
     {
         for(sal_uInt16 i = 0; i < COLUMN_COUNT; i++)
diff --git a/extensions/source/dbpilots/commonpagesdbp.cxx 
b/extensions/source/dbpilots/commonpagesdbp.cxx
index 3cd5c75..23edfb9 100644
--- a/extensions/source/dbpilots/commonpagesdbp.cxx
+++ b/extensions/source/dbpilots/commonpagesdbp.cxx
@@ -244,10 +244,9 @@ namespace dbp
         {
             const OUString* pNames = _rNames.getConstArray();
             const OUString* pNamesEnd = _rNames.getConstArray() + 
_rNames.getLength();
-            sal_uInt16 nPos = 0;
             while ( pNames != pNamesEnd )
             {
-                nPos = _rListBox.InsertEntry( *pNames++, _rImage );
+                const sal_Int32 nPos = _rListBox.InsertEntry( *pNames++, 
_rImage );
                 _rListBox.SetEntryData( nPos, reinterpret_cast< void* >( 
_nCommandType ) );
             }
         }
diff --git a/extensions/source/dbpilots/gridwizard.cxx 
b/extensions/source/dbpilots/gridwizard.cxx
index 480b9ec..98e9f83 100644
--- a/extensions/source/dbpilots/gridwizard.cxx
+++ b/extensions/source/dbpilots/gridwizard.cxx
@@ -367,12 +367,12 @@ namespace dbp
             return false;
 
         OGridSettings& rSettings = getSettings();
-        sal_uInt16 nSelected = m_pSelFields->GetEntryCount();
+        const sal_Int32 nSelected = m_pSelFields->GetEntryCount();
 
         rSettings.aSelectedFields.realloc(nSelected);
         OUString* pSelected = rSettings.aSelectedFields.getArray();
 
-        for (sal_uInt16 i=0; i<nSelected; ++i, ++pSelected)
+        for (sal_Int32 i=0; i<nSelected; ++i, ++pSelected)
             *pSelected = m_pSelFields->GetEntry(i);
 
         return true;
@@ -417,7 +417,7 @@ namespace dbp
         ListBox& rMoveTo = bMoveRight ? *m_pSelFields : *m_pExistFields;
 
         // the index of the selected entry
-        sal_uInt16 nSelected = bMoveRight ? 
m_pExistFields->GetSelectEntryPos() : m_pSelFields->GetSelectEntryPos();
+        const sal_Int32 nSelected = bMoveRight ? 
m_pExistFields->GetSelectEntryPos() : m_pSelFields->GetSelectEntryPos();
         // the (original) relative position of the entry
         sal_IntPtr nRelativeIndex = reinterpret_cast<sal_IntPtr>(bMoveRight ? 
m_pExistFields->GetEntryData(nSelected) : 
m_pSelFields->GetEntryData(nSelected));
 
diff --git a/extensions/source/propctrlr/listselectiondlg.cxx 
b/extensions/source/propctrlr/listselectiondlg.cxx
index 9b2bbed..01b1134 100644
--- a/extensions/source/propctrlr/listselectiondlg.cxx
+++ b/extensions/source/propctrlr/listselectiondlg.cxx
@@ -132,10 +132,10 @@ namespace pcr
 
     void ListSelectionDialog::collectSelection( Sequence< sal_Int16 >& /* 
[out] */ _rSelection )
     {
-        sal_uInt16 nSelectedCount = m_pEntries->GetSelectEntryCount( );
+        const sal_Int32 nSelectedCount = m_pEntries->GetSelectEntryCount( );
         _rSelection.realloc( nSelectedCount );
         sal_Int16* pSelection = _rSelection.getArray();
-        for ( sal_uInt16 selected = 0; selected < nSelectedCount; ++selected, 
++pSelection )
+        for ( sal_Int32 selected = 0; selected < nSelectedCount; ++selected, 
++pSelection )
             *pSelection = static_cast< sal_Int16 >( 
m_pEntries->GetSelectEntryPos( selected ) );
     }
 
diff --git a/extensions/source/propctrlr/standardcontrol.cxx 
b/extensions/source/propctrlr/standardcontrol.cxx
index b1c205e..c4276e73 100644
--- a/extensions/source/propctrlr/standardcontrol.cxx
+++ b/extensions/source/propctrlr/standardcontrol.cxx
@@ -863,10 +863,10 @@ namespace pcr
 
     Sequence< OUString > SAL_CALL OListboxControl::getListEntries(  ) throw 
(RuntimeException, std::exception)
     {
-        const sal_uInt16 nCount = getTypedControlWindow()->GetEntryCount();
+        const sal_Int32 nCount = getTypedControlWindow()->GetEntryCount();
         Sequence< OUString > aRet(nCount);
         OUString* pIter = aRet.getArray();
-        for (sal_uInt16 i = 0; i < nCount ; ++i,++pIter)
+        for (sal_Int32 i = 0; i < nCount ; ++i,++pIter)
             *pIter = getTypedControlWindow()->GetEntry(i);
 
         return aRet;
@@ -933,10 +933,10 @@ namespace pcr
 
     Sequence< OUString > SAL_CALL OComboboxControl::getListEntries(  ) throw 
(RuntimeException, std::exception)
     {
-        const sal_uInt16 nCount = getTypedControlWindow()->GetEntryCount();
+        const sal_Int32 nCount = getTypedControlWindow()->GetEntryCount();
         Sequence< OUString > aRet(nCount);
         OUString* pIter = aRet.getArray();
-        for (sal_uInt16 i = 0; i < nCount ; ++i,++pIter)
+        for (sal_Int32 i = 0; i < nCount ; ++i,++pIter)
             *pIter = getTypedControlWindow()->GetEntry(i);
 
         return aRet;
diff --git a/fpicker/source/office/iodlgimp.cxx 
b/fpicker/source/office/iodlgimp.cxx
index a032782..b30e078 100644
--- a/fpicker/source/office/iodlgimp.cxx
+++ b/fpicker/source/office/iodlgimp.cxx
@@ -302,7 +302,7 @@ void SvtExpFileDlg_Impl::InsertFilterListEntry( const 
SvtFileDialogFilter_Impl*
         sName = _pFilterDesc->GetName();
 
     // insert an set user data
-    sal_uInt16 nPos = _pLbFilter->InsertEntry( sName );
+    const sal_Int32 nPos = _pLbFilter->InsertEntry( sName );
     _pLbFilter->SetEntryData( nPos, const_cast< void* >( static_cast< const 
void* >( _pFilterDesc ) ) );
 }
 
diff --git a/include/svtools/PlaceEditDialog.hxx 
b/include/svtools/PlaceEditDialog.hxx
index 6acbf78..11ddc5f 100644
--- a/include/svtools/PlaceEditDialog.hxx
+++ b/include/svtools/PlaceEditDialog.hxx
@@ -54,7 +54,7 @@ private:
       */
     std::vector< std::shared_ptr< DetailsContainer > > m_aDetailsContainers;
 
-    unsigned int m_nCurrentType;
+    sal_Int32 m_nCurrentType;
 
     bool bLabelChanged;
     bool m_bShowPassword;
diff --git a/include/svx/lboxctrl.hxx b/include/svx/lboxctrl.hxx
index a6ab60d..05982c4 100644
--- a/include/svx/lboxctrl.hxx
+++ b/include/svx/lboxctrl.hxx
@@ -36,7 +36,7 @@ protected:
     OUString                aActionStr;
     VclPtr<SvxPopupWindowListBox> pPopupWin;
 
-    void    Impl_SetInfo( sal_uInt16 nCount );
+    void    Impl_SetInfo( sal_Int32 nCount );
 
     DECL_LINK_TYPED( PopupModeEndHdl, FloatingWindow*, void );
     DECL_LINK( SelectHdl, void * );
diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx 
b/sc/source/ui/condformat/condformatdlgentry.cxx
index 6157ba3..3d9d0b9 100644
--- a/sc/source/ui/condformat/condformatdlgentry.cxx
+++ b/sc/source/ui/condformat/condformatdlgentry.cxx
@@ -513,7 +513,7 @@ void StyleSelect( ListBox& rLbStyle, ScDocument* pDoc, 
SvxFontPrevWindow& rWdPre
             OUString aName = pStyle->GetName();
             if ( rLbStyle.GetEntryPos(aName) == LISTBOX_ENTRY_NOTFOUND )    // 
all lists contain the same entries
             {
-                for( sal_uInt16 i = 1, n = rLbStyle.GetEntryCount(); i <= n && 
!bFound; ++i)
+                for( sal_Int32 i = 1, n = rLbStyle.GetEntryCount(); i <= n && 
!bFound; ++i)
                 {
                     OUString aStyleName = 
ScGlobal::pCharClass->uppercase(OUString(rLbStyle.GetEntry(i)));
                     if( i == n )
diff --git a/sc/source/ui/dbgui/consdlg.cxx b/sc/source/ui/dbgui/consdlg.cxx
index c2cafd3..1977ee8 100644
--- a/sc/source/ui/dbgui/consdlg.cxx
+++ b/sc/source/ui/dbgui/consdlg.cxx
@@ -365,7 +365,7 @@ IMPL_LINK( ScConsolidateDlg, GetFocusHdl, Control*, pCtr )
 
 IMPL_LINK_NOARG_TYPED(ScConsolidateDlg, OkHdl, Button*, void)
 {
-    sal_uInt16 nDataAreaCount = pLbConsAreas->GetEntryCount();
+    const sal_Int32 nDataAreaCount = pLbConsAreas->GetEntryCount();
 
     if ( nDataAreaCount > 0 )
     {
@@ -379,9 +379,8 @@ IMPL_LINK_NOARG_TYPED(ScConsolidateDlg, OkHdl, Button*, 
void)
             ScConsolidateParam  theOutParam( theConsData );
             ScArea**            ppDataAreas = new ScArea*[nDataAreaCount];
             ScArea*             pArea;
-            sal_uInt16              i=0;
 
-            for ( i=0; i<nDataAreaCount; i++ )
+            for ( sal_Int32 i=0; i<nDataAreaCount; ++i )
             {
                 pArea = new ScArea;
                 ScRangeUtil::MakeArea( pLbConsAreas->GetEntry( i ),
@@ -398,7 +397,7 @@ IMPL_LINK_NOARG_TYPED(ScConsolidateDlg, OkHdl, Button*, 
void)
             theOutParam.bReferenceData  = pBtnRefs->IsChecked();
             theOutParam.SetAreas( ppDataAreas, nDataAreaCount );
 
-            for ( i=0; i<nDataAreaCount; i++ )
+            for ( sal_Int32 i=0; i<nDataAreaCount; ++i )
                 delete ppDataAreas[i];
             delete [] ppDataAreas;
 
@@ -497,7 +496,7 @@ IMPL_LINK( ScConsolidateDlg, SelectHdl, ListBox*, pLb )
     else if ( (pLb == pLbDataArea) || (pLb == pLbDestArea) )
     {
         Edit*   pEd = (pLb == pLbDataArea) ? pEdDataArea : pEdDestArea;
-        sal_uInt16  nSelPos = pLb->GetSelectEntryPos();
+        const sal_Int32 nSelPos = pLb->GetSelectEntryPos();
 
         if (    pRangeUtil
             && (nSelPos > 0)
@@ -550,7 +549,7 @@ IMPL_LINK( ScConsolidateDlg, ModifyHdl, formula::RefEdit*, 
pEd )
 // Resource of the ListBox and these two conversion methods are also in
 // tpsubt and everywhere, where StarCalc functions are selectable.
 
-ScSubTotalFunc ScConsolidateDlg::LbPosToFunc( sal_uInt16 nPos )
+ScSubTotalFunc ScConsolidateDlg::LbPosToFunc( sal_Int32 nPos )
 {
     switch ( nPos )
     {
@@ -570,7 +569,7 @@ ScSubTotalFunc ScConsolidateDlg::LbPosToFunc( sal_uInt16 
nPos )
     }
 }
 
-sal_uInt16 ScConsolidateDlg::FuncToLbPos( ScSubTotalFunc eFunc )
+sal_Int32 ScConsolidateDlg::FuncToLbPos( ScSubTotalFunc eFunc )
 {
     switch ( eFunc )
     {
diff --git a/sc/source/ui/dbgui/csvtablebox.cxx 
b/sc/source/ui/dbgui/csvtablebox.cxx
index 7120f84..27d027d 100644
--- a/sc/source/ui/dbgui/csvtablebox.cxx
+++ b/sc/source/ui/dbgui/csvtablebox.cxx
@@ -221,9 +221,9 @@ void ScCsvTableBox::SetUniStrings(
 
 void ScCsvTableBox::InitTypes( const ListBox& rListBox )
 {
-    sal_uInt16 nTypeCount = rListBox.GetEntryCount();
+    const sal_Int32 nTypeCount = rListBox.GetEntryCount();
     StringVec aTypeNames( nTypeCount );
-    for( sal_uInt16 nIndex = 0; nIndex < nTypeCount; ++nIndex )
+    for( sal_Int32 nIndex = 0; nIndex < nTypeCount; ++nIndex )
         aTypeNames[ nIndex ] = rListBox.GetEntry( nIndex );
     maGrid->SetTypeNames( aTypeNames );
 }
diff --git a/sc/source/ui/dbgui/dapidata.cxx b/sc/source/ui/dbgui/dapidata.cxx
index dd39bf0..93bcce1 100644
--- a/sc/source/ui/dbgui/dapidata.cxx
+++ b/sc/source/ui/dbgui/dapidata.cxx
@@ -97,7 +97,7 @@ void ScDataPilotDatabaseDlg::dispose()
 
 void ScDataPilotDatabaseDlg::GetValues( ScImportSourceDesc& rDesc )
 {
-    sal_uInt16 nSelect = m_pLbType->GetSelectEntryPos();
+    const sal_Int32 nSelect = m_pLbType->GetSelectEntryPos();
 
     rDesc.aDBName = m_pLbDatabase->GetSelectEntry();
     rDesc.aObject = m_pCbObject->GetText();
@@ -128,7 +128,7 @@ void ScDataPilotDatabaseDlg::FillObjects()
     if (aDatabaseName.isEmpty())
         return;
 
-    sal_uInt16 nSelect = m_pLbType->GetSelectEntryPos();
+    const sal_Int32 nSelect = m_pLbType->GetSelectEntryPos();
     if ( nSelect > DP_TYPELIST_QUERY )
         return;                                 // only tables and queries
 
diff --git a/sc/source/ui/dbgui/dapitype.cxx b/sc/source/ui/dbgui/dapitype.cxx
index b920e3a..3621607 100644
--- a/sc/source/ui/dbgui/dapitype.cxx
+++ b/sc/source/ui/dbgui/dapitype.cxx
@@ -83,7 +83,7 @@ bool ScDataPilotSourceTypeDlg::IsNamedRange() const
 
 OUString ScDataPilotSourceTypeDlg::GetSelectedNamedRange() const
 {
-    sal_uInt16 nPos = m_pLbNamedRange->GetSelectEntryPos();
+    const sal_Int32 nPos = m_pLbNamedRange->GetSelectEntryPos();
     return m_pLbNamedRange->GetEntry(nPos);
 }
 
diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx
index e1dc6a5..2771e0a 100644
--- a/sc/source/ui/dbgui/filtdlg.cxx
+++ b/sc/source/ui/dbgui/filtdlg.cxx
@@ -504,14 +504,13 @@ void ScFilterDlg::UpdateValueList( size_t nList )
     if (pDoc && nList > 0 && nList <= QUERY_ENTRY_COUNT)
     {
         ComboBox*   pValList        = maValueEdArr[nList-1];
-        sal_uInt16      nFieldSelPos    = 
maFieldLbArr[nList-1]->GetSelectEntryPos();
-        sal_uInt16      nListPos        = 0;
+        const sal_Int32 nFieldSelPos = 
maFieldLbArr[nList-1]->GetSelectEntryPos();
+        sal_Int32 nListPos = 0;
         OUString aCurValue = pValList->GetText();
 
         pValList->Clear();
-        pValList->InsertEntry( aStrNotEmpty, 0 );
-        pValList->InsertEntry( aStrEmpty, 1 );
-        nListPos = 2;
+        pValList->InsertEntry( aStrNotEmpty, nListPos++ );
+        pValList->InsertEntry( aStrEmpty, nListPos++ );
 
         if ( nFieldSelPos )
         {
@@ -580,8 +579,7 @@ void ScFilterDlg::UpdateValueList( size_t nList )
             std::vector<ScTypedStrData>::const_iterator it = 
pList->maList.begin(), itEnd = pList->maList.end();
             for (; it != itEnd; ++it)
             {
-                pValList->InsertEntry(it->GetString(), nListPos);
-                nListPos++;
+                pValList->InsertEntry(it->GetString(), nListPos++);
             }
         }
         pValList->SetText( aCurValue );
@@ -780,7 +778,7 @@ IMPL_LINK( ScFilterDlg, LbSelectHdl, ListBox*, pLb )
         pLbCond1->Enable();
         pEdVal1->Enable();
 
-        sal_uInt16  nConnect1 = pLbConnect1->GetSelectEntryPos();
+        const sal_Int32 nConnect1 = pLbConnect1->GetSelectEntryPos();
         size_t nQE = nOffset;
         theQueryData.GetEntry(nQE).eConnect =(ScQueryConnect)nConnect1;
         if (maRefreshExceptQuery.size() < nQE + 1)
@@ -794,7 +792,7 @@ IMPL_LINK( ScFilterDlg, LbSelectHdl, ListBox*, pLb )
         pLbCond2->Enable();
         pEdVal2->Enable();
 
-        sal_uInt16  nConnect2 = pLbConnect2->GetSelectEntryPos();
+        const sal_Int32 nConnect2 = pLbConnect2->GetSelectEntryPos();
         size_t nQE = 1+nOffset;
         theQueryData.GetEntry(nQE).eConnect =(ScQueryConnect)nConnect2;
         if (maRefreshExceptQuery.size() < nQE + 1)
@@ -807,7 +805,7 @@ IMPL_LINK( ScFilterDlg, LbSelectHdl, ListBox*, pLb )
         pLbCond3->Enable();
         pEdVal3->Enable();
 
-        sal_uInt16  nConnect3 = pLbConnect3->GetSelectEntryPos();
+        const sal_Int32 nConnect3 = pLbConnect3->GetSelectEntryPos();
         size_t nQE = 2 + nOffset;
         theQueryData.GetEntry(nQE).eConnect = (ScQueryConnect)nConnect3;
         if (maRefreshExceptQuery.size() < nQE + 1)
@@ -821,7 +819,7 @@ IMPL_LINK( ScFilterDlg, LbSelectHdl, ListBox*, pLb )
         pLbCond4->Enable();
         pEdVal4->Enable();
 
-        sal_uInt16  nConnect4 = pLbConnect4->GetSelectEntryPos();
+        const sal_Int32 nConnect4 = pLbConnect4->GetSelectEntryPos();
         size_t nQE = 3 + nOffset;
         theQueryData.GetEntry(nQE).eConnect = (ScQueryConnect)nConnect4;
         if (maRefreshExceptQuery.size() < nQE + 1)
@@ -877,7 +875,7 @@ IMPL_LINK( ScFilterDlg, LbSelectHdl, ListBox*, pLb )
                 pLbConnect2->Enable();
             }
             theQueryData.GetEntry(nOffset).bDoQuery = true;
-            sal_uInt16  nField  = pLb->GetSelectEntryPos();
+            const sal_Int32 nField  = pLb->GetSelectEntryPos();
             theQueryData.GetEntry(nOffset).nField = theQueryData.nCol1 + 
static_cast<SCCOL>(nField) - 1 ;
         }
     }
@@ -923,7 +921,7 @@ IMPL_LINK( ScFilterDlg, LbSelectHdl, ListBox*, pLb )
             {
                 pLbConnect3->Enable();
             }
-            sal_uInt16  nField  = pLb->GetSelectEntryPos();
+            const sal_Int32 nField = pLb->GetSelectEntryPos();
             sal_uInt16 nQ=1+nOffset;
             theQueryData.GetEntry(nQ).bDoQuery = true;
             theQueryData.GetEntry(nQ).nField = theQueryData.nCol1 + 
static_cast<SCCOL>(nField) - 1 ;
@@ -964,7 +962,7 @@ IMPL_LINK( ScFilterDlg, LbSelectHdl, ListBox*, pLb )
                 pLbConnect4->Enable();
             }
 
-            sal_uInt16  nField  = pLb->GetSelectEntryPos();
+            const sal_Int32 nField = pLb->GetSelectEntryPos();
             sal_uInt16 nQ=2+nOffset;
             theQueryData.GetEntry(nQ).bDoQuery = true;
             theQueryData.GetEntry(nQ).nField = theQueryData.nCol1 + 
static_cast<SCCOL>(nField) - 1 ;
@@ -991,7 +989,7 @@ IMPL_LINK( ScFilterDlg, LbSelectHdl, ListBox*, pLb )
         else
         {
             UpdateValueList( 4 );
-            sal_uInt16  nField  = pLb->GetSelectEntryPos();
+            const sal_Int32 nField = pLb->GetSelectEntryPos();
             sal_uInt16 nQ=3+nOffset;
             theQueryData.GetEntry(nQ).bDoQuery = true;
             theQueryData.GetEntry(nQ).nField = theQueryData.nCol1 + 
static_cast<SCCOL>(nField) - 1 ;
@@ -1031,10 +1029,10 @@ IMPL_LINK_TYPED( ScFilterDlg, CheckBoxHdl, Button*, 
pBox, void )
 
     if ( pBox == pBtnHeader )              // Field list and value list
     {
-        sal_uInt16 nCurSel1 = pLbField1->GetSelectEntryPos();
-        sal_uInt16 nCurSel2 = pLbField2->GetSelectEntryPos();
-        sal_uInt16 nCurSel3 = pLbField3->GetSelectEntryPos();
-        sal_uInt16 nCurSel4 = pLbField4->GetSelectEntryPos();
+        const sal_Int32 nCurSel1 = pLbField1->GetSelectEntryPos();
+        const sal_Int32 nCurSel2 = pLbField2->GetSelectEntryPos();
+        const sal_Int32 nCurSel3 = pLbField3->GetSelectEntryPos();
+        const sal_Int32 nCurSel4 = pLbField4->GetSelectEntryPos();
         FillFieldLists();
         pLbField1->SelectEntryPos( nCurSel1 );
         pLbField2->SelectEntryPos( nCurSel2 );
@@ -1131,7 +1129,7 @@ IMPL_LINK( ScFilterDlg, ValModifyHdl, ComboBox*, pEd )
                 rItem.meType = bNumber ? ScQueryEntry::ByValue : 
ScQueryEntry::ByString;
             }
 
-            sal_uInt16  nField  = pLbField->GetSelectEntryPos();
+            const sal_Int32 nField = pLbField->GetSelectEntryPos();
             rEntry.nField = nField ? (theQueryData.nCol1 +
                 static_cast<SCCOL>(nField) - 1) : static_cast<SCCOL>(0);
 
diff --git a/sc/source/ui/dbgui/foptmgr.cxx b/sc/source/ui/dbgui/foptmgr.cxx
index d50c7a92..b4a49fa 100644
--- a/sc/source/ui/dbgui/foptmgr.cxx
+++ b/sc/source/ui/dbgui/foptmgr.cxx
@@ -68,10 +68,9 @@ ScFilterOptionsMgr::ScFilterOptionsMgr(
 
 ScFilterOptionsMgr::~ScFilterOptionsMgr()
 {
-    sal_uInt16 nEntries = pLbCopyArea->GetEntryCount();
-    sal_uInt16 i;
+    const sal_Int32 nEntries = pLbCopyArea->GetEntryCount();
 
-    for ( i=2; i<nEntries; i++ )
+    for ( sal_Int32 i=2; i<nEntries; i++ )
         delete static_cast<OUString*>(pLbCopyArea->GetEntryData( i ));
 }
 
@@ -115,7 +114,7 @@ void ScFilterOptionsMgr::Init()
         ScRange aRange;
         while ( aIter.Next( aName, aRange ) )
         {
-            sal_uInt16 nInsert = pLbCopyArea->InsertEntry( aName );
+            const sal_Int32 nInsert = pLbCopyArea->InsertEntry( aName );
 
             OUString aRefStr(aRange.aStart.Format(SCA_ABS_3D, pDoc, eConv));
             pLbCopyArea->SetEntryData( nInsert, new OUString( aRefStr ) );
@@ -215,7 +214,7 @@ IMPL_LINK( ScFilterOptionsMgr, LbAreaSelHdl, ListBox*, pLb )
     if ( pLb == pLbCopyArea )
     {
         OUString aString;
-        sal_uInt16 nSelPos = pLbCopyArea->GetSelectEntryPos();
+        const sal_Int32 nSelPos = pLbCopyArea->GetSelectEntryPos();
 
         if ( nSelPos > 0 )
             aString = *static_cast<OUString*>(pLbCopyArea->GetEntryData( 
nSelPos ));
@@ -236,8 +235,8 @@ IMPL_LINK( ScFilterOptionsMgr, EdAreaModifyHdl, Edit*, pEd )
         if ( SCA_VALID == (nResult & SCA_VALID) )
         {
             bool    bFound  = false;
-            sal_uInt16  i       = 0;
-            sal_uInt16  nCount  = pLbCopyArea->GetEntryCount();
+            sal_Int32 i = 0;
+            const sal_Int32 nCount = pLbCopyArea->GetEntryCount();
 
             for ( i=2; i<nCount && !bFound; i++ )
             {
diff --git a/sc/source/ui/dbgui/pfiltdlg.cxx b/sc/source/ui/dbgui/pfiltdlg.cxx
index f2ed203..87de436 100644
--- a/sc/source/ui/dbgui/pfiltdlg.cxx
+++ b/sc/source/ui/dbgui/pfiltdlg.cxx
@@ -367,7 +367,7 @@ const ScQueryItem& ScPivotFilterDlg::GetOutputItem()
 
     for ( SCSIZE i=0; i<3; i++ )
     {
-        sal_uInt16      nField  = aFieldLbArr[i]->GetSelectEntryPos();
+        const sal_Int32 nField = aFieldLbArr[i]->GetSelectEntryPos();
         ScQueryOp   eOp     = (ScQueryOp)aCondLbArr[i]->GetSelectEntryPos();
 
         bool bDoThis = (aFieldLbArr[i]->GetSelectEntryPos() != 0);
diff --git a/sc/source/ui/dbgui/sfiltdlg.cxx b/sc/source/ui/dbgui/sfiltdlg.cxx
index 237ab59..bbc88e0 100644
--- a/sc/source/ui/dbgui/sfiltdlg.cxx
+++ b/sc/source/ui/dbgui/sfiltdlg.cxx
@@ -103,10 +103,9 @@ ScSpecialFilterDlg::~ScSpecialFilterDlg()
 
 void ScSpecialFilterDlg::dispose()
 {
-    sal_uInt16 nEntries = pLbFilterArea->GetEntryCount();
-    sal_uInt16 i;
+    const sal_Int32 nEntries = pLbFilterArea->GetEntryCount();
 
-    for ( i=1; i<nEntries; i++ )
+    for ( sal_Int32 i=1; i<nEntries; ++i )
         delete static_cast<OUString*>(pLbFilterArea->GetEntryData( i ));
 
     delete pOptionsMgr;
@@ -164,13 +163,12 @@ void ScSpecialFilterDlg::Init( const SfxItemSet& rArgSet )
         if (!pRangeNames->empty())
         {
             ScRangeName::const_iterator itr = pRangeNames->begin(), itrEnd = 
pRangeNames->end();
-            sal_uInt16 nInsert = 0;
             for (; itr != itrEnd; ++itr)
             {
                 if (!itr->second->HasType(RT_CRITERIA))
                     continue;
 
-                nInsert = pLbFilterArea->InsertEntry(itr->second->GetName());
+                const sal_Int32 nInsert = 
pLbFilterArea->InsertEntry(itr->second->GetName());
                 OUString aSymbol;
                 itr->second->GetSymbol(aSymbol);
                 pLbFilterArea->SetEntryData(nInsert, new OUString(aSymbol));
@@ -432,7 +430,7 @@ IMPL_LINK( ScSpecialFilterDlg, FilterAreaSelHdl, ListBox*, 
pLb )
     if ( pLb == pLbFilterArea )
     {
         OUString  aString;
-        sal_uInt16  nSelPos = pLbFilterArea->GetSelectEntryPos();
+        const sal_Int32 nSelPos = pLbFilterArea->GetSelectEntryPos();
 
         if ( nSelPos > 0 )
             aString = *static_cast<OUString*>(pLbFilterArea->GetEntryData( 
nSelPos ));
@@ -455,8 +453,8 @@ IMPL_LINK( ScSpecialFilterDlg, FilterAreaModHdl, 
formula::RefEdit*, pEd )
             if ( SCA_VALID == (nResult & SCA_VALID) )
             {
                 bool    bFound  = false;
-                sal_uInt16  i       = 0;
-                sal_uInt16  nCount  = pLbFilterArea->GetEntryCount();
+                sal_Int32 i = 0;
+                const sal_Int32 nCount  = pLbFilterArea->GetEntryCount();
 
                 for ( i=1; i<nCount && !bFound; i++ )
                 {
diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index 17665148..b5ef0b3 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -530,9 +530,9 @@ ScTabPageSortOptions::~ScTabPageSortOptions()
 
 void ScTabPageSortOptions::dispose()
 {
-    sal_uInt16 nEntries = m_pLbOutPos->GetEntryCount();
+    const sal_Int32 nEntries = m_pLbOutPos->GetEntryCount();
 
-    for ( sal_uInt16 i=1; i<nEntries; i++ )
+    for ( sal_Int32 i=1; i<nEntries; ++i )
         delete static_cast<OUString*>(m_pLbOutPos->GetEntryData( i ));
 
     delete pColRes;
@@ -594,7 +594,7 @@ void ScTabPageSortOptions::Init()
         ScRange aRange;
         while ( aIter.Next( aName, aRange ) )
         {
-            sal_uInt16 nInsert = m_pLbOutPos->InsertEntry( aName );
+            const sal_Int32 nInsert = m_pLbOutPos->InsertEntry( aName );
 
             OUString aRefStr(aRange.aStart.Format(SCA_ABS_3D, pDoc, eConv));
             m_pLbOutPos->SetEntryData( nInsert, new OUString( aRefStr ) );
@@ -746,7 +746,7 @@ bool ScTabPageSortOptions::FillItemSet( SfxItemSet* rArgSet 
)
     {
         uno::Sequence<OUString> aAlgos = pColWrap->listCollatorAlgorithms(
                 aNewSortData.aCollatorLocale );
-        sal_uInt16 nSel = m_pLbAlgorithm->GetSelectEntryPos();
+        const sal_Int32 nSel = m_pLbAlgorithm->GetSelectEntryPos();

... etc. - the rest is truncated
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to