diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2014-07-23 14:03:48 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2014-07-26 14:25:25 +0200 |
commit | 3e7004c3acb1807aa758d84f7b44ba867196b7b5 (patch) | |
tree | a2fddcb37716ce267789f50159a1c7e8d84d2c1d /sw | |
parent | 4f2b97d4c763b711992968f86b4cbf36342681f7 (diff) |
sal_uInt16 to size_t/bool in SwInputFieldList
Change-Id: Ib54e747abaf4e7a911dd3986d27f21a96eaa6120
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/expfld.hxx | 10 | ||||
-rw-r--r-- | sw/source/core/fields/fldlst.cxx | 24 | ||||
-rw-r--r-- | sw/source/uibase/wrtsh/wrtsh2.cxx | 4 |
3 files changed, 19 insertions, 19 deletions
diff --git a/sw/inc/expfld.hxx b/sw/inc/expfld.hxx index eb588342e2ec..121125ec1be9 100644 --- a/sw/inc/expfld.hxx +++ b/sw/inc/expfld.hxx @@ -357,17 +357,17 @@ public: SwInputFieldList( SwEditShell* pShell, bool bBuildTmpLst = false ); ~SwInputFieldList(); - sal_uInt16 Count() const; - SwField* GetField(sal_uInt16 nId); + size_t Count() const; + SwField* GetField(size_t nId); - void GotoFieldPos(sal_uInt16 nId); + void GotoFieldPos(size_t nId); void PushCrsr(); void PopCrsr(); - /** Put all that are new into SortLst for updating. @return count. + /** Put all that are new into SortLst for updating. @return true if not empty. (For Glossary: only update its input-fields). Compare TmpLst with current fields. */ - sal_uInt16 BuildSortLst(); + bool BuildSortLst(); private: SwEditShell* pSh; 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 ); |