diff options
author | Noel Grandin <noel@peralex.com> | 2016-01-28 15:15:19 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-01-29 10:54:23 +0200 |
commit | 31f12941635f52d34497b9af1361c0e81906762d (patch) | |
tree | bde9a343f86ea38540fe1b4bd777dc8fd1e56afd /comphelper | |
parent | ba03604b55e757d31aef3c676e177a7b7101cf20 (diff) |
sequence->vector in OSimpleLogRing
Change-Id: Ief35ce33a11c93a4a78e50ccdd936ec7e17102a2
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/misc/documentiologring.cxx | 8 | ||||
-rw-r--r-- | comphelper/source/misc/documentiologring.hxx | 3 |
2 files changed, 6 insertions, 5 deletions
diff --git a/comphelper/source/misc/documentiologring.cxx b/comphelper/source/misc/documentiologring.cxx index a9457a84fb39..aaea0caea8fe 100644 --- a/comphelper/source/misc/documentiologring.cxx +++ b/comphelper/source/misc/documentiologring.cxx @@ -78,7 +78,7 @@ void SAL_CALL OSimpleLogRing::logString( const OUString& aMessage ) throw (uno:: ::osl::MutexGuard aGuard( m_aMutex ); m_aMessages[m_nPos] = aMessage; - if ( ++m_nPos >= m_aMessages.getLength() ) + if ( ++m_nPos >= (sal_Int32)m_aMessages.size() ) { m_nPos = 0; m_bFull = true; @@ -93,12 +93,12 @@ uno::Sequence< OUString > SAL_CALL OSimpleLogRing::getCollectedLog() throw (uno: { ::osl::MutexGuard aGuard( m_aMutex ); - sal_Int32 nResLen = m_bFull ? m_aMessages.getLength() : m_nPos; + sal_Int32 nResLen = m_bFull ? m_aMessages.size() : m_nPos; sal_Int32 nStart = m_bFull ? m_nPos : 0; uno::Sequence< OUString > aResult( nResLen ); for ( sal_Int32 nInd = 0; nInd < nResLen; nInd++ ) - aResult[nInd] = m_aMessages[ ( nStart + nInd ) % m_aMessages.getLength() ]; + aResult[nInd] = m_aMessages[ ( nStart + nInd ) % m_aMessages.size() ]; // if used once then default initialized m_bInitialized = true; @@ -121,7 +121,7 @@ void SAL_CALL OSimpleLogRing::initialize( const uno::Sequence< uno::Any >& aArgu { sal_Int32 nLen = 0; if ( aArguments.getLength() == 1 && ( aArguments[0] >>= nLen ) && nLen ) - m_aMessages.realloc( nLen ); + m_aMessages.resize( nLen ); else throw lang::IllegalArgumentException( "Nonnull size is expected as the first argument!", diff --git a/comphelper/source/misc/documentiologring.hxx b/comphelper/source/misc/documentiologring.hxx index ffd124e22154..e6974d988caa 100644 --- a/comphelper/source/misc/documentiologring.hxx +++ b/comphelper/source/misc/documentiologring.hxx @@ -26,6 +26,7 @@ #include <osl/mutex.hxx> #include <cppuhelper/implbase.hxx> +#include <vector> #define SIMPLELOGRING_SIZE 256 @@ -37,7 +38,7 @@ class OSimpleLogRing : public ::cppu::WeakImplHelper< css::logging::XSimpleLogRi css::lang::XServiceInfo > { ::osl::Mutex m_aMutex; - css::uno::Sequence< OUString > m_aMessages; + std::vector< OUString > m_aMessages; bool m_bInitialized; bool m_bFull; |