diff options
28 files changed, 106 insertions, 106 deletions
diff --git a/cui/source/dialogs/linkdlg.cxx b/cui/source/dialogs/linkdlg.cxx index b61e7213079b..5df9370a9b3d 100644 --- a/cui/source/dialogs/linkdlg.cxx +++ b/cui/source/dialogs/linkdlg.cxx @@ -283,7 +283,7 @@ IMPL_LINK_NOARG(SvBaseLinksDlg, UpdateNowClickHdl) SvBaseLinkRef xLink = aLnkArr[ n ]; // first look for the entry in the array - for( sal_uInt16 i = 0; i < pLinkMgr->GetLinks().Count(); ++i ) + for( sal_uInt16 i = 0; i < pLinkMgr->GetLinks().size(); ++i ) if( &xLink == *pLinkMgr->GetLinks()[ i ] ) { xLink->SetUseCache( sal_False ); @@ -513,7 +513,7 @@ IMPL_LINK( SvBaseLinksDlg, EndEditHdl, sfx2::SvBaseLink*, _pLink ) // anymore, fill the list completely new. Otherwise only the // edited link needs to be refreshed. sal_Bool bLinkFnd = sal_False; - for( sal_uInt16 n = pLinkMgr->GetLinks().Count(); n; ) + for( sal_uInt16 n = pLinkMgr->GetLinks().size(); n; ) if( _pLink == &(*pLinkMgr->GetLinks()[ --n ]) ) { bLinkFnd = sal_True; @@ -575,12 +575,12 @@ void SvBaseLinksDlg::SetManager( LinkManager* pNewMgr ) if( pLinkMgr ) { SvBaseLinks& rLnks = (SvBaseLinks&)pLinkMgr->GetLinks(); - for( sal_uInt16 n = 0; n < rLnks.Count(); ++n ) + for( sal_uInt16 n = 0; n < rLnks.size(); ++n ) { SvBaseLinkRef* pLinkRef = rLnks[ n ]; if( !pLinkRef->Is() ) { - rLnks.Remove( n, 1 ); + rLnks.erase( rLnks.begin() + n ); --n; continue; } @@ -588,7 +588,7 @@ void SvBaseLinksDlg::SetManager( LinkManager* pNewMgr ) InsertEntry( **pLinkRef ); } - if( rLnks.Count() ) + if( !rLnks.empty() ) { SvLBoxEntry* pEntry = Links().GetEntry( 0 ); Links().SetCurEntry( pEntry ); @@ -673,7 +673,7 @@ void SvBaseLinksDlg::SetActLink( SvBaseLink * pLink ) { const SvBaseLinks& rLnks = pLinkMgr->GetLinks(); sal_uInt16 nSelect = 0; - for( sal_uInt16 n = 0; n < rLnks.Count(); ++n ) + for( sal_uInt16 n = 0; n < rLnks.size(); ++n ) { SvBaseLinkRef* pLinkRef = rLnks[ n ]; // #109573# only visible links have been inserted into the TreeListBox, diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx index 6fcb80e897f0..241985935641 100644 --- a/sc/source/core/data/documen2.cxx +++ b/sc/source/core/data/documen2.cxx @@ -378,8 +378,8 @@ ScDocument::~ScDocument() for( ::sfx2::SvLinkSources::const_iterator it = aTemp.begin(); it != aTemp.end(); ++it ) (*it)->Closed(); - if ( pLinkManager->GetLinks().Count() ) - pLinkManager->Remove( 0, pLinkManager->GetLinks().Count() ); + if ( pLinkManager->GetLinks().size() ) + pLinkManager->Remove( 0, pLinkManager->GetLinks().size() ); } mxFormulaParserPool.reset(); diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx index 1d1407803cf7..11a640c87725 100644 --- a/sc/source/core/data/documen8.cxx +++ b/sc/source/core/data/documen8.cxx @@ -908,7 +908,7 @@ bool ScDocument::IdleCheckLinks() // true = demnaechst wieder versuche if (GetLinkManager()) { const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks(); - sal_uInt16 nCount = rLinks.Count(); + sal_uInt16 nCount = rLinks.size(); for (sal_uInt16 i=0; i<nCount; i++) { ::sfx2::SvBaseLink* pBase = *rLinks[i]; @@ -934,7 +934,7 @@ void ScDocument::SaveDdeLinks(SvStream& rStream) const bool bExport40 = ( rStream.GetVersion() <= SOFFICE_FILEFORMAT_40 ); const ::sfx2::SvBaseLinks& rLinks = GetLinkManager()->GetLinks(); - sal_uInt16 nCount = rLinks.Count(); + sal_uInt16 nCount = rLinks.size(); // erstmal zaehlen... @@ -987,7 +987,7 @@ bool ScDocument::HasDdeLinks() const if (GetLinkManager()) // Clipboard z.B. hat keinen LinkManager { const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks(); - sal_uInt16 nCount = rLinks.Count(); + sal_uInt16 nCount = rLinks.size(); for (sal_uInt16 i=0; i<nCount; i++) if ((*rLinks[i])->ISA(ScDdeLink)) return true; @@ -1015,7 +1015,7 @@ void ScDocument::UpdateExternalRefLinks(Window* pWin) return; const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks(); - sal_uInt16 nCount = rLinks.Count(); + sal_uInt16 nCount = rLinks.size(); bool bAny = false; for (sal_uInt16 i = 0; i < nCount; ++i) @@ -1069,7 +1069,7 @@ void ScDocument::UpdateDdeLinks(Window* pWin) if (GetLinkManager()) { const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks(); - sal_uInt16 nCount = rLinks.Count(); + sal_uInt16 nCount = rLinks.size(); sal_uInt16 i; // falls das Updaten laenger dauert, erstmal alle Werte @@ -1128,7 +1128,7 @@ bool ScDocument::UpdateDdeLink( const rtl::OUString& rAppl, const rtl::OUString& if (GetLinkManager()) { const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks(); - sal_uInt16 nCount = rLinks.Count(); + sal_uInt16 nCount = rLinks.size(); for (sal_uInt16 i=0; i<nCount; i++) { ::sfx2::SvBaseLink* pBase = *rLinks[i]; @@ -1154,7 +1154,7 @@ void ScDocument::DisconnectDdeLinks() if (GetLinkManager()) { const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks(); - sal_uInt16 nCount = rLinks.Count(); + sal_uInt16 nCount = rLinks.size(); for (sal_uInt16 i=0; i<nCount; i++) { ::sfx2::SvBaseLink* pBase = *rLinks[i]; @@ -1177,7 +1177,7 @@ void ScDocument::CopyDdeLinks( ScDocument* pDestDoc ) const else if (GetLinkManager()) // Links direkt kopieren { const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks(); - sal_uInt16 nCount = rLinks.Count(); + sal_uInt16 nCount = rLinks.size(); for (sal_uInt16 i=0; i<nCount; i++) { ::sfx2::SvBaseLink* pBase = *rLinks[i]; @@ -1198,7 +1198,7 @@ sal_uInt16 ScDocument::GetDdeLinkCount() const if (GetLinkManager()) { const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks(); - sal_uInt16 nCount = rLinks.Count(); + sal_uInt16 nCount = rLinks.size(); for (sal_uInt16 i=0; i<nCount; i++) if ((*rLinks[i])->ISA(ScDdeLink)) ++nDdeCount; @@ -1222,7 +1222,7 @@ ScDdeLink* lclGetDdeLink( if( pLinkManager ) { const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks(); - sal_uInt16 nCount = rLinks.Count(); + sal_uInt16 nCount = rLinks.size(); if( pnDdePos ) *pnDdePos = 0; for( sal_uInt16 nIndex = 0; nIndex < nCount; ++nIndex ) { @@ -1249,7 +1249,7 @@ ScDdeLink* lclGetDdeLink( const sfx2::LinkManager* pLinkManager, sal_uInt16 nDde if( pLinkManager ) { const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks(); - sal_uInt16 nCount = rLinks.Count(); + sal_uInt16 nCount = rLinks.size(); sal_uInt16 nDdeIndex = 0; // counts only the DDE links for( sal_uInt16 nIndex = 0; nIndex < nCount; ++nIndex ) { @@ -1345,7 +1345,7 @@ bool ScDocument::HasAreaLinks() const if (GetLinkManager()) // Clipboard z.B. hat keinen LinkManager { const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks(); - sal_uInt16 nCount = rLinks.Count(); + sal_uInt16 nCount = rLinks.size(); for (sal_uInt16 i=0; i<nCount; i++) if ((*rLinks[i])->ISA(ScAreaLink)) return true; @@ -1359,7 +1359,7 @@ void ScDocument::UpdateAreaLinks() if (GetLinkManager()) { const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks(); - sal_uInt16 nCount = rLinks.Count(); + sal_uInt16 nCount = rLinks.size(); for (sal_uInt16 i=0; i<nCount; i++) { ::sfx2::SvBaseLink* pBase = *rLinks[i]; @@ -1375,7 +1375,7 @@ void ScDocument::DeleteAreaLinksOnTab( SCTAB nTab ) { const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks(); sal_uInt16 nPos = 0; - while ( nPos < rLinks.Count() ) + while ( nPos < rLinks.size() ) { const ::sfx2::SvBaseLink* pBase = *rLinks[nPos]; if ( pBase->ISA(ScAreaLink) && @@ -1395,7 +1395,7 @@ void ScDocument::UpdateRefAreaLinks( UpdateRefMode eUpdateRefMode, bool bAnyUpdate = false; const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks(); - sal_uInt16 nCount = rLinks.Count(); + sal_uInt16 nCount = rLinks.size(); for (sal_uInt16 i=0; i<nCount; i++) { ::sfx2::SvBaseLink* pBase = *rLinks[i]; @@ -1446,7 +1446,7 @@ void ScDocument::UpdateRefAreaLinks( UpdateRefMode eUpdateRefMode, { // remove the first link, exit the inner loop, don't increment nFirstIndex pLinkManager->Remove( pFirst ); - nCount = rLinks.Count(); + nCount = rLinks.size(); bFound = true; } } diff --git a/sc/source/core/tool/ddelink.cxx b/sc/source/core/tool/ddelink.cxx index 5d36e5281d9b..5bac102f9fb1 100644 --- a/sc/source/core/tool/ddelink.cxx +++ b/sc/source/core/tool/ddelink.cxx @@ -238,7 +238,7 @@ void ScDdeLink::ListenersGone() sfx2::LinkManager* pLinkMgr = pDoc->GetLinkManager(); pLinkMgr->Remove( this); // deletes this - if ( !pLinkMgr->GetLinks().Count() ) // letzten geloescht ? + if ( pLinkMgr->GetLinks().empty() ) // letzten geloescht ? { SfxBindings* pBindings = pStackDoc->GetViewBindings(); // don't use member pDoc! if (pBindings) diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx index 18609d4948b3..e359a3de0fab 100644 --- a/sc/source/core/tool/interpr2.cxx +++ b/sc/source/core/tool/interpr2.cxx @@ -2230,7 +2230,7 @@ void ScInterpreter::ScStyle() ScDdeLink* lcl_GetDdeLink( sfx2::LinkManager* pLinkMgr, const String& rA, const String& rT, const String& rI, sal_uInt8 nM ) { - sal_uInt16 nCount = pLinkMgr->GetLinks().Count(); + sal_uInt16 nCount = pLinkMgr->GetLinks().size(); for (sal_uInt16 i=0; i<nCount; i++ ) { ::sfx2::SvBaseLink* pBase = *pLinkMgr->GetLinks()[i]; @@ -2301,7 +2301,7 @@ void ScInterpreter::ScDde() { pLink = new ScDdeLink( pDok, aAppl, aTopic, aItem, nMode ); pLinkMgr->InsertDDELink( pLink, aAppl, aTopic, aItem ); - if ( pLinkMgr->GetLinks().Count() == 1 ) // erster ? + if ( pLinkMgr->GetLinks().size() == 1 ) // erster ? { SfxBindings* pBindings = pDok->GetViewBindings(); if (pBindings) diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index a58170617786..a7c7ab0015c3 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -4984,7 +4984,7 @@ sal_Bool ScDocFunc::InsertAreaLink( const String& rFile, const String& rFilter, // remove them first (file format specifies only one link definition // for a cell) - sal_uInt16 nLinkCount = pLinkManager->GetLinks().Count(); + sal_uInt16 nLinkCount = pLinkManager->GetLinks().size(); sal_uInt16 nRemoved = 0; sal_uInt16 nLinkPos = 0; while (nLinkPos<nLinkCount) @@ -5009,7 +5009,7 @@ sal_Bool ScDocFunc::InsertAreaLink( const String& rFile, const String& rFilter, pOldArea->GetSource(), pOldArea->GetDestArea(), pOldArea->GetRefreshDelay() ) ); } pLinkManager->Remove( pBase ); - nLinkCount = pLinkManager->GetLinks().Count(); + nLinkCount = pLinkManager->GetLinks().size(); ++nRemoved; } else diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx index e72c143c1945..e88bd5ecf136 100644 --- a/sc/source/ui/docshell/docsh6.cxx +++ b/sc/source/ui/docshell/docsh6.cxx @@ -385,7 +385,7 @@ void ScDocShell::UpdateLinks() // nicht mehr benutzte Links raus - sal_uInt16 nCount = pLinkManager->GetLinks().Count(); + sal_uInt16 nCount = pLinkManager->GetLinks().size(); for (sal_uInt16 k=nCount; k>0; ) { --k; @@ -450,7 +450,7 @@ sal_Bool ScDocShell::ReloadTabLinks() sfx2::LinkManager* pLinkManager = aDocument.GetLinkManager(); sal_Bool bAny = false; - sal_uInt16 nCount = pLinkManager->GetLinks().Count(); + sal_uInt16 nCount = pLinkManager->GetLinks().size(); for (sal_uInt16 i=0; i<nCount; i++ ) { ::sfx2::SvBaseLink* pBase = *pLinkManager->GetLinks()[i]; diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx index 1f9c5d89f0f2..3540c22bb985 100644 --- a/sc/source/ui/navipi/content.cxx +++ b/sc/source/ui/navipi/content.cxx @@ -814,7 +814,7 @@ void ScContentTree::GetLinkNames() sfx2::LinkManager* pLinkManager = pDoc->GetLinkManager(); OSL_ENSURE(pLinkManager, "kein LinkManager am Dokument?"); const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks(); - sal_uInt16 nCount = rLinks.Count(); + sal_uInt16 nCount = rLinks.size(); for (sal_uInt16 i=0; i<nCount; i++) { ::sfx2::SvBaseLink* pBase = *rLinks[i]; @@ -835,7 +835,7 @@ const ScAreaLink* ScContentTree::GetLink( sal_uLong nIndex ) sfx2::LinkManager* pLinkManager = pDoc->GetLinkManager(); OSL_ENSURE(pLinkManager, "kein LinkManager am Dokument?"); const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks(); - sal_uInt16 nCount = rLinks.Count(); + sal_uInt16 nCount = rLinks.size(); for (sal_uInt16 i=0; i<nCount; i++) { ::sfx2::SvBaseLink* pBase = *rLinks[i]; diff --git a/sc/source/ui/undo/areasave.cxx b/sc/source/ui/undo/areasave.cxx index f91460b3b91e..28d88c272665 100644 --- a/sc/source/ui/undo/areasave.cxx +++ b/sc/source/ui/undo/areasave.cxx @@ -113,7 +113,7 @@ bool ScAreaLinkSaveCollection::IsEqual( const ScDocument* pDoc ) const { size_t nPos = 0; const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks(); - sal_uInt16 nLinkCount = rLinks.Count(); + sal_uInt16 nLinkCount = rLinks.size(); for (sal_uInt16 i=0; i<nLinkCount; i++) { ::sfx2::SvBaseLink* pBase = *rLinks[i]; @@ -134,7 +134,7 @@ bool ScAreaLinkSaveCollection::IsEqual( const ScDocument* pDoc ) const ScAreaLink* lcl_FindLink( const ::sfx2::SvBaseLinks& rLinks, const ScAreaLinkSaver& rSaver ) { - sal_uInt16 nLinkCount = rLinks.Count(); + sal_uInt16 nLinkCount = rLinks.size(); for (sal_uInt16 i=0; i<nLinkCount; i++) { ::sfx2::SvBaseLink* pBase = *rLinks[i]; @@ -179,7 +179,7 @@ ScAreaLinkSaveCollection* ScAreaLinkSaveCollection::CreateFromDoc( const ScDocum if (pLinkManager) { const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks(); - sal_uInt16 nLinkCount = rLinks.Count(); + sal_uInt16 nLinkCount = rLinks.size(); for (sal_uInt16 i=0; i<nLinkCount; i++) { ::sfx2::SvBaseLink* pBase = *rLinks[i]; diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx index 2340da7c26ab..13522ad62f15 100644 --- a/sc/source/ui/undo/undoblk3.cxx +++ b/sc/source/ui/undo/undoblk3.cxx @@ -1773,7 +1773,7 @@ ScAreaLink* lcl_FindAreaLink( sfx2::LinkManager* pLinkManager, const String& rDo const String& rSrc, const ScRange& rDest ) { const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks(); - sal_uInt16 nCount = pLinkManager->GetLinks().Count(); + sal_uInt16 nCount = pLinkManager->GetLinks().size(); for (sal_uInt16 i=0; i<nCount; i++) { ::sfx2::SvBaseLink* pBase = *rLinks[i]; diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index 0f7e3278e565..4c7cb9097a54 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -7753,7 +7753,7 @@ void SAL_CALL ScTableSheetObj::link( const rtl::OUString& aUrl, const rtl::OUStr //! Update nur fuer die betroffene Tabelle??? sfx2::LinkManager* pLinkManager = pDoc->GetLinkManager(); - sal_uInt16 nCount = pLinkManager->GetLinks().Count(); + sal_uInt16 nCount = pLinkManager->GetLinks().size(); for ( sal_uInt16 i=0; i<nCount; i++ ) { ::sfx2::SvBaseLink* pBase = *pLinkManager->GetLinks()[i]; diff --git a/sc/source/ui/unoobj/linkuno.cxx b/sc/source/ui/unoobj/linkuno.cxx index b5d327f5f8cd..4986f514450c 100644 --- a/sc/source/ui/unoobj/linkuno.cxx +++ b/sc/source/ui/unoobj/linkuno.cxx @@ -122,7 +122,7 @@ ScTableLink* ScSheetLinkObj::GetLink_Impl() const if (pDocShell) { sfx2::LinkManager* pLinkManager = pDocShell->GetDocument()->GetLinkManager(); - sal_uInt16 nCount = pLinkManager->GetLinks().Count(); + sal_uInt16 nCount = pLinkManager->GetLinks().size(); for (sal_uInt16 i=0; i<nCount; i++) { ::sfx2::SvBaseLink* pBase = *pLinkManager->GetLinks()[i]; @@ -596,7 +596,7 @@ ScAreaLink* lcl_GetAreaLink( ScDocShell* pDocShell, sal_uInt16 nPos ) if (pDocShell) { sfx2::LinkManager* pLinkManager = pDocShell->GetDocument()->GetLinkManager(); - sal_uInt16 nTotalCount = pLinkManager->GetLinks().Count(); + sal_uInt16 nTotalCount = pLinkManager->GetLinks().size(); sal_uInt16 nAreaCount = 0; for (sal_uInt16 i=0; i<nTotalCount; i++) { @@ -1014,7 +1014,7 @@ sal_Int32 SAL_CALL ScAreaLinksObj::getCount() throw(uno::RuntimeException) if (pDocShell) { sfx2::LinkManager* pLinkManager = pDocShell->GetDocument()->GetLinkManager(); - sal_uInt16 nTotalCount = pLinkManager->GetLinks().Count(); + sal_uInt16 nTotalCount = pLinkManager->GetLinks().size(); for (sal_uInt16 i=0; i<nTotalCount; i++) { ::sfx2::SvBaseLink* pBase = *pLinkManager->GetLinks()[i]; diff --git a/sc/source/ui/vba/vbaquerytable.cxx b/sc/source/ui/vba/vbaquerytable.cxx index 03e734a81548..aa4f8d01e62a 100644 --- a/sc/source/ui/vba/vbaquerytable.cxx +++ b/sc/source/ui/vba/vbaquerytable.cxx @@ -67,7 +67,7 @@ ScVbaQueryTable::Refresh( const ::com::sun::star::uno::Any& /*aBackgroundQuery*/ //Get link info sfx2::LinkManager *pLinkMng = m_pDocument->GetLinkManager(); const ::sfx2::SvBaseLinks &rLinks = pLinkMng->GetLinks(); - sal_uInt16 nCount = rLinks.Count(); + sal_uInt16 nCount = rLinks.size(); for (sal_uInt16 i=0; i<nCount; i++) { diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx index 61795fa87fb4..6f250b5e834b 100644 --- a/sc/source/ui/view/tabvwshb.cxx +++ b/sc/source/ui/view/tabvwshb.cxx @@ -465,7 +465,7 @@ void ScTabViewShell::GetDrawInsState(SfxItemSet &rSet) case SID_LINKS: { - if (GetViewData()->GetDocument()->GetLinkManager()->GetLinks().Count() == 0 ) + if (GetViewData()->GetDocument()->GetLinkManager()->GetLinks().empty()) rSet.DisableItem( SID_LINKS ); } break; diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx index e897fc561a27..4c7c98985ab9 100644 --- a/sd/source/core/drawdoc.cxx +++ b/sd/source/core/drawdoc.cxx @@ -399,9 +399,9 @@ SdDrawDocument::~SdDrawDocument() if (pLinkManager) { // BaseLinks freigeben - if ( pLinkManager->GetLinks().Count() ) + if ( !pLinkManager->GetLinks().empty() ) { - pLinkManager->Remove( 0, pLinkManager->GetLinks().Count() ); + pLinkManager->Remove( 0, pLinkManager->GetLinks().size() ); } delete pLinkManager; @@ -714,7 +714,7 @@ void SdDrawDocument::NewOrLoadCompleted(DocCreationMode eMode) /** updates all links, only links in this document should by resolved */ void SdDrawDocument::UpdateAllLinks() { - if ( !pDocLockedInsertingLinks && pLinkManager && pLinkManager->GetLinks().Count() ) + if ( !pDocLockedInsertingLinks && pLinkManager && !pLinkManager->GetLinks().empty() ) { pDocLockedInsertingLinks = this; // lock inserting links. only links in this document should by resolved diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx index 819debc6c6c5..f423d3f2d1ec 100644 --- a/sd/source/core/drawdoc2.cxx +++ b/sd/source/core/drawdoc2.cxx @@ -891,7 +891,7 @@ sal_Bool SdDrawDocument::MovePages(sal_uInt16 nTargetPage) sal_uLong SdDrawDocument::GetLinkCount() { - return ( pLinkManager->GetLinks().Count() ); + return pLinkManager->GetLinks().size(); } /************************************************************************* diff --git a/sfx2/inc/sfx2/linkmgr.hxx b/sfx2/inc/sfx2/linkmgr.hxx index f9fd7d577ee4..87b7729ebecd 100644 --- a/sfx2/inc/sfx2/linkmgr.hxx +++ b/sfx2/inc/sfx2/linkmgr.hxx @@ -32,7 +32,6 @@ #include "sfx2/dllapi.h" #include <sfx2/linksrc.hxx> #include <tools/string.hxx> -#include <svl/svarray.hxx> #include <vector> #include <set> @@ -57,8 +56,7 @@ namespace sfx2 class SvBaseLink; class SvBaseLinkRef; -typedef SvBaseLinkRef* SvBaseLinkRefPtr; -SV_DECL_PTRARR( SvBaseLinks, SvBaseLinkRefPtr, 1 ) +typedef std::vector<SvBaseLinkRef*> SvBaseLinks; typedef std::set<SvLinkSource*> SvLinkSources; diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx index be02f9fadafc..b397b3b2b3a8 100644 --- a/sfx2/source/appl/linkmgr2.cxx +++ b/sfx2/source/appl/linkmgr2.cxx @@ -74,8 +74,6 @@ public: }; -SV_IMPL_PTRARR( SvBaseLinks, SvBaseLinkRefPtr ) - LinkManager::LinkManager(SfxObjectShell* p) : pPersist( p ) { @@ -84,15 +82,15 @@ LinkManager::LinkManager(SfxObjectShell* p) LinkManager::~LinkManager() { - SvBaseLinkRef** ppRef = (SvBaseLinkRef**)aLinkTbl.GetData(); - for( sal_uInt16 n = aLinkTbl.Count(); n; --n, ++ppRef ) + for( sal_uInt16 n = 0; n < aLinkTbl.size(); ++n) { - if( (*ppRef)->Is() ) + SvBaseLinkRef* pTmp = aLinkTbl[ n ]; + if( pTmp->Is() ) { - (*(*ppRef))->Disconnect(); - (*(*ppRef))->SetLinkManager( NULL ); + (*pTmp)->Disconnect(); + (*pTmp)->SetLinkManager( NULL ); } - delete *ppRef; + delete pTmp; } } @@ -121,48 +119,49 @@ void LinkManager::Remove( SvBaseLink *pLink ) { // No duplicate links inserted int bFound = sal_False; - SvBaseLinkRef** ppRef = (SvBaseLinkRef**)aLinkTbl.GetData(); - for( sal_uInt16 n = aLinkTbl.Count(); n; --n, ++ppRef ) + for( sal_uInt16 n = 0; n < aLinkTbl.size(); ) { - if( pLink == *(*ppRef) ) + SvBaseLinkRef* pTmp = aLinkTbl[ n ]; + if( pLink == *pTmp ) { - (*(*ppRef))->Disconnect(); - (*(*ppRef))->SetLinkManager( NULL ); - (*(*ppRef)).Clear(); + (*pTmp)->Disconnect(); + (*pTmp)->SetLinkManager( NULL ); + (*pTmp).Clear(); bFound = sal_True; } - // Remove emty ones if they exist - if( !(*ppRef)->Is() ) + // Remove empty ones if they exist + if( !pTmp->Is() ) { - delete *ppRef; - aLinkTbl.Remove( aLinkTbl.Count() - n, 1 ); + delete pTmp; + aLinkTbl.erase( aLinkTbl.begin() + n ); if( bFound ) return ; - --ppRef; } + else + ++n; } } void LinkManager::Remove( sal_uInt16 nPos, sal_uInt16 nCnt ) { - if( nCnt && nPos < aLinkTbl.Count() ) + if( nCnt && nPos < aLinkTbl.size() ) { - if( nPos + nCnt > aLinkTbl.Count() ) - nCnt = aLinkTbl.Count() - nPos; + if( nPos + nCnt > aLinkTbl.size() ) + nCnt = aLinkTbl.size() - nPos; - SvBaseLinkRef** ppRef = (SvBaseLinkRef**)aLinkTbl.GetData() + nPos; - for( sal_uInt16 n = nCnt; n; --n, ++ppRef ) + for( sal_uInt16 n = nPos; n < nPos + nCnt; ++n) { - if( (*ppRef)->Is() ) + SvBaseLinkRef* pTmp = aLinkTbl[ n ]; + if( pTmp->Is() ) { - (*(*ppRef))->Disconnect(); - (*(*ppRef))->SetLinkManager( NULL ); + (*pTmp)->Disconnect(); + (*pTmp)->SetLinkManager( NULL ); } - delete *ppRef; + delete pTmp; } - aLinkTbl.Remove( nPos, nCnt ); + aLinkTbl.erase( aLinkTbl.begin() + nPos, aLinkTbl.begin() + nPos + nCnt ); } } @@ -170,11 +169,14 @@ void LinkManager::Remove( sal_uInt16 nPos, sal_uInt16 nCnt ) sal_Bool LinkManager::Insert( SvBaseLink* pLink ) { // No duplicate links inserted - for( sal_uInt16 n = 0; n < aLinkTbl.Count(); ++n ) + for( sal_uInt16 n = 0; n < aLinkTbl.size(); ++n ) { SvBaseLinkRef* pTmp = aLinkTbl[ n ]; if( !pTmp->Is() ) - aLinkTbl.DeleteAndDestroy( n-- ); + { + delete pTmp; + aLinkTbl.erase( aLinkTbl.begin() + n-- ); + } if( pLink == *pTmp ) return sal_False; @@ -182,7 +184,7 @@ sal_Bool LinkManager::Insert( SvBaseLink* pLink ) SvBaseLinkRef* pTmp = new SvBaseLinkRef( pLink ); pLink->SetLinkManager( this ); - aLinkTbl.Insert( pTmp, aLinkTbl.Count() ); + aLinkTbl.push_back( pTmp ); return sal_True; } @@ -321,7 +323,7 @@ void LinkManager::UpdateAllLinks( // links in ... no contact between them! SvPtrarr aTmpArr( 255 ); sal_uInt16 n; - for( n = 0; n < aLinkTbl.Count(); ++n ) + for( n = 0; n < aLinkTbl.size(); ++n ) { SvBaseLink* pLink = *aLinkTbl[ n ]; if( !pLink ) @@ -338,7 +340,7 @@ void LinkManager::UpdateAllLinks( // search first in the array after the entry sal_uInt16 nFndPos = USHRT_MAX; - for( sal_uInt16 i = 0; i < aLinkTbl.Count(); ++i ) + for( sal_uInt16 i = 0; i < aLinkTbl.size(); ++i ) if( pLink == *aLinkTbl[ i ] ) { nFndPos = i; @@ -433,7 +435,7 @@ void LinkManager::ReconnectDdeLink(SfxObjectShell& rServer) return; const ::sfx2::SvBaseLinks& rLinks = GetLinks(); - sal_uInt16 n = rLinks.Count(); + sal_uInt16 n = rLinks.size(); for (sal_uInt16 i = 0; i < n; ++i) { @@ -527,7 +529,7 @@ void LinkManager::CancelTransfers() sfx2::SvBaseLink* pLnk; const sfx2::SvBaseLinks& rLnks = GetLinks(); - for( sal_uInt16 n = rLnks.Count(); n; ) + for( sal_uInt16 n = rLnks.size(); n; ) if( 0 != ( pLnk = &(*rLnks[ --n ])) && OBJECT_CLIENT_FILE == (OBJECT_CLIENT_FILE & pLnk->GetObjType()) && 0 != ( pFileObj = (SvFileObject*)pLnk->GetObj() ) ) diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index b7414dbedc02..54e6e421ba47 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -2478,7 +2478,7 @@ bool SwDoc::LinksUpdated() const // embedded alle lokalen Links (Bereiche/Grafiken) ::sfx2::SvBaseLink* lcl_FindNextRemovableLink( const ::sfx2::SvBaseLinks& rLinks, sfx2::LinkManager& rLnkMgr ) { - for( sal_uInt16 n = 0; n < rLinks.Count(); ++n ) + for( sal_uInt16 n = 0; n < rLinks.size(); ++n ) { ::sfx2::SvBaseLink* pLnk = &(*rLinks[ n ]); if( pLnk && @@ -2504,7 +2504,7 @@ bool SwDoc::EmbedAllLinks() sal_Bool bRet = sal_False; sfx2::LinkManager& rLnkMgr = GetLinkManager(); const ::sfx2::SvBaseLinks& rLinks = rLnkMgr.GetLinks(); - if( rLinks.Count() ) + if( !rLinks.empty() ) { ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo()); diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index 2d3e7c15a75c..270d6af262a7 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -516,8 +516,8 @@ SwDoc::~SwDoc() it != aTemp.end(); ++it ) (*it)->Closed(); - if( pLinkMgr->GetLinks().Count() ) - pLinkMgr->Remove( 0, pLinkMgr->GetLinks().Count() ); + if( !pLinkMgr->GetLinks().empty() ) + pLinkMgr->Remove( 0, pLinkMgr->GetLinks().size() ); } // The ChapterNumbers/Numbers need to be deleted before the Templates @@ -928,7 +928,7 @@ void SwDoc::UpdateLinks( sal_Bool bUI ) if ( GetDocShell()) { sal_uInt16 nUpdateDocMode = GetDocShell()->GetUpdateDocMode(); if( (nLinkMode != NEVER || document::UpdateDocMode::FULL_UPDATE == nUpdateDocMode) && - GetLinkManager().GetLinks().Count() && + !GetLinkManager().GetLinks().empty() && SFX_CREATE_MODE_INTERNAL != ( eMode = GetDocShell()->GetCreateMode()) && SFX_CREATE_MODE_ORGANIZER != eMode && diff --git a/sw/source/core/doc/swserv.cxx b/sw/source/core/doc/swserv.cxx index 68093c739758..ceba15f63041 100644 --- a/sw/source/core/doc/swserv.cxx +++ b/sw/source/core/doc/swserv.cxx @@ -248,7 +248,7 @@ sal_Bool SwServerObject::IsLinkInServer( const SwBaseLink* pChkLnk ) const SwServerObject::ServerModes eSave = eType; if( !pChkLnk ) ((SwServerObject*)this)->eType = NONE_SERVER; - for( sal_uInt16 n = rLnks.Count(); n; ) + for( sal_uInt16 n = rLnks.size(); n; ) { const ::sfx2::SvBaseLink* pLnk = &(*rLnks[ --n ]); if( pLnk && OBJECT_CLIENT_GRF != pLnk->GetObjType() && diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx index 156952a60014..7ee67d7eef03 100644 --- a/sw/source/core/docnode/section.cxx +++ b/sw/source/core/docnode/section.cxx @@ -616,7 +616,7 @@ void SwSection::MakeChildLinksVisible( const SwSectionNode& rSectNd ) { const SwNode* pNd; const ::sfx2::SvBaseLinks& rLnks = rSectNd.GetDoc()->GetLinkManager().GetLinks(); - for( sal_uInt16 n = rLnks.Count(); n; ) + for( sal_uInt16 n = rLnks.size(); n; ) { ::sfx2::SvBaseLink* pBLnk = &(*rLnks[ --n ]); if( pBLnk && !pBLnk->IsVisible() && @@ -1132,7 +1132,7 @@ void lcl_BreakSectionLinksInSect( const SwSectionNode& rSectNd ) } const ::sfx2::SvBaseLink* pOwnLink( &(rSectNd.GetSection().GetBaseLink() ) ); const ::sfx2::SvBaseLinks& rLnks = rSectNd.GetDoc()->GetLinkManager().GetLinks(); - for ( sal_uInt16 n = rLnks.Count(); n > 0; ) + for ( sal_uInt16 n = rLnks.size(); n > 0; ) { SwIntrnlSectRefLink* pSectLnk = dynamic_cast<SwIntrnlSectRefLink*>(&(*rLnks[ --n ])); if ( pSectLnk && pSectLnk != pOwnLink && @@ -1143,9 +1143,9 @@ void lcl_BreakSectionLinksInSect( const SwSectionNode& rSectNd ) pSectLnk->GetSectNode()->GetSection().BreakLink(); // for robustness, because link is removed from the link manager - if ( n > rLnks.Count() ) + if ( n > rLnks.size() ) { - n = rLnks.Count(); + n = rLnks.size(); } } } @@ -1165,7 +1165,7 @@ void lcl_UpdateLinksInSect( SwBaseLink& rUpdLnk, SwSectionNode& rSectNd ) aValue <<= ::rtl::OUString( sName ); // beliebiger Name const ::sfx2::SvBaseLinks& rLnks = pDoc->GetLinkManager().GetLinks(); - for( sal_uInt16 n = rLnks.Count(); n; ) + for( sal_uInt16 n = rLnks.size(); n; ) { ::sfx2::SvBaseLink* pLnk = &(*rLnks[ --n ]); if( pLnk && pLnk != &rUpdLnk && @@ -1184,7 +1184,7 @@ void lcl_UpdateLinksInSect( SwBaseLink& rUpdLnk, SwSectionNode& rSectNd ) // ggfs. neu den Link-Pointer wieder suchen, damit nicht einer // ausgelassen oder doppelt gerufen wird. - if( n >= rLnks.Count() && 0 != ( n = rLnks.Count() )) + if( n >= rLnks.size() && 0 != ( n = rLnks.size() )) --n; if( n && pLnk != &(*rLnks[ n ]) ) diff --git a/sw/source/core/docnode/swbaslnk.cxx b/sw/source/core/docnode/swbaslnk.cxx index f8becf2afd9a..1a797f36da64 100644 --- a/sw/source/core/docnode/swbaslnk.cxx +++ b/sw/source/core/docnode/swbaslnk.cxx @@ -243,7 +243,7 @@ void lcl_CallModify( SwGrfNode& rGrfNd, SfxPoolItem& rItem ) bInNotifyLinks = sal_True; const ::sfx2::SvBaseLinks& rLnks = pDoc->GetLinkManager().GetLinks(); - for( sal_uInt16 n = rLnks.Count(); n; ) + for( sal_uInt16 n = rLnks.size(); n; ) { ::sfx2::SvBaseLink* pLnk = &(*rLnks[ --n ]); if( pLnk && OBJECT_CLIENT_GRF == pLnk->GetObjType() && diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx index 151d79528810..f5986c725216 100644 --- a/sw/source/core/graphic/ndgrf.cxx +++ b/sw/source/core/graphic/ndgrf.cxx @@ -992,7 +992,7 @@ void DelAllGrfCacheEntries( SwDoc* pDoc ) const ::sfx2::SvBaseLinks& rLnks = rLnkMgr.GetLinks(); SwGrfNode* pGrfNd; String sFileNm; - for( sal_uInt16 n = rLnks.Count(); n; ) + for( sal_uInt16 n = rLnks.size(); n; ) { ::sfx2::SvBaseLink* pLnk = &(*rLnks[ --n ]); if( pLnk && OBJECT_CLIENT_GRF == pLnk->GetObjType() && diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx index b4e89352c961..909741733987 100644 --- a/sw/source/ui/app/docsh.cxx +++ b/sw/source/ui/app/docsh.cxx @@ -1061,7 +1061,7 @@ void SwDocShell::GetState(SfxItemSet& rSet) sfx2::LinkManager& rLnkMgr = pDoc->GetLinkManager(); const ::sfx2::SvBaseLinks& rLnks = rLnkMgr.GetLinks(); sal_Bool bRet = sal_False; - if( rLnks.Count() ) + if( !rLnks.empty() ) bRet = sal_True; else { diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx index f74f99ea57d1..e7867bb1443f 100644 --- a/sw/source/ui/shells/basesh.cxx +++ b/sw/source/ui/shells/basesh.cxx @@ -625,7 +625,7 @@ void SwBaseShell::Execute(SfxRequest &rReq) { SwView& rTempView = GetView(); rSh.EnterStdMode(); - if( rSh.GetLinkManager().GetLinks().Count() ) + if( !rSh.GetLinkManager().GetLinks().empty() ) { rSh.StartAllAction(); rSh.GetLinkManager().UpdateAllLinks( sal_False, sal_True, sal_True ); @@ -1121,7 +1121,7 @@ void SwBaseShell::Execute(SfxRequest &rReq) case FN_UPDATE_ALL_LINKS: { - if( rSh.GetLinkManager().GetLinks().Count() ) + if( !rSh.GetLinkManager().GetLinks().empty() ) { sal_Bool bUpdateGrf = sal_False, bCallErrHdl = sal_False; rSh.EnterStdMode(); @@ -1749,7 +1749,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) rSet.DisableItem( nWhich ); break; case FN_UPDATE_ALL_LINKS: - if ( !rSh.GetLinkManager().GetLinks().Count() ) + if ( rSh.GetLinkManager().GetLinks().empty() ) rSet.DisableItem(nWhich); break; case FN_XFORMS_DESIGN_MODE: diff --git a/sw/source/ui/uiview/viewstat.cxx b/sw/source/ui/uiview/viewstat.cxx index 2805c64917e8..7938caab65cc 100644 --- a/sw/source/ui/uiview/viewstat.cxx +++ b/sw/source/ui/uiview/viewstat.cxx @@ -81,7 +81,7 @@ void SwView::GetState(SfxItemSet &rSet) switch(nWhich) { case FN_EDIT_LINK_DLG: - if( !pWrtShell->GetLinkManager().GetLinks().Count() ) + if( pWrtShell->GetLinkManager().GetLinks().empty() ) rSet.DisableItem(nWhich); else if( pWrtShell->IsSelFrmMode() && pWrtShell->IsSelObjProtected(FLYPROTECT_CONTENT)) diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index 43c167211eeb..b39951a3d677 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -2240,7 +2240,7 @@ void SwXTextDocument::updateLinks( ) throw(RuntimeException) throw RuntimeException(); SwDoc* pDoc = pDocShell->GetDoc(); sfx2::LinkManager& rLnkMan = pDoc->GetLinkManager(); - if( rLnkMan.GetLinks().Count() ) + if( !rLnkMan.GetLinks().empty() ) { UnoActionContext aAction(pDoc); rLnkMan.UpdateAllLinks( sal_False, sal_False, sal_True ); |