summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2014-12-25 17:06:46 +0100
committerMatteo Casalin <matteo.casalin@yahoo.com>2014-12-25 18:21:11 +0100
commit257ff5bea3a40646e7dae88f708c136be93ed1b2 (patch)
tree3bc51290ad3821f34f4de68d9596c795aa633562
parentd07f0997c54e9cef31d996ebeb2aabfb4b4e0265 (diff)
sal_uInt16 to size_t
Change-Id: I66239d89049f1386e5725e540c4dcc2b09c3ebf0
-rw-r--r--sw/inc/doc.hxx4
-rw-r--r--sw/inc/fesh.hxx4
-rw-r--r--sw/source/core/doc/docfly.cxx16
-rw-r--r--sw/source/core/frmedt/fefly1.cxx4
-rw-r--r--sw/source/core/frmedt/feshview.cxx4
-rw-r--r--sw/source/core/layout/laycache.cxx4
-rw-r--r--sw/source/core/layout/layhelp.hxx6
-rw-r--r--sw/source/core/unocore/unocoll.cxx6
-rw-r--r--sw/source/core/unocore/unoframe.cxx4
-rw-r--r--sw/source/uibase/shells/frmsh.cxx4
-rw-r--r--sw/source/uibase/utlui/content.cxx2
11 files changed, 29 insertions, 29 deletions
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index a7c8926cd4f2..c99118565a17 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -888,8 +888,8 @@ public:
/** Access to frames.
Iterate over Flys - forr Basic-Collections. */
- sal_uInt16 GetFlyCount( FlyCntType eType = FLYCNTTYPE_ALL, bool bIgnoreTextBoxes = false ) const;
- SwFrmFmt* GetFlyNum(sal_uInt16 nIdx, FlyCntType eType = FLYCNTTYPE_ALL, bool bIgnoreTextBoxes = false );
+ size_t GetFlyCount( FlyCntType eType = FLYCNTTYPE_ALL, bool bIgnoreTextBoxes = false ) const;
+ SwFrmFmt* GetFlyNum(size_t nIdx, FlyCntType eType = FLYCNTTYPE_ALL, bool bIgnoreTextBoxes = false );
// Copy formats in own arrays and return them.
SwFrmFmt *CopyFrmFmt ( const SwFrmFmt& );
diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx
index 4896406e76a4..079ef712f8bb 100644
--- a/sw/inc/fesh.hxx
+++ b/sw/inc/fesh.hxx
@@ -376,8 +376,8 @@ public:
{ return GotoObj( false, eType); }
/// Iterate over flys - for Basic-collections.
- sal_uInt16 GetFlyCount( FlyCntType eType = FLYCNTTYPE_ALL, bool bIgnoreTextBoxes = false ) const;
- const SwFrmFmt* GetFlyNum(sal_uInt16 nIdx, FlyCntType eType = FLYCNTTYPE_ALL, bool bIgnoreTextBoxes = false) const;
+ size_t GetFlyCount( FlyCntType eType = FLYCNTTYPE_ALL, bool bIgnoreTextBoxes = false ) const;
+ const SwFrmFmt* GetFlyNum(size_t nIdx, FlyCntType eType = FLYCNTTYPE_ALL, bool bIgnoreTextBoxes = false) const;
/// If a fly is selected, it draws cursor into the first CntntFrm.
const SwFrmFmt* SelFlyGrabCrsr();
diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx
index 67cddeadc6fc..5548ccdd1928 100644
--- a/sw/source/core/doc/docfly.cxx
+++ b/sw/source/core/doc/docfly.cxx
@@ -72,18 +72,18 @@
using namespace ::com::sun::star;
-sal_uInt16 SwDoc::GetFlyCount( FlyCntType eType, bool bIgnoreTextBoxes ) const
+size_t SwDoc::GetFlyCount( FlyCntType eType, bool bIgnoreTextBoxes ) const
{
const SwFrmFmts& rFmts = *GetSpzFrmFmts();
- sal_uInt16 nSize = rFmts.size();
- sal_uInt16 nCount = 0;
+ const size_t nSize = rFmts.size();
+ size_t nCount = 0;
const SwNodeIndex* pIdx;
std::set<const SwFrmFmt*> aTextBoxes;
if (bIgnoreTextBoxes)
aTextBoxes = SwTextBoxHelper::findTextBoxes(this);
- for ( sal_uInt16 i = 0; i < nSize; i++)
+ for ( size_t i = 0; i < nSize; ++i)
{
const SwFrmFmt* pFlyFmt = rFmts[ i ];
@@ -123,19 +123,19 @@ sal_uInt16 SwDoc::GetFlyCount( FlyCntType eType, bool bIgnoreTextBoxes ) const
}
/// @attention If you change this, also update SwXFrameEnumeration in unocoll.
-SwFrmFmt* SwDoc::GetFlyNum( sal_uInt16 nIdx, FlyCntType eType, bool bIgnoreTextBoxes )
+SwFrmFmt* SwDoc::GetFlyNum( size_t nIdx, FlyCntType eType, bool bIgnoreTextBoxes )
{
SwFrmFmts& rFmts = *GetSpzFrmFmts();
SwFrmFmt* pRetFmt = 0;
- sal_uInt16 nSize = rFmts.size();
+ const size_t nSize = rFmts.size();
const SwNodeIndex* pIdx;
- sal_uInt16 nCount = 0;
+ size_t nCount = 0;
std::set<const SwFrmFmt*> aTextBoxes;
if (bIgnoreTextBoxes)
aTextBoxes = SwTextBoxHelper::findTextBoxes(this);
- for( sal_uInt16 i = 0; !pRetFmt && i < nSize; ++i )
+ for( size_t i = 0; !pRetFmt && i < nSize; ++i )
{
SwFrmFmt* pFlyFmt = rFmts[ i ];
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index e2c7f9aa2a8d..957ddaceb16c 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -1837,14 +1837,14 @@ void SwFEShell::GetConnectableFrmFmts(SwFrmFmt & rFmt,
if (pOldChainPrev)
mpDoc->Unchain(*pOldChainPrev);
- sal_uInt16 nCnt = mpDoc->GetFlyCount(FLYCNTTYPE_FRM);
+ const size_t nCnt = mpDoc->GetFlyCount(FLYCNTTYPE_FRM);
/* potential successors resp. predecessors */
::std::vector< const SwFrmFmt * > aTmpSpzArray;
mpDoc->FindFlyByName(rReference);
- for (sal_uInt16 n = 0; n < nCnt; n++)
+ for (size_t n = 0; n < nCnt; ++n)
{
const SwFrmFmt & rFmt1 = *(mpDoc->GetFlyNum(n, FLYCNTTYPE_FRM));
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index fafe8631766a..b1be489e2913 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -2234,12 +2234,12 @@ bool SwFEShell::GotoFly( const OUString& rName, FlyCntType eType, bool bSelFrm )
return bRet;
}
-sal_uInt16 SwFEShell::GetFlyCount( FlyCntType eType, bool bIgnoreTextBoxes ) const
+size_t SwFEShell::GetFlyCount( FlyCntType eType, bool bIgnoreTextBoxes ) const
{
return GetDoc()->GetFlyCount(eType, bIgnoreTextBoxes);
}
-const SwFrmFmt* SwFEShell::GetFlyNum(sal_uInt16 nIdx, FlyCntType eType, bool bIgnoreTextBoxes ) const
+const SwFrmFmt* SwFEShell::GetFlyNum(size_t nIdx, FlyCntType eType, bool bIgnoreTextBoxes ) const
{
return GetDoc()->GetFlyNum(nIdx, eType, bIgnoreTextBoxes);
}
diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx
index c9374ba1cf68..c91f22c81872 100644
--- a/sw/source/core/layout/laycache.cxx
+++ b/sw/source/core/layout/laycache.cxx
@@ -912,7 +912,7 @@ void SwLayHelper::_CheckFlyCache( SwPageFrm* pPage )
{
if( !pImpl || !pPage )
return;
- sal_uInt16 nFlyCount = pImpl->GetFlyCount();
+ const size_t nFlyCount = pImpl->GetFlyCount();
// Any text frames at the page, fly cache available?
if( pPage->GetSortedObjs() && nFlyIdx < nFlyCount )
{
@@ -929,7 +929,7 @@ void SwLayHelper::_CheckFlyCache( SwPageFrm* pPage )
// sort cached objects on this page by ordnum
std::set< const SwFlyCache*, FlyCacheCompare > aFlyCacheSet;
- sal_uInt16 nIdx = nFlyIdx;
+ size_t nIdx = nFlyIdx;
SwFlyCache* pFlyC;
while( nIdx < nFlyCount &&
diff --git a/sw/source/core/layout/layhelp.hxx b/sw/source/core/layout/layhelp.hxx
index 47412c001de6..148c1c9db96d 100644
--- a/sw/source/core/layout/layhelp.hxx
+++ b/sw/source/core/layout/layhelp.hxx
@@ -69,8 +69,8 @@ public:
sal_Int32 GetBreakOfst( size_t nIdx ) const { return aOffset[ nIdx ]; }
sal_uInt16 GetBreakType( sal_uInt16 nIdx ) const { return aType[ nIdx ]; }
- sal_uInt16 GetFlyCount() const { return aFlyCache.size(); }
- SwFlyCache& GetFlyCache( sal_uInt16 nIdx ) { return aFlyCache[ nIdx ]; }
+ size_t GetFlyCount() const { return aFlyCache.size(); }
+ SwFlyCache& GetFlyCache( size_t nIdx ) { return aFlyCache[ nIdx ]; }
bool IsUseFlyCache() const { return bUseFlyCache; }
};
@@ -109,7 +109,7 @@ class SwLayHelper
sal_uLong nParagraphCnt;
sal_uLong nStartOfContent;
sal_uInt16 nIndex; // the index in the page break array
- sal_uInt16 nFlyIdx; // the index in the fly cache array
+ size_t nFlyIdx; // the index in the fly cache array
bool bFirst : 1;
void _CheckFlyCache( SwPageFrm* pPage );
public:
diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx
index 589d3f25df17..c200afed30da 100644
--- a/sw/source/core/unocore/unocoll.cxx
+++ b/sw/source/core/unocore/unocoll.cxx
@@ -1195,7 +1195,7 @@ sal_Int32 SwXFrames::getCount(void) throw(uno::RuntimeException, std::exception)
if(!IsValid())
throw uno::RuntimeException();
// Ignore TextBoxes for TextFrames.
- return GetDoc()->GetFlyCount(eType, /*bIgnoreTextBoxes=*/eType == FLYCNTTYPE_FRM);
+ return static_cast<sal_Int32>(GetDoc()->GetFlyCount(eType, /*bIgnoreTextBoxes=*/eType == FLYCNTTYPE_FRM));
}
uno::Any SwXFrames::getByIndex(sal_Int32 nIndex)
@@ -1204,10 +1204,10 @@ uno::Any SwXFrames::getByIndex(sal_Int32 nIndex)
SolarMutexGuard aGuard;
if(!IsValid())
throw uno::RuntimeException();
- if(nIndex < 0 || nIndex >= USHRT_MAX)
+ if(nIndex < 0)
throw IndexOutOfBoundsException();
// Ignore TextBoxes for TextFrames.
- SwFrmFmt* pFmt = GetDoc()->GetFlyNum(static_cast<sal_uInt16>(nIndex), eType, /*bIgnoreTextBoxes=*/eType == FLYCNTTYPE_FRM);
+ SwFrmFmt* pFmt = GetDoc()->GetFlyNum(static_cast<size_t>(nIndex), eType, /*bIgnoreTextBoxes=*/eType == FLYCNTTYPE_FRM);
if(!pFmt)
throw IndexOutOfBoundsException();
return lcl_UnoWrapFrame(pFmt, eType);
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index db74773686d2..1db4715b4f9a 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -1686,10 +1686,10 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::
}
else
{
- sal_uInt16 nCount = pDoc->GetFlyCount(FLYCNTTYPE_FRM);
+ const size_t nCount = pDoc->GetFlyCount(FLYCNTTYPE_FRM);
SwFrmFmt* pChain = 0;
- for( sal_uInt16 i = 0; i < nCount; i++)
+ for( size_t i = 0; i < nCount; ++i )
{
SwFrmFmt* pFmt2 = pDoc->GetFlyNum(i, FLYCNTTYPE_FRM);
if(sChainName == pFmt2->GetName() )
diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx
index 9bae91524b67..72c476595168 100644
--- a/sw/source/uibase/shells/frmsh.cxx
+++ b/sw/source/uibase/shells/frmsh.cxx
@@ -94,8 +94,8 @@ using namespace ::com::sun::star::uno;
static void lcl_FrmGetMaxLineWidth(const SvxBorderLine* pBorderLine, SvxBorderLine& rBorderLine);
static const SwFrmFmt* lcl_GetFrmFmtByName(SwWrtShell& rSh, const OUString& rName)
{
- sal_uInt16 nCount = rSh.GetFlyCount(FLYCNTTYPE_FRM);
- for( sal_uInt16 i = 0; i < nCount; i++)
+ const size_t nCount = rSh.GetFlyCount(FLYCNTTYPE_FRM);
+ for( size_t i = 0; i < nCount; ++i )
{
const SwFrmFmt* pFmt = rSh.GetFlyNum(i, FLYCNTTYPE_FRM);
if(pFmt->GetName() == rName)
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index 3b4ebde35bc4..cdd36f1f9d2a 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -554,7 +554,7 @@ void SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged)
"MemberCount differs");
Point aNullPt;
nMemberCount = pWrtShell->GetFlyCount(eType, /*bIgnoreTextBoxes=*/true);
- for(sal_uInt16 i = 0; i < nMemberCount; i++)
+ for(size_t i = 0; i < nMemberCount; ++i)
{
const SwFrmFmt* pFrmFmt = pWrtShell->GetFlyNum(i,eType,/*bIgnoreTextBoxes=*/true);
const OUString sFrmName = pFrmFmt->GetName();