diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2015-05-13 09:54:50 +0200 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2015-05-18 13:54:12 +0200 |
commit | 3ccacb47faa625563f8bf0af8d4c62c1eea6ce7c (patch) | |
tree | 1fdf122a4dba1f212fed3e2b2fa9c84ab798c951 | |
parent | dcce3f7fd50b05593e77d7ff43735c5694e9422b (diff) |
tdf#89783: Allow more than 64k PageDescs
+ adjust related code using the functionality
Change-Id: I6fa4ad04137643009ee39522c36d6c9e6f3d2502
36 files changed, 120 insertions, 120 deletions
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx index 31fdbe224916..84fbb87245c3 100644 --- a/sw/inc/crsrsh.hxx +++ b/sw/inc/crsrsh.hxx @@ -659,7 +659,7 @@ public: bool GotoHeaderTxt(); ///< jump from the content to the header bool GotoFooterTxt(); ///< jump from the content to the footer // jump to the header/footer of the given or current PageDesc - bool SetCrsrInHdFt( sal_uInt16 nDescNo = USHRT_MAX, + bool SetCrsrInHdFt( size_t nDescNo = SIZE_MAX, bool bInHeader = true ); // is point of cursor in header/footer. pbInHeader return true if it is // in a headerframe otherwise in a footerframe diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 9cc929c1b4f4..5459308496a9 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -939,13 +939,13 @@ public: sal_Int32 nDocPageCount ); // PageDescriptor interface. - sal_uInt16 GetPageDescCnt() const { return maPageDescs.size(); } - const SwPageDesc& GetPageDesc( const sal_uInt16 i ) const { return maPageDescs[i]; } - SwPageDesc& GetPageDesc( sal_uInt16 i ) { return maPageDescs[i]; } - SwPageDesc* FindPageDesc(const OUString& rName, sal_uInt16* pPos = NULL); - SwPageDesc* FindPageDesc(const OUString& rName, sal_uInt16* pPos = NULL) const; + size_t GetPageDescCnt() const { return maPageDescs.size(); } + const SwPageDesc& GetPageDesc( const size_t i ) const { return maPageDescs[i]; } + SwPageDesc& GetPageDesc( size_t i ) { return maPageDescs[i]; } + SwPageDesc* FindPageDesc(const OUString& rName, size_t* pPos = NULL); + SwPageDesc* FindPageDesc(const OUString& rName, size_t* pPos = NULL) const; // Just searches the pointer in the maPageDescs vector! - bool ContainsPageDesc(const SwPageDesc *pDesc, sal_uInt16* pPos = NULL); + bool ContainsPageDesc(const SwPageDesc *pDesc, size_t* pPos = NULL); /** Copy the complete PageDesc - beyond document and "deep"! Optionally copying of PoolFmtId, -HlpId can be prevented. */ @@ -964,9 +964,9 @@ public: // For Reader void ChgPageDesc( const OUString & rName, const SwPageDesc& ); - void ChgPageDesc( sal_uInt16 i, const SwPageDesc& ); + void ChgPageDesc( size_t i, const SwPageDesc& ); void DelPageDesc( const OUString & rName, bool bBroadcast = false); - void DelPageDesc( sal_uInt16 i, bool bBroadcast = false ); + void DelPageDesc( size_t i, bool bBroadcast = false ); void PreDelPageDesc(SwPageDesc * pDel); SwPageDesc* MakePageDesc(const OUString &rName, const SwPageDesc* pCpy = 0, bool bRegardLanguage = true, diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx index 289fb92f04a7..6925032b79ae 100644 --- a/sw/inc/fesh.hxx +++ b/sw/inc/fesh.hxx @@ -573,15 +573,15 @@ public: /// PageDescriptor-interface void ChgCurPageDesc( const SwPageDesc& ); - sal_uInt16 GetCurPageDesc( const bool bCalcFrm = true ) const; - sal_uInt16 GetMousePageDesc( const Point &rPt ) const; - sal_uInt16 GetPageDescCnt() const; + size_t GetCurPageDesc( const bool bCalcFrm = true ) const; + size_t GetMousePageDesc( const Point &rPt ) const; + size_t GetPageDescCnt() const; SwPageDesc* FindPageDescByName( const OUString& rName, bool bGetFromPool = false, - sal_uInt16* pPos = 0 ); + size_t* pPos = 0 ); - const SwPageDesc& GetPageDesc( sal_uInt16 i ) const; - void ChgPageDesc( sal_uInt16 i, const SwPageDesc& ); + const SwPageDesc& GetPageDesc( size_t i ) const; + void ChgPageDesc( size_t i, const SwPageDesc& ); /** if inside all selection only one PageDesc, @return this. Otherwise @return 0 pointer */ const SwPageDesc* GetSelectedPageDescs() const; diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx index f3990c6a0578..d27494db31ef 100644 --- a/sw/inc/node.hxx +++ b/sw/inc/node.hxx @@ -268,7 +268,7 @@ public: /** Search PageDesc with which this node is formatted. If layout is existent search over layout, else only the hard way is left: search over the nodes to the front!! */ - const SwPageDesc* FindPageDesc( bool bCalcLay, sal_uInt32* pPgDescNdIdx = 0 ) const; + const SwPageDesc* FindPageDesc( bool bCalcLay, size_t* pPgDescNdIdx = 0 ) const; /// If node is in a fly return the respective format. SwFrmFmt* GetFlyFmt() const; diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index 727c2194527c..3b0d097ef515 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -186,7 +186,7 @@ bool SwCrsrShell::GotoFooterTxt() return 0 != pFrm; } -bool SwCrsrShell::SetCrsrInHdFt( sal_uInt16 nDescNo, bool bInHeader ) +bool SwCrsrShell::SetCrsrInHdFt( size_t nDescNo, bool bInHeader ) { bool bRet = false; SwDoc *pMyDoc = GetDoc(); @@ -194,7 +194,7 @@ bool SwCrsrShell::SetCrsrInHdFt( sal_uInt16 nDescNo, bool bInHeader ) SET_CURR_SHELL( this ); - if( USHRT_MAX == nDescNo ) + if( SIZE_MAX == nDescNo ) { // take the current one const SwPageFrm* pPage = GetCurrFrm()->FindPageFrm(); diff --git a/sw/source/core/doc/DocumentStylePoolManager.cxx b/sw/source/core/doc/DocumentStylePoolManager.cxx index 8d4fe0e1b7ae..d6c10ffa879e 100644 --- a/sw/source/core/doc/DocumentStylePoolManager.cxx +++ b/sw/source/core/doc/DocumentStylePoolManager.cxx @@ -1361,7 +1361,7 @@ SwPageDesc* DocumentStylePoolManager::GetPageDescFromPool( sal_uInt16 nId, bool OSL_ENSURE( RES_POOLPAGE_BEGIN <= nId && nId < RES_POOLPAGE_END, "Wrong AutoFormat Id" ); - for( sal_uInt16 n = 0; n < m_rDoc.GetPageDescCnt(); ++n ) + for( size_t n = 0; n < m_rDoc.GetPageDescCnt(); ++n ) { if ( nId == m_rDoc.GetPageDesc(n).GetPoolFmtId() ) { @@ -2182,7 +2182,7 @@ bool DocumentStylePoolManager::IsPoolPageDescUsed( sal_uInt16 nId ) const "Wrong AutoFormat Id" ); SwPageDesc *pNewPgDsc = 0; bool bFnd = false; - for( sal_uInt16 n = 0; !bFnd && n < m_rDoc.GetPageDescCnt(); ++n ) + for( size_t n = 0; !bFnd && n < m_rDoc.GetPageDescCnt(); ++n ) { pNewPgDsc = &m_rDoc.GetPageDesc(n); if( nId == pNewPgDsc->GetPoolFmtId() ) diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx index 43924035665f..fe6023b893ce 100644 --- a/sw/source/core/doc/docdesc.cxx +++ b/sw/source/core/doc/docdesc.cxx @@ -376,7 +376,7 @@ void SwDoc::CopyMasterFooter(const SwPageDesc &rChged, const SwFmtFooter &rFoot, } } -void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged ) +void SwDoc::ChgPageDesc( size_t i, const SwPageDesc &rChged ) { OSL_ENSURE( i < maPageDescs.size(), "PageDescs is out of range." ); @@ -611,7 +611,7 @@ void SwDoc::BroadcastStyleOperation(const OUString& rName, SfxStyleFamily eFamil } } -void SwDoc::DelPageDesc( sal_uInt16 i, bool bBroadcast ) +void SwDoc::DelPageDesc( size_t i, bool bBroadcast ) { OSL_ENSURE( i < maPageDescs.size(), "PageDescs is out of range." ); OSL_ENSURE( i != 0, "You cannot delete the default Pagedesc."); @@ -816,7 +816,7 @@ struct CompareSwPageDescName { template <class UnaryPredicate> static SwPageDesc* lcl_FindPageDesc( SwPageDescs *pPageDescs, - sal_uInt16 *pPos, UnaryPredicate pred ) + size_t *pPos, UnaryPredicate pred ) { SwPageDescs::iterator it = std::find_if( pPageDescs->begin(), pPageDescs->end(), pred); @@ -828,17 +828,17 @@ static SwPageDesc* lcl_FindPageDesc( SwPageDescs *pPageDescs, *pPos = std::distance( pPageDescs->begin(), it ); } else if( pPos ) - *pPos = USHRT_MAX; + *pPos = SIZE_MAX; return res; } -SwPageDesc* SwDoc::FindPageDesc( const OUString & rName, sal_uInt16* pPos ) +SwPageDesc* SwDoc::FindPageDesc( const OUString & rName, size_t* pPos ) { return lcl_FindPageDesc<CompareSwPageDescName>( &maPageDescs, pPos, CompareSwPageDescName(rName) ); } -SwPageDesc* SwDoc::FindPageDesc( const OUString & rName, sal_uInt16* pPos ) const +SwPageDesc* SwDoc::FindPageDesc( const OUString & rName, size_t* pPos ) const { return lcl_FindPageDesc<CompareSwPageDescName>( const_cast <SwPageDescs *>( &maPageDescs ), pPos, @@ -851,7 +851,7 @@ struct CompareSwPageDescToPtr { const SwPageDesc *mPtr; }; -bool SwDoc::ContainsPageDesc( const SwPageDesc *pDesc, sal_uInt16* pPos ) +bool SwDoc::ContainsPageDesc( const SwPageDesc *pDesc, size_t* pPos ) { if (pDesc == NULL) return false; @@ -863,7 +863,7 @@ bool SwDoc::ContainsPageDesc( const SwPageDesc *pDesc, sal_uInt16* pPos ) void SwDoc::DelPageDesc( const OUString & rName, bool bBroadcast ) { - sal_uInt16 nI; + size_t nI; if (FindPageDesc(rName, &nI)) DelPageDesc(nI, bBroadcast); @@ -871,7 +871,7 @@ void SwDoc::DelPageDesc( const OUString & rName, bool bBroadcast ) void SwDoc::ChgPageDesc( const OUString & rName, const SwPageDesc & rDesc) { - sal_uInt16 nI; + size_t nI; if (FindPageDesc(rName, &nI)) ChgPageDesc(nI, rDesc); @@ -884,7 +884,7 @@ void SwDoc::ChgPageDesc( const OUString & rName, const SwPageDesc & rDesc) */ void SwDoc::CheckDefaultPageFmt() { - for ( sal_uInt16 i = 0; i < GetPageDescCnt(); ++i ) + for ( size_t i = 0; i < GetPageDescCnt(); ++i ) { SwPageDesc& rDesc = GetPageDesc( i ); @@ -916,7 +916,7 @@ void SwDoc::SetDefaultPageMode(bool bSquaredPageMode) aNewGrid.Init(); SetDefault(aNewGrid); - for ( sal_uInt16 i = 0; i < GetPageDescCnt(); ++i ) + for ( size_t i = 0; i < GetPageDescCnt(); ++i ) { SwPageDesc& rDesc = GetPageDesc( i ); diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index 899c03ad7214..60f9756069c7 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -685,7 +685,7 @@ void SwDoc::ClearDoc() mpOutlineRule->SetCountPhantoms( !GetDocumentSettingManager().get(DocumentSettingId::OLD_NUMBERING) ); // remove the dummy pagedesc from the array and delete all the old ones - sal_uInt16 nDummyPgDsc = 0; + size_t nDummyPgDsc = 0; if (FindPageDesc(pDummyPgDsc->GetName(), &nDummyPgDsc)) pDummyPgDsc = maPageDescs.release(maPageDescs.begin() + nDummyPgDsc).release(); maPageDescs.clear(); diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx index 9a2cbbafb692..c64a438ff8ce 100644 --- a/sw/source/core/doc/doctxm.cxx +++ b/sw/source/core/doc/doctxm.cxx @@ -783,8 +783,8 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr, if ( !_bNewTOX && !pDefaultPageDesc ) { // determine page description of table-of-content - sal_uInt32 nPgDescNdIdx = pSectNd->GetIndex() + 1; - sal_uInt32* pPgDescNdIdx = &nPgDescNdIdx; + size_t nPgDescNdIdx = pSectNd->GetIndex() + 1; + size_t* pPgDescNdIdx = &nPgDescNdIdx; pDefaultPageDesc = pSectNd->FindPageDesc( false, pPgDescNdIdx ); if ( nPgDescNdIdx < pSectNd->GetIndex() ) { diff --git a/sw/source/core/doc/poolfmt.cxx b/sw/source/core/doc/poolfmt.cxx index 8165c82807fb..bf9a98e38de0 100644 --- a/sw/source/core/doc/poolfmt.cxx +++ b/sw/source/core/doc/poolfmt.cxx @@ -293,8 +293,8 @@ void SwDoc::RemoveAllFmtLanguageDependencies() SvxFrameDirectionItem aFrameDir( FRMDIR_HORI_LEFT_TOP, RES_FRAMEDIR ); - sal_uInt16 nCount = GetPageDescCnt(); - for( sal_uInt16 i=0; i<nCount; ++i ) + size_t nCount = GetPageDescCnt(); + for( size_t i=0; i<nCount; ++i ) { SwPageDesc& rDesc = GetPageDesc( i ); rDesc.GetMaster().SetFmtAttr( aFrameDir ); diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index 15da2b39e005..0f01281fb979 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -455,7 +455,7 @@ bool SwNode::IsProtect() const /// Find the PageDesc that is used to format this node. If the Layout is available, /// we search through that. Else we can only do it the hard way by searching onwards through the nodes. const SwPageDesc* SwNode::FindPageDesc( bool bCalcLay, - sal_uInt32* pPgDescNdIdx ) const + size_t* pPgDescNdIdx ) const { if ( !GetNodes().IsDocNodes() ) { @@ -599,7 +599,7 @@ const SwPageDesc* SwNode::FindPageDesc( bool bCalcLay, eAskUse = nsUseOnPage::PD_FOOTERSHARE; } - for( sal_uInt16 n = pDoc->GetPageDescCnt(); n && !pPgDesc; ) + for( size_t n = pDoc->GetPageDescCnt(); n && !pPgDesc; ) { const SwPageDesc& rPgDsc = pDoc->GetPageDesc( --n ); const SwFrmFmt* pFmt = &rPgDsc.GetMaster(); diff --git a/sw/source/core/frmedt/fedesc.cxx b/sw/source/core/frmedt/fedesc.cxx index 2c0b31f51445..d6a24296fe7a 100644 --- a/sw/source/core/frmedt/fedesc.cxx +++ b/sw/source/core/frmedt/fedesc.cxx @@ -33,7 +33,7 @@ #include <edimp.hxx> #include <SwStyleNameMapper.hxx> -sal_uInt16 SwFEShell::GetPageDescCnt() const +size_t SwFEShell::GetPageDescCnt() const { return GetDoc()->GetPageDescCnt(); } @@ -44,7 +44,7 @@ void SwFEShell::ChgCurPageDesc( const SwPageDesc& rDesc ) // SS does not change PageDesc, but only sets the attibute. // The Pagedesc should be available in the document bool bFound = false; - for ( sal_uInt16 nTst = 0; nTst < GetPageDescCnt(); ++nTst ) + for ( size_t nTst = 0; nTst < GetPageDescCnt(); ++nTst ) if ( &rDesc == &GetPageDesc( nTst ) ) bFound = true; OSL_ENSURE( bFound, "ChgCurPageDesc with invalid descriptor." ); @@ -102,7 +102,7 @@ void SwFEShell::ChgCurPageDesc( const SwPageDesc& rDesc ) EndAllActionAndCall(); } -void SwFEShell::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged ) +void SwFEShell::ChgPageDesc( size_t i, const SwPageDesc &rChged ) { StartAllAction(); SET_CURR_SHELL( this ); @@ -117,14 +117,14 @@ void SwFEShell::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged ) EndAllActionAndCall(); } -const SwPageDesc& SwFEShell::GetPageDesc( sal_uInt16 i ) const +const SwPageDesc& SwFEShell::GetPageDesc( size_t i ) const { return GetDoc()->GetPageDesc( i ); } SwPageDesc* SwFEShell::FindPageDescByName( const OUString& rName, bool bGetFromPool, - sal_uInt16* pPos ) + size_t* pPos ) { SwPageDesc* pDesc = GetDoc()->FindPageDesc(rName, pPos); if( !pDesc && bGetFromPool ) @@ -139,7 +139,7 @@ SwPageDesc* SwFEShell::FindPageDescByName( const OUString& rName, return pDesc; } -sal_uInt16 SwFEShell::GetMousePageDesc( const Point &rPt ) const +size_t SwFEShell::GetMousePageDesc( const Point &rPt ) const { if( GetLayout() ) { @@ -150,7 +150,7 @@ sal_uInt16 SwFEShell::GetMousePageDesc( const Point &rPt ) const while( pPage->GetNext() && rPt.Y() > pPage->Frm().Bottom() ) pPage = static_cast<const SwPageFrm*>( pPage->GetNext() ); SwDoc *pMyDoc = GetDoc(); - sal_uInt16 nPos; + size_t nPos; if (pMyDoc->ContainsPageDesc( pPage->GetPageDesc(), &nPos ) ) return nPos; } @@ -158,7 +158,7 @@ sal_uInt16 SwFEShell::GetMousePageDesc( const Point &rPt ) const return 0; } -sal_uInt16 SwFEShell::GetCurPageDesc( const bool bCalcFrm ) const +size_t SwFEShell::GetCurPageDesc( const bool bCalcFrm ) const { const SwFrm *pFrm = GetCurrFrm( bCalcFrm ); if ( pFrm ) @@ -166,7 +166,7 @@ sal_uInt16 SwFEShell::GetCurPageDesc( const bool bCalcFrm ) const const SwPageFrm *pPage = pFrm->FindPageFrm(); if ( pPage ) { - sal_uInt16 nPos; + size_t nPos; if (GetDoc()->ContainsPageDesc( pPage->GetPageDesc(), &nPos )) return nPos; } diff --git a/sw/source/core/layout/pagedesc.cxx b/sw/source/core/layout/pagedesc.cxx index a130835dc62c..01a4a5a0d2d5 100644 --- a/sw/source/core/layout/pagedesc.cxx +++ b/sw/source/core/layout/pagedesc.cxx @@ -331,9 +331,9 @@ void SwPageDesc::ChgFirstShare( bool bNew ) SwPageDesc* SwPageDesc::GetByName(SwDoc& rDoc, const OUString& rName) { - const sal_uInt16 nDCount = rDoc.GetPageDescCnt(); + const size_t nDCount = rDoc.GetPageDescCnt(); - for( sal_uInt16 i = 0; i < nDCount; i++ ) + for( size_t i = 0; i < nDCount; i++ ) { SwPageDesc* pDsc = &rDoc.GetPageDesc( i ); if(pDsc->GetName() == rName) diff --git a/sw/source/core/tox/ToxTabStopTokenHandler.cxx b/sw/source/core/tox/ToxTabStopTokenHandler.cxx index 462adbfa483d..67fd69bc66aa 100644 --- a/sw/source/core/tox/ToxTabStopTokenHandler.cxx +++ b/sw/source/core/tox/ToxTabStopTokenHandler.cxx @@ -83,7 +83,7 @@ DefaultToxTabStopTokenHandler::HandleTabStopToken( long DefaultToxTabStopTokenHandler::CalculatePageMarginFromPageDescription(const SwTxtNode& targetNode) const { - sal_uInt32 nPgDescNdIdx = targetNode.GetIndex() + 1; + size_t nPgDescNdIdx = targetNode.GetIndex() + 1; const SwPageDesc *pPageDesc = targetNode.FindPageDesc(false, &nPgDescNdIdx); if (!pPageDesc || nPgDescNdIdx < mIndexOfSectionNode) { // Use default page description, if none is found or the found one is given by a Node before the diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index e2cc2e39ab3f..bf5d910b615d 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -1187,8 +1187,8 @@ CreateParentXText(SwDoc & rDoc, const SwPosition& rPos) case SwFooterStartNode: { const bool bHeader = (SwHeaderStartNode == eType); - const sal_uInt16 nPDescCount = rDoc.GetPageDescCnt(); - for(sal_uInt16 i = 0; i < nPDescCount; i++) + const size_t nPDescCount = rDoc.GetPageDescCnt(); + for(size_t i = 0; i < nPDescCount; i++) { const SwPageDesc& rDesc = rDoc.GetPageDesc( i ); const SwFrmFmt* pFrmFmtMaster = &rDesc.GetMaster(); diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index cde2dcf589ba..8080292470e3 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -529,8 +529,8 @@ static sal_Int32 lcl_GetCountOrName(const SwDoc &rDoc, { const sal_Int32 nBaseCount = RES_POOLPAGE_END - RES_POOLPAGE_BEGIN; nIndex = nIndex - nBaseCount; - const sal_uInt16 nArrLen = rDoc.GetPageDescCnt(); - for(sal_uInt16 i = 0; i < nArrLen; ++i) + const size_t nArrLen = rDoc.GetPageDescCnt(); + for(size_t i = 0; i < nArrLen; ++i) { const SwPageDesc& rDesc = rDoc.GetPageDesc(i); @@ -3105,7 +3105,7 @@ void SAL_CALL SwXStyle::setAllPropertiesToDefault( ) { rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *static_cast<SwDocStyleSheet*>(pBase) ) ); SwFmt *pTargetFmt = 0; - sal_uInt16 nPgDscPos = USHRT_MAX; + size_t nPgDscPos = SIZE_MAX; switch(eFamily) { case SFX_STYLE_FAMILY_CHAR: @@ -3145,7 +3145,7 @@ void SAL_CALL SwXStyle::setAllPropertiesToDefault( ) if(pTargetFmt) { - if(USHRT_MAX != nPgDscPos) + if(SIZE_MAX != nPgDscPos) { SwPageDesc& rPageDesc = m_pDoc->GetPageDesc(nPgDscPos); rPageDesc.ResetAllMasterAttr(); @@ -3195,7 +3195,7 @@ void SAL_CALL SwXStyle::setAllPropertiesToDefault( ) pTargetFmt->ResetAllFmtAttr(); } - if(USHRT_MAX != nPgDscPos) + if(SIZE_MAX != nPgDscPos) { m_pDoc->ChgPageDesc(nPgDscPos, m_pDoc->GetPageDesc(nPgDscPos)); } diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx index 4a56f0d14306..8362b1609f1b 100644 --- a/sw/source/core/view/vprint.cxx +++ b/sw/source/core/view/vprint.cxx @@ -223,10 +223,10 @@ void SwViewShell::ChgAllPageOrientation( Orientation eOri ) OSL_ENSURE( mnStartAction, "missing an Action" ); SET_CURR_SHELL( this ); - const sal_uInt16 nAll = GetDoc()->GetPageDescCnt(); + const size_t nAll = GetDoc()->GetPageDescCnt(); bool bNewOri = eOri != ORIENTATION_PORTRAIT; - for( sal_uInt16 i = 0; i < nAll; ++ i ) + for( size_t i = 0; i < nAll; ++ i ) { const SwPageDesc& rOld = GetDoc()->GetPageDesc( i ); @@ -263,9 +263,9 @@ void SwViewShell::ChgAllPageSize( Size &rSz ) SET_CURR_SHELL( this ); SwDoc* pMyDoc = GetDoc(); - const sal_uInt16 nAll = pMyDoc->GetPageDescCnt(); + const size_t nAll = pMyDoc->GetPageDescCnt(); - for( sal_uInt16 i = 0; i < nAll; ++i ) + for( size_t i = 0; i < nAll; ++i ) { const SwPageDesc &rOld = pMyDoc->GetPageDesc( i ); SwPageDesc aNew( rOld ); diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx index 96d2422a5060..7a72d158f724 100644 --- a/sw/source/filter/basflt/fltshell.cxx +++ b/sw/source/filter/basflt/fltshell.cxx @@ -967,7 +967,7 @@ SfxPoolItem* SwFltTOX::Clone(SfxItemPool*) const // UpdatePageDescs needs to be called at end of parsing to make Writer actually // accept Pagedescs contents -void UpdatePageDescs(SwDoc &rDoc, sal_uInt16 nInPageDescOffset) +void UpdatePageDescs(SwDoc &rDoc, size_t nInPageDescOffset) { // Update document page descriptors (only this way also left pages // get adjusted) @@ -976,7 +976,7 @@ void UpdatePageDescs(SwDoc &rDoc, sal_uInt16 nInPageDescOffset) rDoc.ChgPageDesc(0, rDoc.GetPageDesc(0)); // PageDescs "Convert..." - for (sal_uInt16 i = nInPageDescOffset; i < rDoc.GetPageDescCnt(); ++i) + for (size_t i = nInPageDescOffset; i < rDoc.GetPageDescCnt(); ++i) rDoc.ChgPageDesc(i, rDoc.GetPageDesc(i)); } diff --git a/sw/source/filter/html/htmlcss1.cxx b/sw/source/filter/html/htmlcss1.cxx index 4d14e70bd61c..487549411f20 100644 --- a/sw/source/filter/html/htmlcss1.cxx +++ b/sw/source/filter/html/htmlcss1.cxx @@ -89,7 +89,7 @@ static struct SwCSS1ItemIds void SwCSS1Parser::ChgPageDesc( const SwPageDesc *pPageDesc, const SwPageDesc& rNewPageDesc ) { - sal_uInt16 pos; + size_t pos; bool found = pDoc->ContainsPageDesc( pPageDesc, &pos ); OSL_ENSURE( found, "Seitenvorlage nicht gefunden" ); if (found) @@ -1343,8 +1343,8 @@ SwPageDesc *SwCSS1Parser::GetMasterPageDesc() static SwPageDesc *FindPageDesc(SwDoc *pDoc, sal_uInt16 nPoolId) { - sal_uInt16 nPageDescs = pDoc->GetPageDescCnt(); - sal_uInt16 nPage; + size_t nPageDescs = pDoc->GetPageDescCnt(); + size_t nPage; for (nPage=0; nPage < nPageDescs && pDoc->GetPageDesc(nPage).GetPoolFmtId() != nPoolId; ++nPage) ; diff --git a/sw/source/filter/html/htmlsect.cxx b/sw/source/filter/html/htmlsect.cxx index b8e77ac69a8d..3c495d0f4c73 100644 --- a/sw/source/filter/html/htmlsect.cxx +++ b/sw/source/filter/html/htmlsect.cxx @@ -202,7 +202,7 @@ void SwHTMLParser::NewDivision( int nToken ) pDoc->getIDocumentContentOperations().DelFullPara( aDelPam ); // Die Seitenvorlage aktualisieren - for( sal_uInt16 i=0; i < pDoc->GetPageDescCnt(); i++ ) + for( size_t i=0; i < pDoc->GetPageDescCnt(); i++ ) { if( RES_POOLPAGE_HTML == pDoc->GetPageDesc(i).GetPoolFmtId() ) { diff --git a/sw/source/filter/inc/fltshell.hxx b/sw/source/filter/inc/fltshell.hxx index c4c6021dacc9..94301c82bd8c 100644 --- a/sw/source/filter/inc/fltshell.hxx +++ b/sw/source/filter/inc/fltshell.hxx @@ -326,7 +326,7 @@ public: } }; -SW_DLLPUBLIC void UpdatePageDescs(SwDoc &rDoc, sal_uInt16 nInPageDescOffset); +SW_DLLPUBLIC void UpdatePageDescs(SwDoc &rDoc, size_t nInPageDescOffset); #endif diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index 718d5527fe94..30f28648dafe 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -444,14 +444,14 @@ void RtfExport::WriteInfo() void RtfExport::WritePageDescTable() { // Write page descriptions (page styles) - sal_uInt16 nSize = m_pDoc->GetPageDescCnt(); + size_t nSize = m_pDoc->GetPageDescCnt(); if (!nSize) return; Strm().WriteCharPtr(SAL_NEWLINE_STRING); m_bOutPageDescs = true; Strm().WriteChar('{').WriteCharPtr(OOO_STRING_SVTOOLS_RTF_IGNORE).WriteCharPtr(OOO_STRING_SVTOOLS_RTF_PGDSCTBL); - for (sal_uInt16 n = 0; n < nSize; ++n) + for (size_t n = 0; n < nSize; ++n) { const SwPageDesc& rPageDesc = m_pDoc->GetPageDesc(n); @@ -462,7 +462,7 @@ void RtfExport::WritePageDescTable() OutPageDescription(rPageDesc, false, false); // search for the next page description - sal_uInt16 i = nSize; + size_t i = nSize; while (i) if (rPageDesc.GetFollow() == &m_pDoc->GetPageDesc(--i)) break; @@ -570,13 +570,14 @@ void RtfExport::ExportDocument_Impl() else if (rSttNd.IsTableNode()) pSet = &rSttNd.GetTableNode()->GetTable(). GetFrmFmt()->GetAttrSet(); + else if (rSttNd.IsSectionNode()) pSet = &rSttNd.GetSectionNode()->GetSection(). GetFmt()->GetAttrSet(); if (pSet) { - sal_uInt16 nPosInDoc; + size_t nPosInDoc; pSttPgDsc = static_cast<const SwFmtPageDesc*>(&pSet->Get(RES_PAGEDESC)); if (!pSttPgDsc->GetPageDesc()) pSttPgDsc = 0; diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 95f0f30f7025..a216ed4b9d0e 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -4915,7 +4915,7 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos) m_pAnchorStck = new SwWW8FltAnchorStack(&m_rDoc, m_nFieldFlags); - sal_uInt16 nPageDescOffset = m_rDoc.GetPageDescCnt(); + size_t nPageDescOffset = m_rDoc.GetPageDescCnt(); SwNodeIndex aSttNdIdx( m_rDoc.GetNodes() ); SwRelNumRuleSpaces aRelNumRule(m_rDoc, m_bNewDoc); diff --git a/sw/source/ui/chrdlg/break.cxx b/sw/source/ui/chrdlg/break.cxx index e3833679e5c1..a4ae9e945a4f 100644 --- a/sw/source/ui/chrdlg/break.cxx +++ b/sw/source/ui/chrdlg/break.cxx @@ -148,8 +148,8 @@ SwBreakDlg::SwBreakDlg( vcl::Window *pParent, SwWrtShell &rS ) m_pPageNumEdit->SetModifyHdl(LINK(this,SwBreakDlg,PageNumModifyHdl)); // Insert page description to Listbox - const sal_uInt16 nCount = rSh.GetPageDescCnt(); - for( sal_uInt16 i = 0; i < nCount; ++i) + const size_t nCount = rSh.GetPageDescCnt(); + for( size_t i = 0; i < nCount; ++i) { const SwPageDesc &rPageDesc = rSh.GetPageDesc(i); ::InsertStringSorted(rPageDesc.GetName(), *m_pPageCollBox, 1 ); diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx index d45c5c4ca3ed..1d0c7beaeeaa 100644 --- a/sw/source/ui/frmdlg/column.cxx +++ b/sw/source/ui/frmdlg/column.cxx @@ -348,7 +348,7 @@ IMPL_LINK_NOARG(SwColumnDlg, OkHdl) if(pPageSet && SfxItemState::SET == pPageSet->GetItemState(RES_COL) && bPageChanged) { // deterine current PageDescriptor and fill the Set with it - const sal_uInt16 nCurIdx = rWrtShell.GetCurPageDesc(); + const size_t nCurIdx = rWrtShell.GetCurPageDesc(); SwPageDesc aPageDesc(rWrtShell.GetPageDesc(nCurIdx)); SwFrmFmt &rFmt = aPageDesc.GetMaster(); rFmt.SetFmtAttr(pPageSet->Get(RES_COL)); diff --git a/sw/source/ui/misc/docfnote.cxx b/sw/source/ui/misc/docfnote.cxx index 81cf7bd44d6b..76cad1a47ac5 100644 --- a/sw/source/ui/misc/docfnote.cxx +++ b/sw/source/ui/misc/docfnote.cxx @@ -235,8 +235,8 @@ void SwEndNoteOptionPage::Reset( const SfxItemSet* ) for( sal_uInt16 i = RES_POOLPAGE_BEGIN; i < RES_POOLPAGE_END; ++i ) m_pPageTemplBox->InsertEntry(SwStyleNameMapper::GetUIName( i, OUString() )); - const sal_uInt16 nCount = pSh->GetPageDescCnt(); - for(sal_uInt16 i = 0; i < nCount; ++i) + const size_t nCount = pSh->GetPageDescCnt(); + for(size_t i = 0; i < nCount; ++i) { const SwPageDesc &rPageDesc = pSh->GetPageDesc(i); if(LISTBOX_ENTRY_NOTFOUND == m_pPageTemplBox->GetEntryPos(rPageDesc.GetName())) diff --git a/sw/source/ui/misc/titlepage.cxx b/sw/source/ui/misc/titlepage.cxx index ecf49356c47c..8af9afeacf98 100644 --- a/sw/source/ui/misc/titlepage.cxx +++ b/sw/source/ui/misc/titlepage.cxx @@ -52,7 +52,7 @@ namespace void lcl_ChangePage(SwWrtShell *pSh, sal_uInt16 nNewNumber, const SwPageDesc *pNewDesc) { - const sal_uInt16 nCurIdx = pSh->GetCurPageDesc(); + const size_t nCurIdx = pSh->GetCurPageDesc(); const SwPageDesc &rCurrentDesc = pSh->GetPageDesc( nCurIdx ); const SwFmtPageDesc *pPageFmtDesc(0); @@ -193,7 +193,7 @@ SwTitlePageDlg::SwTitlePageDlg( vcl::Window *pParent ) : { while (mpSh->SttNxtPg()) { - const sal_uInt16 nCurIdx = mpSh->GetCurPageDesc(); + const size_t nCurIdx = mpSh->GetCurPageDesc(); const SwPageDesc &rPageDesc = mpSh->GetPageDesc( nCurIdx ); if (mpIndexDesc != &rPageDesc) diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx index 19b3b79af16d..2796753c4f72 100644 --- a/sw/source/ui/table/tabledlg.cxx +++ b/sw/source/ui/table/tabledlg.cxx @@ -1497,9 +1497,9 @@ void SwTextFlowPage::Reset( const SfxItemSet* rSet ) if(bFlowAllowed) { //Inserting of the existing page templates in the list box - const sal_uInt16 nCount = pShell->GetPageDescCnt(); + const size_t nCount = pShell->GetPageDescCnt(); - for( sal_uInt16 i = 0; i < nCount; ++i) + for( size_t i = 0; i < nCount; ++i) { const SwPageDesc &rPageDesc = pShell->GetPageDesc(i); m_pPageCollLB->InsertEntry(rPageDesc.GetName()); diff --git a/sw/source/uibase/app/appenv.cxx b/sw/source/uibase/app/appenv.cxx index 885ee5334844..e56ea2684059 100644 --- a/sw/source/uibase/app/appenv.cxx +++ b/sw/source/uibase/app/appenv.cxx @@ -404,7 +404,7 @@ void SwModule::InsertEnv( SfxRequest& rReq ) // Apply page description - sal_uInt16 nPos; + size_t nPos; pSh->FindPageDescByName( pDesc->GetName(), false, &nPos ); diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx index caf4f66df824..f58e99e504d0 100644 --- a/sw/source/uibase/app/docst.cxx +++ b/sw/source/uibase/app/docst.cxx @@ -211,7 +211,7 @@ void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh) rSet.DisableItem( nWhich ); else { - sal_uInt16 n = pShell->GetCurPageDesc( false ); + size_t n = pShell->GetCurPageDesc( false ); if( n < pShell->GetPageDescCnt() ) aName = pShell->GetPageDesc( n ).GetName(); @@ -1205,7 +1205,7 @@ sal_uInt16 SwDocShell::MakeByExample( const OUString &rName, sal_uInt16 nFamily, case SFX_STYLE_FAMILY_PAGE: { pCurrWrtShell->StartAllAction(); - sal_uInt16 nPgDsc = pCurrWrtShell->GetCurPageDesc(); + size_t nPgDsc = pCurrWrtShell->GetCurPageDesc(); SwPageDesc& rSrc = (SwPageDesc&)pCurrWrtShell->GetPageDesc( nPgDsc ); SwPageDesc& rDest = *const_cast<SwPageDesc*>(pStyle->GetPageDesc()); diff --git a/sw/source/uibase/app/docstyle.cxx b/sw/source/uibase/app/docstyle.cxx index d3ac73ff47ac..8260a1c46c49 100644 --- a/sw/source/uibase/app/docstyle.cxx +++ b/sw/source/uibase/app/docstyle.cxx @@ -1147,7 +1147,7 @@ bool SwDocStyleSheet::SetFollow( const OUString& rStr) const SwPageDesc* pFollowDesc = !rStr.isEmpty() ? lcl_FindPageDesc(rDoc, rStr) : 0; - sal_uInt16 nId = 0; + size_t nId = 0; if (pFollowDesc != pDesc->GetFollow() && rDoc.FindPageDesc(pDesc->GetName(), &nId)) { SwPageDesc aDesc( *pDesc ); @@ -1313,7 +1313,7 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet, SwFmt* pFmt = 0; SwPageDesc* pNewDsc = 0; - sal_uInt16 nPgDscPos = 0; + size_t nPgDscPos = 0; switch(nFamily) { @@ -1581,7 +1581,7 @@ static void lcl_SaveStyles( sal_uInt16 nFamily, std::vector<void*>& rArr, SwDoc& case SFX_STYLE_FAMILY_CHAR: { const SwCharFmts& rTbl = *rDoc.GetCharFmts(); - for( sal_uInt16 n = 0, nCnt = rTbl.size(); n < nCnt; ++n ) + for( size_t n = 0, nCnt = rTbl.size(); n < nCnt; ++n ) { rArr.push_back( rTbl[ n ] ); } @@ -1590,7 +1590,7 @@ static void lcl_SaveStyles( sal_uInt16 nFamily, std::vector<void*>& rArr, SwDoc& case SFX_STYLE_FAMILY_PARA: { const SwTxtFmtColls& rTbl = *rDoc.GetTxtFmtColls(); - for( sal_uInt16 n = 0, nCnt = rTbl.size(); n < nCnt; ++n ) + for( size_t n = 0, nCnt = rTbl.size(); n < nCnt; ++n ) { rArr.push_back( rTbl[ n ] ); } @@ -1599,7 +1599,7 @@ static void lcl_SaveStyles( sal_uInt16 nFamily, std::vector<void*>& rArr, SwDoc& case SFX_STYLE_FAMILY_FRAME: { const SwFrmFmts& rTbl = *rDoc.GetFrmFmts(); - for( sal_uInt16 n = 0, nCnt = rTbl.size(); n < nCnt; ++n ) + for( size_t n = 0, nCnt = rTbl.size(); n < nCnt; ++n ) { rArr.push_back( rTbl[ n ] ); } @@ -1608,7 +1608,7 @@ static void lcl_SaveStyles( sal_uInt16 nFamily, std::vector<void*>& rArr, SwDoc& case SFX_STYLE_FAMILY_PAGE: { - for( sal_uInt16 n = 0, nCnt = rDoc.GetPageDescCnt(); n < nCnt; ++n ) + for( size_t n = 0, nCnt = rDoc.GetPageDescCnt(); n < nCnt; ++n ) { rArr.push_back( &rDoc.GetPageDesc( n ) ); } @@ -1618,7 +1618,7 @@ static void lcl_SaveStyles( sal_uInt16 nFamily, std::vector<void*>& rArr, SwDoc& case SFX_STYLE_FAMILY_PSEUDO: { const SwNumRuleTbl& rTbl = rDoc.GetNumRuleTbl(); - for( sal_uInt16 n = 0, nCnt = rTbl.size(); n < nCnt; ++n ) + for( size_t n = 0, nCnt = rTbl.size(); n < nCnt; ++n ) { rArr.push_back( rTbl[ n ] ); } @@ -1634,7 +1634,7 @@ static bool lcl_Contains(const std::vector<void*>& rArr, const void* p) static void lcl_DeleteInfoStyles( sal_uInt16 nFamily, std::vector<void*>& rArr, SwDoc& rDoc ) { - sal_uInt16 n, nCnt; + size_t n, nCnt; switch( nFamily ) { case SFX_STYLE_FAMILY_CHAR: @@ -1681,7 +1681,7 @@ static void lcl_DeleteInfoStyles( sal_uInt16 nFamily, std::vector<void*>& rArr, case SFX_STYLE_FAMILY_PAGE: { - std::deque<sal_uInt16> aDelArr; + std::deque<size_t> aDelArr; for( n = 0, nCnt = rDoc.GetPageDescCnt(); n < nCnt; ++n ) { if( !lcl_Contains( rArr, &rDoc.GetPageDesc( n ) )) @@ -2281,7 +2281,7 @@ void SwDocStyleSheetPool::Replace( SfxStyleSheetBase& rSource, { const SwFmt *pSourceFmt = 0; SwFmt *pTargetFmt = 0; - sal_uInt16 nPgDscPos = USHRT_MAX; + size_t nPgDscPos = SIZE_MAX; switch( eFamily ) { case SFX_STYLE_FAMILY_CHAR : @@ -2319,15 +2319,14 @@ void SwDocStyleSheetPool::Replace( SfxStyleSheetBase& rSource, { if( pSourceFmt ) pTargetFmt->DelDiffs( *pSourceFmt ); - else if( USHRT_MAX != nPgDscPos ) + else if( SIZE_MAX != nPgDscPos ) pTargetFmt->ResetFmtAttr( RES_PAGEDESC, RES_FRMATR_END-1 ); else { // #i73790# - method renamed pTargetFmt->ResetAllFmtAttr(); } - - if( USHRT_MAX != nPgDscPos ) + if( SIZE_MAX != nPgDscPos ) rDoc.ChgPageDesc( nPgDscPos, rDoc.GetPageDesc(nPgDscPos) ); } @@ -2593,8 +2592,8 @@ SfxStyleSheetBase* SwStyleSheetIterator::First() if( nSearchFamily == SFX_STYLE_FAMILY_CHAR || nSearchFamily == SFX_STYLE_FAMILY_ALL ) { - const sal_uInt16 nArrLen = rDoc.GetCharFmts()->size(); - for( sal_uInt16 i = 0; i < nArrLen; i++ ) + const size_t nArrLen = rDoc.GetCharFmts()->size(); + for( size_t i = 0; i < nArrLen; i++ ) { SwCharFmt* pFmt = (*rDoc.GetCharFmts())[ i ]; @@ -2676,8 +2675,8 @@ SfxStyleSheetBase* SwStyleSheetIterator::First() nSMask = SWSTYLEBIT_HTML; } - const sal_uInt16 nArrLen = rDoc.GetTxtFmtColls()->size(); - for( sal_uInt16 i = 0; i < nArrLen; i++ ) + const size_t nArrLen = rDoc.GetTxtFmtColls()->size(); + for( size_t i = 0; i < nArrLen; i++ ) { SwTxtFmtColl* pColl = (*rDoc.GetTxtFmtColls())[ i ]; @@ -2822,8 +2821,8 @@ SfxStyleSheetBase* SwStyleSheetIterator::First() if( nSearchFamily == SFX_STYLE_FAMILY_FRAME || nSearchFamily == SFX_STYLE_FAMILY_ALL ) { - const sal_uInt16 nArrLen = rDoc.GetFrmFmts()->size(); - for( sal_uInt16 i = 0; i < nArrLen; i++ ) + const size_t nArrLen = rDoc.GetFrmFmts()->size(); + for( size_t i = 0; i < nArrLen; i++ ) { const SwFrmFmt* pFmt = (*rDoc.GetFrmFmts())[ i ]; @@ -2858,8 +2857,8 @@ SfxStyleSheetBase* SwStyleSheetIterator::First() if( nSearchFamily == SFX_STYLE_FAMILY_PAGE || nSearchFamily == SFX_STYLE_FAMILY_ALL ) { - const sal_uInt16 nCount = rDoc.GetPageDescCnt(); - for(sal_uInt16 i = 0; i < nCount; ++i) + const size_t nCount = rDoc.GetPageDescCnt(); + for(size_t i = 0; i < nCount; ++i) { const SwPageDesc& rDesc = rDoc.GetPageDesc(i); const sal_uInt16 nId = rDesc.GetPoolFmtId(); diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx index 3be5b835e260..0edb99813184 100644 --- a/sw/source/uibase/shells/basesh.cxx +++ b/sw/source/uibase/shells/basesh.cxx @@ -743,7 +743,7 @@ void SwBaseShell::Execute(SfxRequest &rReq) if (pArgs) { // Determine the current PageDescriptor and fill the set with that. - const sal_uInt16 nCurIdx = rSh.GetCurPageDesc(); + const size_t nCurIdx = rSh.GetCurPageDesc(); SwPageDesc aPageDesc(rSh.GetPageDesc(nCurIdx)); SwFrmFmt &rFmt = aPageDesc.GetMaster(); @@ -2374,7 +2374,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) { if( !bBackground ) { - const sal_uInt16 nCurIdx = rSh.GetCurPageDesc(); + const size_t nCurIdx = rSh.GetCurPageDesc(); const SwPageDesc& rPageDesc = rSh.GetPageDesc( nCurIdx ); // Temporary view, because the shell does not need to be valid after the dialogue // for example disable header diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index efebf89a8534..96012b98a3b5 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -882,7 +882,7 @@ void SwView::Execute(SfxRequest &rReq) { if(pArgs) { - const sal_uInt16 nCurIdx = m_pWrtShell->GetCurPageDesc(); + const size_t nCurIdx = m_pWrtShell->GetCurPageDesc(); SwPageDesc aPageDesc( m_pWrtShell->GetPageDesc( nCurIdx ) ); ::ItemSetToPageDesc( *pArgs, aPageDesc ); // change the descriptor of the core @@ -973,7 +973,7 @@ void SwView::Execute(SfxRequest &rReq) { if(pArgs && SfxItemState::SET == pArgs->GetItemState(RES_BACKGROUND, false, &pItem)) { - const sal_uInt16 nCurIdx = m_pWrtShell->GetCurPageDesc(); + const size_t nCurIdx = m_pWrtShell->GetCurPageDesc(); SwPageDesc aDesc( m_pWrtShell->GetPageDesc( nCurIdx )); SwFrmFmt& rMaster = aDesc.GetMaster(); rMaster.SetFmtAttr(*pItem); @@ -2019,11 +2019,11 @@ bool SwView::JumpToSwMark( const OUString& rMark ) // Undo "Insert form file" crashes with documents imported from binary filter (.sdw) => disabled // Undo "Insert form file" crashes with (.odt) documents crashes if these documents contains // page styles with active header/footer => disabled for those documents -static sal_uInt16 lcl_PageDescWithHeader( const SwDoc& rDoc ) +static size_t lcl_PageDescWithHeader( const SwDoc& rDoc ) { - sal_uInt16 nRet = 0; - sal_uInt16 nCnt = rDoc.GetPageDescCnt(); - for( sal_uInt16 i = 0; i < nCnt; ++i ) + size_t nRet = 0; + size_t nCnt = rDoc.GetPageDescCnt(); + for( size_t i = 0; i < nCnt; ++i ) { const SwPageDesc& rPageDesc = rDoc.GetPageDesc( i ); const SwFrmFmt& rMaster = rPageDesc.GetMaster(); @@ -2152,7 +2152,7 @@ long SwView::InsertMedium( sal_uInt16 nSlotId, SfxMedium* pMedium, sal_Int16 nVe if( pRead || (pMedium->GetFilter()->GetFilterFlags() & SfxFilterFlags::STARONEFILTER) ) { - sal_uInt16 nUndoCheck = 0; + size_t nUndoCheck = 0; SwDoc *pDoc = pDocSh->GetDoc(); if( pRead && pDocSh->GetDoc() ) nUndoCheck = lcl_PageDescWithHeader( *pDoc ); diff --git a/sw/source/uibase/uiview/viewstat.cxx b/sw/source/uibase/uiview/viewstat.cxx index b2aafe025565..29a6f207d188 100644 --- a/sw/source/uibase/uiview/viewstat.cxx +++ b/sw/source/uibase/uiview/viewstat.cxx @@ -148,7 +148,7 @@ void SwView::GetState(SfxItemSet &rSet) case RES_PAPER_BIN: case FN_PARAM_FTN_INFO: { - const sal_uInt16 nCurIdx = m_pWrtShell->GetCurPageDesc(); + const size_t nCurIdx = m_pWrtShell->GetCurPageDesc(); const SwPageDesc& rDesc = m_pWrtShell->GetPageDesc( nCurIdx ); //UUUU set correct parent to get the XFILL_NONE FillStyle as needed @@ -165,7 +165,7 @@ void SwView::GetState(SfxItemSet &rSet) case RES_BACKGROUND: case SID_ATTR_BRUSH: { - const sal_uInt16 nCurIdx = m_pWrtShell->GetCurPageDesc(); + const size_t nCurIdx = m_pWrtShell->GetCurPageDesc(); const SwPageDesc& rDesc = m_pWrtShell->GetPageDesc( nCurIdx ); const SwFrmFmt& rMaster = rDesc.GetMaster(); const SvxBrushItem& rBrush = static_cast<const SvxBrushItem&>( diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx index 4ba0ed93be95..ae04fafdc26e 100644 --- a/sw/source/uibase/uiview/viewtab.cxx +++ b/sw/source/uibase/uiview/viewtab.cxx @@ -231,7 +231,7 @@ void SwView::ExecTabWin( SfxRequest& rReq ) const sal_uInt16 nSlot = rReq.GetSlot(); const SfxItemSet* pReqArgs = rReq.GetArgs(); - const sal_uInt16 nDescId = rSh.GetCurPageDesc(); + const size_t nDescId = rSh.GetCurPageDesc(); const SwPageDesc& rDesc = rSh.GetPageDesc( nDescId ); const bool bVerticalWriting = rSh.IsInVerticalText(); diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx index 7601a5554332..669b23632179 100644 --- a/sw/source/uibase/wrtsh/wrtsh1.cxx +++ b/sw/source/uibase/wrtsh/wrtsh1.cxx @@ -1752,7 +1752,7 @@ void SwWrtShell::ChangeHeaderOrFooter( StartUndo( UNDO_HEADER_FOOTER ); // #i7983# bool bExecute = true; bool bCrsrSet = false; - for( sal_uInt16 nFrom = 0, nTo = GetPageDescCnt(); + for( size_t nFrom = 0, nTo = GetPageDescCnt(); nFrom < nTo; ++nFrom ) { SwPageDesc aDesc( GetPageDesc( nFrom )); @@ -1805,7 +1805,7 @@ void SwWrtShell::ChangeHeaderOrFooter( if ( !IsHeaderFooterEdit() ) ToggleHeaderFooterEdit(); bCrsrSet = SetCrsrInHdFt( - rStyleName.isEmpty() ? (sal_uInt16)0xFFFF : nFrom, + rStyleName.isEmpty() ? SIZE_MAX : nFrom, bHeader ); } } |