summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-10-22 20:50:23 +0200
committerMichael Stahl <mstahl@redhat.com>2015-10-23 11:21:33 +0200
commitfc90cf2af58dc8d551c39ba37d3a44597aa11e44 (patch)
treedbeabaf23e2be93a6549bbb1c8ed5ed22a59e04f /ucb
parentc06e2fcc2c03c4b6353bd9a1e282c36de872d777 (diff)
ucb: replace boost::ptr_vector with std::vector<std::unique_ptr>
Change-Id: I05c64aaed4aaea813b369dccc721f9d10167f161
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/ucp/webdav-neon/webdavdatasupplier.cxx53
1 files changed, 27 insertions, 26 deletions
diff --git a/ucb/source/ucp/webdav-neon/webdavdatasupplier.cxx b/ucb/source/ucp/webdav-neon/webdavdatasupplier.cxx
index 16f3969a9e23..dc86ddb2632a 100644
--- a/ucb/source/ucp/webdav-neon/webdavdatasupplier.cxx
+++ b/ucb/source/ucp/webdav-neon/webdavdatasupplier.cxx
@@ -32,12 +32,14 @@
**************************************************************************
*************************************************************************/
-#include <boost/ptr_container/ptr_vector.hpp>
+
#include <osl/diagnose.h>
+#include <o3tl/make_unique.hxx>
#include <com/sun/star/ucb/OpenMode.hpp>
#include <ucbhelper/contentidentifier.hxx>
#include <ucbhelper/providerhelper.hxx>
#include <memory>
+#include <vector>
#include "webdavdatasupplier.hxx"
#include "webdavcontent.hxx"
#include "ContentProperties.hxx"
@@ -75,7 +77,7 @@ struct ResultListEntry
-typedef boost::ptr_vector<ResultListEntry> ResultList;
+typedef std::vector<std::unique_ptr<ResultListEntry>> ResultList;
@@ -86,7 +88,7 @@ typedef boost::ptr_vector<ResultListEntry> ResultList;
struct DataSupplier_Impl
{
osl::Mutex m_aMutex;
- ResultList m_aResults;
+ ResultList m_Results;
rtl::Reference< Content > m_xContent;
uno::Reference< uno::XComponentContext > m_xContext;
sal_Int32 m_nOpenMode;
@@ -131,9 +133,9 @@ OUString DataSupplier::queryContentIdentifierString( sal_uInt32 nIndex )
{
osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex );
- if ( nIndex < m_pImpl->m_aResults.size() )
+ if (nIndex < m_pImpl->m_Results.size())
{
- OUString aId = m_pImpl->m_aResults[ nIndex ].aId;
+ OUString aId = m_pImpl->m_Results[ nIndex ]->aId;
if ( !aId.isEmpty() )
{
// Already cached.
@@ -145,8 +147,7 @@ OUString DataSupplier::queryContentIdentifierString( sal_uInt32 nIndex )
{
OUString aId = m_pImpl->m_xContent->getResourceAccess().getURL();
- const ContentProperties& props
- = *( m_pImpl->m_aResults[ nIndex ].pData );
+ const ContentProperties& props(*(m_pImpl->m_Results[ nIndex ]->pData));
if ( ( aId.lastIndexOf( '/' ) + 1 ) != aId.getLength() )
aId += "/";
@@ -156,7 +157,7 @@ OUString DataSupplier::queryContentIdentifierString( sal_uInt32 nIndex )
if ( props.isTrailingSlash() )
aId += "/";
- m_pImpl->m_aResults[ nIndex ].aId = aId;
+ m_pImpl->m_Results[ nIndex ]->aId = aId;
return aId;
}
return OUString();
@@ -169,10 +170,10 @@ DataSupplier::queryContentIdentifier( sal_uInt32 nIndex )
{
osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex );
- if ( nIndex < m_pImpl->m_aResults.size() )
+ if (nIndex < m_pImpl->m_Results.size())
{
uno::Reference< ucb::XContentIdentifier > xId
- = m_pImpl->m_aResults[ nIndex ].xId;
+ = m_pImpl->m_Results[ nIndex ]->xId;
if ( xId.is() )
{
// Already cached.
@@ -185,7 +186,7 @@ DataSupplier::queryContentIdentifier( sal_uInt32 nIndex )
{
uno::Reference< ucb::XContentIdentifier > xId
= new ::ucbhelper::ContentIdentifier( aId );
- m_pImpl->m_aResults[ nIndex ].xId = xId;
+ m_pImpl->m_Results[ nIndex ]->xId = xId;
return xId;
}
return uno::Reference< ucb::XContentIdentifier >();
@@ -198,10 +199,10 @@ DataSupplier::queryContent( sal_uInt32 nIndex )
{
osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex );
- if ( nIndex < m_pImpl->m_aResults.size() )
+ if (nIndex < m_pImpl->m_Results.size())
{
uno::Reference< ucb::XContent > xContent
- = m_pImpl->m_aResults[ nIndex ].xContent;
+ = m_pImpl->m_Results[ nIndex ]->xContent;
if ( xContent.is() )
{
// Already cached.
@@ -217,7 +218,7 @@ DataSupplier::queryContent( sal_uInt32 nIndex )
{
uno::Reference< ucb::XContent > xContent
= m_pImpl->m_xContent->getProvider()->queryContent( xId );
- m_pImpl->m_aResults[ nIndex ].xContent = xContent;
+ m_pImpl->m_Results[ nIndex ]->xContent = xContent;
return xContent;
}
@@ -234,7 +235,7 @@ bool DataSupplier::getResult( sal_uInt32 nIndex )
{
osl::ClearableGuard< osl::Mutex > aGuard( m_pImpl->m_aMutex );
- if ( m_pImpl->m_aResults.size() > nIndex )
+ if (nIndex < m_pImpl->m_Results.size())
{
// Result already present.
return true;
@@ -243,7 +244,7 @@ bool DataSupplier::getResult( sal_uInt32 nIndex )
// Obtain values...
if ( getData() )
{
- if ( m_pImpl->m_aResults.size() > nIndex )
+ if (nIndex < m_pImpl->m_Results.size())
{
// Result already present.
return true;
@@ -260,14 +261,14 @@ sal_uInt32 DataSupplier::totalCount()
// Obtain values...
getData();
- return m_pImpl->m_aResults.size();
+ return m_pImpl->m_Results.size();
}
// virtual
sal_uInt32 DataSupplier::currentCount()
{
- return m_pImpl->m_aResults.size();
+ return m_pImpl->m_Results.size();
}
@@ -284,9 +285,9 @@ uno::Reference< sdbc::XRow > DataSupplier::queryPropertyValues(
{
osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex );
- if ( nIndex < m_pImpl->m_aResults.size() )
+ if (nIndex < m_pImpl->m_Results.size())
{
- uno::Reference< sdbc::XRow > xRow = m_pImpl->m_aResults[ nIndex ].xRow;
+ uno::Reference< sdbc::XRow > xRow = m_pImpl->m_Results[ nIndex ]->xRow;
if ( xRow.is() )
{
// Already cached.
@@ -300,11 +301,11 @@ uno::Reference< sdbc::XRow > DataSupplier::queryPropertyValues(
= Content::getPropertyValues(
m_pImpl->m_xContext,
getResultSet()->getProperties(),
- *(m_pImpl->m_aResults[ nIndex ].pData),
+ *(m_pImpl->m_Results[ nIndex ]->pData),
rtl::Reference< ::ucbhelper::ContentProviderImplHelper >(
m_pImpl->m_xContent->getProvider().get() ),
queryContentIdentifierString( nIndex ) );
- m_pImpl->m_aResults[ nIndex ].xRow = xRow;
+ m_pImpl->m_Results[ nIndex ]->xRow = xRow;
return xRow;
}
@@ -317,8 +318,8 @@ void DataSupplier::releasePropertyValues( sal_uInt32 nIndex )
{
osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex );
- if ( nIndex < m_pImpl->m_aResults.size() )
- m_pImpl->m_aResults[ nIndex ].xRow = uno::Reference< sdbc::XRow >();
+ if (nIndex < m_pImpl->m_Results.size())
+ m_pImpl->m_Results[ nIndex ]->xRow = uno::Reference< sdbc::XRow >();
}
@@ -470,8 +471,8 @@ bool DataSupplier::getData()
break;
}
- m_pImpl->m_aResults.push_back(
- new ResultListEntry( pContentProperties ) );
+ m_pImpl->m_Results.push_back(
+ o3tl::make_unique<ResultListEntry>(pContentProperties));
}
}
catch ( DAVException const & )