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 /sw/source/uibase | |
parent | dcce3f7fd50b05593e77d7ff43735c5694e9422b (diff) |
tdf#89783: Allow more than 64k PageDescs
+ adjust related code using the functionality
Change-Id: I6fa4ad04137643009ee39522c36d6c9e6f3d2502
Diffstat (limited to 'sw/source/uibase')
-rw-r--r-- | sw/source/uibase/app/appenv.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/app/docst.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/app/docstyle.cxx | 41 | ||||
-rw-r--r-- | sw/source/uibase/shells/basesh.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/uiview/view2.cxx | 14 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewstat.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewtab.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/wrtsh/wrtsh1.cxx | 4 |
8 files changed, 37 insertions, 38 deletions
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 ); } } |