summaryrefslogtreecommitdiff
path: root/basctl/source/basicide/docsignature.cxx
diff options
context:
space:
mode:
authorUray M. János <uray.janos@gmail.com>2012-09-02 16:21:08 +0200
committerAndras Timar <atimar@suse.com>2012-09-07 11:20:48 +0200
commit81f72a3c3a30ef00dfb03bd7fab148d2fcf3e4f8 (patch)
treed5586410e1f0d6b7413f1cab952c76c1978e0a7f /basctl/source/basicide/docsignature.cxx
parent5764c51f2c9870c91727464c0d889d3554a5663e (diff)
Cleanup in basctl (raw pointers)
Lots of raw pointers have been converted to boost::scoped_ptr to reduce the number of 'delete's and the possibility of memory leaks. Some pointers have been converted to references, to reduce the needless checking for nullptrs, and so simplifying the code. Also some #define-s have been converted to C++ constants or enumerations. Change-Id: Ifbeb78f744bac7a96c8a446ff4db90dedf85fe26
Diffstat (limited to 'basctl/source/basicide/docsignature.cxx')
-rw-r--r--basctl/source/basicide/docsignature.cxx28
1 files changed, 14 insertions, 14 deletions
diff --git a/basctl/source/basicide/docsignature.cxx b/basctl/source/basicide/docsignature.cxx
index 17adaf30822f..0124f523cf7a 100644
--- a/basctl/source/basicide/docsignature.cxx
+++ b/basctl/source/basicide/docsignature.cxx
@@ -38,25 +38,25 @@ namespace basctl
/** === end UNO using === **/
//====================================================================
- //= DocumentSignature_Data
+ //= DocumentSignature::Impl
//====================================================================
- struct DocumentSignature_Data
+ struct DocumentSignature::Impl
{
- SfxObjectShell* pShell;
+ SfxObjectShell* pShell;
- DocumentSignature_Data() : pShell( NULL ) { }
+ Impl () : pShell(0) { }
};
//====================================================================
//= DocumentSignature
//====================================================================
//--------------------------------------------------------------------
- DocumentSignature::DocumentSignature( const ScriptDocument& _rDocument )
- :m_pData( new DocumentSignature_Data )
+ DocumentSignature::DocumentSignature (ScriptDocument const& rDocument) :
+ m_pImpl(new Impl)
{
- if ( _rDocument.isDocument() )
+ if (rDocument.isDocument())
{
- Reference< XModel > xDocument( _rDocument.getDocument() );
+ Reference<XModel> xDocument(rDocument.getDocument());
// find object shell for document
SfxObjectShell* pShell = SfxObjectShell::GetFirst();
while ( pShell )
@@ -65,7 +65,7 @@ namespace basctl
break;
pShell = SfxObjectShell::GetNext( *pShell );
}
- m_pData->pShell = pShell;
+ m_pImpl->pShell = pShell;
}
}
@@ -77,22 +77,22 @@ namespace basctl
//--------------------------------------------------------------------
bool DocumentSignature::supportsSignatures() const
{
- return ( m_pData->pShell != NULL );
+ return ( m_pImpl->pShell != NULL );
}
//--------------------------------------------------------------------
void DocumentSignature::signScriptingContent() const
{
OSL_PRECOND( supportsSignatures(), "DocumentSignature::signScriptingContent: signatures not supported by this document!" );
- if ( m_pData->pShell )
- m_pData->pShell->SignScriptingContent();
+ if ( m_pImpl->pShell )
+ m_pImpl->pShell->SignScriptingContent();
}
//--------------------------------------------------------------------
sal_uInt16 DocumentSignature::getScriptingSignatureState() const
{
- if ( m_pData->pShell )
- return m_pData->pShell->GetScriptingSignatureState();
+ if ( m_pImpl->pShell )
+ return m_pImpl->pShell->GetScriptingSignatureState();
return SIGNATURESTATE_NOSIGNATURES;
}