summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2014-07-23 14:03:48 +0200
committerMatteo Casalin <matteo.casalin@yahoo.com>2014-07-26 14:25:25 +0200
commit3e7004c3acb1807aa758d84f7b44ba867196b7b5 (patch)
treea2fddcb37716ce267789f50159a1c7e8d84d2c1d /sw/source
parent4f2b97d4c763b711992968f86b4cbf36342681f7 (diff)
sal_uInt16 to size_t/bool in SwInputFieldList
Change-Id: Ib54e747abaf4e7a911dd3986d27f21a96eaa6120
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/fields/fldlst.cxx24
-rw-r--r--sw/source/uibase/wrtsh/wrtsh2.cxx4
2 files changed, 14 insertions, 14 deletions
diff --git a/sw/source/core/fields/fldlst.cxx b/sw/source/core/fields/fldlst.cxx
index ef548b4dcf17..eae9d35eca70 100644
--- a/sw/source/core/fields/fldlst.cxx
+++ b/sw/source/core/fields/fldlst.cxx
@@ -38,13 +38,13 @@ SwInputFieldList::SwInputFieldList( SwEditShell* pShell, bool bBuildTmpLst )
pSrtLst = new _SetGetExpFlds();
const SwFldTypes& rFldTypes = *pSh->GetDoc()->GetFldTypes();
- const sal_uInt16 nSize = rFldTypes.size();
+ const size_t nSize = rFldTypes.size();
// iterate over all types
- for(sal_uInt16 i=0; i < nSize; ++i)
+ for(size_t i=0; i < nSize; ++i)
{
SwFieldType* pFldType = (SwFieldType*)rFldTypes[ i ];
- sal_uInt16 nType = pFldType->Which();
+ const sal_uInt16 nType = pFldType->Which();
if( RES_SETEXPFLD == nType || RES_INPUTFLD == nType || RES_DROPDOWN == nType )
{
@@ -82,13 +82,13 @@ SwInputFieldList::~SwInputFieldList()
delete pSrtLst;
}
-sal_uInt16 SwInputFieldList::Count() const
+size_t SwInputFieldList::Count() const
{
return pSrtLst->size();
}
// get field from list in sorted order
-SwField* SwInputFieldList::GetField(sal_uInt16 nId)
+SwField* SwInputFieldList::GetField(size_t nId)
{
const SwTxtFld* pTxtFld = (*pSrtLst)[ nId ]->GetTxtFld();
OSL_ENSURE( pTxtFld, "no TextFld" );
@@ -109,7 +109,7 @@ void SwInputFieldList::PopCrsr()
}
/// go to position of a field
-void SwInputFieldList::GotoFieldPos(sal_uInt16 nId)
+void SwInputFieldList::GotoFieldPos(size_t nId)
{
pSh->StartAllAction();
(*pSrtLst)[ nId ]->GetPosOfContent( *pSh->GetCrsr()->GetPoint() );
@@ -121,18 +121,18 @@ void SwInputFieldList::GotoFieldPos(sal_uInt16 nId)
* All new ones are added to SortList so that they can be updated.
* For text blocks: update only input fields.
*
- * @return count
+ * @return true if not empty
*/
-sal_uInt16 SwInputFieldList::BuildSortLst()
+bool SwInputFieldList::BuildSortLst()
{
const SwFldTypes& rFldTypes = *pSh->GetDoc()->GetFldTypes();
- sal_uInt16 nSize = rFldTypes.size();
+ const size_t nSize = rFldTypes.size();
// iterate over all types
- for( sal_uInt16 i = 0; i < nSize; ++i )
+ for( size_t i = 0; i < nSize; ++i )
{
SwFieldType* pFldType = (SwFieldType*)rFldTypes[ i ];
- sal_uInt16 nType = pFldType->Which();
+ const sal_uInt16 nType = pFldType->Which();
if( RES_SETEXPFLD == nType || RES_INPUTFLD == nType )
{
@@ -166,7 +166,7 @@ sal_uInt16 SwInputFieldList::BuildSortLst()
// the pointers are not needed anymore
aTmpLst.clear();
- return pSrtLst->size();
+ return !pSrtLst->empty();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/wrtsh/wrtsh2.cxx b/sw/source/uibase/wrtsh/wrtsh2.cxx
index 3b1896cd9209..4062aef7f9a7 100644
--- a/sw/source/uibase/wrtsh/wrtsh2.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh2.cxx
@@ -137,14 +137,14 @@ void SwWrtShell::UpdateInputFlds( SwInputFieldList* pLst )
if( !pTmp )
pTmp = new SwInputFieldList( this );
- const sal_uInt16 nCnt = pTmp->Count();
+ const size_t nCnt = pTmp->Count();
if(nCnt)
{
pTmp->PushCrsr();
bool bCancel = false;
OString aDlgPos;
- for( sal_uInt16 i = 0; i < nCnt && !bCancel; ++i )
+ for( size_t i = 0; i < nCnt && !bCancel; ++i )
{
pTmp->GotoFieldPos( i );
SwField* pField = pTmp->GetField( i );