summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-04-12 16:35:25 +0200
committerMichael Stahl <mstahl@redhat.com>2013-04-16 19:11:33 +0000
commit9b9f1c4b6f21eb30eb365da3cca4ca4a1d2d0069 (patch)
treee9e7e327212b0d488a1634099f8ae3234a7b2e5e /sfx2
parent3f153805b84e91dec3819a15ae04d2ba1a9721dc (diff)
Convert SfxViewFactoryArr_Impl from SfxPtrArray to std::vector
Change-Id: I25c8edc51f97af9de2563a8dba7387a2be9f4fd5 Reviewed-on: https://gerrit.libreoffice.org/3360 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/docfac.cxx19
1 files changed, 9 insertions, 10 deletions
diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx
index 25254aa49951..574bc54603a6 100644
--- a/sfx2/source/doc/docfac.cxx
+++ b/sfx2/source/doc/docfac.cxx
@@ -57,7 +57,7 @@ using namespace ::com::sun::star;
//========================================================================
-DECL_PTRARRAY( SfxViewFactoryArr_Impl, SfxViewFactory*, 2, 2 )
+typedef std::vector<SfxViewFactory*> SfxViewFactoryArr_Impl;
//========================================================================
@@ -147,9 +147,9 @@ void SfxObjectFactory::RegisterViewFactory
#if OSL_DEBUG_LEVEL > 0
{
const String sViewName( rFactory.GetAPIViewName() );
- for ( sal_uInt16 i = 0; i < pImpl->aViewFactoryArr.Count(); ++i )
+ for ( SfxViewFactoryArr_Impl::const_iterator it = pImpl->aViewFactoryArr.begin(); it != pImpl->aViewFactoryArr.end(); ++it )
{
- if ( !pImpl->aViewFactoryArr[i]->GetAPIViewName().Equals( sViewName ) )
+ if ( !(*it)->GetAPIViewName().Equals( sViewName ) )
continue;
OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM(
"SfxObjectFactory::RegisterViewFactory: duplicate view name '"));
@@ -160,20 +160,19 @@ void SfxObjectFactory::RegisterViewFactory
}
}
#endif
- sal_uInt16 nPos;
- for ( nPos = 0;
- nPos < pImpl->aViewFactoryArr.Count() &&
- pImpl->aViewFactoryArr[nPos]->GetOrdinal() <= rFactory.GetOrdinal();
- ++nPos )
+ SfxViewFactoryArr_Impl::iterator it = pImpl->aViewFactoryArr.begin();
+ for ( ; it != pImpl->aViewFactoryArr.end() &&
+ (*it)->GetOrdinal() <= rFactory.GetOrdinal();
+ ++it )
/* empty loop */;
- pImpl->aViewFactoryArr.Insert(nPos, &rFactory);
+ pImpl->aViewFactoryArr.insert(it, &rFactory);
}
//--------------------------------------------------------------------
sal_uInt16 SfxObjectFactory::GetViewFactoryCount() const
{
- return pImpl->aViewFactoryArr.Count();
+ return pImpl->aViewFactoryArr.size();
}
//--------------------------------------------------------------------