diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2015-05-12 23:10:04 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2015-05-25 00:30:53 +0200 |
commit | 1700fa84cd29c0f2d84d2af17cabb8e04b143ffe (patch) | |
tree | 10f4b08d3f18c9b699d2838964005e55e8258908 /sw/source/ui/fldui | |
parent | 4dca69d89c95f30cd58a668fd2dc54a8149ab6c8 (diff) |
Use size_t consistently for GetFldTypeCount/GetFldType/RemoveFldType
Change-Id: Ie88af20e20f788c0d8b53f99da3decd98dec5078
Diffstat (limited to 'sw/source/ui/fldui')
-rw-r--r-- | sw/source/ui/fldui/fldref.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/fldui/fldvar.cxx | 10 |
2 files changed, 9 insertions, 7 deletions
diff --git a/sw/source/ui/fldui/fldref.cxx b/sw/source/ui/fldui/fldref.cxx index cef199107340..994ae8f7a72f 100644 --- a/sw/source/ui/fldui/fldref.cxx +++ b/sw/source/ui/fldui/fldref.cxx @@ -201,9 +201,11 @@ void SwFieldRefPage::Reset(const SfxItemSet* ) if(!pSh) pSh = ::GetActiveWrtShell(); - const sal_uInt16 nFieldTypeCnt = pSh->GetFieldTypeCount(RES_SETEXPFLD); + const size_t nFieldTypeCnt = pSh->GetFieldTypeCount(RES_SETEXPFLD); - for (sal_uInt16 n = 0; n < nFieldTypeCnt; ++n) + OSL_ENSURE( nFieldTypeCnt < static_cast<size_t>(REFFLDFLAG), "<SwFieldRefPage::Reset> - Item index will overlap flags!" ); + + for (size_t n = 0; n < nFieldTypeCnt; ++n) { SwSetExpFieldType* pType = static_cast<SwSetExpFieldType*>(pSh->GetFieldType(n, RES_SETEXPFLD)); diff --git a/sw/source/ui/fldui/fldvar.cxx b/sw/source/ui/fldui/fldvar.cxx index 95c737f0ea7a..5cd8a3eaeafc 100644 --- a/sw/source/ui/fldui/fldvar.cxx +++ b/sw/source/ui/fldui/fldvar.cxx @@ -243,10 +243,10 @@ IMPL_LINK( SwFieldVarPage, SubTypeHdl, ListBox *, pBox ) { sal_uInt16 nTypeId = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pTypeLB->GetEntryData(GetTypeSel())); sal_Int32 nSelPos = m_pSelectionLB->GetSelectEntryPos(); - sal_uInt16 nSelData = USHRT_MAX; + size_t nSelData = SIZE_MAX; if (nSelPos != LISTBOX_ENTRY_NOTFOUND) - nSelData = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pSelectionLB->GetEntryData(nSelPos)); + nSelData = static_cast<size_t>(reinterpret_cast<sal_uLong>(m_pSelectionLB->GetEntryData(nSelPos))); if (IsFieldEdit() && (!pBox || bInit)) { @@ -574,11 +574,11 @@ IMPL_LINK( SwFieldVarPage, SubTypeHdl, ListBox *, pBox ) nSelPos = m_pSelectionLB->GetSelectEntryPos(); if (nSelPos != LISTBOX_ENTRY_NOTFOUND) - nSelData = (sal_uInt16)reinterpret_cast<sal_uLong>(m_pSelectionLB->GetEntryData(nSelPos)); + nSelData = static_cast<size_t>(reinterpret_cast<sal_uLong>(m_pSelectionLB->GetEntryData(nSelPos))); else - nSelData = USHRT_MAX; + nSelData = SIZE_MAX; - if (nSelData != USHRT_MAX && pBox && !bInit) + if (nSelData != SIZE_MAX && pBox && !bInit) { m_pValueED->ReplaceSelected(m_pSelectionLB->GetSelectEntry()); ModifyHdl(); |