Use rtl::Reference

Change-Id: I7e3922ba635acdb14ca489bda2535a69249cb001
This commit is contained in:
Stephan Bergmann
2013-11-05 13:20:19 +01:00
parent f479f62c14
commit e66d3da283

View File

@@ -119,8 +119,7 @@ namespace sd
const uno::Reference< embed::XStorage > &xStorage ); const uno::Reference< embed::XStorage > &xStorage );
void AssignURL( XPropertyListType t, const Any* pValue, bool *pOk, bool *pChanged ); void AssignURL( XPropertyListType t, const Any* pValue, bool *pOk, bool *pChanged );
void ExtractURL( XPropertyListType t, Any* pValue ); void ExtractURL( XPropertyListType t, Any* pValue );
Reference< XModel > mxModel; rtl::Reference<SdXImpressDocument> mxModel;
SdXImpressDocument* mpModel;
}; };
Reference< XInterface > SAL_CALL DocumentSettings_createInstance( SdXImpressDocument* pModel ) Reference< XInterface > SAL_CALL DocumentSettings_createInstance( SdXImpressDocument* pModel )
@@ -217,8 +216,7 @@ using namespace ::sd;
DocumentSettings::DocumentSettings( SdXImpressDocument* pModel ) DocumentSettings::DocumentSettings( SdXImpressDocument* pModel )
: PropertySetHelper( createSettingsInfoImpl( !pModel->IsImpressDocument() ) ), : PropertySetHelper( createSettingsInfoImpl( !pModel->IsImpressDocument() ) ),
mxModel( pModel ), mxModel( pModel )
mpModel( pModel )
{ {
} }
@@ -229,7 +227,7 @@ DocumentSettings::~DocumentSettings() throw()
bool DocumentSettings::LoadList( XPropertyListType t, const OUString &rInPath, bool DocumentSettings::LoadList( XPropertyListType t, const OUString &rInPath,
const uno::Reference< embed::XStorage > &xStorage ) const uno::Reference< embed::XStorage > &xStorage )
{ {
SdDrawDocument* pDoc = mpModel->GetDoc(); SdDrawDocument* pDoc = mxModel->GetDoc();
sal_Int32 nSlash = rInPath.lastIndexOf('/'); sal_Int32 nSlash = rInPath.lastIndexOf('/');
OUString aPath, aName; OUString aPath, aName;
@@ -327,7 +325,7 @@ uno::Sequence<beans::PropertyValue>
uno::Sequence<beans::PropertyValue> aRet( aConfigProps.getLength() ); uno::Sequence<beans::PropertyValue> aRet( aConfigProps.getLength() );
bool bHasEmbed = false; bool bHasEmbed = false;
SdDrawDocument* pDoc = mpModel->GetDoc(); SdDrawDocument* pDoc = mxModel->GetDoc();
for( size_t i = 0; i < SAL_N_ELEMENTS( aURLPropertyNames ); i++ ) for( size_t i = 0; i < SAL_N_ELEMENTS( aURLPropertyNames ); i++ )
{ {
XPropertyListRef pList = pDoc->GetPropertyList( (XPropertyListType) i ); XPropertyListRef pList = pDoc->GetPropertyList( (XPropertyListType) i );
@@ -396,8 +394,8 @@ throw (UnknownPropertyException, PropertyVetoException,
{ {
::SolarMutexGuard aGuard; ::SolarMutexGuard aGuard;
SdDrawDocument* pDoc = mpModel->GetDoc(); SdDrawDocument* pDoc = mxModel->GetDoc();
::sd::DrawDocShell* pDocSh = mpModel->GetDocShell(); ::sd::DrawDocShell* pDocSh = mxModel->GetDocShell();
if( NULL == pDoc || NULL == pDocSh ) if( NULL == pDoc || NULL == pDocSh )
{ {
throw RuntimeException("Document or Shell missing", throw RuntimeException("Document or Shell missing",
@@ -940,12 +938,12 @@ throw (UnknownPropertyException, PropertyVetoException,
} }
if( bChanged || bOptionsChanged ) if( bChanged || bOptionsChanged )
mpModel->SetModified( sal_True ); mxModel->SetModified( sal_True );
} }
void DocumentSettings::ExtractURL( XPropertyListType t, Any* pValue ) void DocumentSettings::ExtractURL( XPropertyListType t, Any* pValue )
{ {
XPropertyListRef pList = mpModel->GetDoc()->GetPropertyList( t ); XPropertyListRef pList = mxModel->GetDoc()->GetPropertyList( t );
if( !pList.is() ) if( !pList.is() )
return; return;
@@ -963,8 +961,8 @@ throw (UnknownPropertyException, WrappedTargetException, RuntimeException)
{ {
::SolarMutexGuard aGuard; ::SolarMutexGuard aGuard;
SdDrawDocument* pDoc = mpModel->GetDoc(); SdDrawDocument* pDoc = mxModel->GetDoc();
::sd::DrawDocShell* pDocSh = mpModel->GetDocShell(); ::sd::DrawDocShell* pDocSh = mxModel->GetDocShell();
if( NULL == pDoc || NULL == pDocSh ) if( NULL == pDoc || NULL == pDocSh )
{ {
throw RuntimeException("Document or Shell missing", throw RuntimeException("Document or Shell missing",
@@ -1009,7 +1007,7 @@ throw (UnknownPropertyException, WrappedTargetException, RuntimeException)
ExtractURL( XBITMAP_LIST, pValue ); ExtractURL( XBITMAP_LIST, pValue );
break; break;
case HANDLE_FORBIDDENCHARS: case HANDLE_FORBIDDENCHARS:
*pValue <<= mpModel->getForbiddenCharsTable(); *pValue <<= mxModel->getForbiddenCharsTable();
break; break;
case HANDLE_APPLYUSERDATA: case HANDLE_APPLYUSERDATA:
*pValue <<= pDocSh->IsUseUserData(); *pValue <<= pDocSh->IsUseUserData();
@@ -1264,7 +1262,7 @@ Sequence< OUString > SAL_CALL DocumentSettings::getSupportedServiceNames( )
{ {
Sequence< OUString > aSeq( 2 ); Sequence< OUString > aSeq( 2 );
aSeq[0] = "com.sun.star.document.Settings" ; aSeq[0] = "com.sun.star.document.Settings" ;
if( mpModel->IsImpressDocument() ) if( mxModel->IsImpressDocument() )
{ {
aSeq[1] = "com.sun.star.presentation.DocumentSettings" ; aSeq[1] = "com.sun.star.presentation.DocumentSettings" ;
} }