diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-18 11:38:17 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-18 14:22:26 +0200 |
commit | 9aedc7f9d9b65136880fe6b13e956f0a1fa19c32 (patch) | |
tree | ed16e7cbddf23b964bc42386066dc5d9dc568920 /ucb | |
parent | 64f2c78605a1bab8c7caeb14cf387e1aa4dda51b (diff) |
use rtl::Reference in CachedContentResultSet
instead of storing both a raw pointer and an uno::Reference
Change-Id: I868530ba1697baae88a4322eda6c467c9f8e8eb6
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/cacher/cachedcontentresultset.cxx | 18 | ||||
-rw-r--r-- | ucb/source/cacher/cachedcontentresultset.hxx | 7 |
2 files changed, 10 insertions, 15 deletions
diff --git a/ucb/source/cacher/cachedcontentresultset.cxx b/ucb/source/cacher/cachedcontentresultset.cxx index 584d975d5c47..97c5447e389e 100644 --- a/ucb/source/cacher/cachedcontentresultset.cxx +++ b/ucb/source/cacher/cachedcontentresultset.cxx @@ -667,9 +667,6 @@ CachedContentResultSet::CachedContentResultSet( , m_xFetchProvider( nullptr ) , m_xFetchProviderForContentAccess( nullptr ) - , m_xMyPropertySetInfo( nullptr ) - , m_pMyPropSetInfo( nullptr ) - , m_xContentIdentifierMapping( xContentIdentifierMapping ) , m_nRow( 0 ) // Position is one-based. Zero means: before first element. , m_bAfterLast( false ) @@ -917,11 +914,10 @@ void SAL_CALL CachedContentResultSet ContentResultSetWrapper::impl_initPropertySetInfo(); osl::Guard< osl::Mutex > aGuard( m_aMutex ); - if( m_pMyPropSetInfo ) + if( m_xMyPropertySetInfo.is() ) return; - m_pMyPropSetInfo = new CCRS_PropertySetInfo( m_xPropertySetInfo ); - m_xMyPropertySetInfo = m_pMyPropSetInfo; - m_xPropertySetInfo = m_xMyPropertySetInfo; + m_xMyPropertySetInfo = new CCRS_PropertySetInfo( m_xPropertySetInfo ); + m_xPropertySetInfo = m_xMyPropertySetInfo.get(); } @@ -1018,7 +1014,7 @@ void SAL_CALL CachedContentResultSet throw UnknownPropertyException(); } - Property aProp = m_pMyPropSetInfo->getPropertyByName( aPropertyName ); + Property aProp = m_xMyPropertySetInfo->getPropertyByName( aPropertyName ); //throws UnknownPropertyException, if so if( aProp.Attributes & PropertyAttribute::READONLY ) @@ -1053,7 +1049,7 @@ void SAL_CALL CachedContentResultSet aEvt.Source = static_cast< XPropertySet * >( this ); aEvt.PropertyName = aPropertyName; aEvt.Further = false; - aEvt.PropertyHandle = m_pMyPropSetInfo-> + aEvt.PropertyHandle = m_xMyPropertySetInfo-> m_nFetchDirectionPropertyHandle; aEvt.OldValue <<= m_nFetchDirection; aEvt.NewValue <<= nNew; @@ -1085,7 +1081,7 @@ void SAL_CALL CachedContentResultSet aEvt.Source = static_cast< XPropertySet * >( this ); aEvt.PropertyName = aPropertyName; aEvt.Further = false; - aEvt.PropertyHandle = m_pMyPropSetInfo-> + aEvt.PropertyHandle = m_xMyPropertySetInfo-> m_nFetchSizePropertyHandle; aEvt.OldValue <<= m_nFetchSize; aEvt.NewValue <<= nNew; @@ -1127,7 +1123,7 @@ Any SAL_CALL CachedContentResultSet throw UnknownPropertyException(); } - m_pMyPropSetInfo->getPropertyByName( rPropertyName ); + m_xMyPropertySetInfo->getPropertyByName( rPropertyName ); //throws UnknownPropertyException, if so Any aValue; diff --git a/ucb/source/cacher/cachedcontentresultset.hxx b/ucb/source/cacher/cachedcontentresultset.hxx index 1d9b9f4ce430..ea6b54b734c1 100644 --- a/ucb/source/cacher/cachedcontentresultset.hxx +++ b/ucb/source/cacher/cachedcontentresultset.hxx @@ -28,6 +28,7 @@ #include <com/sun/star/ucb/FetchResult.hpp> #include <com/sun/star/ucb/XContentIdentifierMapping.hpp> #include <com/sun/star/ucb/XCachedContentResultSetFactory.hpp> +#include <rtl/ref.hxx> #define CACHED_CONTENT_RESULTSET_SERVICE_NAME "com.sun.star.ucb.CachedContentResultSet" #define CACHED_CONTENT_RESULTSET_FACTORY_NAME "com.sun.star.ucb.CachedContentResultSetFactory" @@ -119,10 +120,8 @@ class CachedContentResultSet css::uno::Reference< css::ucb::XFetchProviderForContentAccess > m_xFetchProviderForContentAccess; //XFetchProviderForContentAccess-interface from m_xOrigin - //my PropertySetInfo - css::uno::Reference< css::beans::XPropertySetInfo > - m_xMyPropertySetInfo;//holds m_pMyPropSetInfo alive - CCRS_PropertySetInfo* m_pMyPropSetInfo; + rtl::Reference< CCRS_PropertySetInfo > + m_xMyPropertySetInfo; css::uno::Reference< css::ucb::XContentIdentifierMapping > |