diff options
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/cacher/cachedcontentresultset.cxx | 12 | ||||
-rw-r--r-- | ucb/source/cacher/cachedcontentresultset.hxx | 5 |
2 files changed, 9 insertions, 8 deletions
diff --git a/ucb/source/cacher/cachedcontentresultset.cxx b/ucb/source/cacher/cachedcontentresultset.cxx index 40a34fadda86..68ef19d627e6 100644 --- a/ucb/source/cacher/cachedcontentresultset.cxx +++ b/ucb/source/cacher/cachedcontentresultset.cxx @@ -224,9 +224,9 @@ void CachedContentResultSet::CCRS_Cache sal_Int32 nDiff = nRow - m_pResult->StartIndex; if( nDiff < 0 ) nDiff *= -1; - Sequence< sal_Bool >* pMappedReminder = getMappedReminder(); - if( nDiff < pMappedReminder->getLength() ) - (*pMappedReminder)[nDiff] = true; + Sequence< sal_Bool >& rMappedReminder = getMappedReminder(); + if( nDiff < rMappedReminder.getLength() ) + rMappedReminder[nDiff] = true; } bool CachedContentResultSet::CCRS_Cache @@ -242,16 +242,16 @@ bool CachedContentResultSet::CCRS_Cache return false; } -Sequence< sal_Bool >* CachedContentResultSet::CCRS_Cache +Sequence< sal_Bool >& CachedContentResultSet::CCRS_Cache ::getMappedReminder() { if( !m_pMappedReminder ) { sal_Int32 nCount = m_pResult->Rows.getLength(); - m_pMappedReminder.reset(new Sequence< sal_Bool >( nCount )); + m_pMappedReminder.emplace( nCount ); std::fill(m_pMappedReminder->begin(), m_pMappedReminder->end(), false); } - return m_pMappedReminder.get(); + return *m_pMappedReminder; } const Any& CachedContentResultSet::CCRS_Cache diff --git a/ucb/source/cacher/cachedcontentresultset.hxx b/ucb/source/cacher/cachedcontentresultset.hxx index 99867a074894..3c20996b115f 100644 --- a/ucb/source/cacher/cachedcontentresultset.hxx +++ b/ucb/source/cacher/cachedcontentresultset.hxx @@ -34,6 +34,7 @@ #include <rtl/ref.hxx> #include <memory> +#include <optional> namespace com::sun::star::script { class XTypeConverter; @@ -54,7 +55,7 @@ class CachedContentResultSet m_pResult; css::uno::Reference< css::ucb::XContentIdentifierMapping > m_xContentIdentifierMapping; - std::unique_ptr<css::uno::Sequence< sal_Bool >> m_pMappedReminder; + std::optional<css::uno::Sequence< sal_Bool >> m_pMappedReminder; private: /// @throws css::sdbc::SQLException @@ -67,7 +68,7 @@ class CachedContentResultSet void remindMapped( sal_Int32 nRow ); bool isRowMapped( sal_Int32 nRow ); - css::uno::Sequence< sal_Bool >* getMappedReminder(); + css::uno::Sequence< sal_Bool >& getMappedReminder(); public: CCRS_Cache( const css::uno::Reference< |