loplugin:nullptr (automatic rewrite)

Change-Id: I8aec30601862feaeb99e3ce01adf61665688fa9a
This commit is contained in:
Stephan Bergmann 2015-11-10 10:23:11 +01:00
parent 92c697c0e3
commit d930b6c2e6
58 changed files with 655 additions and 655 deletions

View File

@ -81,7 +81,7 @@ class ConfigurationAccess
public: public:
ConfigurationAccess( const css::uno::Reference< css::uno::XComponentContext >& rXFactory, ConfigurationAccess( const css::uno::Reference< css::uno::XComponentContext >& rXFactory,
OptimizerSettings* pDefaultSettings = NULL ); OptimizerSettings* pDefaultSettings = nullptr );
~ConfigurationAccess(); ~ConfigurationAccess();
void SaveConfiguration(); void SaveConfiguration();

View File

@ -314,7 +314,7 @@ void InformationDialog::InitDialog()
InformationDialog::InformationDialog( const Reference< XComponentContext > &rxContext, Reference< XFrame >& rxFrame, const OUString& rSaveAsURL, bool& rbOpenNewDocument, const sal_Int64& rSourceSize, const sal_Int64& rDestSize, const sal_Int64& rApproxSize ) : InformationDialog::InformationDialog( const Reference< XComponentContext > &rxContext, Reference< XFrame >& rxFrame, const OUString& rSaveAsURL, bool& rbOpenNewDocument, const sal_Int64& rSourceSize, const sal_Int64& rDestSize, const sal_Int64& rApproxSize ) :
UnoDialog( rxContext, rxFrame ), UnoDialog( rxContext, rxFrame ),
ConfigurationAccess( rxContext, NULL ), ConfigurationAccess( rxContext, nullptr ),
mxFrame( rxFrame ), mxFrame( rxFrame ),
mxActionListener( new OKActionListener( *this ) ), mxActionListener( new OKActionListener( *this ) ),
mnSourceSize( rSourceSize ), mnSourceSize( rSourceSize ),

View File

@ -49,7 +49,7 @@ void OptimizationStats::SetStatusValue( const PPPOptimizerTokenEnum eStat, const
const uno::Any* OptimizationStats::GetStatusValue( const PPPOptimizerTokenEnum eStat ) const const uno::Any* OptimizationStats::GetStatusValue( const PPPOptimizerTokenEnum eStat ) const
{ {
std::map< PPPOptimizerTokenEnum, uno::Any, Compare >::const_iterator aIter( maStats.find( eStat ) ); std::map< PPPOptimizerTokenEnum, uno::Any, Compare >::const_iterator aIter( maStats.find( eStat ) );
return aIter != maStats.end() ? &((*aIter).second) : NULL; return aIter != maStats.end() ? &((*aIter).second) : nullptr;
} }

View File

@ -207,7 +207,7 @@ void OptimizerDialog::UpdateConfiguration()
OptimizerDialog::OptimizerDialog( const Reference< XComponentContext > &rxContext, Reference< XFrame >& rxFrame, Reference< XDispatch > rxStatusDispatcher ) : OptimizerDialog::OptimizerDialog( const Reference< XComponentContext > &rxContext, Reference< XFrame >& rxFrame, Reference< XDispatch > rxStatusDispatcher ) :
UnoDialog( rxContext, rxFrame ), UnoDialog( rxContext, rxFrame ),
ConfigurationAccess( rxContext, NULL ), ConfigurationAccess( rxContext, nullptr ),
mnCurrentStep( 0 ), mnCurrentStep( 0 ),
mnTabIndex( 0 ), mnTabIndex( 0 ),
mxFrame( rxFrame ), mxFrame( rxFrame ),

View File

@ -33,7 +33,7 @@ using namespace ::com::sun::star::beans;
PPPOptimizerDialog::PPPOptimizerDialog( const Reference< XComponentContext > &xContext ) : PPPOptimizerDialog::PPPOptimizerDialog( const Reference< XComponentContext > &xContext ) :
mxContext( xContext ), mxContext( xContext ),
mpOptimizerDialog( NULL ) mpOptimizerDialog( nullptr )
{ {
} }
@ -126,7 +126,7 @@ void SAL_CALL PPPOptimizerDialog::dispatch( const URL& rURL,
OUString sResult( sBuf.makeStringAndClear() ); OUString sResult( sBuf.makeStringAndClear() );
SAL_INFO("sdext.minimizer", sResult ); SAL_INFO("sdext.minimizer", sResult );
} }
delete mpOptimizerDialog, mpOptimizerDialog = NULL; delete mpOptimizerDialog, mpOptimizerDialog = nullptr;
} }
catch( ... ) catch( ... )
{ {

View File

@ -25,7 +25,7 @@
#include <unordered_map> #include <unordered_map>
typedef std::unordered_map< const char*, PPPOptimizerTokenEnum, rtl::CStringHash, rtl::CStringEqual> TypeNameHashMap; typedef std::unordered_map< const char*, PPPOptimizerTokenEnum, rtl::CStringHash, rtl::CStringEqual> TypeNameHashMap;
static TypeNameHashMap* pHashMap = NULL; static TypeNameHashMap* pHashMap = nullptr;
static ::osl::Mutex& getHashMapMutex() static ::osl::Mutex& getHashMapMutex()
{ {
static osl::Mutex s_aHashMapProtection; static osl::Mutex s_aHashMapProtection;

View File

@ -35,7 +35,7 @@ extern "C"
SAL_UNUSED_PARAMETER void * /*pRegistryKey*/ ) SAL_UNUSED_PARAMETER void * /*pRegistryKey*/ )
{ {
OUString aImplName( OUString::createFromAscii( pImplName ) ); OUString aImplName( OUString::createFromAscii( pImplName ) );
void* pRet = 0; void* pRet = nullptr;
if( pServiceManager ) if( pServiceManager )
{ {

View File

@ -71,7 +71,7 @@ FileEmitContext::FileEmitContext( const OUString& rOr
const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XComponentContext >& xContext,
const pdfparse::PDFContainer* pTop ) : const pdfparse::PDFContainer* pTop ) :
pdfparse::EmitContext( pTop ), pdfparse::EmitContext( pTop ),
m_aReadHandle(NULL), m_aReadHandle(nullptr),
m_nReadLen(0), m_nReadLen(0),
m_xContextStream(), m_xContextStream(),
m_xSeek(), m_xSeek(),
@ -100,7 +100,7 @@ FileEmitContext::FileEmitContext( const OUString& rOr
if( aErr != osl_File_E_None ) if( aErr != osl_File_E_None )
{ {
osl_closeFile( m_aReadHandle ); osl_closeFile( m_aReadHandle );
m_aReadHandle = NULL; m_aReadHandle = nullptr;
} }
} }
m_bDeflate = true; m_bDeflate = true;
@ -228,7 +228,7 @@ OUString SAL_CALL PDFDetector::detect( uno::Sequence< beans::PropertyValue >& rF
} }
if( xInput.is() ) if( xInput.is() )
{ {
oslFileHandle aFile = NULL; oslFileHandle aFile = nullptr;
try { try {
uno::Reference< io::XSeekable > xSeek( xInput, uno::UNO_QUERY ); uno::Reference< io::XSeekable > xSeek( xInput, uno::UNO_QUERY );
if( xSeek.is() ) if( xSeek.is() )
@ -261,7 +261,7 @@ OUString SAL_CALL PDFDetector::detect( uno::Sequence< beans::PropertyValue >& rF
) )
{ {
sal_uInt64 nWritten = 0; sal_uInt64 nWritten = 0;
if( osl_createTempFile( NULL, &aFile, &aURL.pData ) != osl_File_E_None ) if( osl_createTempFile( nullptr, &aFile, &aURL.pData ) != osl_File_E_None )
{ {
bSuccess = false; bSuccess = false;
} }
@ -448,7 +448,7 @@ bool checkDocChecksum( const OUString& rInPDFFileURL,
sal_uInt8 nActualChecksum[ RTL_DIGEST_LENGTH_MD5 ]; sal_uInt8 nActualChecksum[ RTL_DIGEST_LENGTH_MD5 ];
memset( nActualChecksum, 0, sizeof(nActualChecksum) ); memset( nActualChecksum, 0, sizeof(nActualChecksum) );
rtlDigest aActualDigest = rtl_digest_createMD5(); rtlDigest aActualDigest = rtl_digest_createMD5();
oslFileHandle aRead = NULL; oslFileHandle aRead = nullptr;
oslFileError aErr = osl_File_E_None; oslFileError aErr = osl_File_E_None;
if( (aErr = osl_openFile(rInPDFFileURL.pData, if( (aErr = osl_openFile(rInPDFFileURL.pData,
&aRead, &aRead,
@ -527,7 +527,7 @@ uno::Reference< io::XStream > getAdditionalStream( const OUString&
continue; continue;
} }
pdfparse::PDFName* pChkSumName = dynamic_cast<pdfparse::PDFName*>(chk->second); pdfparse::PDFName* pChkSumName = dynamic_cast<pdfparse::PDFName*>(chk->second);
if( pChkSumName == NULL ) if( pChkSumName == nullptr )
{ {
OSL_TRACE( "no name for DocChecksum entry" ); OSL_TRACE( "no name for DocChecksum entry" );
continue; continue;

View File

@ -40,7 +40,7 @@ public:
virtual bool copyOrigBytes( unsigned int nOrigOffset, unsigned int nLen ) = 0; virtual bool copyOrigBytes( unsigned int nOrigOffset, unsigned int nLen ) = 0;
virtual unsigned int readOrigBytes( unsigned int nOrigOffset, unsigned int nLen, void* pBuf ) = 0; virtual unsigned int readOrigBytes( unsigned int nOrigOffset, unsigned int nLen, void* pBuf ) = 0;
explicit EmitContext( const PDFContainer* pTop = NULL ); explicit EmitContext( const PDFContainer* pTop = nullptr );
virtual ~EmitContext(); virtual ~EmitContext();
// set this to deflate contained streams // set this to deflate contained streams
@ -210,14 +210,14 @@ struct PDFStream : public PDFEntry
virtual bool emit( EmitContext& rWriteContext ) const override; virtual bool emit( EmitContext& rWriteContext ) const override;
virtual PDFEntry* clone() const override; virtual PDFEntry* clone() const override;
unsigned int getDictLength( const PDFContainer* pObjectContainer = NULL ) const; // get contents of the "Length" entry of the dict unsigned int getDictLength( const PDFContainer* pObjectContainer = nullptr ) const; // get contents of the "Length" entry of the dict
}; };
struct PDFTrailer : public PDFContainer struct PDFTrailer : public PDFContainer
{ {
PDFDict* m_pDict; PDFDict* m_pDict;
PDFTrailer() : PDFContainer(), m_pDict( NULL ) {} PDFTrailer() : PDFContainer(), m_pDict( nullptr ) {}
virtual ~PDFTrailer(); virtual ~PDFTrailer();
virtual bool emit( EmitContext& rWriteContext ) const override; virtual bool emit( EmitContext& rWriteContext ) const override;
virtual PDFEntry* clone() const override; virtual PDFEntry* clone() const override;
@ -235,7 +235,7 @@ public:
PDFFile() PDFFile()
: PDFContainer(), : PDFContainer(),
m_pData( NULL ), m_pData( nullptr ),
m_nMajor( 0 ), m_nMinor( 0 ) m_nMajor( 0 ), m_nMinor( 0 )
{} {}
virtual ~PDFFile(); virtual ~PDFFile();
@ -267,7 +267,7 @@ struct PDFObject : public PDFContainer
unsigned int m_nGeneration; unsigned int m_nGeneration;
PDFObject( unsigned int nNr, unsigned int nGen ) PDFObject( unsigned int nNr, unsigned int nGen )
: m_pObject( NULL ), m_pStream( NULL ), m_nNumber( nNr ), m_nGeneration( nGen ) {} : m_pObject( nullptr ), m_pStream( nullptr ), m_nNumber( nNr ), m_nGeneration( nGen ) {}
virtual ~PDFObject(); virtual ~PDFObject();
virtual bool emit( EmitContext& rWriteContext ) const override; virtual bool emit( EmitContext& rWriteContext ) const override;
virtual PDFEntry* clone() const override; virtual PDFEntry* clone() const override;

View File

@ -99,10 +99,10 @@ sal_Bool SAL_CALL PDFIHybridAdaptor::filter( const uno::Sequence< beans::Propert
uno::Reference< io::XSeekable > xSeek( xInput, uno::UNO_QUERY ); uno::Reference< io::XSeekable > xSeek( xInput, uno::UNO_QUERY );
if( xSeek.is() ) if( xSeek.is() )
xSeek->seek( 0 ); xSeek->seek( 0 );
oslFileHandle aFile = NULL; oslFileHandle aFile = nullptr;
sal_uInt64 nWritten = 0; sal_uInt64 nWritten = 0;
OUString aURL; OUString aURL;
if( osl_createTempFile( NULL, &aFile, &aURL.pData ) == osl_File_E_None ) if( osl_createTempFile( nullptr, &aFile, &aURL.pData ) == osl_File_E_None )
{ {
SAL_INFO("sdext.pdfimport", "created temp file " << aURL); SAL_INFO("sdext.pdfimport", "created temp file " << aURL);
const sal_Int32 nBufSize = 4096; const sal_Int32 nBufSize = 4096;

View File

@ -95,7 +95,7 @@ using namespace pdfparse;
EmitContext::EmitContext( const PDFContainer* pTop ) : EmitContext::EmitContext( const PDFContainer* pTop ) :
m_bDeflate( false ), m_bDeflate( false ),
m_bDecrypt( false ), m_bDecrypt( false ),
m_pImplData( NULL ) m_pImplData( nullptr )
{ {
if( pTop ) if( pTop )
m_pImplData = new EmitImplData( pTop ); m_pImplData = new EmitImplData( pTop );
@ -490,7 +490,7 @@ PDFObject* PDFContainer::findObject( unsigned int nNumber, unsigned int nGenerat
return pObject; return pObject;
} }
} }
return NULL; return nullptr;
} }
PDFArray::~PDFArray() PDFArray::~PDFArray()
@ -559,7 +559,7 @@ void PDFDict::eraseValue( const OString& rName )
{ {
for( unsigned int j = i+1; j < nEle; j++ ) for( unsigned int j = i+1; j < nEle; j++ )
{ {
if( dynamic_cast<PDFComment*>(m_aSubElements[j]) == NULL ) if( dynamic_cast<PDFComment*>(m_aSubElements[j]) == nullptr )
{ {
// free name and value // free name and value
delete m_aSubElements[j]; delete m_aSubElements[j];
@ -581,17 +581,17 @@ PDFEntry* PDFDict::buildMap()
m_aMap.clear(); m_aMap.clear();
// build map // build map
unsigned int nEle = m_aSubElements.size(); unsigned int nEle = m_aSubElements.size();
PDFName* pName = NULL; PDFName* pName = nullptr;
for( unsigned int i = 0; i < nEle; i++ ) for( unsigned int i = 0; i < nEle; i++ )
{ {
if( dynamic_cast<PDFComment*>(m_aSubElements[i]) == NULL ) if( dynamic_cast<PDFComment*>(m_aSubElements[i]) == nullptr )
{ {
if( pName ) if( pName )
{ {
m_aMap[ pName->m_aName ] = m_aSubElements[i]; m_aMap[ pName->m_aName ] = m_aSubElements[i];
pName = NULL; pName = nullptr;
} }
else if( (pName = dynamic_cast<PDFName*>(m_aSubElements[i])) == NULL ) else if( (pName = dynamic_cast<PDFName*>(m_aSubElements[i])) == nullptr )
return m_aSubElements[i]; return m_aSubElements[i];
} }
} }
@ -617,7 +617,7 @@ bool PDFStream::emit( EmitContext& rWriteContext ) const
PDFEntry* PDFStream::clone() const PDFEntry* PDFStream::clone() const
{ {
return new PDFStream( m_nBeginOffset, m_nEndOffset, NULL ); return new PDFStream( m_nBeginOffset, m_nEndOffset, nullptr );
} }
unsigned int PDFStream::getDictLength( const PDFContainer* pContainer ) const unsigned int PDFStream::getDictLength( const PDFContainer* pContainer ) const
@ -670,7 +670,7 @@ bool PDFObject::getDeflatedStream( char** ppStream, unsigned int* pBytes, const
if( nRead != nOuterStreamLen ) if( nRead != nOuterStreamLen )
{ {
rtl_freeMemory( *ppStream ); rtl_freeMemory( *ppStream );
*ppStream = NULL; *ppStream = nullptr;
*pBytes = 0; *pBytes = 0;
return false; return false;
} }
@ -718,7 +718,7 @@ bool PDFObject::getDeflatedStream( char** ppStream, unsigned int* pBytes, const
} }
} }
else else
*ppStream = NULL, *pBytes = 0; *ppStream = nullptr, *pBytes = 0;
return bIsDeflated; return bIsDeflated;
} }
@ -764,7 +764,7 @@ static void unzipToBuffer( char* pBegin, unsigned int nLen,
if( err < Z_OK ) if( err < Z_OK )
{ {
rtl_freeMemory( *pOutBuf ); rtl_freeMemory( *pOutBuf );
*pOutBuf = NULL; *pOutBuf = nullptr;
*pOutLen = 0; *pOutLen = 0;
} }
} }
@ -774,11 +774,11 @@ bool PDFObject::writeStream( EmitContext& rWriteContext, const PDFFile* pParsedF
bool bSuccess = false; bool bSuccess = false;
if( m_pStream ) if( m_pStream )
{ {
char* pStream = NULL; char* pStream = nullptr;
unsigned int nBytes = 0; unsigned int nBytes = 0;
if( getDeflatedStream( &pStream, &nBytes, pParsedFile, rWriteContext ) && nBytes && rWriteContext.m_bDeflate ) if( getDeflatedStream( &pStream, &nBytes, pParsedFile, rWriteContext ) && nBytes && rWriteContext.m_bDeflate )
{ {
sal_uInt8* pOutBytes = NULL; sal_uInt8* pOutBytes = nullptr;
sal_uInt32 nOutBytes = 0; sal_uInt32 nOutBytes = 0;
unzipToBuffer( pStream, nBytes, &pOutBytes, &nOutBytes ); unzipToBuffer( pStream, nBytes, &pOutBytes, &nOutBytes );
rWriteContext.write( pOutBytes, nOutBytes ); rWriteContext.write( pOutBytes, nOutBytes );
@ -812,13 +812,13 @@ bool PDFObject::emit( EmitContext& rWriteContext ) const
pEData->setDecryptObject( m_nNumber, m_nGeneration ); pEData->setDecryptObject( m_nNumber, m_nGeneration );
if( (rWriteContext.m_bDeflate || rWriteContext.m_bDecrypt) && pEData ) if( (rWriteContext.m_bDeflate || rWriteContext.m_bDecrypt) && pEData )
{ {
char* pStream = NULL; char* pStream = nullptr;
unsigned int nBytes = 0; unsigned int nBytes = 0;
bool bDeflate = getDeflatedStream( &pStream, &nBytes, pEData->m_pObjectContainer, rWriteContext ); bool bDeflate = getDeflatedStream( &pStream, &nBytes, pEData->m_pObjectContainer, rWriteContext );
if( pStream && nBytes ) if( pStream && nBytes )
{ {
// unzip the stream // unzip the stream
sal_uInt8* pOutBytes = NULL; sal_uInt8* pOutBytes = nullptr;
sal_uInt32 nOutBytes = 0; sal_uInt32 nOutBytes = 0;
if( bDeflate && rWriteContext.m_bDeflate ) if( bDeflate && rWriteContext.m_bDeflate )
unzipToBuffer( pStream, nBytes, &pOutBytes, &nOutBytes ); unzipToBuffer( pStream, nBytes, &pOutBytes, &nOutBytes );
@ -1034,8 +1034,8 @@ struct PDFFileImplData
m_nStandardRevision( 0 ), m_nStandardRevision( 0 ),
m_nKeyLength( 0 ), m_nKeyLength( 0 ),
m_nPEntry( 0 ), m_nPEntry( 0 ),
m_aCipher( NULL ), m_aCipher( nullptr ),
m_aDigest( NULL ) m_aDigest( nullptr )
{ {
memset( m_aOEntry, 0, sizeof( m_aOEntry ) ); memset( m_aOEntry, 0, sizeof( m_aOEntry ) );
memset( m_aUEntry, 0, sizeof( m_aUEntry ) ); memset( m_aUEntry, 0, sizeof( m_aUEntry ) );
@ -1089,7 +1089,7 @@ bool PDFFile::decrypt( const sal_uInt8* pInBuffer, sal_uInt32 nLen, sal_uInt8* p
rtlCipherError aErr = rtl_cipher_initARCFOUR( m_pData->m_aCipher, rtlCipherError aErr = rtl_cipher_initARCFOUR( m_pData->m_aCipher,
rtl_Cipher_DirectionDecode, rtl_Cipher_DirectionDecode,
aSum, i, aSum, i,
NULL, 0 ); nullptr, 0 );
if( aErr == rtl_Cipher_E_None ) if( aErr == rtl_Cipher_E_None )
aErr = rtl_cipher_decodeARCFOUR( m_pData->m_aCipher, aErr = rtl_cipher_decodeARCFOUR( m_pData->m_aCipher,
pInBuffer, nLen, pInBuffer, nLen,
@ -1167,7 +1167,7 @@ static bool check_user_password( const OString& rPwd, PDFFileImplData* pData )
// encrypt pad string // encrypt pad string
rtl_cipher_initARCFOUR( pData->m_aCipher, rtl_Cipher_DirectionEncode, rtl_cipher_initARCFOUR( pData->m_aCipher, rtl_Cipher_DirectionEncode,
aKey, nKeyLen, aKey, nKeyLen,
NULL, 0 ); nullptr, 0 );
rtl_cipher_encodeARCFOUR( pData->m_aCipher, nPadString, sizeof( nPadString ), rtl_cipher_encodeARCFOUR( pData->m_aCipher, nPadString, sizeof( nPadString ),
nEncryptedEntry, sizeof( nEncryptedEntry ) ); nEncryptedEntry, sizeof( nEncryptedEntry ) );
bValid = (memcmp( nEncryptedEntry, pData->m_aUEntry, 32 ) == 0); bValid = (memcmp( nEncryptedEntry, pData->m_aUEntry, 32 ) == 0);
@ -1179,7 +1179,7 @@ static bool check_user_password( const OString& rPwd, PDFFileImplData* pData )
rtl_digest_updateMD5( pData->m_aDigest, pData->m_aDocID.getStr(), pData->m_aDocID.getLength() ); rtl_digest_updateMD5( pData->m_aDigest, pData->m_aDocID.getStr(), pData->m_aDocID.getLength() );
rtl_digest_getMD5( pData->m_aDigest, nEncryptedEntry, sizeof(nEncryptedEntry) ); rtl_digest_getMD5( pData->m_aDigest, nEncryptedEntry, sizeof(nEncryptedEntry) );
rtl_cipher_initARCFOUR( pData->m_aCipher, rtl_Cipher_DirectionEncode, rtl_cipher_initARCFOUR( pData->m_aCipher, rtl_Cipher_DirectionEncode,
aKey, sizeof(aKey), NULL, 0 ); aKey, sizeof(aKey), nullptr, 0 );
rtl_cipher_encodeARCFOUR( pData->m_aCipher, rtl_cipher_encodeARCFOUR( pData->m_aCipher,
nEncryptedEntry, 16, nEncryptedEntry, 16,
nEncryptedEntry, 16 ); // encrypt in place nEncryptedEntry, 16 ); // encrypt in place
@ -1190,7 +1190,7 @@ static bool check_user_password( const OString& rPwd, PDFFileImplData* pData )
aTempKey[j] = static_cast<sal_uInt8>( aKey[j] ^ i ); aTempKey[j] = static_cast<sal_uInt8>( aKey[j] ^ i );
rtl_cipher_initARCFOUR( pData->m_aCipher, rtl_Cipher_DirectionEncode, rtl_cipher_initARCFOUR( pData->m_aCipher, rtl_Cipher_DirectionEncode,
aTempKey, sizeof(aTempKey), NULL, 0 ); aTempKey, sizeof(aTempKey), nullptr, 0 );
rtl_cipher_encodeARCFOUR( pData->m_aCipher, rtl_cipher_encodeARCFOUR( pData->m_aCipher,
nEncryptedEntry, 16, nEncryptedEntry, 16,
nEncryptedEntry, 16 ); // encrypt in place nEncryptedEntry, 16 ); // encrypt in place
@ -1237,7 +1237,7 @@ bool PDFFile::setupDecryptionData( const OString& rPwd ) const
if( m_pData->m_nStandardRevision == 2 ) if( m_pData->m_nStandardRevision == 2 )
{ {
rtl_cipher_initARCFOUR( m_pData->m_aCipher, rtl_Cipher_DirectionDecode, rtl_cipher_initARCFOUR( m_pData->m_aCipher, rtl_Cipher_DirectionDecode,
aKey, nKeyLen, NULL, 0 ); aKey, nKeyLen, nullptr, 0 );
rtl_cipher_decodeARCFOUR( m_pData->m_aCipher, rtl_cipher_decodeARCFOUR( m_pData->m_aCipher,
m_pData->m_aOEntry, 32, m_pData->m_aOEntry, 32,
nPwd, 32 ); nPwd, 32 );
@ -1251,7 +1251,7 @@ bool PDFFile::setupDecryptionData( const OString& rPwd ) const
for( unsigned int j = 0; j < sizeof(nTempKey); j++ ) for( unsigned int j = 0; j < sizeof(nTempKey); j++ )
nTempKey[j] = sal_uInt8(aKey[j] ^ i); nTempKey[j] = sal_uInt8(aKey[j] ^ i);
rtl_cipher_initARCFOUR( m_pData->m_aCipher, rtl_Cipher_DirectionDecode, rtl_cipher_initARCFOUR( m_pData->m_aCipher, rtl_Cipher_DirectionDecode,
nTempKey, nKeyLen, NULL, 0 ); nTempKey, nKeyLen, nullptr, 0 );
rtl_cipher_decodeARCFOUR( m_pData->m_aCipher, rtl_cipher_decodeARCFOUR( m_pData->m_aCipher,
nPwd, 32, nPwd, 32,
nPwd, 32 ); // decrypt inplace nPwd, 32 ); // decrypt inplace

View File

@ -307,30 +307,30 @@ public:
if( m_aObjectStack.empty() ) if( m_aObjectStack.empty() )
m_aObjectStack.push_back( new PDFPart() ); m_aObjectStack.push_back( new PDFPart() );
PDFContainer* pContainer = dynamic_cast<PDFContainer*>(m_aObjectStack.back()); PDFContainer* pContainer = dynamic_cast<PDFContainer*>(m_aObjectStack.back());
if( pContainer == NULL ) if( pContainer == nullptr )
parseError( "comment without container", first ); parseError( "comment without container", first );
pContainer->m_aSubElements.push_back( pComment ); pContainer->m_aSubElements.push_back( pComment );
} }
void insertNewValue( PDFEntry* pNewValue, iteratorT pPos ) void insertNewValue( PDFEntry* pNewValue, iteratorT pPos )
{ {
PDFContainer* pContainer = NULL; PDFContainer* pContainer = nullptr;
const char* pMsg = NULL; const char* pMsg = nullptr;
if( ! m_aObjectStack.empty() && if( ! m_aObjectStack.empty() &&
(pContainer = dynamic_cast<PDFContainer*>(m_aObjectStack.back())) != NULL ) (pContainer = dynamic_cast<PDFContainer*>(m_aObjectStack.back())) != nullptr )
{ {
if( dynamic_cast<PDFDict*>(pContainer) == NULL && if( dynamic_cast<PDFDict*>(pContainer) == nullptr &&
dynamic_cast<PDFArray*>(pContainer) == NULL ) dynamic_cast<PDFArray*>(pContainer) == nullptr )
{ {
PDFObject* pObj = dynamic_cast<PDFObject*>(pContainer); PDFObject* pObj = dynamic_cast<PDFObject*>(pContainer);
if( pObj ) if( pObj )
{ {
if( pObj->m_pObject == NULL ) if( pObj->m_pObject == nullptr )
pObj->m_pObject = pNewValue; pObj->m_pObject = pNewValue;
else else
{ {
pMsg = "second value for object"; pMsg = "second value for object";
pContainer = NULL; pContainer = nullptr;
} }
} }
else if( dynamic_cast<PDFDict*>(pNewValue) ) else if( dynamic_cast<PDFDict*>(pNewValue) )
@ -338,16 +338,16 @@ public:
PDFTrailer* pTrailer = dynamic_cast<PDFTrailer*>(pContainer); PDFTrailer* pTrailer = dynamic_cast<PDFTrailer*>(pContainer);
if( pTrailer ) if( pTrailer )
{ {
if( pTrailer->m_pDict == NULL ) if( pTrailer->m_pDict == nullptr )
pTrailer->m_pDict = dynamic_cast<PDFDict*>(pNewValue); pTrailer->m_pDict = dynamic_cast<PDFDict*>(pNewValue);
else else
pContainer = NULL; pContainer = nullptr;
} }
else else
pContainer = NULL; pContainer = nullptr;
} }
else else
pContainer = NULL; pContainer = nullptr;
} }
} }
if( pContainer ) if( pContainer )
@ -421,7 +421,7 @@ public:
{ {
if( m_aObjectStack.empty() ) if( m_aObjectStack.empty() )
parseError( "endobj without obj", first ); parseError( "endobj without obj", first );
else if( dynamic_cast<PDFObject*>(m_aObjectStack.back()) == NULL ) else if( dynamic_cast<PDFObject*>(m_aObjectStack.back()) == nullptr )
parseError( "spurious endobj", first ); parseError( "spurious endobj", first );
else else
m_aObjectStack.pop_back(); m_aObjectStack.pop_back();
@ -447,10 +447,10 @@ public:
} }
void endDict( iteratorT first, SAL_UNUSED_PARAMETER iteratorT ) void endDict( iteratorT first, SAL_UNUSED_PARAMETER iteratorT )
{ {
PDFDict* pDict = NULL; PDFDict* pDict = nullptr;
if( m_aObjectStack.empty() ) if( m_aObjectStack.empty() )
parseError( "dictionary end without begin", first ); parseError( "dictionary end without begin", first );
else if( (pDict = dynamic_cast<PDFDict*>(m_aObjectStack.back())) == NULL ) else if( (pDict = dynamic_cast<PDFDict*>(m_aObjectStack.back())) == nullptr )
parseError( "spurious dictionary end", first ); parseError( "spurious dictionary end", first );
else else
m_aObjectStack.pop_back(); m_aObjectStack.pop_back();
@ -480,7 +480,7 @@ public:
{ {
if( m_aObjectStack.empty() ) if( m_aObjectStack.empty() )
parseError( "array end without begin", first ); parseError( "array end without begin", first );
else if( dynamic_cast<PDFArray*>(m_aObjectStack.back()) == NULL ) else if( dynamic_cast<PDFArray*>(m_aObjectStack.back()) == nullptr )
parseError( "spurious array end", first ); parseError( "spurious array end", first );
else else
m_aObjectStack.pop_back(); m_aObjectStack.pop_back();
@ -533,7 +533,7 @@ public:
{ {
if( m_aObjectStack.empty() ) if( m_aObjectStack.empty() )
parseError( "%%EOF without trailer", first ); parseError( "%%EOF without trailer", first );
else if( dynamic_cast<PDFTrailer*>(m_aObjectStack.back()) == NULL ) else if( dynamic_cast<PDFTrailer*>(m_aObjectStack.back()) == nullptr )
parseError( "spurious %%EOF", first ); parseError( "spurious %%EOF", first );
else else
m_aObjectStack.pop_back(); m_aObjectStack.pop_back();
@ -617,7 +617,7 @@ PDFEntry* PDFReader::read( const char* pFileName )
#else #else
file_iterator<> file_start( pFileName ); file_iterator<> file_start( pFileName );
if( ! file_start ) if( ! file_start )
return NULL; return nullptr;
file_iterator<> file_end = file_start.make_end(); file_iterator<> file_end = file_start.make_end();
PDFGrammar< file_iterator<> > aGrammar( file_start ); PDFGrammar< file_iterator<> > aGrammar( file_start );
@ -651,7 +651,7 @@ PDFEntry* PDFReader::read( const char* pFileName )
#endif #endif
} }
PDFEntry* pRet = NULL; PDFEntry* pRet = nullptr;
unsigned int nEntries = aGrammar.m_aObjectStack.size(); unsigned int nEntries = aGrammar.m_aObjectStack.size();
if( nEntries == 1 ) if( nEntries == 1 )
{ {

View File

@ -83,9 +83,9 @@ namespace
ComponentFactory pFactory; ComponentFactory pFactory;
ComponentDescription() ComponentDescription()
:pAsciiServiceName( NULL ) :pAsciiServiceName( nullptr )
,pAsciiImplementationName( NULL ) ,pAsciiImplementationName( nullptr )
,pFactory( NULL ) ,pFactory( nullptr )
{ {
} }
ComponentDescription( const sal_Char* _pAsciiServiceName, const sal_Char* _pAsciiImplementationName, ComponentFactory _pFactory ) ComponentDescription( const sal_Char* _pAsciiServiceName, const sal_Char* _pAsciiImplementationName, ComponentFactory _pFactory )
@ -120,7 +120,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL pdfimport_component_getFactory(
Reference< XSingleComponentFactory > xFactory; Reference< XSingleComponentFactory > xFactory;
const ComponentDescription* pComponents = lcl_getComponents(); const ComponentDescription* pComponents = lcl_getComponents();
while ( pComponents->pAsciiServiceName != NULL ) while ( pComponents->pAsciiServiceName != nullptr )
{ {
if ( sImplementationName.equalsAscii( pComponents->pAsciiImplementationName ) ) if ( sImplementationName.equalsAscii( pComponents->pAsciiImplementationName ) )
{ {

View File

@ -74,7 +74,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
uno::Reference<pdfi::PDFIRawAdaptor> xAdaptor( new pdfi::PDFIRawAdaptor(OUString(), aEnv.getComponentContext()) ); uno::Reference<pdfi::PDFIRawAdaptor> xAdaptor( new pdfi::PDFIRawAdaptor(OUString(), aEnv.getComponentContext()) );
xAdaptor->setTreeVisitorFactory(pTreeFactory); xAdaptor->setTreeVisitorFactory(pTreeFactory);
xAdaptor->odfConvert( aSrcURL, new OutputWrap(aDstURL), NULL ); xAdaptor->odfConvert( aSrcURL, new OutputWrap(aDstURL), nullptr );
} }
catch (const uno::Exception& e) catch (const uno::Exception& e)
{ {

View File

@ -72,8 +72,8 @@ class FileEmitContext : public EmitContext
FileEmitContext::FileEmitContext( const char* pFileName, const char* pOrigName, const PDFContainer* pTop ) FileEmitContext::FileEmitContext( const char* pFileName, const char* pOrigName, const PDFContainer* pTop )
: EmitContext( pTop ), : EmitContext( pTop ),
m_aHandle( NULL ), m_aHandle( nullptr ),
m_aReadHandle( NULL ), m_aReadHandle( nullptr ),
m_nReadLen( 0 ) m_nReadLen( 0 )
{ {
OUString aSysFile( OStringToOUString( OString( pFileName ), osl_getThreadTextEncoding() ) ); OUString aSysFile( OStringToOUString( OString( pFileName ), osl_getThreadTextEncoding() ) );
@ -90,7 +90,7 @@ FileEmitContext::FileEmitContext( const char* pFileName, const char* pOrigName,
{ {
fprintf( stderr, "could not truncate %s\n", pFileName ); fprintf( stderr, "could not truncate %s\n", pFileName );
osl_closeFile( m_aHandle ); osl_closeFile( m_aHandle );
m_aHandle = NULL; m_aHandle = nullptr;
} }
} }
else if( osl_openFile( aURL.pData, &m_aHandle, else if( osl_openFile( aURL.pData, &m_aHandle,
@ -344,8 +344,8 @@ int write_fonts( const char* i_pInFile, const char* i_pOutFile, PDFFile* i_pPDFF
continue; continue;
OString aFontName( pName->m_aName ); OString aFontName( pName->m_aName );
PDFObjectRef* pStreamRef = 0; PDFObjectRef* pStreamRef = nullptr;
const char* pFileType = NULL; const char* pFileType = nullptr;
// we have a font descriptor, try for a type 1 font // we have a font descriptor, try for a type 1 font
map_it = pDict->m_aMap.find( "FontFile" ); map_it = pDict->m_aMap.find( "FontFile" );
if( map_it != pDict->m_aMap.end() ) if( map_it != pDict->m_aMap.end() )
@ -424,9 +424,9 @@ int write_objects( const char* i_pInFile, const char* i_pOutFile, PDFFile* i_pPD
SAL_IMPLEMENT_MAIN_WITH_ARGS( argc, argv ) SAL_IMPLEMENT_MAIN_WITH_ARGS( argc, argv )
{ {
const char* pInFile = NULL; const char* pInFile = nullptr;
const char* pOutFile = NULL; const char* pOutFile = nullptr;
const char* pPassword = NULL; const char* pPassword = nullptr;
OStringBuffer aOutFile( 256 ); OStringBuffer aOutFile( 256 );
PDFFileHdl aHdl = write_unzipFile; PDFFileHdl aHdl = write_unzipFile;
@ -491,9 +491,9 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS( argc, argv )
return 1; return 1;
} }
} }
else if( pInFile == NULL ) else if( pInFile == nullptr )
pInFile = argv[nArg]; pInFile = argv[nArg];
else if( pOutFile == NULL ) else if( pOutFile == nullptr )
pOutFile = argv[nArg]; pOutFile = argv[nArg];
} }
if( ! pInFile ) if( ! pInFile )

View File

@ -472,12 +472,12 @@ namespace
xAdaptor->setTreeVisitorFactory( createDrawTreeVisitorFactory() ); xAdaptor->setTreeVisitorFactory( createDrawTreeVisitorFactory() );
OUString tempFileURL; OUString tempFileURL;
CPPUNIT_ASSERT( osl::File::createTempFile( NULL, NULL, &tempFileURL ) == osl::File::E_None ); CPPUNIT_ASSERT( osl::File::createTempFile( nullptr, nullptr, &tempFileURL ) == osl::File::E_None );
osl::File::remove( tempFileURL ); // FIXME the below apparently fails silently if the file already exists osl::File::remove( tempFileURL ); // FIXME the below apparently fails silently if the file already exists
CPPUNIT_ASSERT_MESSAGE("Exporting to ODF", CPPUNIT_ASSERT_MESSAGE("Exporting to ODF",
xAdaptor->odfConvert( getURLFromSrc("/sdext/source/pdfimport/test/testinput.pdf"), xAdaptor->odfConvert( getURLFromSrc("/sdext/source/pdfimport/test/testinput.pdf"),
new OutputWrap(tempFileURL), new OutputWrap(tempFileURL),
NULL )); nullptr ));
osl::File::remove( tempFileURL ); osl::File::remove( tempFileURL );
} }
@ -487,12 +487,12 @@ namespace
xAdaptor->setTreeVisitorFactory( createWriterTreeVisitorFactory() ); xAdaptor->setTreeVisitorFactory( createWriterTreeVisitorFactory() );
OUString tempFileURL; OUString tempFileURL;
CPPUNIT_ASSERT( osl::File::createTempFile( NULL, NULL, &tempFileURL ) == osl::File::E_None ); CPPUNIT_ASSERT( osl::File::createTempFile( nullptr, nullptr, &tempFileURL ) == osl::File::E_None );
osl::File::remove( tempFileURL ); // FIXME the below apparently fails silently if the file already exists osl::File::remove( tempFileURL ); // FIXME the below apparently fails silently if the file already exists
CPPUNIT_ASSERT_MESSAGE("Exporting to ODF", CPPUNIT_ASSERT_MESSAGE("Exporting to ODF",
xAdaptor->odfConvert( getURLFromSrc("/sdext/source/pdfimport/test/testinput.pdf"), xAdaptor->odfConvert( getURLFromSrc("/sdext/source/pdfimport/test/testinput.pdf"),
new OutputWrap(tempFileURL), new OutputWrap(tempFileURL),
NULL )); nullptr ));
osl::File::remove( tempFileURL ); osl::File::remove( tempFileURL );
} }

View File

@ -247,7 +247,7 @@ void DrawXmlEmitter::visit( FrameElement& elem, const std::list< Element* >::con
if( elem.Children.empty() ) if( elem.Children.empty() )
return; return;
bool bTextBox = (dynamic_cast<ParagraphElement*>(elem.Children.front()) != NULL); bool bTextBox = (dynamic_cast<ParagraphElement*>(elem.Children.front()) != nullptr);
PropertyMap aFrameProps; PropertyMap aFrameProps;
fillFrameProps( elem, aFrameProps, m_rEmitContext ); fillFrameProps( elem, aFrameProps, m_rEmitContext );
m_rEmitContext.rEmitter.beginTag( "draw:frame", aFrameProps ); m_rEmitContext.rEmitter.beginTag( "draw:frame", aFrameProps );
@ -485,7 +485,7 @@ void DrawXmlOptimizer::visit( PageElement& elem, const std::list< Element* >::co
m_rProcessor.sortElements( &elem ); m_rProcessor.sortElements( &elem );
// find paragraphs in text // find paragraphs in text
ParagraphElement* pCurPara = NULL; ParagraphElement* pCurPara = nullptr;
std::list< Element* >::iterator page_element, next_page_element; std::list< Element* >::iterator page_element, next_page_element;
next_page_element = elem.Children.begin(); next_page_element = elem.Children.begin();
double fCurLineHeight = 0.0; // average height of text items in current para double fCurLineHeight = 0.0; // average height of text items in current para
@ -561,7 +561,7 @@ void DrawXmlOptimizer::visit( PageElement& elem, const std::list< Element* >::co
line_left = pDraw->x; line_left = pDraw->x;
line_right = pDraw->x + pDraw->w; line_right = pDraw->x + pDraw->w;
// begin a new paragraph // begin a new paragraph
pCurPara = NULL; pCurPara = nullptr;
// mark draw element as character // mark draw element as character
pDraw->isCharacter = true; pDraw->isCharacter = true;
} }
@ -569,7 +569,7 @@ void DrawXmlOptimizer::visit( PageElement& elem, const std::list< Element* >::co
if( ! bInsertToParagraph ) if( ! bInsertToParagraph )
{ {
pCurPara = NULL; pCurPara = nullptr;
continue; continue;
} }
} }
@ -589,16 +589,16 @@ void DrawXmlOptimizer::visit( PageElement& elem, const std::list< Element* >::co
// if the new text is significantly distant from the paragraph // if the new text is significantly distant from the paragraph
// begin a new paragraph // begin a new paragraph
if( pGeo->y > pCurPara->y + pCurPara->h + fCurLineHeight*0.5 ) if( pGeo->y > pCurPara->y + pCurPara->h + fCurLineHeight*0.5 )
pCurPara = NULL; // insert new paragraph pCurPara = nullptr; // insert new paragraph
else if( pGeo->y > (pCurPara->y+pCurPara->h - fCurLineHeight*0.05) ) else if( pGeo->y > (pCurPara->y+pCurPara->h - fCurLineHeight*0.05) )
{ {
// new paragraph if either the last line of the paragraph // new paragraph if either the last line of the paragraph
// was significantly shorter than the paragraph as a whole // was significantly shorter than the paragraph as a whole
if( (line_right - line_left) < pCurPara->w*0.75 ) if( (line_right - line_left) < pCurPara->w*0.75 )
pCurPara = NULL; pCurPara = nullptr;
// or the last line was significantly smaller than the column width // or the last line was significantly smaller than the column width
else if( (line_right - line_left) < column_width*0.75 ) else if( (line_right - line_left) < column_width*0.75 )
pCurPara = NULL; pCurPara = nullptr;
} }
} }
@ -629,7 +629,7 @@ void DrawXmlOptimizer::visit( PageElement& elem, const std::list< Element* >::co
// move element to current paragraph // move element to current paragraph
if (! pCurPara ) // new paragraph, insert one if (! pCurPara ) // new paragraph, insert one
{ {
pCurPara = ElementFactory::createParagraphElement( NULL ); pCurPara = ElementFactory::createParagraphElement( nullptr );
// set parent // set parent
pCurPara->Parent = &elem; pCurPara->Parent = &elem;
//insert new paragraph before current element //insert new paragraph before current element

View File

@ -198,11 +198,11 @@ void ParagraphElement::visitedBy( ElementTreeVisitor& r
bool ParagraphElement::isSingleLined( PDFIProcessor& rProc ) const bool ParagraphElement::isSingleLined( PDFIProcessor& rProc ) const
{ {
std::list< Element* >::const_iterator it = Children.begin(); std::list< Element* >::const_iterator it = Children.begin();
TextElement* pText = NULL, *pLastText = NULL; TextElement* pText = nullptr, *pLastText = nullptr;
while( it != Children.end() ) while( it != Children.end() )
{ {
// a paragraph containing subparagraphs cannot be single lined // a paragraph containing subparagraphs cannot be single lined
if( dynamic_cast< ParagraphElement* >(*it) != NULL ) if( dynamic_cast< ParagraphElement* >(*it) != nullptr )
return false; return false;
pText = dynamic_cast< TextElement* >(*it); pText = dynamic_cast< TextElement* >(*it);
@ -224,7 +224,7 @@ bool ParagraphElement::isSingleLined( PDFIProcessor& rProc ) const
} }
// a paragraph without a single text is not considered single lined // a paragraph without a single text is not considered single lined
return pLastText != NULL; return pLastText != nullptr;
} }
double ParagraphElement::getLineHeight( PDFIProcessor& rProc ) const double ParagraphElement::getLineHeight( PDFIProcessor& rProc ) const
@ -233,14 +233,14 @@ double ParagraphElement::getLineHeight( PDFIProcessor& rProc ) const
for( std::list< Element* >::const_iterator it = Children.begin(); it != Children.end(); ++it ) for( std::list< Element* >::const_iterator it = Children.begin(); it != Children.end(); ++it )
{ {
ParagraphElement* pPara = dynamic_cast< ParagraphElement* >(*it); ParagraphElement* pPara = dynamic_cast< ParagraphElement* >(*it);
TextElement* pText = NULL; TextElement* pText = nullptr;
if( pPara ) if( pPara )
{ {
double lh = pPara->getLineHeight( rProc ); double lh = pPara->getLineHeight( rProc );
if( lh > line_h ) if( lh > line_h )
line_h = lh; line_h = lh;
} }
else if( (pText = dynamic_cast< TextElement* >( *it )) != NULL ) else if( (pText = dynamic_cast< TextElement* >( *it )) != nullptr )
{ {
const FontAttributes& rFont = rProc.getFont( pText->FontId ); const FontAttributes& rFont = rProc.getFont( pText->FontId );
double lh = pText->h; double lh = pText->h;
@ -255,7 +255,7 @@ double ParagraphElement::getLineHeight( PDFIProcessor& rProc ) const
TextElement* ParagraphElement::getFirstTextChild() const TextElement* ParagraphElement::getFirstTextChild() const
{ {
TextElement* pText = NULL; TextElement* pText = nullptr;
for( std::list< Element* >::const_iterator it = Children.begin(); for( std::list< Element* >::const_iterator it = Children.begin();
it != Children.end() && ! pText; ++it ) it != Children.end() && ! pText; ++it )
{ {
@ -290,7 +290,7 @@ void PageElement::updateParagraphGeometry( Element* pEle )
for( std::list< Element* >::iterator it = pEle->Children.begin(); for( std::list< Element* >::iterator it = pEle->Children.begin();
it != pEle->Children.end(); ++it ) it != pEle->Children.end(); ++it )
{ {
Element* pChild = NULL; Element* pChild = nullptr;
TextElement* pText = dynamic_cast<TextElement*>(*it); TextElement* pText = dynamic_cast<TextElement*>(*it);
if( pText ) if( pText )
pChild = pText; pChild = pText;
@ -448,7 +448,7 @@ void PageElement::resolveUnderlines( PDFIProcessor& rProc )
} }
// second: hyperlinks may be larger than their underline // second: hyperlinks may be larger than their underline
// since they are just arbitrary rectangles in the action definition // since they are just arbitrary rectangles in the action definition
else if( dynamic_cast< HyperlinkElement* >(pEle) != NULL && else if( dynamic_cast< HyperlinkElement* >(pEle) != nullptr &&
l_x >= pEle->x && r_x <= pEle->x+pEle->w ) l_x >= pEle->x && r_x <= pEle->x+pEle->w )
{ {
bRemovePoly = true; bRemovePoly = true;

View File

@ -110,7 +110,7 @@ namespace pdfi
struct ListElement : public Element struct ListElement : public Element
{ {
ListElement() : Element( NULL ) {} ListElement() : Element( nullptr ) {}
virtual void visitedBy( ElementTreeVisitor&, const std::list< Element* >::const_iterator& ) override; virtual void visitedBy( ElementTreeVisitor&, const std::list< Element* >::const_iterator& ) override;
}; };
@ -245,7 +245,7 @@ namespace pdfi
PageElement( Element* pParent, sal_Int32 nPageNr ) PageElement( Element* pParent, sal_Int32 nPageNr )
: Element( pParent ), PageNumber( nPageNr ), Hyperlinks(), : Element( pParent ), PageNumber( nPageNr ), Hyperlinks(),
TopMargin( 0.0 ), BottomMargin( 0.0 ), LeftMargin( 0.0 ), RightMargin( 0.0 ), TopMargin( 0.0 ), BottomMargin( 0.0 ), LeftMargin( 0.0 ), RightMargin( 0.0 ),
HeaderElement( NULL ), FooterElement( NULL ) HeaderElement( nullptr ), FooterElement( nullptr )
{} {}
private: private:
// helper method for resolveHyperlinks // helper method for resolveHyperlinks
@ -274,7 +274,7 @@ namespace pdfi
{ {
friend class ElementFactory; friend class ElementFactory;
protected: protected:
DocumentElement() : Element( NULL ) {} DocumentElement() : Element( nullptr ) {}
public: public:
virtual ~DocumentElement(); virtual ~DocumentElement();

View File

@ -59,8 +59,8 @@ namespace pdfi
prevCharWidth(0), prevCharWidth(0),
m_pElFactory( new ElementFactory() ), m_pElFactory( new ElementFactory() ),
m_pDocument( ElementFactory::createDocumentElement() ), m_pDocument( ElementFactory::createDocumentElement() ),
m_pCurPage(0), m_pCurPage(nullptr),
m_pCurElement(0), m_pCurElement(nullptr),
m_nNextFontId( 1 ), m_nNextFontId( 1 ),
m_aIdToFont(), m_aIdToFont(),
m_aFontToId(), m_aFontToId(),

View File

@ -87,7 +87,7 @@ const PropertyMap* StyleContainer::getProperties( sal_Int32 nStyleId ) const
{ {
std::unordered_map< sal_Int32, HashedStyle >::const_iterator it = std::unordered_map< sal_Int32, HashedStyle >::const_iterator it =
m_aIdToStyle.find( nStyleId ); m_aIdToStyle.find( nStyleId );
return it != m_aIdToStyle.end() ? &(it->second.Properties) : NULL; return it != m_aIdToStyle.end() ? &(it->second.Properties) : nullptr;
} }
sal_Int32 StyleContainer::setProperties( sal_Int32 nStyleId, const PropertyMap& rNewProps ) sal_Int32 StyleContainer::setProperties( sal_Int32 nStyleId, const PropertyMap& rNewProps )

View File

@ -43,11 +43,11 @@ namespace pdfi
Element* ContainedElement; Element* ContainedElement;
std::vector< Style* > SubStyles; std::vector< Style* > SubStyles;
Style() : ContainedElement( NULL ) {} Style() : ContainedElement( nullptr ) {}
Style( const OString& rName, const PropertyMap& rProps ) : Style( const OString& rName, const PropertyMap& rProps ) :
Name( rName ), Name( rName ),
Properties( rProps ), Properties( rProps ),
ContainedElement( NULL ) ContainedElement( nullptr )
{} {}
}; };
@ -63,7 +63,7 @@ namespace pdfi
bool IsSubStyle; bool IsSubStyle;
sal_Int32 RefCount; sal_Int32 RefCount;
HashedStyle() : ContainedElement( NULL ), IsSubStyle( true ), RefCount( 0 ) {} HashedStyle() : ContainedElement( nullptr ), IsSubStyle( true ), RefCount( 0 ) {}
HashedStyle( const HashedStyle& rRight ) : HashedStyle( const HashedStyle& rRight ) :
Name( rRight.Name ), Name( rRight.Name ),

View File

@ -199,7 +199,7 @@ void WriterXmlEmitter::visit( FrameElement& elem, const std::list< Element* >::c
if( elem.Children.empty() ) if( elem.Children.empty() )
return; return;
bool bTextBox = (dynamic_cast<ParagraphElement*>(elem.Children.front()) != NULL); bool bTextBox = (dynamic_cast<ParagraphElement*>(elem.Children.front()) != nullptr);
PropertyMap aFrameProps; PropertyMap aFrameProps;
fillFrameProps( elem, aFrameProps, m_rEmitContext ); fillFrameProps( elem, aFrameProps, m_rEmitContext );
m_rEmitContext.rEmitter.beginTag( "draw:frame", aFrameProps ); m_rEmitContext.rEmitter.beginTag( "draw:frame", aFrameProps );
@ -321,7 +321,7 @@ void WriterXmlEmitter::visit( DocumentElement& elem, const std::list< Element* >
// currently these are only DrawElement types // currently these are only DrawElement types
for( std::list< Element* >::iterator child_it = pPage->Children.begin(); child_it != pPage->Children.end(); ++child_it ) for( std::list< Element* >::iterator child_it = pPage->Children.begin(); child_it != pPage->Children.end(); ++child_it )
{ {
if( dynamic_cast<DrawElement*>(*child_it) != NULL ) if( dynamic_cast<DrawElement*>(*child_it) != nullptr )
(*child_it)->visitedBy( *this, child_it ); (*child_it)->visitedBy( *this, child_it );
} }
} }
@ -332,7 +332,7 @@ void WriterXmlEmitter::visit( DocumentElement& elem, const std::list< Element* >
// only DrawElement types // only DrawElement types
for( std::list< Element* >::iterator it = elem.Children.begin(); it != elem.Children.end(); ++it ) for( std::list< Element* >::iterator it = elem.Children.begin(); it != elem.Children.end(); ++it )
{ {
if( dynamic_cast<DrawElement*>(*it) == NULL ) if( dynamic_cast<DrawElement*>(*it) == nullptr )
(*it)->visitedBy( *this, it ); (*it)->visitedBy( *this, it );
} }
@ -425,7 +425,7 @@ void WriterXmlOptimizer::visit( ParagraphElement& elem, const std::list< Element
{ {
// find if there is a previous paragraph that might be a heading for this one // find if there is a previous paragraph that might be a heading for this one
std::list<Element*>::const_iterator prev = rParentIt; std::list<Element*>::const_iterator prev = rParentIt;
ParagraphElement* pPrevPara = NULL; ParagraphElement* pPrevPara = nullptr;
while( prev != elem.Parent->Children.begin() ) while( prev != elem.Parent->Children.begin() )
{ {
--prev; --prev;
@ -487,7 +487,7 @@ void WriterXmlOptimizer::visit( PageElement& elem, const std::list< Element* >::
m_rProcessor.sortElements( &elem ); m_rProcessor.sortElements( &elem );
// find paragraphs in text // find paragraphs in text
ParagraphElement* pCurPara = NULL; ParagraphElement* pCurPara = nullptr;
std::list< Element* >::iterator page_element, next_page_element; std::list< Element* >::iterator page_element, next_page_element;
next_page_element = elem.Children.begin(); next_page_element = elem.Children.begin();
double fCurLineHeight = 0.0; // average height of text items in current para double fCurLineHeight = 0.0; // average height of text items in current para
@ -563,7 +563,7 @@ void WriterXmlOptimizer::visit( PageElement& elem, const std::list< Element* >::
line_left = pDraw->x; line_left = pDraw->x;
line_right = pDraw->x + pDraw->w; line_right = pDraw->x + pDraw->w;
// begin a new paragraph // begin a new paragraph
pCurPara = NULL; pCurPara = nullptr;
// mark draw element as character // mark draw element as character
pDraw->isCharacter = true; pDraw->isCharacter = true;
} }
@ -571,7 +571,7 @@ void WriterXmlOptimizer::visit( PageElement& elem, const std::list< Element* >::
if( ! bInsertToParagraph ) if( ! bInsertToParagraph )
{ {
pCurPara = NULL; pCurPara = nullptr;
continue; continue;
} }
} }
@ -591,16 +591,16 @@ void WriterXmlOptimizer::visit( PageElement& elem, const std::list< Element* >::
// if the new text is significantly distant from the paragraph // if the new text is significantly distant from the paragraph
// begin a new paragraph // begin a new paragraph
if( pGeo->y > pCurPara->y+pCurPara->h + fCurLineHeight*0.5 ) if( pGeo->y > pCurPara->y+pCurPara->h + fCurLineHeight*0.5 )
pCurPara = NULL; // insert new paragraph pCurPara = nullptr; // insert new paragraph
else if( pGeo->y > (pCurPara->y+pCurPara->h - fCurLineHeight*0.05) ) else if( pGeo->y > (pCurPara->y+pCurPara->h - fCurLineHeight*0.05) )
{ {
// new paragraph if either the last line of the paragraph // new paragraph if either the last line of the paragraph
// was significantly shorter than the paragraph as a whole // was significantly shorter than the paragraph as a whole
if( (line_right - line_left) < pCurPara->w*0.75 ) if( (line_right - line_left) < pCurPara->w*0.75 )
pCurPara = NULL; pCurPara = nullptr;
// or the last line was significantly smaller than the column width // or the last line was significantly smaller than the column width
else if( (line_right - line_left) < column_width*0.75 ) else if( (line_right - line_left) < column_width*0.75 )
pCurPara = NULL; pCurPara = nullptr;
} }
} }
} }
@ -626,7 +626,7 @@ void WriterXmlOptimizer::visit( PageElement& elem, const std::list< Element* >::
// move element to current paragraph // move element to current paragraph
if( ! pCurPara ) // new paragraph, insert one if( ! pCurPara ) // new paragraph, insert one
{ {
pCurPara = ElementFactory::createParagraphElement( NULL ); pCurPara = ElementFactory::createParagraphElement( nullptr );
// set parent // set parent
pCurPara->Parent = &elem; pCurPara->Parent = &elem;
//insert new paragraph before current element //insert new paragraph before current element
@ -674,15 +674,15 @@ void WriterXmlOptimizer::checkHeaderAndFooter( PageElement& rElem )
if( pPara->y+pPara->h < rElem.h*0.15 && pPara->isSingleLined( m_rProcessor ) ) if( pPara->y+pPara->h < rElem.h*0.15 && pPara->isSingleLined( m_rProcessor ) )
{ {
std::list< Element* >::iterator next_it = it; std::list< Element* >::iterator next_it = it;
ParagraphElement* pNextPara = NULL; ParagraphElement* pNextPara = nullptr;
while( ++next_it != rElem.Children.end() && pNextPara == NULL ) while( ++next_it != rElem.Children.end() && pNextPara == nullptr )
{ {
pNextPara = dynamic_cast<ParagraphElement*>(*next_it); pNextPara = dynamic_cast<ParagraphElement*>(*next_it);
} }
if( pNextPara && pNextPara->y > pPara->y+pPara->h*2 ) if( pNextPara && pNextPara->y > pPara->y+pPara->h*2 )
{ {
rElem.HeaderElement = pPara; rElem.HeaderElement = pPara;
pPara->Parent = NULL; pPara->Parent = nullptr;
rElem.Children.remove( pPara ); rElem.Children.remove( pPara );
} }
} }
@ -701,15 +701,15 @@ void WriterXmlOptimizer::checkHeaderAndFooter( PageElement& rElem )
if( pPara->y > rElem.h*0.85 && pPara->isSingleLined( m_rProcessor ) ) if( pPara->y > rElem.h*0.85 && pPara->isSingleLined( m_rProcessor ) )
{ {
std::list< Element* >::reverse_iterator next_it = rit; std::list< Element* >::reverse_iterator next_it = rit;
ParagraphElement* pNextPara = NULL; ParagraphElement* pNextPara = nullptr;
while( ++next_it != rElem.Children.rend() && pNextPara == NULL ) while( ++next_it != rElem.Children.rend() && pNextPara == nullptr )
{ {
pNextPara = dynamic_cast<ParagraphElement*>(*next_it); pNextPara = dynamic_cast<ParagraphElement*>(*next_it);
} }
if( pNextPara && pNextPara->y < pPara->y-pPara->h*2 ) if( pNextPara && pNextPara->y < pPara->y-pPara->h*2 )
{ {
rElem.FooterElement = pPara; rElem.FooterElement = pPara;
pPara->Parent = NULL; pPara->Parent = nullptr;
rElem.Children.remove( pPara ); rElem.Children.remove( pPara );
} }
} }
@ -996,7 +996,7 @@ void WriterXmlFinalizer::visit( ParagraphElement& elem, const std::list< Element
// check whether to leave some space to next paragraph // check whether to leave some space to next paragraph
// find whether there is a next paragraph // find whether there is a next paragraph
std::list< Element* >::const_iterator it = rParentIt; std::list< Element* >::const_iterator it = rParentIt;
const ParagraphElement* pNextPara = NULL; const ParagraphElement* pNextPara = nullptr;
while( ++it != elem.Parent->Children.end() && ! pNextPara ) while( ++it != elem.Parent->Children.end() && ! pNextPara )
pNextPara = dynamic_cast< const ParagraphElement* >(*it); pNextPara = dynamic_cast< const ParagraphElement* >(*it);
if( pNextPara ) if( pNextPara )
@ -1091,7 +1091,7 @@ void WriterXmlFinalizer::visit( PageElement& elem, const std::list< Element* >::
// calculate page margins out of the relevant children (paragraphs) // calculate page margins out of the relevant children (paragraphs)
elem.TopMargin = elem.h, elem.BottomMargin = 0, elem.LeftMargin = elem.w, elem.RightMargin = 0; elem.TopMargin = elem.h, elem.BottomMargin = 0, elem.LeftMargin = elem.w, elem.RightMargin = 0;
// first element should be a paragraphy // first element should be a paragraphy
ParagraphElement* pFirstPara = NULL; ParagraphElement* pFirstPara = nullptr;
for( std::list< Element* >::const_iterator it = elem.Children.begin(); it != elem.Children.end(); ++it ) for( std::list< Element* >::const_iterator it = elem.Children.begin(); it != elem.Children.end(); ++it )
{ {
if( dynamic_cast<ParagraphElement*>( *it ) ) if( dynamic_cast<ParagraphElement*>( *it ) )
@ -1211,7 +1211,7 @@ void WriterXmlFinalizer::visit( PageElement& elem, const std::list< Element* >::
// no paragraph or other elements before the first paragraph // no paragraph or other elements before the first paragraph
if( ! pFirstPara ) if( ! pFirstPara )
{ {
pFirstPara = ElementFactory::createParagraphElement( NULL ); pFirstPara = ElementFactory::createParagraphElement( nullptr );
pFirstPara->Parent = &elem; pFirstPara->Parent = &elem;
elem.Children.push_front( pFirstPara ); elem.Children.push_front( pFirstPara );
} }

View File

@ -208,7 +208,7 @@ namespace
const sal_Char* pRead(pOrig); const sal_Char* pRead(pOrig);
sal_Char* pWrite(pBuffer); sal_Char* pWrite(pBuffer);
const sal_Char* pCur(pOrig); const sal_Char* pCur(pOrig);
while ((pCur = strchr(pCur, '\\')) != 0) while ((pCur = strchr(pCur, '\\')) != nullptr)
{ {
const sal_Char cNext(pCur[1]); const sal_Char cNext(pCur[1]);
if (cNext == 'n' || cNext == 'r' || cNext == '\\') if (cNext == 'n' || cNext == 'r' || cNext == '\\')
@ -1070,9 +1070,9 @@ bool xpdf_ImportFromFile( const OUString& rURL,
sal_Int32 nArgs = rFilterOptions.isEmpty() ? 2 : 4; sal_Int32 nArgs = rFilterOptions.isEmpty() ? 2 : 4;
oslProcess aProcess; oslProcess aProcess;
oslFileHandle pIn = NULL; oslFileHandle pIn = nullptr;
oslFileHandle pOut = NULL; oslFileHandle pOut = nullptr;
oslFileHandle pErr = NULL; oslFileHandle pErr = nullptr;
oslSecurity pSecurity = osl_getCurrentSecurity (); oslSecurity pSecurity = osl_getCurrentSecurity ();
oslProcessError eErr = oslProcessError eErr =
osl_executeProcess_WithRedirectedIO(converterURL.pData, osl_executeProcess_WithRedirectedIO(converterURL.pData,
@ -1080,7 +1080,7 @@ bool xpdf_ImportFromFile( const OUString& rURL,
nArgs, nArgs,
osl_Process_SEARCHPATH|osl_Process_HIDDEN, osl_Process_SEARCHPATH|osl_Process_HIDDEN,
pSecurity, pSecurity,
0, 0, 0, nullptr, nullptr, 0,
&aProcess, &pIn, &pOut, &pErr); &aProcess, &pIn, &pOut, &pErr);
osl_freeSecurityHandle(pSecurity); osl_freeSecurityHandle(pSecurity);
@ -1206,9 +1206,9 @@ bool xpdf_ImportFromStream( const uno::Reference< io::XInputStream >& xI
OSL_ASSERT(rSink); OSL_ASSERT(rSink);
// convert XInputStream to local temp file // convert XInputStream to local temp file
oslFileHandle aFile = NULL; oslFileHandle aFile = nullptr;
OUString aURL; OUString aURL;
if( osl_createTempFile( NULL, &aFile, &aURL.pData ) != osl_File_E_None ) if( osl_createTempFile( nullptr, &aFile, &aURL.pData ) != osl_File_E_None )
return false; return false;
// copy content, buffered... // copy content, buffered...

View File

@ -874,7 +874,7 @@ void PDFOutDev::drawChar(GfxState *state, double x, double y,
{ {
assert(state); assert(state);
if( u == NULL ) if( u == nullptr )
return; return;
double csdx = 0.0; double csdx = 0.0;

View File

@ -640,7 +640,7 @@ void PresenterAccessible::UpdateAccessibilityHierarchy (
if (mpAccessiblePreview.is()) if (mpAccessiblePreview.is())
{ {
mpAccessibleConsole->RemoveChild(mpAccessiblePreview); mpAccessibleConsole->RemoveChild(mpAccessiblePreview);
mpAccessiblePreview = NULL; mpAccessiblePreview = nullptr;
} }
mxPreviewContentWindow = rxPreviewContentWindow; mxPreviewContentWindow = rxPreviewContentWindow;
@ -663,7 +663,7 @@ void PresenterAccessible::UpdateAccessibilityHierarchy (
if (mpAccessibleNotes.is()) if (mpAccessibleNotes.is())
{ {
mpAccessibleConsole->RemoveChild(mpAccessibleNotes); mpAccessibleConsole->RemoveChild(mpAccessibleNotes);
mpAccessibleNotes = NULL; mpAccessibleNotes = nullptr;
} }
mxNotesContentWindow = rxNotesContentWindow; mxNotesContentWindow = rxNotesContentWindow;
@ -706,11 +706,11 @@ void PresenterAccessible::NotifyCurrentSlideChange (
void SAL_CALL PresenterAccessible::disposing() void SAL_CALL PresenterAccessible::disposing()
{ {
UpdateAccessibilityHierarchy( UpdateAccessibilityHierarchy(
NULL, nullptr,
NULL, nullptr,
OUString(), OUString(),
NULL, nullptr,
NULL, nullptr,
std::shared_ptr<PresenterTextView>()); std::shared_ptr<PresenterTextView>());
if (mxMainWindow.is()) if (mxMainWindow.is())
@ -718,12 +718,12 @@ void SAL_CALL PresenterAccessible::disposing()
mxMainWindow->removeFocusListener(this); mxMainWindow->removeFocusListener(this);
if (mxMainPane.is()) if (mxMainPane.is())
mxMainPane->setAccessible(NULL); mxMainPane->setAccessible(nullptr);
} }
mpAccessiblePreview = NULL; mpAccessiblePreview = nullptr;
mpAccessibleNotes = NULL; mpAccessibleNotes = nullptr;
mpAccessibleConsole = NULL; mpAccessibleConsole = nullptr;
} }
//----- XAccessible ----------------------------------------------------------- //----- XAccessible -----------------------------------------------------------
@ -741,7 +741,7 @@ Reference<XAccessibleContext> SAL_CALL PresenterAccessible::getAccessibleContext
} }
mpAccessibleConsole = AccessibleConsole::Create( mpAccessibleConsole = AccessibleConsole::Create(
mxComponentContext, css::lang::Locale()); mxComponentContext, css::lang::Locale());
mpAccessibleConsole->SetWindow(mxMainWindow, NULL); mpAccessibleConsole->SetWindow(mxMainWindow, nullptr);
mpAccessibleConsole->SetAccessibleParent(mxAccessibleParent); mpAccessibleConsole->SetAccessibleParent(mxAccessibleParent);
UpdateAccessibilityHierarchy(); UpdateAccessibilityHierarchy();
if (mpPresenterController.is()) if (mpPresenterController.is())
@ -766,7 +766,7 @@ void SAL_CALL PresenterAccessible::focusLost (const css::awt::FocusEvent& rEvent
{ {
(void)rEvent; (void)rEvent;
SAL_INFO("sdext.presenter", OSL_THIS_FUNC << ": PresenterAccessible::focusLost at " << this); SAL_INFO("sdext.presenter", OSL_THIS_FUNC << ": PresenterAccessible::focusLost at " << this);
AccessibleFocusManager::Instance()->FocusObject(NULL); AccessibleFocusManager::Instance()->FocusObject(nullptr);
} }
//----- XEventListener ---------------------------------------------------- //----- XEventListener ----------------------------------------------------
@ -775,7 +775,7 @@ void SAL_CALL PresenterAccessible::disposing (const css::lang::EventObject& rEve
throw (css::uno::RuntimeException, std::exception) throw (css::uno::RuntimeException, std::exception)
{ {
if (rEvent.Source == mxMainWindow) if (rEvent.Source == mxMainWindow)
mxMainWindow = NULL; mxMainWindow = nullptr;
} }
//----- XInitialize ----------------------------------------------------------- //----- XInitialize -----------------------------------------------------------
@ -854,7 +854,7 @@ void PresenterAccessible::AccessibleObject::SetAccessibleParent (
void SAL_CALL PresenterAccessible::AccessibleObject::disposing() void SAL_CALL PresenterAccessible::AccessibleObject::disposing()
{ {
AccessibleFocusManager::Instance()->RemoveFocusableObject(this); AccessibleFocusManager::Instance()->RemoveFocusableObject(this);
SetWindow(NULL, NULL); SetWindow(nullptr, nullptr);
} }
//----- XAccessible ------------------------------------------------------- //----- XAccessible -------------------------------------------------------
@ -956,7 +956,7 @@ Reference<XAccessibleRelationSet> SAL_CALL
{ {
ThrowIfDisposed(); ThrowIfDisposed();
return NULL; return nullptr;
} }
Reference<XAccessibleStateSet> SAL_CALL Reference<XAccessibleStateSet> SAL_CALL
@ -1164,12 +1164,12 @@ void SAL_CALL PresenterAccessible::AccessibleObject::disposing (const css::lang:
{ {
if (rEvent.Source == mxContentWindow) if (rEvent.Source == mxContentWindow)
{ {
mxContentWindow = NULL; mxContentWindow = nullptr;
mxBorderWindow = NULL; mxBorderWindow = nullptr;
} }
else else
{ {
SetWindow(NULL, NULL); SetWindow(nullptr, nullptr);
} }
} }
@ -1813,7 +1813,7 @@ bool PresenterAccessible::AccessibleParagraph::GetWindowState (const sal_Int16 n
switch (nType) switch (nType)
{ {
case AccessibleStateType::EDITABLE: case AccessibleStateType::EDITABLE:
return mpParagraph.get()!=NULL; return mpParagraph.get()!=nullptr;
case AccessibleStateType::ACTIVE: case AccessibleStateType::ACTIVE:
return true; return true;

View File

@ -107,7 +107,7 @@ SharedBitmapDescriptor PresenterBitmapContainer::GetBitmap (
BitmapContainer::const_iterator iSet (maIconContainer.find(rsName)); BitmapContainer::const_iterator iSet (maIconContainer.find(rsName));
if (iSet != maIconContainer.end()) if (iSet != maIconContainer.end())
return iSet->second; return iSet->second;
else if (mpParentContainer.get() != NULL) else if (mpParentContainer.get() != nullptr)
return mpParentContainer->GetBitmap(rsName); return mpParentContainer->GetBitmap(rsName);
else else
return SharedBitmapDescriptor(); return SharedBitmapDescriptor();
@ -315,7 +315,7 @@ PresenterBitmapContainer::BitmapDescriptor::BitmapDescriptor (
mxDisabledBitmap(), mxDisabledBitmap(),
mxMaskBitmap() mxMaskBitmap()
{ {
if (rpDefault.get() != NULL) if (rpDefault.get() != nullptr)
{ {
mnWidth = rpDefault->mnWidth; mnWidth = rpDefault->mnWidth;
mnHeight = rpDefault->mnHeight; mnHeight = rpDefault->mnHeight;

View File

@ -92,13 +92,13 @@ public:
const std::shared_ptr<PresenterBitmapContainer>& rpParentContainer, const std::shared_ptr<PresenterBitmapContainer>& rpParentContainer,
const css::uno::Reference<css::uno::XComponentContext>& rxComponentContext, const css::uno::Reference<css::uno::XComponentContext>& rxComponentContext,
const css::uno::Reference<css::rendering::XCanvas>& rxCanvas, const css::uno::Reference<css::rendering::XCanvas>& rxCanvas,
const css::uno::Reference<css::drawing::XPresenterHelper>& rxPresenterHelper = NULL); const css::uno::Reference<css::drawing::XPresenterHelper>& rxPresenterHelper = nullptr);
PresenterBitmapContainer ( PresenterBitmapContainer (
const css::uno::Reference<css::container::XNameAccess>& rsRootNode, const css::uno::Reference<css::container::XNameAccess>& rsRootNode,
const std::shared_ptr<PresenterBitmapContainer>& rpParentContainer, const std::shared_ptr<PresenterBitmapContainer>& rpParentContainer,
const css::uno::Reference<css::uno::XComponentContext>& rxComponentContext, const css::uno::Reference<css::uno::XComponentContext>& rxComponentContext,
const css::uno::Reference<css::rendering::XCanvas>& rxCanvas, const css::uno::Reference<css::rendering::XCanvas>& rxCanvas,
const css::uno::Reference<css::drawing::XPresenterHelper>& rxPresenterHelper = NULL); const css::uno::Reference<css::drawing::XPresenterHelper>& rxPresenterHelper = nullptr);
~PresenterBitmapContainer(); ~PresenterBitmapContainer();
void Initialize ( void Initialize (

View File

@ -58,11 +58,11 @@ const static double gnVerticalBorder (5);
PresenterConfigurationAccess::GetProperty(xProperties, "Action") >>= sAction; PresenterConfigurationAccess::GetProperty(xProperties, "Action") >>= sAction;
PresenterTheme::SharedFontDescriptor pFont; PresenterTheme::SharedFontDescriptor pFont;
if (rpTheme.get() != NULL) if (rpTheme.get() != nullptr)
pFont = rpTheme->GetFont("ButtonFont"); pFont = rpTheme->GetFont("ButtonFont");
PresenterTheme::SharedFontDescriptor pMouseOverFont; PresenterTheme::SharedFontDescriptor pMouseOverFont;
if (rpTheme.get() != NULL) if (rpTheme.get() != nullptr)
pMouseOverFont = rpTheme->GetFont("ButtonMouseOverFont"); pMouseOverFont = rpTheme->GetFont("ButtonMouseOverFont");
rtl::Reference<PresenterButton> pButton ( rtl::Reference<PresenterButton> pButton (
@ -79,7 +79,7 @@ const static double gnVerticalBorder (5);
return pButton; return pButton;
} }
else else
return NULL; return nullptr;
} }
PresenterButton::PresenterButton ( PresenterButton::PresenterButton (
@ -153,7 +153,7 @@ void SAL_CALL PresenterButton::disposing()
if (mxCanvas.is()) if (mxCanvas.is())
{ {
Reference<lang::XComponent> xComponent (mxCanvas, UNO_QUERY); Reference<lang::XComponent> xComponent (mxCanvas, UNO_QUERY);
mxCanvas = NULL; mxCanvas = nullptr;
if (xComponent.is()) if (xComponent.is())
xComponent->dispose(); xComponent->dispose();
} }
@ -165,7 +165,7 @@ void SAL_CALL PresenterButton::disposing()
mxWindow->removeMouseListener(this); mxWindow->removeMouseListener(this);
mxWindow->removeMouseMotionListener(this); mxWindow->removeMouseMotionListener(this);
Reference<lang::XComponent> xComponent (mxWindow, UNO_QUERY); Reference<lang::XComponent> xComponent (mxWindow, UNO_QUERY);
mxWindow = NULL; mxWindow = nullptr;
if (xComponent.is()) if (xComponent.is())
xComponent->dispose(); xComponent->dispose();
} }
@ -201,7 +201,7 @@ void PresenterButton::SetCanvas (
if (mxCanvas.is()) if (mxCanvas.is())
{ {
Reference<lang::XComponent> xComponent (mxCanvas, UNO_QUERY); Reference<lang::XComponent> xComponent (mxCanvas, UNO_QUERY);
mxCanvas = NULL; mxCanvas = nullptr;
if (xComponent.is()) if (xComponent.is())
xComponent->dispose(); xComponent->dispose();
} }
@ -277,7 +277,7 @@ void SAL_CALL PresenterButton::windowPaint (const css::awt::PaintEvent& rEvent)
rendering::ViewState aViewState( rendering::ViewState aViewState(
geometry::AffineMatrix2D(1,0,0, 0,1,0), geometry::AffineMatrix2D(1,0,0, 0,1,0),
NULL); nullptr);
rendering::RenderState aRenderState( rendering::RenderState aRenderState(
geometry::AffineMatrix2D(1,0,0, 0,1,0), geometry::AffineMatrix2D(1,0,0, 0,1,0),
PresenterGeometryHelper::CreatePolygon(rEvent.UpdateRect, mxCanvas->getDevice()), PresenterGeometryHelper::CreatePolygon(rEvent.UpdateRect, mxCanvas->getDevice()),
@ -310,7 +310,7 @@ void SAL_CALL PresenterButton::mouseReleased (const css::awt::MouseEvent& rEvent
if (meState == PresenterBitmapDescriptor::ButtonDown) if (meState == PresenterBitmapDescriptor::ButtonDown)
{ {
OSL_ASSERT(mpPresenterController.get()!=NULL); OSL_ASSERT(mpPresenterController.get()!=nullptr);
mpPresenterController->DispatchUnoCommand(msAction); mpPresenterController->DispatchUnoCommand(msAction);
meState = PresenterBitmapDescriptor::Normal; meState = PresenterBitmapDescriptor::Normal;
@ -358,16 +358,16 @@ void SAL_CALL PresenterButton::disposing (const css::lang::EventObject& rEvent)
throw (css::uno::RuntimeException, std::exception) throw (css::uno::RuntimeException, std::exception)
{ {
if (rEvent.Source == mxWindow) if (rEvent.Source == mxWindow)
mxWindow = NULL; mxWindow = nullptr;
} }
css::geometry::IntegerSize2D PresenterButton::CalculateButtonSize() css::geometry::IntegerSize2D PresenterButton::CalculateButtonSize()
{ {
if (mpFont.get()!=NULL && !mpFont->mxFont.is() && mxCanvas.is()) if (mpFont.get()!=nullptr && !mpFont->mxFont.is() && mxCanvas.is())
mpFont->PrepareFont(mxCanvas); mpFont->PrepareFont(mxCanvas);
if (mpFont.get()==NULL || !mpFont->mxFont.is()) if (mpFont.get()==nullptr || !mpFont->mxFont.is())
return geometry::IntegerSize2D(-1,-1); return geometry::IntegerSize2D(-1,-1);
geometry::RealSize2D aTextSize (PresenterCanvasHelper::GetTextSize(mpFont->mxFont,msText)); geometry::RealSize2D aTextSize (PresenterCanvasHelper::GetTextSize(mpFont->mxFont,msText));
@ -399,7 +399,7 @@ void PresenterButton::RenderButton (
GetBitmap(rpCenter, eMode), GetBitmap(rpCenter, eMode),
GetBitmap(rpRight, eMode)); GetBitmap(rpRight, eMode));
if (rpFont.get()==NULL || ! rpFont->mxFont.is()) if (rpFont.get()==nullptr || ! rpFont->mxFont.is())
return; return;
const rendering::StringContext aContext (msText, 0, msText.getLength()); const rendering::StringContext aContext (msText, 0, msText.getLength());
@ -407,7 +407,7 @@ void PresenterButton::RenderButton (
rpFont->mxFont->createTextLayout(aContext,rendering::TextDirection::WEAK_LEFT_TO_RIGHT,0)); rpFont->mxFont->createTextLayout(aContext,rendering::TextDirection::WEAK_LEFT_TO_RIGHT,0));
const geometry::RealRectangle2D aTextBBox (xLayout->queryTextBounds()); const geometry::RealRectangle2D aTextBBox (xLayout->queryTextBounds());
rendering::RenderState aRenderState (geometry::AffineMatrix2D(1,0,0, 0,1,0), NULL, rendering::RenderState aRenderState (geometry::AffineMatrix2D(1,0,0, 0,1,0), nullptr,
Sequence<double>(4), rendering::CompositeOperation::SOURCE); Sequence<double>(4), rendering::CompositeOperation::SOURCE);
PresenterCanvasHelper::SetDeviceColor(aRenderState, rpFont->mnColor); PresenterCanvasHelper::SetDeviceColor(aRenderState, rpFont->mnColor);
@ -417,7 +417,7 @@ void PresenterButton::RenderButton (
/// this is responsible of the close button /// this is responsible of the close button
rxCanvas->drawTextLayout( rxCanvas->drawTextLayout(
xLayout, xLayout,
rendering::ViewState(geometry::AffineMatrix2D(1,0,0, 0,1,0), NULL), rendering::ViewState(geometry::AffineMatrix2D(1,0,0, 0,1,0), nullptr),
aRenderState); aRenderState);
} }
@ -430,12 +430,12 @@ Reference<rendering::XBitmap> PresenterButton::GetBitmap (
const SharedBitmapDescriptor& mpIcon, const SharedBitmapDescriptor& mpIcon,
const PresenterBitmapDescriptor::Mode eMode) const PresenterBitmapDescriptor::Mode eMode)
{ {
if (mpIcon.get() != NULL) if (mpIcon.get() != nullptr)
return mpIcon->GetBitmap(eMode); return mpIcon->GetBitmap(eMode);
else else
{ {
OSL_ASSERT(mpIcon.get()!=NULL); OSL_ASSERT(mpIcon.get()!=nullptr);
return NULL; return nullptr;
} }
} }
@ -470,7 +470,7 @@ void PresenterButton::SetupButtonBitmaps()
mxMouseOverBitmap = mxCanvas->getDevice()->createCompatibleAlphaBitmap(maButtonSize); mxMouseOverBitmap = mxCanvas->getDevice()->createCompatibleAlphaBitmap(maButtonSize);
xCanvas.set(mxMouseOverBitmap, UNO_QUERY); xCanvas.set(mxMouseOverBitmap, UNO_QUERY);
if (mpMouseOverFont.get()!=NULL && !mpMouseOverFont->mxFont.is() && mxCanvas.is()) if (mpMouseOverFont.get()!=nullptr && !mpMouseOverFont->mxFont.is() && mxCanvas.is())
mpMouseOverFont->PrepareFont(mxCanvas); mpMouseOverFont->PrepareFont(mxCanvas);
if (xCanvas.is()) if (xCanvas.is())
RenderButton( RenderButton(

View File

@ -33,10 +33,10 @@ namespace sdext { namespace presenter {
PresenterCanvasHelper::PresenterCanvasHelper() PresenterCanvasHelper::PresenterCanvasHelper()
: maDefaultViewState( : maDefaultViewState(
geometry::AffineMatrix2D(1,0,0, 0,1,0), geometry::AffineMatrix2D(1,0,0, 0,1,0),
NULL), nullptr),
maDefaultRenderState( maDefaultRenderState(
geometry::AffineMatrix2D(1,0,0, 0,1,0), geometry::AffineMatrix2D(1,0,0, 0,1,0),
NULL, nullptr,
Sequence<double>(4), Sequence<double>(4),
rendering::CompositeOperation::SOURCE) rendering::CompositeOperation::SOURCE)
{ {
@ -66,7 +66,7 @@ void PresenterCanvasHelper::PaintRectangle (
const css::rendering::ViewState& rDefaultViewState, const css::rendering::ViewState& rDefaultViewState,
const css::rendering::RenderState& rDefaultRenderState) const css::rendering::RenderState& rDefaultRenderState)
{ {
if (rpBitmap.get() == NULL) if (rpBitmap.get() == nullptr)
return; return;
if ( ! rxCanvas.is() || ! rxCanvas->getDevice().is()) if ( ! rxCanvas.is() || ! rxCanvas->getDevice().is())

View File

@ -36,15 +36,15 @@ static const struct ImplementationEntry gServiceEntries[] =
PresenterProtocolHandler::Create, PresenterProtocolHandler::Create,
PresenterProtocolHandler::getImplementationName_static, PresenterProtocolHandler::getImplementationName_static,
PresenterProtocolHandler::getSupportedServiceNames_static, PresenterProtocolHandler::getSupportedServiceNames_static,
createSingleComponentFactory, 0, 0 createSingleComponentFactory, nullptr, 0
}, },
{ {
PresenterScreenJob::Create, PresenterScreenJob::Create,
PresenterScreenJob::getImplementationName_static, PresenterScreenJob::getImplementationName_static,
PresenterScreenJob::getSupportedServiceNames_static, PresenterScreenJob::getSupportedServiceNames_static,
createSingleComponentFactory, 0, 0 createSingleComponentFactory, nullptr, 0
}, },
{ 0, 0, 0, 0, 0, 0 } { nullptr, nullptr, nullptr, nullptr, nullptr, 0 }
}; };
extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL presenter_component_getFactory( extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL presenter_component_getFactory(

View File

@ -114,7 +114,7 @@ bool PresenterConfigurationAccess::GoToChild (const OUString& rsPathToNode)
return true; return true;
} }
mxRoot = NULL; mxRoot = nullptr;
return false; return false;
} }
@ -127,7 +127,7 @@ bool PresenterConfigurationAccess::GoToChild (const Predicate& rPredicate)
if (Reference<XInterface>(maNode, UNO_QUERY).is()) if (Reference<XInterface>(maNode, UNO_QUERY).is())
return true; return true;
mxRoot = NULL; mxRoot = nullptr;
return false; return false;
} }

View File

@ -204,14 +204,14 @@ void PresenterController::disposing()
mxMainWindow->removeFocusListener(this); mxMainWindow->removeFocusListener(this);
mxMainWindow->removeMouseListener(this); mxMainWindow->removeMouseListener(this);
mxMainWindow->removeMouseMotionListener(this); mxMainWindow->removeMouseMotionListener(this);
mxMainWindow = NULL; mxMainWindow = nullptr;
} }
if (mxConfigurationController.is()) if (mxConfigurationController.is())
mxConfigurationController->removeConfigurationChangeListener(this); mxConfigurationController->removeConfigurationChangeListener(this);
Reference<XComponent> xWindowManagerComponent ( Reference<XComponent> xWindowManagerComponent (
static_cast<XWeak*>(mpWindowManager.get()), UNO_QUERY); static_cast<XWeak*>(mpWindowManager.get()), UNO_QUERY);
mpWindowManager = NULL; mpWindowManager = nullptr;
if (xWindowManagerComponent.is()) if (xWindowManagerComponent.is())
xWindowManagerComponent->dispose(); xWindowManagerComponent->dispose();
@ -220,29 +220,29 @@ void PresenterController::disposing()
Reference<frame::XFrame> xFrame (mxController->getFrame()); Reference<frame::XFrame> xFrame (mxController->getFrame());
if (xFrame.is()) if (xFrame.is())
xFrame->removeFrameActionListener(this); xFrame->removeFrameActionListener(this);
mxController = NULL; mxController = nullptr;
} }
mxComponentContext = NULL; mxComponentContext = nullptr;
mxConfigurationController = NULL; mxConfigurationController = nullptr;
mxSlideShowController = NULL; mxSlideShowController = nullptr;
mxMainPaneId = NULL; mxMainPaneId = nullptr;
mpPaneContainer = NULL; mpPaneContainer = nullptr;
mnCurrentSlideIndex = -1; mnCurrentSlideIndex = -1;
mxCurrentSlide = NULL; mxCurrentSlide = nullptr;
mxNextSlide = NULL; mxNextSlide = nullptr;
mpTheme.reset(); mpTheme.reset();
{ {
Reference<lang::XComponent> xComponent ( Reference<lang::XComponent> xComponent (
static_cast<XWeak*>(mpPaneBorderPainter.get()), UNO_QUERY); static_cast<XWeak*>(mpPaneBorderPainter.get()), UNO_QUERY);
mpPaneBorderPainter = NULL; mpPaneBorderPainter = nullptr;
if (xComponent.is()) if (xComponent.is())
xComponent->dispose(); xComponent->dispose();
} }
mpCanvasHelper.reset(); mpCanvasHelper.reset();
{ {
Reference<lang::XComponent> xComponent (mxPresenterHelper, UNO_QUERY); Reference<lang::XComponent> xComponent (mxPresenterHelper, UNO_QUERY);
mxPresenterHelper = NULL; mxPresenterHelper = nullptr;
if (xComponent.is()) if (xComponent.is())
xComponent->dispose(); xComponent->dispose();
} }
@ -250,7 +250,7 @@ void PresenterController::disposing()
mnPendingSlideNumber = -1; mnPendingSlideNumber = -1;
{ {
Reference<lang::XComponent> xComponent (mxUrlTransformer, UNO_QUERY); Reference<lang::XComponent> xComponent (mxUrlTransformer, UNO_QUERY);
mxUrlTransformer = NULL; mxUrlTransformer = nullptr;
if (xComponent.is()) if (xComponent.is())
xComponent->dispose(); xComponent->dispose();
} }
@ -280,7 +280,7 @@ void PresenterController::GetSlides (const sal_Int32 nOffset)
return; return;
// Get the current slide from the slide show controller. // Get the current slide from the slide show controller.
mxCurrentSlide = NULL; mxCurrentSlide = nullptr;
Reference<container::XIndexAccess> xIndexAccess(mxSlideShowController, UNO_QUERY); Reference<container::XIndexAccess> xIndexAccess(mxSlideShowController, UNO_QUERY);
sal_Int32 nSlideIndex = -1; sal_Int32 nSlideIndex = -1;
try try
@ -303,7 +303,7 @@ void PresenterController::GetSlides (const sal_Int32 nOffset)
} }
// Get the next slide. // Get the next slide.
mxNextSlide = NULL; mxNextSlide = nullptr;
try try
{ {
const sal_Int32 nNextSlideIndex (mxSlideShowController->getNextSlideIndex()+nOffset); const sal_Int32 nNextSlideIndex (mxSlideShowController->getNextSlideIndex()+nOffset);
@ -368,7 +368,7 @@ void PresenterController::UpdatePaneTitles()
PresenterPaneContainer::PaneList::const_iterator iPane; PresenterPaneContainer::PaneList::const_iterator iPane;
for (iPane=mpPaneContainer->maPanes.begin(); iPane!=mpPaneContainer->maPanes.end(); ++iPane) for (iPane=mpPaneContainer->maPanes.begin(); iPane!=mpPaneContainer->maPanes.end(); ++iPane)
{ {
OSL_ASSERT((*iPane).get() != NULL); OSL_ASSERT((*iPane).get() != nullptr);
OUString sTemplate (IsAccessibilityActive() OUString sTemplate (IsAccessibilityActive()
? (*iPane)->msAccessibleTitleTemplate ? (*iPane)->msAccessibleTitleTemplate
@ -431,7 +431,7 @@ void PresenterController::UpdateViews()
SharedBitmapDescriptor SharedBitmapDescriptor
PresenterController::GetViewBackground (const OUString& rsViewURL) const PresenterController::GetViewBackground (const OUString& rsViewURL) const
{ {
if (mpTheme.get() != NULL) if (mpTheme.get() != nullptr)
{ {
const OUString sStyleName (mpTheme->GetStyleName(rsViewURL)); const OUString sStyleName (mpTheme->GetStyleName(rsViewURL));
return mpTheme->GetBitmap(sStyleName, "Background"); return mpTheme->GetBitmap(sStyleName, "Background");
@ -442,7 +442,7 @@ SharedBitmapDescriptor
PresenterTheme::SharedFontDescriptor PresenterTheme::SharedFontDescriptor
PresenterController::GetViewFont (const OUString& rsViewURL) const PresenterController::GetViewFont (const OUString& rsViewURL) const
{ {
if (mpTheme.get() != NULL) if (mpTheme.get() != nullptr)
{ {
const OUString sStyleName (mpTheme->GetStyleName(rsViewURL)); const OUString sStyleName (mpTheme->GetStyleName(rsViewURL));
return mpTheme->GetFont(sStyleName); return mpTheme->GetFont(sStyleName);
@ -495,7 +495,7 @@ void PresenterController::ShowView (const OUString& rsViewURL)
{ {
PresenterPaneContainer::SharedPaneDescriptor pDescriptor ( PresenterPaneContainer::SharedPaneDescriptor pDescriptor (
mpPaneContainer->FindViewURL(rsViewURL)); mpPaneContainer->FindViewURL(rsViewURL));
if (pDescriptor.get() != NULL) if (pDescriptor.get() != nullptr)
{ {
pDescriptor->mbIsActive = true; pDescriptor->mbIsActive = true;
mxConfigurationController->requestResourceActivation( mxConfigurationController->requestResourceActivation(
@ -514,7 +514,7 @@ void PresenterController::HideView (const OUString& rsViewURL)
{ {
PresenterPaneContainer::SharedPaneDescriptor pDescriptor ( PresenterPaneContainer::SharedPaneDescriptor pDescriptor (
mpPaneContainer->FindViewURL(rsViewURL)); mpPaneContainer->FindViewURL(rsViewURL));
if (pDescriptor.get() != NULL) if (pDescriptor.get() != nullptr)
{ {
mxConfigurationController->requestResourceDeactivation( mxConfigurationController->requestResourceDeactivation(
ResourceId::createWithAnchor( ResourceId::createWithAnchor(
@ -543,11 +543,11 @@ void PresenterController::DispatchUnoCommand (const OUString& rsCommand) const
Reference<css::frame::XDispatch> PresenterController::GetDispatch (const util::URL& rURL) const Reference<css::frame::XDispatch> PresenterController::GetDispatch (const util::URL& rURL) const
{ {
if ( ! mxController.is()) if ( ! mxController.is())
return NULL; return nullptr;
Reference<frame::XDispatchProvider> xDispatchProvider (mxController->getFrame(), UNO_QUERY); Reference<frame::XDispatchProvider> xDispatchProvider (mxController->getFrame(), UNO_QUERY);
if ( ! xDispatchProvider.is()) if ( ! xDispatchProvider.is())
return NULL; return nullptr;
return xDispatchProvider->queryDispatch( return xDispatchProvider->queryDispatch(
rURL, rURL,
@ -783,7 +783,7 @@ void SAL_CALL PresenterController::notifyConfigurationChange (
mpWindowManager->Update(); mpWindowManager->Update();
// Request the repainting of the area previously // Request the repainting of the area previously
// occupied by the view. // occupied by the view.
if (pDescriptor.get() != NULL) if (pDescriptor.get() != nullptr)
GetPaintManager()->Invalidate(pDescriptor->mxBorderWindow); GetPaintManager()->Invalidate(pDescriptor->mxBorderWindow);
} }
} }
@ -806,13 +806,13 @@ void SAL_CALL PresenterController::disposing (
throw (RuntimeException, std::exception) throw (RuntimeException, std::exception)
{ {
if (rEvent.Source == mxController) if (rEvent.Source == mxController)
mxController = NULL; mxController = nullptr;
else if (rEvent.Source == mxConfigurationController) else if (rEvent.Source == mxConfigurationController)
mxConfigurationController = NULL; mxConfigurationController = nullptr;
else if (rEvent.Source == mxSlideShowController) else if (rEvent.Source == mxSlideShowController)
mxSlideShowController = NULL; mxSlideShowController = nullptr;
else if (rEvent.Source == mxMainWindow) else if (rEvent.Source == mxMainWindow)
mxMainWindow = NULL; mxMainWindow = nullptr;
} }
//----- XFrameActionListener -------------------------------------------------- //----- XFrameActionListener --------------------------------------------------
@ -976,7 +976,7 @@ void SAL_CALL PresenterController::keyReleased (const awt::KeyEvent& rEvent)
case awt::Key::F1: case awt::Key::F1:
// Toggle the help view. // Toggle the help view.
if (mpWindowManager.get() != NULL) if (mpWindowManager.get() != nullptr)
{ {
if (mpWindowManager->GetViewMode() != PresenterWindowManager::VM_Help) if (mpWindowManager->GetViewMode() != PresenterWindowManager::VM_Help)
mpWindowManager->SetViewMode(PresenterWindowManager::VM_Help); mpWindowManager->SetViewMode(PresenterWindowManager::VM_Help);
@ -1018,7 +1018,7 @@ void PresenterController::HandleNumericKeyPress (
// Ctrl-1, Ctrl-2, and Ctrl-3 are used to switch between views // Ctrl-1, Ctrl-2, and Ctrl-3 are used to switch between views
// (slide view, notes view, normal). Ctrl-4 switches monitors // (slide view, notes view, normal). Ctrl-4 switches monitors
mnPendingSlideNumber = -1; mnPendingSlideNumber = -1;
if (mpWindowManager.get() == NULL) if (mpWindowManager.get() == nullptr)
return; return;
switch(nKey) switch(nKey)
{ {
@ -1120,7 +1120,7 @@ void PresenterController::InitializeMainPane (const Reference<XPane>& rxPane)
mpWindowManager->SetParentPane(rxPane); mpWindowManager->SetParentPane(rxPane);
mpWindowManager->SetTheme(mpTheme); mpWindowManager->SetTheme(mpTheme);
if (mpPaneBorderPainter.get() != NULL) if (mpPaneBorderPainter.get() != nullptr)
mpPaneBorderPainter->SetTheme(mpTheme); mpPaneBorderPainter->SetTheme(mpTheme);
// Add key listener // Add key listener
@ -1190,7 +1190,7 @@ void PresenterController::UpdatePendingSlideNumber (const sal_Int32 nPendingSlid
{ {
mnPendingSlideNumber = nPendingSlideNumber; mnPendingSlideNumber = nPendingSlideNumber;
if (mpTheme.get() == NULL) if (mpTheme.get() == nullptr)
return; return;
if ( ! mxMainWindow.is()) if ( ! mxMainWindow.is())
@ -1198,7 +1198,7 @@ void PresenterController::UpdatePendingSlideNumber (const sal_Int32 nPendingSlid
PresenterTheme::SharedFontDescriptor pFont ( PresenterTheme::SharedFontDescriptor pFont (
mpTheme->GetFont("PendingSlideNumberFont")); mpTheme->GetFont("PendingSlideNumberFont"));
if (pFont.get() == NULL) if (pFont.get() == nullptr)
return; return;
pFont->PrepareFont(Reference<rendering::XCanvas>(mxCanvas, UNO_QUERY)); pFont->PrepareFont(Reference<rendering::XCanvas>(mxCanvas, UNO_QUERY));

View File

@ -55,7 +55,7 @@ void SAL_CALL PresenterCurrentSlideObserver::disposing()
if(mxSlideShowController.is()) if(mxSlideShowController.is())
{ {
mxSlideShowController->removeSlideShowListener(static_cast<XSlideShowListener*>(this)); mxSlideShowController->removeSlideShowListener(static_cast<XSlideShowListener*>(this));
mxSlideShowController = NULL; mxSlideShowController = nullptr;
} }
} }
@ -136,7 +136,7 @@ void SAL_CALL PresenterCurrentSlideObserver::disposing (
if (rEvent.Source == Reference<XInterface>(static_cast<XWeak*>(mpPresenterController.get()))) if (rEvent.Source == Reference<XInterface>(static_cast<XWeak*>(mpPresenterController.get())))
dispose(); dispose();
else if (rEvent.Source == mxSlideShowController) else if (rEvent.Source == mxSlideShowController)
mxSlideShowController = NULL; mxSlideShowController = nullptr;
} }
} } // end of namespace ::sdext::presenter } } // end of namespace ::sdext::presenter

View File

@ -92,10 +92,10 @@ void PresenterFrameworkObserver::Shutdown()
maAction = Action(); maAction = Action();
maPredicate = Predicate(); maPredicate = Predicate();
if (mxConfigurationController != NULL) if (mxConfigurationController != nullptr)
{ {
mxConfigurationController->removeConfigurationChangeListener(this); mxConfigurationController->removeConfigurationChangeListener(this);
mxConfigurationController = NULL; mxConfigurationController = nullptr;
} }
} }
@ -107,7 +107,7 @@ void SAL_CALL PresenterFrameworkObserver::disposing (const lang::EventObject& rE
if (rEvent.Source == mxConfigurationController) if (rEvent.Source == mxConfigurationController)
{ {
mxConfigurationController = NULL; mxConfigurationController = nullptr;
if (maAction) if (maAction)
maAction(false); maAction(false);
} }

View File

@ -181,7 +181,7 @@ Reference<rendering::XPolyPolygon2D> PresenterGeometryHelper::CreatePolygon(
const Reference<rendering::XGraphicDevice>& rxDevice) const Reference<rendering::XGraphicDevice>& rxDevice)
{ {
if ( ! rxDevice.is()) if ( ! rxDevice.is())
return NULL; return nullptr;
Sequence<Sequence<geometry::RealPoint2D> > aPoints(1); Sequence<Sequence<geometry::RealPoint2D> > aPoints(1);
aPoints[0] = Sequence<geometry::RealPoint2D>(4); aPoints[0] = Sequence<geometry::RealPoint2D>(4);
@ -203,7 +203,7 @@ Reference<rendering::XPolyPolygon2D> PresenterGeometryHelper::CreatePolygon(
const Reference<rendering::XGraphicDevice>& rxDevice) const Reference<rendering::XGraphicDevice>& rxDevice)
{ {
if ( ! rxDevice.is()) if ( ! rxDevice.is())
return NULL; return nullptr;
Sequence<Sequence<geometry::RealPoint2D> > aPoints(1); Sequence<Sequence<geometry::RealPoint2D> > aPoints(1);
aPoints[0] = Sequence<geometry::RealPoint2D>(4); aPoints[0] = Sequence<geometry::RealPoint2D>(4);
@ -225,7 +225,7 @@ Reference<rendering::XPolyPolygon2D> PresenterGeometryHelper::CreatePolygon(
const Reference<rendering::XGraphicDevice>& rxDevice) const Reference<rendering::XGraphicDevice>& rxDevice)
{ {
if ( ! rxDevice.is()) if ( ! rxDevice.is())
return NULL; return nullptr;
const sal_Int32 nCount (rBoxes.size()); const sal_Int32 nCount (rBoxes.size());
Sequence<Sequence<geometry::RealPoint2D> > aPoints(nCount); Sequence<Sequence<geometry::RealPoint2D> > aPoints(nCount);

View File

@ -156,7 +156,7 @@ PresenterHelpView::PresenterHelpView (
if (mpPresenterController.is()) if (mpPresenterController.is())
{ {
mpFont = mpPresenterController->GetViewFont(mxViewId->getResourceURL()); mpFont = mpPresenterController->GetViewFont(mxViewId->getResourceURL());
if (mpFont.get() != NULL) if (mpFont.get() != nullptr)
{ {
mpFont->PrepareFont(mxCanvas); mpFont->PrepareFont(mxCanvas);
} }
@ -176,8 +176,8 @@ PresenterHelpView::PresenterHelpView (
} }
catch (RuntimeException&) catch (RuntimeException&)
{ {
mxViewId = NULL; mxViewId = nullptr;
mxWindow = NULL; mxWindow = nullptr;
throw; throw;
} }
} }
@ -188,13 +188,13 @@ PresenterHelpView::~PresenterHelpView()
void SAL_CALL PresenterHelpView::disposing() void SAL_CALL PresenterHelpView::disposing()
{ {
mxViewId = NULL; mxViewId = nullptr;
if (mpCloseButton.is()) if (mpCloseButton.is())
{ {
Reference<lang::XComponent> xComponent ( Reference<lang::XComponent> xComponent (
static_cast<XWeak*>(mpCloseButton.get()), UNO_QUERY); static_cast<XWeak*>(mpCloseButton.get()), UNO_QUERY);
mpCloseButton = NULL; mpCloseButton = nullptr;
if (xComponent.is()) if (xComponent.is())
xComponent->dispose(); xComponent->dispose();
} }
@ -213,11 +213,11 @@ void SAL_CALL PresenterHelpView::disposing (const lang::EventObject& rEventObjec
{ {
if (rEventObject.Source == mxCanvas) if (rEventObject.Source == mxCanvas)
{ {
mxCanvas = NULL; mxCanvas = nullptr;
} }
else if (rEventObject.Source == mxWindow) else if (rEventObject.Source == mxWindow)
{ {
mxWindow = NULL; mxWindow = nullptr;
dispose(); dispose();
} }
} }
@ -285,7 +285,7 @@ void PresenterHelpView::Paint (const awt::Rectangle& rUpdateBox)
rendering::RenderState aRenderState ( rendering::RenderState aRenderState (
geometry::AffineMatrix2D(1,0,0, 0,1,0), geometry::AffineMatrix2D(1,0,0, 0,1,0),
NULL, nullptr,
Sequence<double>(4), Sequence<double>(4),
rendering::CompositeOperation::SOURCE); rendering::CompositeOperation::SOURCE);
PresenterCanvasHelper::SetDeviceColor(aRenderState, mpFont->mnColor); PresenterCanvasHelper::SetDeviceColor(aRenderState, mpFont->mnColor);
@ -385,7 +385,7 @@ void PresenterHelpView::ProcessString (
void PresenterHelpView::CheckFontSize() void PresenterHelpView::CheckFontSize()
{ {
if (mpFont.get() == NULL) if (mpFont.get() == nullptr)
return; return;
sal_Int32 nBestSize (6); sal_Int32 nBestSize (6);
@ -421,7 +421,7 @@ void PresenterHelpView::CheckFontSize()
if (nHeightDifference<=0 && mpFont->mnSize>nBestSize) if (nHeightDifference<=0 && mpFont->mnSize>nBestSize)
nBestSize = mpFont->mnSize; nBestSize = mpFont->mnSize;
mpFont->mnSize = nFontSizeGuess; mpFont->mnSize = nFontSizeGuess;
mpFont->mxFont = NULL; mpFont->mxFont = nullptr;
mpFont->PrepareFont(mxCanvas); mpFont->PrepareFont(mxCanvas);
// Reformat blocks. // Reformat blocks.
@ -432,7 +432,7 @@ void PresenterHelpView::CheckFontSize()
if (nBestSize != mpFont->mnSize) if (nBestSize != mpFont->mnSize)
{ {
mpFont->mnSize = nBestSize; mpFont->mnSize = nBestSize;
mpFont->mxFont = NULL; mpFont->mxFont = nullptr;
mpFont->PrepareFont(mxCanvas); mpFont->PrepareFont(mxCanvas);
// Reformat blocks. // Reformat blocks.
@ -482,7 +482,7 @@ void PresenterHelpView::ProvideCanvas()
void PresenterHelpView::Resize() void PresenterHelpView::Resize()
{ {
if (mpCloseButton.get() != NULL && mxWindow.is()) if (mpCloseButton.get() != nullptr && mxWindow.is())
{ {
const awt::Rectangle aWindowBox (mxWindow->getPosSize()); const awt::Rectangle aWindowBox (mxWindow->getPosSize());
mnMaximalWidth = (mxWindow->getPosSize().Width - 4*gnHorizontalGap) / 2; mnMaximalWidth = (mxWindow->getPosSize().Width - 4*gnHorizontalGap) / 2;

View File

@ -144,25 +144,25 @@ void SAL_CALL PresenterNotesView::disposing()
mxParentWindow->removeWindowListener(this); mxParentWindow->removeWindowListener(this);
mxParentWindow->removePaintListener(this); mxParentWindow->removePaintListener(this);
mxParentWindow->removeKeyListener(this); mxParentWindow->removeKeyListener(this);
mxParentWindow = NULL; mxParentWindow = nullptr;
} }
// Dispose tool bar. // Dispose tool bar.
{ {
Reference<XComponent> xComponent (static_cast<XWeak*>(mpToolBar.get()), UNO_QUERY); Reference<XComponent> xComponent (static_cast<XWeak*>(mpToolBar.get()), UNO_QUERY);
mpToolBar = NULL; mpToolBar = nullptr;
if (xComponent.is()) if (xComponent.is())
xComponent->dispose(); xComponent->dispose();
} }
{ {
Reference<XComponent> xComponent (mxToolBarCanvas, UNO_QUERY); Reference<XComponent> xComponent (mxToolBarCanvas, UNO_QUERY);
mxToolBarCanvas = NULL; mxToolBarCanvas = nullptr;
if (xComponent.is()) if (xComponent.is())
xComponent->dispose(); xComponent->dispose();
} }
{ {
Reference<XComponent> xComponent (mxToolBarWindow, UNO_QUERY); Reference<XComponent> xComponent (mxToolBarWindow, UNO_QUERY);
mxToolBarWindow = NULL; mxToolBarWindow = nullptr;
if (xComponent.is()) if (xComponent.is())
xComponent->dispose(); xComponent->dispose();
} }
@ -170,23 +170,23 @@ void SAL_CALL PresenterNotesView::disposing()
// Dispose close button // Dispose close button
{ {
Reference<XComponent> xComponent (static_cast<XWeak*>(mpCloseButton.get()), UNO_QUERY); Reference<XComponent> xComponent (static_cast<XWeak*>(mpCloseButton.get()), UNO_QUERY);
mpCloseButton = NULL; mpCloseButton = nullptr;
if (xComponent.is()) if (xComponent.is())
xComponent->dispose(); xComponent->dispose();
} }
// Create the tool bar. // Create the tool bar.
mpScrollBar = NULL; mpScrollBar = nullptr;
mxViewId = NULL; mxViewId = nullptr;
} }
void PresenterNotesView::CreateToolBar ( void PresenterNotesView::CreateToolBar (
const css::uno::Reference<css::uno::XComponentContext>& rxContext, const css::uno::Reference<css::uno::XComponentContext>& rxContext,
const ::rtl::Reference<PresenterController>& rpPresenterController) const ::rtl::Reference<PresenterController>& rpPresenterController)
{ {
if (rpPresenterController.get() == NULL) if (rpPresenterController.get() == nullptr)
return; return;
Reference<drawing::XPresenterHelper> xPresenterHelper ( Reference<drawing::XPresenterHelper> xPresenterHelper (
@ -270,7 +270,7 @@ void PresenterNotesView::SetSlide (const Reference<drawing::XDrawPage>& rxNotesP
Layout(); Layout();
if (mpScrollBar.get() != NULL) if (mpScrollBar.get() != nullptr)
{ {
mpScrollBar->SetThumbPosition(0, false); mpScrollBar->SetThumbPosition(0, false);
UpdateScrollBar(); UpdateScrollBar();
@ -286,7 +286,7 @@ void SAL_CALL PresenterNotesView::disposing (const lang::EventObject& rEventObje
throw (RuntimeException, std::exception) throw (RuntimeException, std::exception)
{ {
if (rEventObject.Source == mxParentWindow) if (rEventObject.Source == mxParentWindow)
mxParentWindow = NULL; mxParentWindow = nullptr;
} }
//----- XWindowListener ------------------------------------------------------- //----- XWindowListener -------------------------------------------------------
@ -350,7 +350,7 @@ void SAL_CALL PresenterNotesView::setCurrentPage (const Reference<drawing::XDraw
throw (RuntimeException, std::exception) throw (RuntimeException, std::exception)
{ {
// Get the associated notes page. // Get the associated notes page.
mxCurrentNotesPage = NULL; mxCurrentNotesPage = nullptr;
try try
{ {
Reference<presentation::XPresentationPage> xPresentationPage(rxSlide, UNO_QUERY); Reference<presentation::XPresentationPage> xPresentationPage(rxSlide, UNO_QUERY);
@ -367,7 +367,7 @@ void SAL_CALL PresenterNotesView::setCurrentPage (const Reference<drawing::XDraw
Reference<drawing::XDrawPage> SAL_CALL PresenterNotesView::getCurrentPage() Reference<drawing::XDrawPage> SAL_CALL PresenterNotesView::getCurrentPage()
throw (RuntimeException, std::exception) throw (RuntimeException, std::exception)
{ {
return NULL; return nullptr;
} }
//----- XKeyListener ---------------------------------------------------------- //----- XKeyListener ----------------------------------------------------------
@ -440,13 +440,13 @@ void PresenterNotesView::Layout()
mnSeparatorYLocation = aWindowBox.Height - nToolBarHeight - gnSpaceBelowSeparator; mnSeparatorYLocation = aWindowBox.Height - nToolBarHeight - gnSpaceBelowSeparator;
aNewTextBoundingBox.Y2 = mnSeparatorYLocation - gnSpaceAboveSeparator; aNewTextBoundingBox.Y2 = mnSeparatorYLocation - gnSpaceAboveSeparator;
// Place the close button. // Place the close button.
if (mpCloseButton.get() != NULL) if (mpCloseButton.get() != nullptr)
mpCloseButton->SetCenter(geometry::RealPoint2D( mpCloseButton->SetCenter(geometry::RealPoint2D(
(aWindowBox.Width + aToolBarSize.Width) / 2, (aWindowBox.Width + aToolBarSize.Width) / 2,
aWindowBox.Height - aToolBarSize.Height/2)); aWindowBox.Height - aToolBarSize.Height/2));
} }
// Check whether the vertical scroll bar is necessary. // Check whether the vertical scroll bar is necessary.
if (mpScrollBar.get() != NULL) if (mpScrollBar.get() != nullptr)
{ {
bool bShowVerticalScrollbar (false); bool bShowVerticalScrollbar (false);
try try
@ -519,7 +519,7 @@ void PresenterNotesView::Paint (const awt::Rectangle& rUpdateBox)
if ( ! mxCanvas.is()) if ( ! mxCanvas.is())
return; return;
if (mpBackground.get() == NULL) if (mpBackground.get() == nullptr)
mpBackground = mpPresenterController->GetViewBackground(mxViewId->getResourceURL()); mpBackground = mpPresenterController->GetViewBackground(mxViewId->getResourceURL());
if (rUpdateBox.Y < maTextBoundingBox.Y2 if (rUpdateBox.Y < maTextBoundingBox.Y2
@ -542,14 +542,14 @@ void PresenterNotesView::PaintToolBar (const awt::Rectangle& rUpdateBox)
rendering::ViewState aViewState ( rendering::ViewState aViewState (
geometry::AffineMatrix2D(1,0,0, 0,1,0), geometry::AffineMatrix2D(1,0,0, 0,1,0),
NULL); nullptr);
rendering::RenderState aRenderState( rendering::RenderState aRenderState(
geometry::AffineMatrix2D(1,0,0, 0,1,0), geometry::AffineMatrix2D(1,0,0, 0,1,0),
NULL, nullptr,
Sequence<double>(4), Sequence<double>(4),
rendering::CompositeOperation::SOURCE); rendering::CompositeOperation::SOURCE);
if (mpBackground.get() != NULL) if (mpBackground.get() != nullptr)
{ {
// Paint the background. // Paint the background.
mpPresenterController->GetCanvasHelper()->Paint( mpPresenterController->GetCanvasHelper()->Paint(
@ -584,11 +584,11 @@ void PresenterNotesView::PaintText (const awt::Rectangle& rUpdateBox)
PresenterGeometryHelper::CreatePolygon(aBox, mxCanvas->getDevice())); PresenterGeometryHelper::CreatePolygon(aBox, mxCanvas->getDevice()));
rendering::RenderState aRenderState( rendering::RenderState aRenderState(
geometry::AffineMatrix2D(1,0,0, 0,1,0), geometry::AffineMatrix2D(1,0,0, 0,1,0),
NULL, nullptr,
Sequence<double>(3), Sequence<double>(3),
rendering::CompositeOperation::SOURCE); rendering::CompositeOperation::SOURCE);
if (mpBackground.get() != NULL) if (mpBackground.get() != nullptr)
{ {
// Paint the background. // Paint the background.
mpPresenterController->GetCanvasHelper()->Paint( mpPresenterController->GetCanvasHelper()->Paint(
@ -645,7 +645,7 @@ void PresenterNotesView::ChangeFontSize (const sal_Int32 nSizeChange)
if (nNewSize > 5) if (nNewSize > 5)
{ {
mpFont->mnSize = nNewSize; mpFont->mnSize = nNewSize;
mpFont->mxFont = NULL; mpFont->mxFont = nullptr;
mpTextView->SetFont(mpFont); mpTextView->SetFont(mpFont);
Layout(); Layout();
@ -660,7 +660,7 @@ void PresenterNotesView::ChangeFontSize (const sal_Int32 nSizeChange)
std::shared_ptr<PresenterConfigurationAccess> pConfiguration ( std::shared_ptr<PresenterConfigurationAccess> pConfiguration (
mpPresenterController->GetTheme()->GetNodeForViewStyle( mpPresenterController->GetTheme()->GetNodeForViewStyle(
sStyleName)); sStyleName));
if (pConfiguration.get()==NULL || ! pConfiguration->IsValid()) if (pConfiguration.get()==nullptr || ! pConfiguration->IsValid())
return; return;
pConfiguration->GoToChild(OUString("Font")); pConfiguration->GoToChild(OUString("Font"));
@ -681,7 +681,7 @@ std::shared_ptr<PresenterTextView> PresenterNotesView::GetTextView() const
void PresenterNotesView::UpdateScrollBar() void PresenterNotesView::UpdateScrollBar()
{ {
if (mpScrollBar.get() != NULL) if (mpScrollBar.get() != nullptr)
{ {
try try
{ {

View File

@ -66,7 +66,7 @@ void PresenterPaintManager::Invalidate (
PresenterPaneContainer::SharedPaneDescriptor pDescriptor( PresenterPaneContainer::SharedPaneDescriptor pDescriptor(
mpPaneContainer->FindContentWindow(rxWindow)); mpPaneContainer->FindContentWindow(rxWindow));
if (pDescriptor.get()==NULL || ! pDescriptor->mbIsOpaque) if (pDescriptor.get()==nullptr || ! pDescriptor->mbIsOpaque)
nInvalidateMode |= awt::InvalidateStyle::TRANSPARENT; nInvalidateMode |= awt::InvalidateStyle::TRANSPARENT;
else else
nInvalidateMode |= awt::InvalidateStyle::NOTRANSPARENT; nInvalidateMode |= awt::InvalidateStyle::NOTRANSPARENT;
@ -108,7 +108,7 @@ void PresenterPaintManager::Invalidate (
PresenterPaneContainer::SharedPaneDescriptor pDescriptor( PresenterPaneContainer::SharedPaneDescriptor pDescriptor(
mpPaneContainer->FindContentWindow(rxWindow)); mpPaneContainer->FindContentWindow(rxWindow));
if (pDescriptor.get()==NULL || ! pDescriptor->mbIsOpaque) if (pDescriptor.get()==nullptr || ! pDescriptor->mbIsOpaque)
nInvalidateMode |= awt::InvalidateStyle::TRANSPARENT; nInvalidateMode |= awt::InvalidateStyle::TRANSPARENT;
else else
nInvalidateMode |= awt::InvalidateStyle::NOTRANSPARENT; nInvalidateMode |= awt::InvalidateStyle::NOTRANSPARENT;

View File

@ -59,7 +59,7 @@ PresenterPaneBase::PresenterPaneBase (
mbHasCallout(false), mbHasCallout(false),
maCalloutAnchor() maCalloutAnchor()
{ {
if (mpPresenterController.get() != NULL) if (mpPresenterController.get() != nullptr)
mxPresenterHelper = mpPresenterController->GetPresenterHelper(); mxPresenterHelper = mpPresenterController->GetPresenterHelper();
} }
@ -77,41 +77,41 @@ void PresenterPaneBase::disposing()
{ {
Reference<XComponent> xComponent (mxContentCanvas, UNO_QUERY); Reference<XComponent> xComponent (mxContentCanvas, UNO_QUERY);
mxContentCanvas = NULL; mxContentCanvas = nullptr;
if (xComponent.is()) if (xComponent.is())
xComponent->dispose(); xComponent->dispose();
} }
{ {
Reference<XComponent> xComponent (mxContentWindow, UNO_QUERY); Reference<XComponent> xComponent (mxContentWindow, UNO_QUERY);
mxContentWindow = NULL; mxContentWindow = nullptr;
if (xComponent.is()) if (xComponent.is())
xComponent->dispose(); xComponent->dispose();
} }
{ {
Reference<XComponent> xComponent (mxBorderCanvas, UNO_QUERY); Reference<XComponent> xComponent (mxBorderCanvas, UNO_QUERY);
mxBorderCanvas = NULL; mxBorderCanvas = nullptr;
if (xComponent.is()) if (xComponent.is())
xComponent->dispose(); xComponent->dispose();
} }
{ {
Reference<XComponent> xComponent (mxBorderWindow, UNO_QUERY); Reference<XComponent> xComponent (mxBorderWindow, UNO_QUERY);
mxBorderWindow = NULL; mxBorderWindow = nullptr;
if (xComponent.is()) if (xComponent.is())
xComponent->dispose(); xComponent->dispose();
} }
mxComponentContext = NULL; mxComponentContext = nullptr;
} }
void PresenterPaneBase::SetTitle (const OUString& rsTitle) void PresenterPaneBase::SetTitle (const OUString& rsTitle)
{ {
msTitle = rsTitle; msTitle = rsTitle;
OSL_ASSERT(mpPresenterController.get()!=NULL); OSL_ASSERT(mpPresenterController.get()!=nullptr);
OSL_ASSERT(mpPresenterController->GetPaintManager().get()!=NULL); OSL_ASSERT(mpPresenterController->GetPaintManager().get()!=nullptr);
mpPresenterController->GetPaintManager()->Invalidate(mxBorderWindow); mpPresenterController->GetPaintManager()->Invalidate(mxBorderWindow);
} }
@ -245,8 +245,8 @@ void SAL_CALL PresenterPaneBase::initialize (const Sequence<Any>& rArguments)
} }
catch (Exception&) catch (Exception&)
{ {
mxContentWindow = NULL; mxContentWindow = nullptr;
mxComponentContext = NULL; mxComponentContext = nullptr;
throw; throw;
} }
} }
@ -310,7 +310,7 @@ void SAL_CALL PresenterPaneBase::disposing (const lang::EventObject& rEvent)
{ {
if (rEvent.Source == mxBorderWindow) if (rEvent.Source == mxBorderWindow)
{ {
mxBorderWindow = NULL; mxBorderWindow = nullptr;
} }
} }

View File

@ -216,7 +216,7 @@ void SAL_CALL PresenterPaneBorderPainter::paintBorder (
} }
ProvideTheme(rxCanvas); ProvideTheme(rxCanvas);
if (mpRenderer.get() != NULL) if (mpRenderer.get() != nullptr)
{ {
mpRenderer->SetCanvas(rxCanvas); mpRenderer->SetCanvas(rxCanvas);
mpRenderer->SetupClipping( mpRenderer->SetupClipping(
@ -252,7 +252,7 @@ void SAL_CALL PresenterPaneBorderPainter::paintBorderWithCallout (
} }
ProvideTheme(rxCanvas); ProvideTheme(rxCanvas);
if (mpRenderer.get() != NULL) if (mpRenderer.get() != nullptr)
{ {
mpRenderer->SetCanvas(rxCanvas); mpRenderer->SetCanvas(rxCanvas);
mpRenderer->SetupClipping( mpRenderer->SetupClipping(
@ -274,12 +274,12 @@ awt::Point SAL_CALL PresenterPaneBorderPainter::getCalloutOffset (
{ {
ThrowIfDisposed(); ThrowIfDisposed();
ProvideTheme(); ProvideTheme();
if (mpRenderer.get() != NULL) if (mpRenderer.get() != nullptr)
{ {
const std::shared_ptr<RendererPaneStyle> pRendererPaneStyle( const std::shared_ptr<RendererPaneStyle> pRendererPaneStyle(
mpRenderer->GetRendererPaneStyle(rsPaneBorderStyleName)); mpRenderer->GetRendererPaneStyle(rsPaneBorderStyleName));
if (pRendererPaneStyle.get() != NULL if (pRendererPaneStyle.get() != nullptr
&& pRendererPaneStyle->mpBottomCallout.get() != NULL) && pRendererPaneStyle->mpBottomCallout.get() != nullptr)
{ {
return awt::Point ( return awt::Point (
0, 0,
@ -300,7 +300,7 @@ bool PresenterPaneBorderPainter::ProvideTheme (const Reference<rendering::XCanva
if ( ! mxContext.is()) if ( ! mxContext.is())
return false; return false;
if (mpTheme.get() != NULL) if (mpTheme.get() != nullptr)
{ {
// Check if the theme already has a canvas. // Check if the theme already has a canvas.
if ( ! mpTheme->HasCanvas()) if ( ! mpTheme->HasCanvas())
@ -315,9 +315,9 @@ bool PresenterPaneBorderPainter::ProvideTheme (const Reference<rendering::XCanva
bModified = true; bModified = true;
} }
if (mpTheme.get() != NULL && bModified) if (mpTheme.get() != nullptr && bModified)
{ {
if (mpRenderer.get() == NULL) if (mpRenderer.get() == nullptr)
mpRenderer.reset(new Renderer(mxContext, mpTheme)); mpRenderer.reset(new Renderer(mxContext, mpTheme));
else else
mpRenderer->SetCanvas(rxCanvas); mpRenderer->SetCanvas(rxCanvas);
@ -328,10 +328,10 @@ bool PresenterPaneBorderPainter::ProvideTheme (const Reference<rendering::XCanva
bool PresenterPaneBorderPainter::ProvideTheme() bool PresenterPaneBorderPainter::ProvideTheme()
{ {
if (mpTheme.get() == NULL) if (mpTheme.get() == nullptr)
{ {
// Create a theme without bitmaps (no canvas => no bitmaps). // Create a theme without bitmaps (no canvas => no bitmaps).
return ProvideTheme(NULL); return ProvideTheme(nullptr);
} }
else else
{ {
@ -344,7 +344,7 @@ bool PresenterPaneBorderPainter::ProvideTheme()
void PresenterPaneBorderPainter::SetTheme (const std::shared_ptr<PresenterTheme>& rpTheme) void PresenterPaneBorderPainter::SetTheme (const std::shared_ptr<PresenterTheme>& rpTheme)
{ {
mpTheme = rpTheme; mpTheme = rpTheme;
if (mpRenderer.get() == NULL) if (mpRenderer.get() == nullptr)
mpRenderer.reset(new Renderer(mxContext, mpTheme)); mpRenderer.reset(new Renderer(mxContext, mpTheme));
} }
@ -353,10 +353,10 @@ awt::Rectangle PresenterPaneBorderPainter::AddBorder (
const awt::Rectangle& rInnerBox, const awt::Rectangle& rInnerBox,
const css::drawing::framework::BorderType eBorderType) const const css::drawing::framework::BorderType eBorderType) const
{ {
if (mpRenderer.get() != NULL) if (mpRenderer.get() != nullptr)
{ {
const std::shared_ptr<RendererPaneStyle> pRendererPaneStyle(mpRenderer->GetRendererPaneStyle(rsPaneURL)); const std::shared_ptr<RendererPaneStyle> pRendererPaneStyle(mpRenderer->GetRendererPaneStyle(rsPaneURL));
if (pRendererPaneStyle.get() != NULL) if (pRendererPaneStyle.get() != nullptr)
return pRendererPaneStyle->AddBorder(rInnerBox, eBorderType); return pRendererPaneStyle->AddBorder(rInnerBox, eBorderType);
} }
return rInnerBox; return rInnerBox;
@ -367,10 +367,10 @@ awt::Rectangle PresenterPaneBorderPainter::RemoveBorder (
const css::awt::Rectangle& rOuterBox, const css::awt::Rectangle& rOuterBox,
const css::drawing::framework::BorderType eBorderType) const const css::drawing::framework::BorderType eBorderType) const
{ {
if (mpRenderer.get() != NULL) if (mpRenderer.get() != nullptr)
{ {
const std::shared_ptr<RendererPaneStyle> pRendererPaneStyle(mpRenderer->GetRendererPaneStyle(rsPaneURL)); const std::shared_ptr<RendererPaneStyle> pRendererPaneStyle(mpRenderer->GetRendererPaneStyle(rsPaneURL));
if (pRendererPaneStyle.get() != NULL) if (pRendererPaneStyle.get() != nullptr)
return pRendererPaneStyle->RemoveBorder(rOuterBox, eBorderType); return pRendererPaneStyle->RemoveBorder(rOuterBox, eBorderType);
} }
return rOuterBox; return rOuterBox;
@ -397,7 +397,7 @@ PresenterPaneBorderPainter::Renderer::Renderer (
maRendererPaneStyles(), maRendererPaneStyles(),
mxCanvas(), mxCanvas(),
mxPresenterHelper(), mxPresenterHelper(),
maViewState(geometry::AffineMatrix2D(1,0,0, 0,1,0), NULL), maViewState(geometry::AffineMatrix2D(1,0,0, 0,1,0), nullptr),
mxViewStateClip(), mxViewStateClip(),
mbHasCallout(false), mbHasCallout(false),
maCalloutAnchor() maCalloutAnchor()
@ -438,7 +438,7 @@ void PresenterPaneBorderPainter::Renderer::PaintBorder (
// Create the outer and inner border of the, ahm, border. // Create the outer and inner border of the, ahm, border.
std::shared_ptr<RendererPaneStyle> pStyle (GetRendererPaneStyle(rsPaneURL)); std::shared_ptr<RendererPaneStyle> pStyle (GetRendererPaneStyle(rsPaneURL));
if (pStyle.get() == NULL) if (pStyle.get() == nullptr)
return; return;
awt::Rectangle aOuterBox (rBBox); awt::Rectangle aOuterBox (rBBox);
@ -567,7 +567,7 @@ void PresenterPaneBorderPainter::Renderer::PaintTitle (
rendering::RenderState aRenderState( rendering::RenderState aRenderState(
geometry::AffineMatrix2D(1,0,nX, 0,1,nY), geometry::AffineMatrix2D(1,0,nX, 0,1,nY),
NULL, nullptr,
Sequence<double>(4), Sequence<double>(4),
rendering::CompositeOperation::SOURCE); rendering::CompositeOperation::SOURCE);
@ -605,7 +605,7 @@ void PresenterPaneBorderPainter::Renderer::PaintTitle (
std::shared_ptr<RendererPaneStyle> std::shared_ptr<RendererPaneStyle>
PresenterPaneBorderPainter::Renderer::GetRendererPaneStyle (const OUString& rsResourceURL) PresenterPaneBorderPainter::Renderer::GetRendererPaneStyle (const OUString& rsResourceURL)
{ {
OSL_ASSERT(mpTheme.get()!=NULL); OSL_ASSERT(mpTheme.get()!=nullptr);
RendererPaneStyleContainer::const_iterator iStyle (maRendererPaneStyles.find(rsResourceURL)); RendererPaneStyleContainer::const_iterator iStyle (maRendererPaneStyles.find(rsResourceURL));
if (iStyle == maRendererPaneStyles.end()) if (iStyle == maRendererPaneStyles.end())
@ -734,7 +734,7 @@ void PresenterPaneBorderPainter::Renderer::PaintBitmap(
geometry::AffineMatrix2D( geometry::AffineMatrix2D(
double(nW)/rpBitmap->mnWidth, 0, nX, double(nW)/rpBitmap->mnWidth, 0, nX,
0, double(nH)/rpBitmap->mnHeight, nY), 0, double(nH)/rpBitmap->mnHeight, nY),
NULL, nullptr,
Sequence<double>(4), Sequence<double>(4),
rendering::CompositeOperation::OVER); rendering::CompositeOperation::OVER);
@ -750,14 +750,14 @@ void PresenterPaneBorderPainter::Renderer::SetupClipping (
const awt::Rectangle& rOuterBox, const awt::Rectangle& rOuterBox,
const OUString& rsPaneStyleName) const OUString& rsPaneStyleName)
{ {
mxViewStateClip = NULL; mxViewStateClip = nullptr;
maViewState.Clip = NULL; maViewState.Clip = nullptr;
if ( ! mxCanvas.is()) if ( ! mxCanvas.is())
return; return;
std::shared_ptr<RendererPaneStyle> pStyle (GetRendererPaneStyle(rsPaneStyleName)); std::shared_ptr<RendererPaneStyle> pStyle (GetRendererPaneStyle(rsPaneStyleName));
if (pStyle.get() == NULL) if (pStyle.get() == nullptr)
{ {
mxViewStateClip = PresenterGeometryHelper::CreatePolygon( mxViewStateClip = PresenterGeometryHelper::CreatePolygon(
rUpdateBox, rUpdateBox,
@ -815,7 +815,7 @@ RendererPaneStyle::RendererPaneStyle (
maOuterBorderSize(), maOuterBorderSize(),
maTotalBorderSize() maTotalBorderSize()
{ {
if (rpTheme.get() != NULL) if (rpTheme.get() != nullptr)
{ {
mpTopLeft = GetBitmap(rpTheme, rsStyleName, "TopLeft"); mpTopLeft = GetBitmap(rpTheme, rsStyleName, "TopLeft");
mpTop = GetBitmap(rpTheme, rsStyleName, "Top"); mpTop = GetBitmap(rpTheme, rsStyleName, "Top");
@ -832,7 +832,7 @@ RendererPaneStyle::RendererPaneStyle (
mpFont = rpTheme->GetFont(rsStyleName); mpFont = rpTheme->GetFont(rsStyleName);
OUString sAnchor ("Left"); OUString sAnchor ("Left");
if (mpFont.get() != NULL) if (mpFont.get() != nullptr)
{ {
sAnchor = mpFont->msAnchor; sAnchor = mpFont->msAnchor;
mnFontXOffset = mpFont->mnXOffset; mnFontXOffset = mpFont->mnXOffset;
@ -876,7 +876,7 @@ awt::Rectangle RendererPaneStyle::AddBorder (
const awt::Rectangle& rBox, const awt::Rectangle& rBox,
const drawing::framework::BorderType eBorderType) const const drawing::framework::BorderType eBorderType) const
{ {
const BorderSize* pBorderSize = NULL; const BorderSize* pBorderSize = nullptr;
switch (eBorderType) switch (eBorderType)
{ {
case drawing::framework::BorderType_INNER_BORDER: case drawing::framework::BorderType_INNER_BORDER:
@ -902,7 +902,7 @@ awt::Rectangle RendererPaneStyle::RemoveBorder (
const awt::Rectangle& rBox, const awt::Rectangle& rBox,
const css::drawing::framework::BorderType eBorderType) const const css::drawing::framework::BorderType eBorderType) const
{ {
const BorderSize* pBorderSize = NULL; const BorderSize* pBorderSize = nullptr;
switch (eBorderType) switch (eBorderType)
{ {
case drawing::framework::BorderType_INNER_BORDER: case drawing::framework::BorderType_INNER_BORDER:
@ -927,7 +927,7 @@ awt::Rectangle RendererPaneStyle::RemoveBorder (
const Reference<rendering::XCanvasFont> RendererPaneStyle::GetFont ( const Reference<rendering::XCanvasFont> RendererPaneStyle::GetFont (
const Reference<rendering::XCanvas>& rxCanvas) const const Reference<rendering::XCanvas>& rxCanvas) const
{ {
if (mpFont.get() != NULL) if (mpFont.get() != nullptr)
mpFont->PrepareFont(rxCanvas); mpFont->PrepareFont(rxCanvas);
return mpFont->mxFont; return mpFont->mxFont;
} }
@ -946,7 +946,7 @@ SharedBitmapDescriptor RendererPaneStyle::GetBitmap(
const OUString& rsBitmapName) const OUString& rsBitmapName)
{ {
SharedBitmapDescriptor pDescriptor (rpTheme->GetBitmap(rsStyleName, rsBitmapName)); SharedBitmapDescriptor pDescriptor (rpTheme->GetBitmap(rsStyleName, rsBitmapName));
if (pDescriptor.get() != NULL) if (pDescriptor.get() != nullptr)
return pDescriptor; return pDescriptor;
else else
return mpEmpty; return mpEmpty;

View File

@ -67,13 +67,13 @@ void PresenterPaneContainer::PreparePane (
return; return;
SharedPaneDescriptor pPane (FindPaneURL(rxPaneId->getResourceURL())); SharedPaneDescriptor pPane (FindPaneURL(rxPaneId->getResourceURL()));
if (pPane.get() == NULL) if (pPane.get() == nullptr)
{ {
// No entry found for the given pane id. Create a new one. // No entry found for the given pane id. Create a new one.
SharedPaneDescriptor pDescriptor (new PaneDescriptor()); SharedPaneDescriptor pDescriptor (new PaneDescriptor());
pDescriptor->mxPaneId = rxPaneId; pDescriptor->mxPaneId = rxPaneId;
pDescriptor->msViewURL = rsViewURL; pDescriptor->msViewURL = rsViewURL;
pDescriptor->mxPane = NULL; pDescriptor->mxPane = nullptr;
if (rsTitle.indexOf('%') < 0) if (rsTitle.indexOf('%') < 0)
{ {
pDescriptor->msTitle = rsTitle; pDescriptor->msTitle = rsTitle;
@ -123,11 +123,11 @@ PresenterPaneContainer::SharedPaneDescriptor
sPaneURL = xPaneId->getResourceURL(); sPaneURL = xPaneId->getResourceURL();
pDescriptor = FindPaneURL(sPaneURL); pDescriptor = FindPaneURL(sPaneURL);
if (pDescriptor.get() == NULL) if (pDescriptor.get() == nullptr)
PreparePane(xPaneId, OUString(), OUString(), OUString(), PreparePane(xPaneId, OUString(), OUString(), OUString(),
false, ViewInitializationFunction(), 0,0,0,0); false, ViewInitializationFunction(), 0,0,0,0);
pDescriptor = FindPaneURL(sPaneURL); pDescriptor = FindPaneURL(sPaneURL);
if (pDescriptor.get() != NULL) if (pDescriptor.get() != nullptr)
{ {
Reference<awt::XWindow> xWindow (rxPane->getWindow()); Reference<awt::XWindow> xWindow (rxPane->getWindow());
pDescriptor->mxContentWindow = xWindow; pDescriptor->mxContentWindow = xWindow;
@ -160,7 +160,7 @@ PresenterPaneContainer::SharedPaneDescriptor
sPaneURL = rxPaneId->getResourceURL(); sPaneURL = rxPaneId->getResourceURL();
SharedPaneDescriptor pDescriptor (FindPaneURL(sPaneURL)); SharedPaneDescriptor pDescriptor (FindPaneURL(sPaneURL));
if (pDescriptor.get() != NULL) if (pDescriptor.get() != nullptr)
{ {
pDescriptor->mxBorderWindow = rxBorderWindow; pDescriptor->mxBorderWindow = rxBorderWindow;
return pDescriptor; return pDescriptor;
@ -188,7 +188,7 @@ PresenterPaneContainer::SharedPaneDescriptor
} }
pDescriptor = FindPaneURL(sPaneURL); pDescriptor = FindPaneURL(sPaneURL);
if (pDescriptor.get() != NULL) if (pDescriptor.get() != nullptr)
{ {
pDescriptor->mxView = rxView; pDescriptor->mxView = rxView;
pDescriptor->mpViewBackground = rpViewBackground; pDescriptor->mpViewBackground = rpViewBackground;
@ -217,14 +217,14 @@ PresenterPaneContainer::SharedPaneDescriptor
PresenterPaneContainer::RemovePane (const Reference<XResourceId>& rxPaneId) PresenterPaneContainer::RemovePane (const Reference<XResourceId>& rxPaneId)
{ {
SharedPaneDescriptor pDescriptor (FindPaneId(rxPaneId)); SharedPaneDescriptor pDescriptor (FindPaneId(rxPaneId));
if (pDescriptor.get() != NULL) if (pDescriptor.get() != nullptr)
{ {
if (pDescriptor->mxContentWindow.is()) if (pDescriptor->mxContentWindow.is())
pDescriptor->mxContentWindow->removeEventListener(this); pDescriptor->mxContentWindow->removeEventListener(this);
pDescriptor->mxContentWindow = NULL; pDescriptor->mxContentWindow = nullptr;
pDescriptor->mxBorderWindow = NULL; pDescriptor->mxBorderWindow = nullptr;
pDescriptor->mxPane = NULL; pDescriptor->mxPane = nullptr;
pDescriptor->mxView = NULL; pDescriptor->mxView = nullptr;
pDescriptor->mbIsActive = false; pDescriptor->mbIsActive = false;
} }
return pDescriptor; return pDescriptor;
@ -247,9 +247,9 @@ PresenterPaneContainer::SharedPaneDescriptor
} }
pDescriptor = FindPaneURL(sPaneURL); pDescriptor = FindPaneURL(sPaneURL);
if (pDescriptor.get() != NULL) if (pDescriptor.get() != nullptr)
{ {
pDescriptor->mxView = NULL; pDescriptor->mxView = nullptr;
pDescriptor->mpViewBackground = SharedBitmapDescriptor(); pDescriptor->mpViewBackground = SharedBitmapDescriptor();
} }
} }
@ -329,7 +329,7 @@ PresenterPaneContainer::SharedPaneDescriptor PresenterPaneContainer::FindViewURL
OUString PresenterPaneContainer::GetPaneURLForViewURL (const OUString& rsViewURL) OUString PresenterPaneContainer::GetPaneURLForViewURL (const OUString& rsViewURL)
{ {
SharedPaneDescriptor pDescriptor (FindViewURL(rsViewURL)); SharedPaneDescriptor pDescriptor (FindViewURL(rsViewURL));
if (pDescriptor.get() != NULL) if (pDescriptor.get() != nullptr)
if (pDescriptor->mxPaneId.is()) if (pDescriptor->mxPaneId.is())
return pDescriptor->mxPaneId->getResourceURL(); return pDescriptor->mxPaneId->getResourceURL();
return OUString(); return OUString();
@ -337,7 +337,7 @@ OUString PresenterPaneContainer::GetPaneURLForViewURL (const OUString& rsViewURL
void PresenterPaneContainer::ToTop (const SharedPaneDescriptor& rpDescriptor) void PresenterPaneContainer::ToTop (const SharedPaneDescriptor& rpDescriptor)
{ {
if (rpDescriptor.get() != NULL) if (rpDescriptor.get() != nullptr)
{ {
// Find iterator for pDescriptor. // Find iterator for pDescriptor.
PaneList::iterator iPane; PaneList::iterator iPane;
@ -365,7 +365,7 @@ void SAL_CALL PresenterPaneContainer::disposing (
{ {
SharedPaneDescriptor pDescriptor ( SharedPaneDescriptor pDescriptor (
FindContentWindow(Reference<awt::XWindow>(rEvent.Source, UNO_QUERY))); FindContentWindow(Reference<awt::XWindow>(rEvent.Source, UNO_QUERY)));
if (pDescriptor.get() != NULL) if (pDescriptor.get() != nullptr)
{ {
RemovePane(pDescriptor->mxPaneId); RemovePane(pDescriptor->mxPaneId);
} }

View File

@ -124,7 +124,7 @@ void SAL_CALL PresenterPaneFactory::disposing()
mxConfigurationControllerWeak = WeakReference<XConfigurationController>(); mxConfigurationControllerWeak = WeakReference<XConfigurationController>();
// Dispose the panes in the cache. // Dispose the panes in the cache.
if (mpResourceCache.get() != NULL) if (mpResourceCache.get() != nullptr)
{ {
ResourceContainer::const_iterator iPane (mpResourceCache->begin()); ResourceContainer::const_iterator iPane (mpResourceCache->begin());
ResourceContainer::const_iterator iEnd (mpResourceCache->end()); ResourceContainer::const_iterator iEnd (mpResourceCache->end());
@ -147,13 +147,13 @@ Reference<XResource> SAL_CALL PresenterPaneFactory::createResource (
ThrowIfDisposed(); ThrowIfDisposed();
if ( ! rxPaneId.is()) if ( ! rxPaneId.is())
return NULL; return nullptr;
const OUString sPaneURL (rxPaneId->getResourceURL()); const OUString sPaneURL (rxPaneId->getResourceURL());
if (sPaneURL.isEmpty()) if (sPaneURL.isEmpty())
return NULL; return nullptr;
if (mpResourceCache.get() != NULL) if (mpResourceCache.get() != nullptr)
{ {
// Has the requested resource already been created? // Has the requested resource already been created?
ResourceContainer::const_iterator iResource (mpResourceCache->find(sPaneURL)); ResourceContainer::const_iterator iResource (mpResourceCache->find(sPaneURL));
@ -164,7 +164,7 @@ Reference<XResource> SAL_CALL PresenterPaneFactory::createResource (
mpPresenterController->GetPaneContainer()); mpPresenterController->GetPaneContainer());
PresenterPaneContainer::SharedPaneDescriptor pDescriptor ( PresenterPaneContainer::SharedPaneDescriptor pDescriptor (
pPaneContainer->FindPaneURL(sPaneURL)); pPaneContainer->FindPaneURL(sPaneURL));
if (pDescriptor.get() != NULL) if (pDescriptor.get() != nullptr)
{ {
pDescriptor->SetActivationState(true); pDescriptor->SetActivationState(true);
if (pDescriptor->mxBorderWindow.is()) if (pDescriptor->mxBorderWindow.is())
@ -195,13 +195,13 @@ void SAL_CALL PresenterPaneFactory::releaseResource (const Reference<XResource>&
const OUString sPaneURL (rxResource->getResourceId()->getResourceURL()); const OUString sPaneURL (rxResource->getResourceId()->getResourceURL());
PresenterPaneContainer::SharedPaneDescriptor pDescriptor ( PresenterPaneContainer::SharedPaneDescriptor pDescriptor (
pPaneContainer->FindPaneURL(sPaneURL)); pPaneContainer->FindPaneURL(sPaneURL));
if (pDescriptor.get() != NULL) if (pDescriptor.get() != nullptr)
{ {
pDescriptor->SetActivationState(false); pDescriptor->SetActivationState(false);
if (pDescriptor->mxBorderWindow.is()) if (pDescriptor->mxBorderWindow.is())
pDescriptor->mxBorderWindow->setVisible(sal_False); pDescriptor->mxBorderWindow->setVisible(sal_False);
if (mpResourceCache.get() != NULL) if (mpResourceCache.get() != nullptr)
{ {
// Store the pane in the cache. // Store the pane in the cache.
(*mpResourceCache)[sPaneURL] = rxResource; (*mpResourceCache)[sPaneURL] = rxResource;
@ -223,19 +223,19 @@ Reference<XResource> PresenterPaneFactory::CreatePane (
const OUString& rsTitle) const OUString& rsTitle)
{ {
if ( ! rxPaneId.is()) if ( ! rxPaneId.is())
return NULL; return nullptr;
Reference<XConfigurationController> xCC (mxConfigurationControllerWeak); Reference<XConfigurationController> xCC (mxConfigurationControllerWeak);
if ( ! xCC.is()) if ( ! xCC.is())
return NULL; return nullptr;
Reference<XComponentContext> xContext (mxComponentContextWeak); Reference<XComponentContext> xContext (mxComponentContextWeak);
if ( ! xContext.is()) if ( ! xContext.is())
return NULL; return nullptr;
Reference<XPane> xParentPane (xCC->getResource(rxPaneId->getAnchor()), UNO_QUERY); Reference<XPane> xParentPane (xCC->getResource(rxPaneId->getAnchor()), UNO_QUERY);
if ( ! xParentPane.is()) if ( ! xParentPane.is())
return NULL; return nullptr;
try try
{ {
@ -250,7 +250,7 @@ Reference<XResource> PresenterPaneFactory::CreatePane (
OSL_ASSERT(false); OSL_ASSERT(false);
} }
return NULL; return nullptr;
} }
Reference<XResource> PresenterPaneFactory::CreatePane ( Reference<XResource> PresenterPaneFactory::CreatePane (
@ -295,7 +295,7 @@ Reference<XResource> PresenterPaneFactory::CreatePane (
PresenterPaneContainer::SharedPaneDescriptor pDescriptor( PresenterPaneContainer::SharedPaneDescriptor pDescriptor(
pContainer->StoreBorderWindow(rxPaneId, xPane->GetBorderWindow())); pContainer->StoreBorderWindow(rxPaneId, xPane->GetBorderWindow()));
pContainer->StorePane(xPane); pContainer->StorePane(xPane);
if (pDescriptor.get() != NULL) if (pDescriptor.get() != nullptr)
{ {
if (bIsSpritePane) if (bIsSpritePane)
{ {

View File

@ -373,10 +373,10 @@ Reference<frame::XDispatch> PresenterProtocolHandler::Dispatch::Create (
const ::rtl::Reference<PresenterController>& rpPresenterController) const ::rtl::Reference<PresenterController>& rpPresenterController)
{ {
::rtl::Reference<Dispatch> pDispatch (new Dispatch (rsURLPath, rpPresenterController)); ::rtl::Reference<Dispatch> pDispatch (new Dispatch (rsURLPath, rpPresenterController));
if (pDispatch->mpCommand.get() != NULL) if (pDispatch->mpCommand.get() != nullptr)
return Reference<frame::XDispatch>(pDispatch.get()); return Reference<frame::XDispatch>(pDispatch.get());
else else
return NULL; return nullptr;
} }
PresenterProtocolHandler::Dispatch::Dispatch ( PresenterProtocolHandler::Dispatch::Dispatch (
@ -389,7 +389,7 @@ PresenterProtocolHandler::Dispatch::Dispatch (
maStatusListenerContainer(), maStatusListenerContainer(),
mbIsListeningToWindowManager(false) mbIsListeningToWindowManager(false)
{ {
if (mpCommand.get() != NULL) if (mpCommand.get() != nullptr)
{ {
mpPresenterController->GetWindowManager()->AddLayoutListener(this); mpPresenterController->GetWindowManager()->AddLayoutListener(this);
mbIsListeningToWindowManager = true; mbIsListeningToWindowManager = true;
@ -401,7 +401,7 @@ Command* PresenterProtocolHandler::Dispatch::CreateCommand (
const ::rtl::Reference<PresenterController>& rpPresenterController) const ::rtl::Reference<PresenterController>& rpPresenterController)
{ {
if (rsURLPath.getLength() <= 5) if (rsURLPath.getLength() <= 5)
return NULL; return nullptr;
if (rsURLPath == "CloseNotes") if (rsURLPath == "CloseNotes")
return new SetNotesViewCommand(false, rpPresenterController); return new SetNotesViewCommand(false, rpPresenterController);
@ -430,7 +430,7 @@ Command* PresenterProtocolHandler::Dispatch::CreateCommand (
if (rsURLPath == "ShrinkNotesFont") if (rsURLPath == "ShrinkNotesFont")
return new NotesFontSizeCommand(rpPresenterController, -1); return new NotesFontSizeCommand(rpPresenterController, -1);
return NULL; return nullptr;
} }
PresenterProtocolHandler::Dispatch::~Dispatch() PresenterProtocolHandler::Dispatch::~Dispatch()
@ -441,7 +441,7 @@ void PresenterProtocolHandler::Dispatch::disposing()
{ {
if (mbIsListeningToWindowManager) if (mbIsListeningToWindowManager)
{ {
if (mpPresenterController.get() != NULL) if (mpPresenterController.get() != nullptr)
mpPresenterController->GetWindowManager()->RemoveLayoutListener(this); mpPresenterController->GetWindowManager()->RemoveLayoutListener(this);
mbIsListeningToWindowManager = false; mbIsListeningToWindowManager = false;
} }
@ -463,7 +463,7 @@ void SAL_CALL PresenterProtocolHandler::Dispatch::dispatch(
if (rURL.Protocol == "vnd.org.libreoffice.presenterscreen:" if (rURL.Protocol == "vnd.org.libreoffice.presenterscreen:"
&& rURL.Path == msURLPath) && rURL.Path == msURLPath)
{ {
if (mpCommand.get() != NULL) if (mpCommand.get() != nullptr)
mpCommand->Execute(); mpCommand->Execute();
} }
else else
@ -769,14 +769,14 @@ NotesFontSizeCommand::NotesFontSizeCommand(
::rtl::Reference<PresenterNotesView> NotesFontSizeCommand::GetNotesView() const ::rtl::Reference<PresenterNotesView> NotesFontSizeCommand::GetNotesView() const
{ {
if (mpPresenterController.get() == NULL) if (mpPresenterController.get() == nullptr)
return NULL; return nullptr;
PresenterPaneContainer::SharedPaneDescriptor pDescriptor ( PresenterPaneContainer::SharedPaneDescriptor pDescriptor (
mpPresenterController->GetPaneContainer()->FindViewURL( mpPresenterController->GetPaneContainer()->FindViewURL(
PresenterViewFactory::msNotesViewURL)); PresenterViewFactory::msNotesViewURL));
if (pDescriptor.get() == NULL) if (pDescriptor.get() == nullptr)
return NULL; return nullptr;
return dynamic_cast<PresenterNotesView*>(pDescriptor->mxView.get()); return dynamic_cast<PresenterNotesView*>(pDescriptor->mxView.get());
} }

View File

@ -122,7 +122,7 @@ PresenterScreenJob::~PresenterScreenJob()
void SAL_CALL PresenterScreenJob::disposing() void SAL_CALL PresenterScreenJob::disposing()
{ {
mxComponentContext = NULL; mxComponentContext = nullptr;
} }
//----- XJob ----------------------------------------------------------- //----- XJob -----------------------------------------------------------
@ -208,7 +208,7 @@ void SAL_CALL PresenterScreenListener::disposing()
if (mpPresenterScreen.is()) if (mpPresenterScreen.is())
{ {
mpPresenterScreen->RequestShutdownPresenterScreen(); mpPresenterScreen->RequestShutdownPresenterScreen();
mpPresenterScreen = NULL; mpPresenterScreen = nullptr;
} }
} }
@ -229,7 +229,7 @@ void SAL_CALL PresenterScreenListener::notifyEvent( const css::document::EventOb
if (mpPresenterScreen.is()) if (mpPresenterScreen.is())
{ {
mpPresenterScreen->RequestShutdownPresenterScreen(); mpPresenterScreen->RequestShutdownPresenterScreen();
mpPresenterScreen = NULL; mpPresenterScreen = nullptr;
} }
} }
} }
@ -244,7 +244,7 @@ void SAL_CALL PresenterScreenListener::disposing (const css::lang::EventObject&
if (mpPresenterScreen.is()) if (mpPresenterScreen.is())
{ {
mpPresenterScreen->RequestShutdownPresenterScreen(); mpPresenterScreen->RequestShutdownPresenterScreen();
mpPresenterScreen = NULL; mpPresenterScreen = nullptr;
} }
} }
@ -306,7 +306,7 @@ void SAL_CALL PresenterScreen::disposing()
{ {
xCC->restoreConfiguration(mxSavedConfiguration); xCC->restoreConfiguration(mxSavedConfiguration);
} }
mxConfigurationControllerWeak = Reference<XConfigurationController>(NULL); mxConfigurationControllerWeak = Reference<XConfigurationController>(nullptr);
Reference<lang::XComponent> xViewFactoryComponent (mxViewFactory, UNO_QUERY); Reference<lang::XComponent> xViewFactoryComponent (mxViewFactory, UNO_QUERY);
if (xViewFactoryComponent.is()) if (xViewFactoryComponent.is())
@ -315,7 +315,7 @@ void SAL_CALL PresenterScreen::disposing()
if (xPaneFactoryComponent.is()) if (xPaneFactoryComponent.is())
xPaneFactoryComponent->dispose(); xPaneFactoryComponent->dispose();
mxModel = NULL; mxModel = nullptr;
} }
//----- XEventListener -------------------------------------------------------- //----- XEventListener --------------------------------------------------------
@ -560,7 +560,7 @@ Reference<drawing::framework::XResourceId> PresenterScreen::GetMainPaneId (
// displays. That leaves no room for the presenter. // displays. That leaves no room for the presenter.
const sal_Int32 nScreen(GetPresenterScreenNumber(rxPresentation)); const sal_Int32 nScreen(GetPresenterScreenNumber(rxPresentation));
if (nScreen < 0) if (nScreen < 0)
return NULL; return nullptr;
return ResourceId::create( return ResourceId::create(
Reference<XComponentContext>(mxContextWeak), Reference<XComponentContext>(mxContextWeak),
@ -578,7 +578,7 @@ void PresenterScreen::RequestShutdownPresenterScreen()
if (xCC.is() && mxSavedConfiguration.is()) if (xCC.is() && mxSavedConfiguration.is())
{ {
xCC->restoreConfiguration(mxSavedConfiguration); xCC->restoreConfiguration(mxSavedConfiguration);
mxSavedConfiguration = NULL; mxSavedConfiguration = nullptr;
} }
if (xCC.is()) if (xCC.is())
@ -600,14 +600,14 @@ void PresenterScreen::ShutdownPresenterScreen()
Reference<lang::XComponent> xViewFactoryComponent (mxViewFactory, UNO_QUERY); Reference<lang::XComponent> xViewFactoryComponent (mxViewFactory, UNO_QUERY);
if (xViewFactoryComponent.is()) if (xViewFactoryComponent.is())
xViewFactoryComponent->dispose(); xViewFactoryComponent->dispose();
mxViewFactory = NULL; mxViewFactory = nullptr;
Reference<lang::XComponent> xPaneFactoryComponent (mxPaneFactory, UNO_QUERY); Reference<lang::XComponent> xPaneFactoryComponent (mxPaneFactory, UNO_QUERY);
if (xPaneFactoryComponent.is()) if (xPaneFactoryComponent.is())
xPaneFactoryComponent->dispose(); xPaneFactoryComponent->dispose();
mxPaneFactory = NULL; mxPaneFactory = nullptr;
if (mpPresenterController.get() != NULL) if (mpPresenterController.get() != nullptr)
{ {
mpPresenterController->dispose(); mpPresenterController->dispose();
mpPresenterController.clear(); mpPresenterController.clear();
@ -844,7 +844,7 @@ void PresenterScreen::SetupView(
aViewDescriptor = iDescriptor->second; aViewDescriptor = iDescriptor->second;
// Prepare the pane. // Prepare the pane.
OSL_ASSERT(mpPaneContainer.get() != NULL); OSL_ASSERT(mpPaneContainer.get() != nullptr);
mpPaneContainer->PreparePane( mpPaneContainer->PreparePane(
xPaneId, xPaneId,
rsViewURL, rsViewURL,

View File

@ -154,7 +154,7 @@ void SAL_CALL PresenterScrollBar::disposing()
mxWindow->removeMouseMotionListener(this); mxWindow->removeMouseMotionListener(this);
Reference<lang::XComponent> xComponent (mxWindow, UNO_QUERY); Reference<lang::XComponent> xComponent (mxWindow, UNO_QUERY);
mxWindow = NULL; mxWindow = nullptr;
if (xComponent.is()) if (xComponent.is())
xComponent->dispose(); xComponent->dispose();
} }
@ -245,7 +245,7 @@ void PresenterScrollBar::SetCanvas (const Reference<css::rendering::XCanvas>& rx
mxCanvas = rxCanvas; mxCanvas = rxCanvas;
if (mxCanvas.is()) if (mxCanvas.is())
{ {
if (mpBitmaps.get()==NULL) if (mpBitmaps.get()==nullptr)
{ {
if (mpSharedBitmaps.expired()) if (mpSharedBitmaps.expired())
{ {
@ -458,7 +458,7 @@ void SAL_CALL PresenterScrollBar::disposing (const css::lang::EventObject& rEven
throw (css::uno::RuntimeException, std::exception) throw (css::uno::RuntimeException, std::exception)
{ {
if (rEvent.Source == mxWindow) if (rEvent.Source == mxWindow)
mxWindow = NULL; mxWindow = nullptr;
} }
@ -474,7 +474,7 @@ void PresenterScrollBar::Repaint (
const geometry::RealRectangle2D& rBox, const geometry::RealRectangle2D& rBox,
const bool bAsynchronousUpdate) const bool bAsynchronousUpdate)
{ {
if (mpPaintManager.get() != NULL) if (mpPaintManager.get() != nullptr)
mpPaintManager->Invalidate( mpPaintManager->Invalidate(
mxWindow, mxWindow,
PresenterGeometryHelper::ConvertRectangle(rBox), PresenterGeometryHelper::ConvertRectangle(rBox),
@ -484,7 +484,7 @@ void PresenterScrollBar::Repaint (
void PresenterScrollBar::PaintBackground( void PresenterScrollBar::PaintBackground(
const css::awt::Rectangle& rUpdateBox) const css::awt::Rectangle& rUpdateBox)
{ {
if (mpBackgroundBitmap.get() == NULL) if (mpBackgroundBitmap.get() == nullptr)
return; return;
const awt::Rectangle aWindowBox (mxWindow->getPosSize()); const awt::Rectangle aWindowBox (mxWindow->getPosSize());
@ -528,7 +528,7 @@ void PresenterScrollBar::PaintBitmap(
geometry::AffineMatrix2D( geometry::AffineMatrix2D(
1,0,aBox.X1 + (aBox.X2-aBox.X1 - aBitmapSize.Width)/2, 1,0,aBox.X1 + (aBox.X2-aBox.X1 - aBitmapSize.Width)/2,
0,1,aBox.Y1 + (aBox.Y2-aBox.Y1 - aBitmapSize.Height)/2), 0,1,aBox.Y1 + (aBox.Y2-aBox.Y1 - aBitmapSize.Height)/2),
NULL, nullptr,
Sequence<double>(4), Sequence<double>(4),
rendering::CompositeOperation::SOURCE); rendering::CompositeOperation::SOURCE);
@ -582,7 +582,7 @@ void PresenterScrollBar::UpdateWidthOrHeight (
sal_Int32& rSize, sal_Int32& rSize,
const SharedBitmapDescriptor& rpDescriptor) const SharedBitmapDescriptor& rpDescriptor)
{ {
if (rpDescriptor.get() != NULL) if (rpDescriptor.get() != nullptr)
{ {
Reference<rendering::XBitmap> xBitmap (rpDescriptor->GetNormalBitmap()); Reference<rendering::XBitmap> xBitmap (rpDescriptor->GetNormalBitmap());
if (xBitmap.is()) if (xBitmap.is())
@ -599,8 +599,8 @@ css::uno::Reference<css::rendering::XBitmap> PresenterScrollBar::GetBitmap (
const Area eArea, const Area eArea,
const SharedBitmapDescriptor& rpBitmaps) const const SharedBitmapDescriptor& rpBitmaps) const
{ {
if (rpBitmaps.get() == NULL) if (rpBitmaps.get() == nullptr)
return NULL; return nullptr;
else else
return rpBitmaps->GetBitmap(GetBitmapMode(eArea)); return rpBitmaps->GetBitmap(GetBitmapMode(eArea));
} }
@ -684,7 +684,7 @@ void PresenterVerticalScrollBar::UpdateBorders()
const awt::Rectangle aWindowBox (mxWindow->getPosSize()); const awt::Rectangle aWindowBox (mxWindow->getPosSize());
double nBottom = aWindowBox.Height; double nBottom = aWindowBox.Height;
if (mpNextButtonDescriptor.get() != NULL) if (mpNextButtonDescriptor.get() != nullptr)
{ {
Reference<rendering::XBitmap> xBitmap (mpNextButtonDescriptor->GetNormalBitmap()); Reference<rendering::XBitmap> xBitmap (mpNextButtonDescriptor->GetNormalBitmap());
if (xBitmap.is()) if (xBitmap.is())
@ -695,7 +695,7 @@ void PresenterVerticalScrollBar::UpdateBorders()
nBottom -= aSize.Height + gnScrollBarGap; nBottom -= aSize.Height + gnScrollBarGap;
} }
} }
if (mpPrevButtonDescriptor.get() != NULL) if (mpPrevButtonDescriptor.get() != nullptr)
{ {
Reference<rendering::XBitmap> xBitmap (mpPrevButtonDescriptor->GetNormalBitmap()); Reference<rendering::XBitmap> xBitmap (mpPrevButtonDescriptor->GetNormalBitmap());
if (xBitmap.is()) if (xBitmap.is())
@ -747,7 +747,7 @@ void PresenterVerticalScrollBar::UpdateBorders()
void PresenterVerticalScrollBar::UpdateBitmaps() void PresenterVerticalScrollBar::UpdateBitmaps()
{ {
if (mpBitmaps.get() != NULL) if (mpBitmaps.get() != nullptr)
{ {
mpPrevButtonDescriptor = mpBitmaps->GetBitmap("Up"); mpPrevButtonDescriptor = mpBitmaps->GetBitmap("Up");
mpNextButtonDescriptor = mpBitmaps->GetBitmap("Down"); mpNextButtonDescriptor = mpBitmaps->GetBitmap("Down");
@ -812,7 +812,7 @@ PresenterScrollBar::MousePressRepeater::MousePressRepeater (
void PresenterScrollBar::MousePressRepeater::Dispose() void PresenterScrollBar::MousePressRepeater::Dispose()
{ {
Stop(); Stop();
mpScrollBar = NULL; mpScrollBar = nullptr;
} }
void PresenterScrollBar::MousePressRepeater::Start (const PresenterScrollBar::Area& reArea) void PresenterScrollBar::MousePressRepeater::Start (const PresenterScrollBar::Area& reArea)
@ -861,7 +861,7 @@ void PresenterScrollBar::MousePressRepeater::Callback (const TimeValue& rCurrent
{ {
(void)rCurrentTime; (void)rCurrentTime;
if (mpScrollBar.get() == NULL) if (mpScrollBar.get() == nullptr)
{ {
Stop(); Stop();
return; return;

View File

@ -87,7 +87,7 @@ PresenterSlidePreview::PresenterSlidePreview (
mxWindow->setVisible(sal_True); mxWindow->setVisible(sal_True);
} }
if (mpPresenterController.get() != NULL) if (mpPresenterController.get() != nullptr)
mnSlideAspectRatio = mpPresenterController->GetSlideAspectRatio(); mnSlideAspectRatio = mpPresenterController->GetSlideAspectRatio();
Reference<lang::XMultiComponentFactory> xFactory (rxContext->getServiceManager(), UNO_QUERY); Reference<lang::XMultiComponentFactory> xFactory (rxContext->getServiceManager(), UNO_QUERY);
@ -115,8 +115,8 @@ void SAL_CALL PresenterSlidePreview::disposing()
{ {
mxWindow->removeWindowListener(this); mxWindow->removeWindowListener(this);
mxWindow->removePaintListener(this); mxWindow->removePaintListener(this);
mxWindow = NULL; mxWindow = nullptr;
mxCanvas = NULL; mxCanvas = nullptr;
} }
Reference<lang::XComponent> xComponent (mxPreviewRenderer, UNO_QUERY); Reference<lang::XComponent> xComponent (mxPreviewRenderer, UNO_QUERY);
@ -193,9 +193,9 @@ void SAL_CALL PresenterSlidePreview::disposing (const lang::EventObject& rEvent)
{ {
if (rEvent.Source == mxWindow) if (rEvent.Source == mxWindow)
{ {
mxWindow = NULL; mxWindow = nullptr;
mxCanvas = NULL; mxCanvas = nullptr;
mxPreview = NULL; mxPreview = nullptr;
} }
} }
@ -213,7 +213,7 @@ Reference<drawing::XDrawPage> SAL_CALL PresenterSlidePreview::getCurrentPage()
throw (RuntimeException, std::exception) throw (RuntimeException, std::exception)
{ {
ThrowIfDisposed(); ThrowIfDisposed();
return NULL; return nullptr;
} }
@ -221,7 +221,7 @@ Reference<drawing::XDrawPage> SAL_CALL PresenterSlidePreview::getCurrentPage()
void PresenterSlidePreview::SetSlide (const Reference<drawing::XDrawPage>& rxPage) void PresenterSlidePreview::SetSlide (const Reference<drawing::XDrawPage>& rxPage)
{ {
mxCurrentSlide = rxPage; mxCurrentSlide = rxPage;
mxPreview = NULL; mxPreview = nullptr;
Reference<beans::XPropertySet> xPropertySet (mxCurrentSlide, UNO_QUERY); Reference<beans::XPropertySet> xPropertySet (mxCurrentSlide, UNO_QUERY);
if (xPropertySet.is()) if (xPropertySet.is())
@ -310,12 +310,12 @@ void PresenterSlidePreview::Paint (const awt::Rectangle& rBoundingBox)
// Paint the preview. // Paint the preview.
const rendering::ViewState aViewState( const rendering::ViewState aViewState(
geometry::AffineMatrix2D(1,0,0, 0,1,0), geometry::AffineMatrix2D(1,0,0, 0,1,0),
NULL); nullptr);
Sequence<double> aBackgroundColor(4); Sequence<double> aBackgroundColor(4);
rendering::RenderState aRenderState ( rendering::RenderState aRenderState (
geometry::AffineMatrix2D(1, 0, aPreviewBox.X, 0, 1, aPreviewBox.Y), geometry::AffineMatrix2D(1, 0, aPreviewBox.X, 0, 1, aPreviewBox.Y),
NULL, nullptr,
aBackgroundColor, aBackgroundColor,
rendering::CompositeOperation::SOURCE); rendering::CompositeOperation::SOURCE);
PresenterCanvasHelper::SetDeviceColor(aRenderState, 0x00000000); PresenterCanvasHelper::SetDeviceColor(aRenderState, 0x00000000);
@ -329,7 +329,7 @@ void PresenterSlidePreview::Paint (const awt::Rectangle& rBoundingBox)
Reference<rendering::XBitmap> xTransitionIcon (aTransitionDescriptor->GetNormalBitmap()); Reference<rendering::XBitmap> xTransitionIcon (aTransitionDescriptor->GetNormalBitmap());
rendering::RenderState aTransitionRenderState ( rendering::RenderState aTransitionRenderState (
geometry::AffineMatrix2D(1, 0, aTransitionPreviewBox.X, 0, 1, aTransitionPreviewBox.Y), geometry::AffineMatrix2D(1, 0, aTransitionPreviewBox.X, 0, 1, aTransitionPreviewBox.Y),
NULL, nullptr,
aBackgroundColor, aBackgroundColor,
rendering::CompositeOperation::SOURCE); rendering::CompositeOperation::SOURCE);
mxCanvas->drawBitmap(xTransitionIcon, aViewState, aTransitionRenderState); mxCanvas->drawBitmap(xTransitionIcon, aViewState, aTransitionRenderState);
@ -341,7 +341,7 @@ void PresenterSlidePreview::Paint (const awt::Rectangle& rBoundingBox)
Reference<rendering::XBitmap> xAnimationIcon (aAnimationDescriptor->GetNormalBitmap()); Reference<rendering::XBitmap> xAnimationIcon (aAnimationDescriptor->GetNormalBitmap());
rendering::RenderState aAnimationRenderState ( rendering::RenderState aAnimationRenderState (
geometry::AffineMatrix2D(1, 0, aAnimationPreviewBox.X, 0, 1, aAnimationPreviewBox.Y), geometry::AffineMatrix2D(1, 0, aAnimationPreviewBox.X, 0, 1, aAnimationPreviewBox.Y),
NULL, nullptr,
aBackgroundColor, aBackgroundColor,
rendering::CompositeOperation::SOURCE); rendering::CompositeOperation::SOURCE);
mxCanvas->drawBitmap(xAnimationIcon, aViewState, aAnimationRenderState); mxCanvas->drawBitmap(xAnimationIcon, aViewState, aAnimationRenderState);

View File

@ -84,7 +84,7 @@ PresenterSlideShowView::PresenterSlideShowView (
mbIsEndSlideVisible(false), mbIsEndSlideVisible(false),
mxCurrentSlide() mxCurrentSlide()
{ {
if (mpPresenterController.get() != NULL) if (mpPresenterController.get() != nullptr)
{ {
mnPageAspectRatio = mpPresenterController->GetSlideAspectRatio(); mnPageAspectRatio = mpPresenterController->GetSlideAspectRatio();
mpBackground = mpPresenterController->GetViewBackground(mxViewId->getResourceURL()); mpBackground = mpPresenterController->GetViewBackground(mxViewId->getResourceURL());
@ -186,7 +186,7 @@ void PresenterSlideShowView::disposing()
::cppu::OInterfaceContainerHelper* pIterator ::cppu::OInterfaceContainerHelper* pIterator
= maBroadcaster.getContainer(cppu::UnoType<lang::XEventListener>::get()); = maBroadcaster.getContainer(cppu::UnoType<lang::XEventListener>::get());
if (pIterator != NULL) if (pIterator != nullptr)
pIterator->disposeAndClear(aEvent); pIterator->disposeAndClear(aEvent);
// Do this for // Do this for
@ -198,56 +198,56 @@ void PresenterSlideShowView::disposing()
mxWindow->removeMouseListener(this); mxWindow->removeMouseListener(this);
mxWindow->removeMouseMotionListener(this); mxWindow->removeMouseMotionListener(this);
mxWindow->removeWindowListener(this); mxWindow->removeWindowListener(this);
mxWindow = NULL; mxWindow = nullptr;
} }
mxSlideShowController = NULL; mxSlideShowController = nullptr;
mxSlideShow = NULL; mxSlideShow = nullptr;
if (mxViewCanvas.is()) if (mxViewCanvas.is())
{ {
Reference<XComponent> xComponent (mxViewCanvas, UNO_QUERY); Reference<XComponent> xComponent (mxViewCanvas, UNO_QUERY);
mxViewCanvas = NULL; mxViewCanvas = nullptr;
if (xComponent.is()) if (xComponent.is())
xComponent->dispose(); xComponent->dispose();
} }
if (mxViewWindow.is()) if (mxViewWindow.is())
{ {
Reference<XComponent> xComponent (mxViewWindow, UNO_QUERY); Reference<XComponent> xComponent (mxViewWindow, UNO_QUERY);
mxViewWindow = NULL; mxViewWindow = nullptr;
if (xComponent.is()) if (xComponent.is())
xComponent->dispose(); xComponent->dispose();
} }
if (mxPointer.is()) if (mxPointer.is())
{ {
Reference<XComponent> xComponent (mxPointer, UNO_QUERY); Reference<XComponent> xComponent (mxPointer, UNO_QUERY);
mxPointer = NULL; mxPointer = nullptr;
if (xComponent.is()) if (xComponent.is())
xComponent->dispose(); xComponent->dispose();
} }
if (mxBackgroundPolygon1.is()) if (mxBackgroundPolygon1.is())
{ {
Reference<XComponent> xComponent (mxBackgroundPolygon1, UNO_QUERY); Reference<XComponent> xComponent (mxBackgroundPolygon1, UNO_QUERY);
mxBackgroundPolygon1 = NULL; mxBackgroundPolygon1 = nullptr;
if (xComponent.is()) if (xComponent.is())
xComponent->dispose(); xComponent->dispose();
} }
if (mxBackgroundPolygon2.is()) if (mxBackgroundPolygon2.is())
{ {
Reference<XComponent> xComponent (mxBackgroundPolygon2, UNO_QUERY); Reference<XComponent> xComponent (mxBackgroundPolygon2, UNO_QUERY);
mxBackgroundPolygon2 = NULL; mxBackgroundPolygon2 = nullptr;
if (xComponent.is()) if (xComponent.is())
xComponent->dispose(); xComponent->dispose();
} }
mxComponentContext = NULL; mxComponentContext = nullptr;
mpPresenterController = NULL; mpPresenterController = nullptr;
mxViewId = NULL; mxViewId = nullptr;
mxController = NULL; mxController = nullptr;
mxCanvas = NULL; mxCanvas = nullptr;
mpBackground.reset(); mpBackground.reset();
msClickToExitPresentationText.clear(); msClickToExitPresentationText.clear();
msClickToExitPresentationTitle.clear(); msClickToExitPresentationTitle.clear();
msTitleTemplate.clear(); msTitleTemplate.clear();
mxCurrentSlide = NULL; mxCurrentSlide = nullptr;
} }
//----- XDrawView ------------------------------------------------------------- //----- XDrawView -------------------------------------------------------------
@ -257,7 +257,7 @@ void SAL_CALL PresenterSlideShowView::setCurrentPage (
throw (css::uno::RuntimeException, std::exception) throw (css::uno::RuntimeException, std::exception)
{ {
mxCurrentSlide = rxSlide; mxCurrentSlide = rxSlide;
if (mpPresenterController.get() != NULL if (mpPresenterController.get() != nullptr
&& mxSlideShowController.is() && mxSlideShowController.is()
&& ! mpPresenterController->GetCurrentSlide().is() && ! mpPresenterController->GetCurrentSlide().is()
&& ! mxSlideShowController->isPaused()) && ! mxSlideShowController->isPaused())
@ -272,7 +272,7 @@ void SAL_CALL PresenterSlideShowView::setCurrentPage (
// backwards. // backwards.
PresenterPaneContainer::SharedPaneDescriptor pDescriptor ( PresenterPaneContainer::SharedPaneDescriptor pDescriptor (
mpPresenterController->GetPaneContainer()->FindViewURL(mxViewId->getResourceURL())); mpPresenterController->GetPaneContainer()->FindViewURL(mxViewId->getResourceURL()));
if (pDescriptor.get() != NULL) if (pDescriptor.get() != nullptr)
{ {
msTitleTemplate = pDescriptor->msTitleTemplate; msTitleTemplate = pDescriptor->msTitleTemplate;
pDescriptor->msTitleTemplate = msClickToExitPresentationTitle; pDescriptor->msTitleTemplate = msClickToExitPresentationTitle;
@ -286,7 +286,7 @@ void SAL_CALL PresenterSlideShowView::setCurrentPage (
// Restore the title template. // Restore the title template.
PresenterPaneContainer::SharedPaneDescriptor pDescriptor ( PresenterPaneContainer::SharedPaneDescriptor pDescriptor (
mpPresenterController->GetPaneContainer()->FindViewURL(mxViewId->getResourceURL())); mpPresenterController->GetPaneContainer()->FindViewURL(mxViewId->getResourceURL()));
if (pDescriptor.get() != NULL) if (pDescriptor.get() != nullptr)
{ {
pDescriptor->msTitleTemplate = msTitleTemplate; pDescriptor->msTitleTemplate = msTitleTemplate;
(pDescriptor->msTitle).clear(); (pDescriptor->msTitle).clear();
@ -339,11 +339,11 @@ void SAL_CALL PresenterSlideShowView::clear()
rendering::ViewState aViewState ( rendering::ViewState aViewState (
geometry::AffineMatrix2D(1,0,0, 0,1,0), geometry::AffineMatrix2D(1,0,0, 0,1,0),
NULL); nullptr);
double aColor[4] = {0,0,0,0}; double aColor[4] = {0,0,0,0};
rendering::RenderState aRenderState( rendering::RenderState aRenderState(
geometry::AffineMatrix2D(1,0,0, 0,1,0), geometry::AffineMatrix2D(1,0,0, 0,1,0),
NULL, nullptr,
Sequence<double>(aColor,4), Sequence<double>(aColor,4),
rendering::CompositeOperation::SOURCE); rendering::CompositeOperation::SOURCE);
mxViewCanvas->fillPolyPolygon(xPolygon, aViewState, aRenderState); mxViewCanvas->fillPolyPolygon(xPolygon, aViewState, aRenderState);
@ -503,9 +503,9 @@ void SAL_CALL PresenterSlideShowView::disposing (const lang::EventObject& rEvent
throw (RuntimeException, std::exception) throw (RuntimeException, std::exception)
{ {
if (rEvent.Source == mxViewWindow) if (rEvent.Source == mxViewWindow)
mxViewWindow = NULL; mxViewWindow = nullptr;
else if (rEvent.Source == mxSlideShow) else if (rEvent.Source == mxSlideShow)
mxSlideShow = NULL; mxSlideShow = nullptr;
} }
//----- XPaintListener -------------------------------------------------------- //----- XPaintListener --------------------------------------------------------
@ -538,7 +538,7 @@ void SAL_CALL PresenterSlideShowView::mousePressed (const awt::MouseEvent& rEven
aEvent.Source = static_cast<XWeak*>(this); aEvent.Source = static_cast<XWeak*>(this);
::cppu::OInterfaceContainerHelper* pIterator ::cppu::OInterfaceContainerHelper* pIterator
= maBroadcaster.getContainer(cppu::UnoType<awt::XMouseListener>::get()); = maBroadcaster.getContainer(cppu::UnoType<awt::XMouseListener>::get());
if (pIterator != NULL) if (pIterator != nullptr)
{ {
pIterator->notifyEach(&awt::XMouseListener::mousePressed, aEvent); pIterator->notifyEach(&awt::XMouseListener::mousePressed, aEvent);
} }
@ -547,7 +547,7 @@ void SAL_CALL PresenterSlideShowView::mousePressed (const awt::MouseEvent& rEven
// the PresenterController so that it switches to the next slide and // the PresenterController so that it switches to the next slide and
// ends the presentation. // ends the presentation.
if (mbIsEndSlideVisible) if (mbIsEndSlideVisible)
if (mpPresenterController.get() != NULL) if (mpPresenterController.get() != nullptr)
mpPresenterController->HandleMouseClick(rEvent); mpPresenterController->HandleMouseClick(rEvent);
} }
@ -558,7 +558,7 @@ void SAL_CALL PresenterSlideShowView::mouseReleased (const awt::MouseEvent& rEve
aEvent.Source = static_cast<XWeak*>(this); aEvent.Source = static_cast<XWeak*>(this);
::cppu::OInterfaceContainerHelper* pIterator ::cppu::OInterfaceContainerHelper* pIterator
= maBroadcaster.getContainer(cppu::UnoType<awt::XMouseListener>::get()); = maBroadcaster.getContainer(cppu::UnoType<awt::XMouseListener>::get());
if (pIterator != NULL) if (pIterator != nullptr)
{ {
pIterator->notifyEach(&awt::XMouseListener::mouseReleased, aEvent); pIterator->notifyEach(&awt::XMouseListener::mouseReleased, aEvent);
} }
@ -571,7 +571,7 @@ void SAL_CALL PresenterSlideShowView::mouseEntered (const awt::MouseEvent& rEven
aEvent.Source = static_cast<XWeak*>(this); aEvent.Source = static_cast<XWeak*>(this);
::cppu::OInterfaceContainerHelper* pIterator ::cppu::OInterfaceContainerHelper* pIterator
= maBroadcaster.getContainer(cppu::UnoType<awt::XMouseListener>::get()); = maBroadcaster.getContainer(cppu::UnoType<awt::XMouseListener>::get());
if (pIterator != NULL) if (pIterator != nullptr)
{ {
pIterator->notifyEach(&awt::XMouseListener::mouseEntered, aEvent); pIterator->notifyEach(&awt::XMouseListener::mouseEntered, aEvent);
} }
@ -584,7 +584,7 @@ void SAL_CALL PresenterSlideShowView::mouseExited (const awt::MouseEvent& rEvent
aEvent.Source = static_cast<XWeak*>(this); aEvent.Source = static_cast<XWeak*>(this);
::cppu::OInterfaceContainerHelper* pIterator ::cppu::OInterfaceContainerHelper* pIterator
= maBroadcaster.getContainer(cppu::UnoType<awt::XMouseListener>::get()); = maBroadcaster.getContainer(cppu::UnoType<awt::XMouseListener>::get());
if (pIterator != NULL) if (pIterator != nullptr)
{ {
pIterator->notifyEach(&awt::XMouseListener::mouseExited, aEvent); pIterator->notifyEach(&awt::XMouseListener::mouseExited, aEvent);
} }
@ -599,7 +599,7 @@ void SAL_CALL PresenterSlideShowView::mouseDragged (const awt::MouseEvent& rEven
aEvent.Source = static_cast<XWeak*>(this); aEvent.Source = static_cast<XWeak*>(this);
::cppu::OInterfaceContainerHelper* pIterator ::cppu::OInterfaceContainerHelper* pIterator
= maBroadcaster.getContainer(cppu::UnoType<awt::XMouseMotionListener>::get()); = maBroadcaster.getContainer(cppu::UnoType<awt::XMouseMotionListener>::get());
if (pIterator != NULL) if (pIterator != nullptr)
{ {
pIterator->notifyEach(&awt::XMouseMotionListener::mouseDragged, aEvent); pIterator->notifyEach(&awt::XMouseMotionListener::mouseDragged, aEvent);
} }
@ -612,7 +612,7 @@ void SAL_CALL PresenterSlideShowView::mouseMoved (const awt::MouseEvent& rEvent)
aEvent.Source = static_cast<XWeak*>(this); aEvent.Source = static_cast<XWeak*>(this);
::cppu::OInterfaceContainerHelper* pIterator ::cppu::OInterfaceContainerHelper* pIterator
= maBroadcaster.getContainer(cppu::UnoType<awt::XMouseMotionListener>::get()); = maBroadcaster.getContainer(cppu::UnoType<awt::XMouseMotionListener>::get());
if (pIterator != NULL) if (pIterator != nullptr)
{ {
pIterator->notifyEach(&awt::XMouseMotionListener::mouseMoved, aEvent); pIterator->notifyEach(&awt::XMouseMotionListener::mouseMoved, aEvent);
} }
@ -693,7 +693,7 @@ void PresenterSlideShowView::PaintOuterWindow (const awt::Rectangle& rRepaintBox
if ( ! mxCanvas.is()) if ( ! mxCanvas.is())
return; return;
if (mpBackground.get() == NULL) if (mpBackground.get() == nullptr)
return; return;
const rendering::ViewState aViewState( const rendering::ViewState aViewState(
@ -702,7 +702,7 @@ void PresenterSlideShowView::PaintOuterWindow (const awt::Rectangle& rRepaintBox
rendering::RenderState aRenderState ( rendering::RenderState aRenderState (
geometry::AffineMatrix2D(1,0,0, 0,1,0), geometry::AffineMatrix2D(1,0,0, 0,1,0),
NULL, nullptr,
Sequence<double>(4), Sequence<double>(4),
rendering::CompositeOperation::SOURCE); rendering::CompositeOperation::SOURCE);
@ -718,8 +718,8 @@ void PresenterSlideShowView::PaintOuterWindow (const awt::Rectangle& rRepaintBox
1, 1,
0, 0,
xBackgroundBitmap, xBackgroundBitmap,
NULL, nullptr,
NULL, nullptr,
rendering::StrokeAttributes(), rendering::StrokeAttributes(),
rendering::TexturingMode::REPEAT, rendering::TexturingMode::REPEAT,
rendering::TexturingMode::REPEAT); rendering::TexturingMode::REPEAT);
@ -759,7 +759,7 @@ void PresenterSlideShowView::PaintEndSlide (const awt::Rectangle& rRepaintBox)
rendering::RenderState aRenderState ( rendering::RenderState aRenderState (
geometry::AffineMatrix2D(1,0,0, 0,1,0), geometry::AffineMatrix2D(1,0,0, 0,1,0),
NULL, nullptr,
Sequence<double>(4), Sequence<double>(4),
rendering::CompositeOperation::SOURCE); rendering::CompositeOperation::SOURCE);
PresenterCanvasHelper::SetDeviceColor(aRenderState, util::Color(0x00000000)); PresenterCanvasHelper::SetDeviceColor(aRenderState, util::Color(0x00000000));
@ -770,15 +770,15 @@ void PresenterSlideShowView::PaintEndSlide (const awt::Rectangle& rRepaintBox)
do do
{ {
if (mpPresenterController.get() == NULL) if (mpPresenterController.get() == nullptr)
break; break;
std::shared_ptr<PresenterTheme> pTheme (mpPresenterController->GetTheme()); std::shared_ptr<PresenterTheme> pTheme (mpPresenterController->GetTheme());
if (pTheme.get() == NULL) if (pTheme.get() == nullptr)
break; break;
const OUString sViewStyle (pTheme->GetStyleName(mxViewId->getResourceURL())); const OUString sViewStyle (pTheme->GetStyleName(mxViewId->getResourceURL()));
PresenterTheme::SharedFontDescriptor pFont (pTheme->GetFont(sViewStyle)); PresenterTheme::SharedFontDescriptor pFont (pTheme->GetFont(sViewStyle));
if (pFont.get() == NULL) if (pFont.get() == nullptr)
break; break;
/// this is responsible of the " presentation exit " text inside the slide windows /// this is responsible of the " presentation exit " text inside the slide windows
@ -811,7 +811,7 @@ void PresenterSlideShowView::PaintInnerWindow (const awt::PaintEvent& rEvent)
aEvent.Source = static_cast<XWeak*>(this); aEvent.Source = static_cast<XWeak*>(this);
::cppu::OInterfaceContainerHelper* pIterator ::cppu::OInterfaceContainerHelper* pIterator
= maBroadcaster.getContainer(cppu::UnoType<awt::XPaintListener>::get()); = maBroadcaster.getContainer(cppu::UnoType<awt::XPaintListener>::get());
if (pIterator != NULL) if (pIterator != nullptr)
{ {
pIterator->notifyEach(&awt::XPaintListener::windowPaint, aEvent); pIterator->notifyEach(&awt::XPaintListener::windowPaint, aEvent);
} }
@ -919,7 +919,7 @@ void PresenterSlideShowView::Resize()
lang::EventObject aEvent (static_cast<XWeak*>(this)); lang::EventObject aEvent (static_cast<XWeak*>(this));
::cppu::OInterfaceContainerHelper* pIterator ::cppu::OInterfaceContainerHelper* pIterator
= maBroadcaster.getContainer(cppu::UnoType<util::XModifyListener>::get()); = maBroadcaster.getContainer(cppu::UnoType<util::XModifyListener>::get());
if (pIterator != NULL) if (pIterator != nullptr)
{ {
pIterator->notifyEach(&util::XModifyListener::modified, aEvent); pIterator->notifyEach(&util::XModifyListener::modified, aEvent);
} }
@ -946,8 +946,8 @@ void PresenterSlideShowView::CreateBackgroundPolygons()
const awt::Rectangle aViewWindowBox (mxViewWindow->getPosSize()); const awt::Rectangle aViewWindowBox (mxViewWindow->getPosSize());
if (aWindowBox.Height == aViewWindowBox.Height && aWindowBox.Width == aViewWindowBox.Width) if (aWindowBox.Height == aViewWindowBox.Height && aWindowBox.Width == aViewWindowBox.Width)
{ {
mxBackgroundPolygon1 = NULL; mxBackgroundPolygon1 = nullptr;
mxBackgroundPolygon2 = NULL; mxBackgroundPolygon2 = nullptr;
} }
else if (aWindowBox.Height == aViewWindowBox.Height) else if (aWindowBox.Height == aViewWindowBox.Height)
{ {

View File

@ -270,7 +270,7 @@ PresenterSlideSorter::PresenterSlideSorter (
if ( ! rxContext.is() if ( ! rxContext.is()
|| ! rxViewId.is() || ! rxViewId.is()
|| ! rxController.is() || ! rxController.is()
|| rpPresenterController.get()==NULL) || rpPresenterController.get()==nullptr)
{ {
throw lang::IllegalArgumentException(); throw lang::IllegalArgumentException();
} }
@ -316,11 +316,11 @@ PresenterSlideSorter::PresenterSlideSorter (
mxCanvas, mxCanvas,
"SlideSorterCloser"); "SlideSorterCloser");
if (mpPresenterController->GetTheme().get() != NULL) if (mpPresenterController->GetTheme().get() != nullptr)
{ {
PresenterTheme::SharedFontDescriptor pFont ( PresenterTheme::SharedFontDescriptor pFont (
mpPresenterController->GetTheme()->GetFont("ButtonFont")); mpPresenterController->GetTheme()->GetFont("ButtonFont"));
if (pFont.get() != NULL) if (pFont.get() != nullptr)
maSeparatorColor = pFont->mnColor; maSeparatorColor = pFont->mnColor;
} }
@ -372,15 +372,15 @@ PresenterSlideSorter::~PresenterSlideSorter()
void SAL_CALL PresenterSlideSorter::disposing() void SAL_CALL PresenterSlideSorter::disposing()
{ {
mxComponentContext = NULL; mxComponentContext = nullptr;
mxViewId = NULL; mxViewId = nullptr;
mxPane = NULL; mxPane = nullptr;
if (mpVerticalScrollBar.is()) if (mpVerticalScrollBar.is())
{ {
Reference<lang::XComponent> xComponent ( Reference<lang::XComponent> xComponent (
static_cast<XWeak*>(mpVerticalScrollBar.get()), UNO_QUERY); static_cast<XWeak*>(mpVerticalScrollBar.get()), UNO_QUERY);
mpVerticalScrollBar = NULL; mpVerticalScrollBar = nullptr;
if (xComponent.is()) if (xComponent.is())
xComponent->dispose(); xComponent->dispose();
} }
@ -388,7 +388,7 @@ void SAL_CALL PresenterSlideSorter::disposing()
{ {
Reference<lang::XComponent> xComponent ( Reference<lang::XComponent> xComponent (
static_cast<XWeak*>(mpCloseButton.get()), UNO_QUERY); static_cast<XWeak*>(mpCloseButton.get()), UNO_QUERY);
mpCloseButton = NULL; mpCloseButton = nullptr;
if (xComponent.is()) if (xComponent.is())
xComponent->dispose(); xComponent->dispose();
} }
@ -398,10 +398,10 @@ void SAL_CALL PresenterSlideSorter::disposing()
Reference<lang::XComponent> xComponent (mxCanvas, UNO_QUERY); Reference<lang::XComponent> xComponent (mxCanvas, UNO_QUERY);
if (xComponent.is()) if (xComponent.is())
xComponent->removeEventListener(static_cast<awt::XWindowListener*>(this)); xComponent->removeEventListener(static_cast<awt::XWindowListener*>(this));
mxCanvas = NULL; mxCanvas = nullptr;
} }
mpPresenterController = NULL; mpPresenterController = nullptr;
mxSlideShowController = NULL; mxSlideShowController = nullptr;
mpLayout.reset(); mpLayout.reset();
mpMouseOverManager.reset(); mpMouseOverManager.reset();
@ -410,7 +410,7 @@ void SAL_CALL PresenterSlideSorter::disposing()
mxPreviewCache->removePreviewCreationNotifyListener(this); mxPreviewCache->removePreviewCreationNotifyListener(this);
Reference<XComponent> xComponent (mxPreviewCache, UNO_QUERY); Reference<XComponent> xComponent (mxPreviewCache, UNO_QUERY);
mxPreviewCache = NULL; mxPreviewCache = nullptr;
if (xComponent.is()) if (xComponent.is())
xComponent->dispose(); xComponent->dispose();
} }
@ -436,17 +436,17 @@ void SAL_CALL PresenterSlideSorter::disposing (const lang::EventObject& rEventOb
{ {
if (rEventObject.Source == mxWindow) if (rEventObject.Source == mxWindow)
{ {
mxWindow = NULL; mxWindow = nullptr;
dispose(); dispose();
} }
else if (rEventObject.Source == mxPreviewCache) else if (rEventObject.Source == mxPreviewCache)
{ {
mxPreviewCache = NULL; mxPreviewCache = nullptr;
dispose(); dispose();
} }
else if (rEventObject.Source == mxCanvas) else if (rEventObject.Source == mxCanvas)
{ {
mxCanvas = NULL; mxCanvas = nullptr;
mbIsLayoutPending = true; mbIsLayoutPending = true;
mbIsPaintPending = true; mbIsPaintPending = true;
@ -543,8 +543,8 @@ void SAL_CALL PresenterSlideSorter::mouseReleased (const css::awt::MouseEvent& r
break; break;
case 2: case 2:
OSL_ASSERT(mpPresenterController.get()!=NULL); OSL_ASSERT(mpPresenterController.get()!=nullptr);
OSL_ASSERT(mpPresenterController->GetWindowManager().get()!=NULL); OSL_ASSERT(mpPresenterController->GetWindowManager().get()!=nullptr);
mpPresenterController->GetWindowManager()->SetSlideSorterState(false); mpPresenterController->GetWindowManager()->SetSlideSorterState(false);
GotoSlide(nSlideIndex); GotoSlide(nSlideIndex);
break; break;
@ -563,7 +563,7 @@ void SAL_CALL PresenterSlideSorter::mouseExited (const css::awt::MouseEvent& rEv
{ {
(void)rEvent; (void)rEvent;
mnSlideIndexMousePressed = -1; mnSlideIndexMousePressed = -1;
if (mpMouseOverManager.get() != NULL) if (mpMouseOverManager.get() != nullptr)
mpMouseOverManager->SetSlide(mnSlideIndexMousePressed, awt::Rectangle(0,0,0,0)); mpMouseOverManager->SetSlide(mnSlideIndexMousePressed, awt::Rectangle(0,0,0,0));
} }
@ -572,7 +572,7 @@ void SAL_CALL PresenterSlideSorter::mouseExited (const css::awt::MouseEvent& rEv
void SAL_CALL PresenterSlideSorter::mouseMoved (const css::awt::MouseEvent& rEvent) void SAL_CALL PresenterSlideSorter::mouseMoved (const css::awt::MouseEvent& rEvent)
throw (css::uno::RuntimeException, std::exception) throw (css::uno::RuntimeException, std::exception)
{ {
if (mpMouseOverManager.get() != NULL) if (mpMouseOverManager.get() != nullptr)
{ {
css::awt::MouseEvent rTemp =rEvent; css::awt::MouseEvent rTemp =rEvent;
/// check whether RTL interface or not /// check whether RTL interface or not
@ -635,7 +635,7 @@ void SAL_CALL PresenterSlideSorter::notifyPreviewCreation (
sal_Int32 nSlideIndex) sal_Int32 nSlideIndex)
throw(css::uno::RuntimeException, std::exception) throw(css::uno::RuntimeException, std::exception)
{ {
OSL_ASSERT(mpLayout.get()!=NULL); OSL_ASSERT(mpLayout.get()!=nullptr);
awt::Rectangle aBBox (mpLayout->GetBoundingBox(nSlideIndex)); awt::Rectangle aBBox (mpLayout->GetBoundingBox(nSlideIndex));
mpPresenterController->GetPaintManager()->Invalidate(mxWindow, aBBox, true); mpPresenterController->GetPaintManager()->Invalidate(mxWindow, aBBox, true);
@ -679,7 +679,7 @@ Reference<drawing::XDrawPage> SAL_CALL PresenterSlideSorter::getCurrentPage()
throw (RuntimeException, std::exception) throw (RuntimeException, std::exception)
{ {
ThrowIfDisposed(); ThrowIfDisposed();
return NULL; return nullptr;
} }
@ -702,7 +702,7 @@ void PresenterSlideSorter::UpdateLayout()
mxViewId->getResourceURL())); mxViewId->getResourceURL()));
do do
{ {
if (pPane.get() == NULL) if (pPane.get() == nullptr)
break; break;
if ( ! pPane->mxPane.is()) if ( ! pPane->mxPane.is())
break; break;
@ -743,7 +743,7 @@ void PresenterSlideSorter::UpdateLayout()
mpLayout->GetLastVisibleSlideIndex()); mpLayout->GetLastVisibleSlideIndex());
// Clear the frame polygon so that it is re-created on the next paint. // Clear the frame polygon so that it is re-created on the next paint.
mxPreviewFrame = NULL; mxPreviewFrame = nullptr;
} }
geometry::RealRectangle2D PresenterSlideSorter::PlaceScrollBars ( geometry::RealRectangle2D PresenterSlideSorter::PlaceScrollBars (
@ -754,7 +754,7 @@ geometry::RealRectangle2D PresenterSlideSorter::PlaceScrollBars (
Reference<container::XIndexAccess> xSlides (mxSlideShowController, UNO_QUERY_THROW); Reference<container::XIndexAccess> xSlides (mxSlideShowController, UNO_QUERY_THROW);
if (xSlides.is()) if (xSlides.is())
bIsScrollBarNeeded = mpLayout->IsScrollBarNeeded(xSlides->getCount()); bIsScrollBarNeeded = mpLayout->IsScrollBarNeeded(xSlides->getCount());
if (mpVerticalScrollBar.get() != NULL) if (mpVerticalScrollBar.get() != nullptr)
{ {
if (bIsScrollBarNeeded) if (bIsScrollBarNeeded)
{ {
@ -807,7 +807,7 @@ void PresenterSlideSorter::PlaceCloseButton (
// centered over the callout. Otherwise it is centered with respect to // centered over the callout. Otherwise it is centered with respect to
// the whole window. // the whole window.
sal_Int32 nCloseButtonCenter (rCenterBox.Width/2); sal_Int32 nCloseButtonCenter (rCenterBox.Width/2);
if (rpPane.get() != NULL && rpPane->mxPane.is()) if (rpPane.get() != nullptr && rpPane->mxPane.is())
{ {
const sal_Int32 nCalloutCenter (rpPane->mxPane->GetCalloutAnchor().X - nLeftBorderWidth); const sal_Int32 nCalloutCenter (rpPane->mxPane->GetCalloutAnchor().X - nLeftBorderWidth);
const sal_Int32 nDistanceFromWindowCenter (abs(nCalloutCenter - rCenterBox.Width/2)); const sal_Int32 nDistanceFromWindowCenter (abs(nCalloutCenter - rCenterBox.Width/2));
@ -874,11 +874,11 @@ double PresenterSlideSorter::GetSlideAspectRatio() const
Reference<rendering::XBitmap> PresenterSlideSorter::GetPreview (const sal_Int32 nSlideIndex) Reference<rendering::XBitmap> PresenterSlideSorter::GetPreview (const sal_Int32 nSlideIndex)
{ {
if (nSlideIndex < 0 || nSlideIndex>=mpLayout->mnSlideCount) if (nSlideIndex < 0 || nSlideIndex>=mpLayout->mnSlideCount)
return NULL; return nullptr;
else if (mxPane.is()) else if (mxPane.is())
return mxPreviewCache->getSlidePreview(nSlideIndex, mxPane->getCanvas()); return mxPreviewCache->getSlidePreview(nSlideIndex, mxPane->getCanvas());
else else
return NULL; return nullptr;
} }
void PresenterSlideSorter::PaintPreview ( void PresenterSlideSorter::PaintPreview (
@ -931,14 +931,14 @@ void PresenterSlideSorter::PaintPreview (
geometry::AffineMatrix2D( geometry::AffineMatrix2D(
1, 0, aTopLeft.X, 1, 0, aTopLeft.X,
0, 1, aTopLeft.Y), 0, 1, aTopLeft.Y),
NULL, nullptr,
Sequence<double>(4), Sequence<double>(4),
rendering::CompositeOperation::SOURCE); rendering::CompositeOperation::SOURCE);
// Emphasize the current slide. // Emphasize the current slide.
if (nSlideIndex == mnCurrentSlideIndex) if (nSlideIndex == mnCurrentSlideIndex)
{ {
if (mpCurrentSlideFrameRenderer.get() != NULL) if (mpCurrentSlideFrameRenderer.get() != nullptr)
{ {
const awt::Rectangle aSlideBoundingBox( const awt::Rectangle aSlideBoundingBox(
sal::static_int_cast<sal_Int32>(0.5 + aTopLeft.X), sal::static_int_cast<sal_Int32>(0.5 + aTopLeft.X),
@ -970,7 +970,7 @@ void PresenterSlideSorter::PaintPreview (
geometry::AffineMatrix2D( geometry::AffineMatrix2D(
1, 0, aAnimationPreviewBox.X, 1, 0, aAnimationPreviewBox.X,
0, 1, aAnimationPreviewBox.Y), 0, 1, aAnimationPreviewBox.Y),
NULL, nullptr,
Sequence<double>(4), Sequence<double>(4),
rendering::CompositeOperation::SOURCE); rendering::CompositeOperation::SOURCE);
rxCanvas->drawBitmap(xAnimationIcon, aViewState, aAnimationRenderState); rxCanvas->drawBitmap(xAnimationIcon, aViewState, aAnimationRenderState);
@ -984,7 +984,7 @@ void PresenterSlideSorter::PaintPreview (
geometry::AffineMatrix2D( geometry::AffineMatrix2D(
1, 0, aTransitionPreviewBox.X, 1, 0, aTransitionPreviewBox.X,
0, 1, aTransitionPreviewBox.Y), 0, 1, aTransitionPreviewBox.Y),
NULL, nullptr,
Sequence<double>(4), Sequence<double>(4),
rendering::CompositeOperation::SOURCE); rendering::CompositeOperation::SOURCE);
rxCanvas->drawBitmap(xTransitionIcon, aViewState, aTransitionRenderState); rxCanvas->drawBitmap(xTransitionIcon, aViewState, aTransitionRenderState);
@ -1043,12 +1043,12 @@ void PresenterSlideSorter::Paint (const awt::Rectangle& rUpdateBox)
// Paint the horizontal separator. // Paint the horizontal separator.
rendering::RenderState aRenderState (geometry::AffineMatrix2D(1,0,0, 0,1,0), rendering::RenderState aRenderState (geometry::AffineMatrix2D(1,0,0, 0,1,0),
NULL, Sequence<double>(4), rendering::CompositeOperation::SOURCE); nullptr, Sequence<double>(4), rendering::CompositeOperation::SOURCE);
PresenterCanvasHelper::SetDeviceColor(aRenderState, maSeparatorColor); PresenterCanvasHelper::SetDeviceColor(aRenderState, maSeparatorColor);
mxCanvas->drawLine( mxCanvas->drawLine(
geometry::RealPoint2D(0, mnSeparatorY), geometry::RealPoint2D(0, mnSeparatorY),
geometry::RealPoint2D(mxWindow->getPosSize().Width, mnSeparatorY), geometry::RealPoint2D(mxWindow->getPosSize().Width, mnSeparatorY),
rendering::ViewState(geometry::AffineMatrix2D(1,0,0, 0,1,0), NULL), rendering::ViewState(geometry::AffineMatrix2D(1,0,0, 0,1,0), nullptr),
aRenderState); aRenderState);
// Paint the slides. // Paint the slides.
@ -1452,7 +1452,7 @@ void PresenterSlideSorter::Layout::UpdateScrollBars()
sal_Int32 nTotalRowCount (0); sal_Int32 nTotalRowCount (0);
nTotalRowCount = sal_Int32(ceil(double(mnSlideCount) / double(mnColumnCount))); nTotalRowCount = sal_Int32(ceil(double(mnSlideCount) / double(mnColumnCount)));
if (mpVerticalScrollBar.get() != NULL) if (mpVerticalScrollBar.get() != nullptr)
{ {
mpVerticalScrollBar->SetTotalSize( mpVerticalScrollBar->SetTotalSize(
nTotalRowCount * maPreviewSize.Height nTotalRowCount * maPreviewSize.Height
@ -1501,10 +1501,10 @@ PresenterSlideSorter::MouseOverManager::MouseOverManager (
mxInvalidateTarget(rxInvalidateTarget), mxInvalidateTarget(rxInvalidateTarget),
mpPaintManager(rpPaintManager) mpPaintManager(rpPaintManager)
{ {
if (rpTheme.get()!=NULL) if (rpTheme.get()!=nullptr)
{ {
std::shared_ptr<PresenterBitmapContainer> pBitmaps (rpTheme->GetBitmapContainer()); std::shared_ptr<PresenterBitmapContainer> pBitmaps (rpTheme->GetBitmapContainer());
if (pBitmaps.get() != NULL) if (pBitmaps.get() != nullptr)
{ {
mpLeftLabelBitmap = pBitmaps->GetBitmap("LabelLeft"); mpLeftLabelBitmap = pBitmaps->GetBitmap("LabelLeft");
mpCenterLabelBitmap = pBitmaps->GetBitmap("LabelCenter"); mpCenterLabelBitmap = pBitmaps->GetBitmap("LabelCenter");
@ -1529,7 +1529,7 @@ void PresenterSlideSorter::MouseOverManager::Paint (
if (mxCanvas != rxCanvas) if (mxCanvas != rxCanvas)
SetCanvas(rxCanvas); SetCanvas(rxCanvas);
if (rxCanvas != NULL) if (rxCanvas != nullptr)
{ {
if ( ! mxBitmap.is()) if ( ! mxBitmap.is())
mxBitmap = CreateBitmap(msText, maSlideBoundingBox.Width); mxBitmap = CreateBitmap(msText, maSlideBoundingBox.Width);
@ -1547,7 +1547,7 @@ void PresenterSlideSorter::MouseOverManager::Paint (
rxClip), rxClip),
rendering::RenderState( rendering::RenderState(
geometry::AffineMatrix2D(1,0,nXOffset, 0,1,nYOffset), geometry::AffineMatrix2D(1,0,nXOffset, 0,1,nYOffset),
NULL, nullptr,
Sequence<double>(4), Sequence<double>(4),
rendering::CompositeOperation::SOURCE)); rendering::CompositeOperation::SOURCE));
} }
@ -1558,7 +1558,7 @@ void PresenterSlideSorter::MouseOverManager::SetCanvas (
const Reference<rendering::XCanvas>& rxCanvas) const Reference<rendering::XCanvas>& rxCanvas)
{ {
mxCanvas = rxCanvas; mxCanvas = rxCanvas;
if (mpFont.get() != NULL) if (mpFont.get() != nullptr)
mpFont->PrepareFont(Reference<rendering::XCanvas>(mxCanvas, UNO_QUERY)); mpFont->PrepareFont(Reference<rendering::XCanvas>(mxCanvas, UNO_QUERY));
} }
@ -1577,7 +1577,7 @@ void PresenterSlideSorter::MouseOverManager::SetSlide (
if (nSlideIndex >= 0) if (nSlideIndex >= 0)
{ {
if (mxSlides.get() != NULL) if (mxSlides.get() != nullptr)
{ {
msText.clear(); msText.clear();
@ -1593,7 +1593,7 @@ void PresenterSlideSorter::MouseOverManager::SetSlide (
{ {
msText.clear(); msText.clear();
} }
mxBitmap = NULL; mxBitmap = nullptr;
Invalidate(); Invalidate();
} }
@ -1603,10 +1603,10 @@ Reference<rendering::XBitmap> PresenterSlideSorter::MouseOverManager::CreateBitm
const sal_Int32 nMaximalWidth) const const sal_Int32 nMaximalWidth) const
{ {
if ( ! mxCanvas.is()) if ( ! mxCanvas.is())
return NULL; return nullptr;
if (mpFont.get()==NULL || !mpFont->mxFont.is()) if (mpFont.get()==nullptr || !mpFont->mxFont.is())
return NULL; return nullptr;
// Long text has to be shortened. // Long text has to be shortened.
const OUString sText (GetFittingText(rsText, nMaximalWidth const OUString sText (GetFittingText(rsText, nMaximalWidth
@ -1623,11 +1623,11 @@ Reference<rendering::XBitmap> PresenterSlideSorter::MouseOverManager::CreateBitm
mxCanvas->getDevice()->createCompatibleAlphaBitmap(aLabelSize)); mxCanvas->getDevice()->createCompatibleAlphaBitmap(aLabelSize));
if ( ! xBitmap.is()) if ( ! xBitmap.is())
return NULL; return nullptr;
Reference<rendering::XBitmapCanvas> xBitmapCanvas (xBitmap, UNO_QUERY); Reference<rendering::XBitmapCanvas> xBitmapCanvas (xBitmap, UNO_QUERY);
if ( ! xBitmapCanvas.is()) if ( ! xBitmapCanvas.is())
return NULL; return nullptr;
// Paint the background. // Paint the background.
PaintButtonBackground(xBitmapCanvas, aLabelSize); PaintButtonBackground(xBitmapCanvas, aLabelSize);
@ -1647,11 +1647,11 @@ Reference<rendering::XBitmap> PresenterSlideSorter::MouseOverManager::CreateBitm
const rendering::ViewState aViewState( const rendering::ViewState aViewState(
geometry::AffineMatrix2D(1,0,0, 0,1,0), geometry::AffineMatrix2D(1,0,0, 0,1,0),
NULL); nullptr);
rendering::RenderState aRenderState ( rendering::RenderState aRenderState (
geometry::AffineMatrix2D(1,0,nXOffset, 0,1,nYOffset), geometry::AffineMatrix2D(1,0,nXOffset, 0,1,nYOffset),
NULL, nullptr,
Sequence<double>(4), Sequence<double>(4),
rendering::CompositeOperation::SOURCE); rendering::CompositeOperation::SOURCE);
PresenterCanvasHelper::SetDeviceColor(aRenderState, mpFont->mnColor); PresenterCanvasHelper::SetDeviceColor(aRenderState, mpFont->mnColor);
@ -1727,7 +1727,7 @@ geometry::IntegerSize2D PresenterSlideSorter::MouseOverManager::CalculateLabelSi
{ {
// Height is specified by the label bitmaps. // Height is specified by the label bitmaps.
sal_Int32 nHeight (32); sal_Int32 nHeight (32);
if (mpCenterLabelBitmap.get() != NULL) if (mpCenterLabelBitmap.get() != nullptr)
{ {
Reference<rendering::XBitmap> xBitmap (mpCenterLabelBitmap->GetNormalBitmap()); Reference<rendering::XBitmap> xBitmap (mpCenterLabelBitmap->GetNormalBitmap());
if (xBitmap.is()) if (xBitmap.is())
@ -1749,15 +1749,15 @@ void PresenterSlideSorter::MouseOverManager::PaintButtonBackground (
{ {
// Get the bitmaps for painting the label background. // Get the bitmaps for painting the label background.
Reference<rendering::XBitmap> xLeftLabelBitmap; Reference<rendering::XBitmap> xLeftLabelBitmap;
if (mpLeftLabelBitmap.get() != NULL) if (mpLeftLabelBitmap.get() != nullptr)
xLeftLabelBitmap = mpLeftLabelBitmap->GetNormalBitmap(); xLeftLabelBitmap = mpLeftLabelBitmap->GetNormalBitmap();
Reference<rendering::XBitmap> xCenterLabelBitmap; Reference<rendering::XBitmap> xCenterLabelBitmap;
if (mpCenterLabelBitmap.get() != NULL) if (mpCenterLabelBitmap.get() != nullptr)
xCenterLabelBitmap = mpCenterLabelBitmap->GetNormalBitmap(); xCenterLabelBitmap = mpCenterLabelBitmap->GetNormalBitmap();
Reference<rendering::XBitmap> xRightLabelBitmap; Reference<rendering::XBitmap> xRightLabelBitmap;
if (mpRightLabelBitmap.get() != NULL) if (mpRightLabelBitmap.get() != nullptr)
xRightLabelBitmap = mpRightLabelBitmap->GetNormalBitmap(); xRightLabelBitmap = mpRightLabelBitmap->GetNormalBitmap();
PresenterUIPainter::PaintHorizontalBitmapComposite ( PresenterUIPainter::PaintHorizontalBitmapComposite (
@ -1771,7 +1771,7 @@ void PresenterSlideSorter::MouseOverManager::PaintButtonBackground (
void PresenterSlideSorter::MouseOverManager::Invalidate() void PresenterSlideSorter::MouseOverManager::Invalidate()
{ {
if (mpPaintManager.get() != NULL) if (mpPaintManager.get() != nullptr)
mpPaintManager->Invalidate(mxInvalidateTarget, maSlideBoundingBox, true); mpPaintManager->Invalidate(mxInvalidateTarget, maSlideBoundingBox, true);
} }
@ -1820,31 +1820,31 @@ PresenterSlideSorter::CurrentSlideFrameRenderer::CurrentSlideFrameRenderer (
mpBottomRight = aContainer.GetBitmap("BottomRight"); mpBottomRight = aContainer.GetBitmap("BottomRight");
// Determine size of frame. // Determine size of frame.
if (mpTop.get() != NULL) if (mpTop.get() != nullptr)
mnTopFrameSize = mpTop->mnHeight; mnTopFrameSize = mpTop->mnHeight;
if (mpLeft.get() != NULL) if (mpLeft.get() != nullptr)
mnLeftFrameSize = mpLeft->mnWidth; mnLeftFrameSize = mpLeft->mnWidth;
if (mpRight.get() != NULL) if (mpRight.get() != nullptr)
mnRightFrameSize = mpRight->mnWidth; mnRightFrameSize = mpRight->mnWidth;
if (mpBottom.get() != NULL) if (mpBottom.get() != nullptr)
mnBottomFrameSize = mpBottom->mnHeight; mnBottomFrameSize = mpBottom->mnHeight;
if (mpTopLeft.get() != NULL) if (mpTopLeft.get() != nullptr)
{ {
mnTopFrameSize = ::std::max(mnTopFrameSize, mpTopLeft->mnHeight); mnTopFrameSize = ::std::max(mnTopFrameSize, mpTopLeft->mnHeight);
mnLeftFrameSize = ::std::max(mnLeftFrameSize, mpTopLeft->mnWidth); mnLeftFrameSize = ::std::max(mnLeftFrameSize, mpTopLeft->mnWidth);
} }
if (mpTopRight.get() != NULL) if (mpTopRight.get() != nullptr)
{ {
mnTopFrameSize = ::std::max(mnTopFrameSize, mpTopRight->mnHeight); mnTopFrameSize = ::std::max(mnTopFrameSize, mpTopRight->mnHeight);
mnRightFrameSize = ::std::max(mnRightFrameSize, mpTopRight->mnWidth); mnRightFrameSize = ::std::max(mnRightFrameSize, mpTopRight->mnWidth);
} }
if (mpBottomLeft.get() != NULL) if (mpBottomLeft.get() != nullptr)
{ {
mnLeftFrameSize = ::std::max(mnLeftFrameSize, mpBottomLeft->mnWidth); mnLeftFrameSize = ::std::max(mnLeftFrameSize, mpBottomLeft->mnWidth);
mnBottomFrameSize = ::std::max(mnBottomFrameSize, mpBottomLeft->mnHeight); mnBottomFrameSize = ::std::max(mnBottomFrameSize, mpBottomLeft->mnHeight);
} }
if (mpBottomRight.get() != NULL) if (mpBottomRight.get() != nullptr)
{ {
mnRightFrameSize = ::std::max(mnRightFrameSize, mpBottomRight->mnWidth); mnRightFrameSize = ::std::max(mnRightFrameSize, mpBottomRight->mnWidth);
mnBottomFrameSize = ::std::max(mnBottomFrameSize, mpBottomRight->mnHeight); mnBottomFrameSize = ::std::max(mnBottomFrameSize, mpBottomRight->mnHeight);
@ -1866,7 +1866,7 @@ void PresenterSlideSorter::CurrentSlideFrameRenderer::PaintCurrentSlideFrame (
const Reference<rendering::XPolyPolygon2D> xClip ( const Reference<rendering::XPolyPolygon2D> xClip (
PresenterGeometryHelper::CreatePolygon(rClipBox, rxCanvas->getDevice())); PresenterGeometryHelper::CreatePolygon(rClipBox, rxCanvas->getDevice()));
if (mpTop.get() != NULL) if (mpTop.get() != nullptr)
{ {
PaintBitmapTiled( PaintBitmapTiled(
mpTop->GetNormalBitmap(), mpTop->GetNormalBitmap(),
@ -1877,7 +1877,7 @@ void PresenterSlideSorter::CurrentSlideFrameRenderer::PaintCurrentSlideFrame (
rSlideBoundingBox.Width, rSlideBoundingBox.Width,
mpTop->mnHeight); mpTop->mnHeight);
} }
if (mpLeft.get() != NULL) if (mpLeft.get() != nullptr)
{ {
PaintBitmapTiled( PaintBitmapTiled(
mpLeft->GetNormalBitmap(), mpLeft->GetNormalBitmap(),
@ -1888,7 +1888,7 @@ void PresenterSlideSorter::CurrentSlideFrameRenderer::PaintCurrentSlideFrame (
mpLeft->mnWidth, mpLeft->mnWidth,
rSlideBoundingBox.Height); rSlideBoundingBox.Height);
} }
if (mpRight.get() != NULL) if (mpRight.get() != nullptr)
{ {
PaintBitmapTiled( PaintBitmapTiled(
mpRight->GetNormalBitmap(), mpRight->GetNormalBitmap(),
@ -1899,7 +1899,7 @@ void PresenterSlideSorter::CurrentSlideFrameRenderer::PaintCurrentSlideFrame (
mpRight->mnWidth, mpRight->mnWidth,
rSlideBoundingBox.Height); rSlideBoundingBox.Height);
} }
if (mpBottom.get() != NULL) if (mpBottom.get() != nullptr)
{ {
PaintBitmapTiled( PaintBitmapTiled(
mpBottom->GetNormalBitmap(), mpBottom->GetNormalBitmap(),
@ -1910,7 +1910,7 @@ void PresenterSlideSorter::CurrentSlideFrameRenderer::PaintCurrentSlideFrame (
rSlideBoundingBox.Width, rSlideBoundingBox.Width,
mpBottom->mnHeight); mpBottom->mnHeight);
} }
if (mpTopLeft.get() != NULL) if (mpTopLeft.get() != nullptr)
{ {
PaintBitmapOnce( PaintBitmapOnce(
mpTopLeft->GetNormalBitmap(), mpTopLeft->GetNormalBitmap(),
@ -1919,7 +1919,7 @@ void PresenterSlideSorter::CurrentSlideFrameRenderer::PaintCurrentSlideFrame (
rSlideBoundingBox.X - mpTopLeft->mnWidth, rSlideBoundingBox.X - mpTopLeft->mnWidth,
rSlideBoundingBox.Y - mpTopLeft->mnHeight); rSlideBoundingBox.Y - mpTopLeft->mnHeight);
} }
if (mpTopRight.get() != NULL) if (mpTopRight.get() != nullptr)
{ {
PaintBitmapOnce( PaintBitmapOnce(
mpTopRight->GetNormalBitmap(), mpTopRight->GetNormalBitmap(),
@ -1928,7 +1928,7 @@ void PresenterSlideSorter::CurrentSlideFrameRenderer::PaintCurrentSlideFrame (
rSlideBoundingBox.X + rSlideBoundingBox.Width, rSlideBoundingBox.X + rSlideBoundingBox.Width,
rSlideBoundingBox.Y - mpTopLeft->mnHeight); rSlideBoundingBox.Y - mpTopLeft->mnHeight);
} }
if (mpBottomLeft.get() != NULL) if (mpBottomLeft.get() != nullptr)
{ {
PaintBitmapOnce( PaintBitmapOnce(
mpBottomLeft->GetNormalBitmap(), mpBottomLeft->GetNormalBitmap(),
@ -1937,7 +1937,7 @@ void PresenterSlideSorter::CurrentSlideFrameRenderer::PaintCurrentSlideFrame (
rSlideBoundingBox.X - mpBottomLeft->mnWidth, rSlideBoundingBox.X - mpBottomLeft->mnWidth,
rSlideBoundingBox.Y + rSlideBoundingBox.Height); rSlideBoundingBox.Y + rSlideBoundingBox.Height);
} }
if (mpBottomRight.get() != NULL) if (mpBottomRight.get() != nullptr)
{ {
PaintBitmapOnce( PaintBitmapOnce(
mpBottomRight->GetNormalBitmap(), mpBottomRight->GetNormalBitmap(),
@ -1977,7 +1977,7 @@ void PresenterSlideSorter::CurrentSlideFrameRenderer::PaintBitmapOnce(
geometry::AffineMatrix2D( geometry::AffineMatrix2D(
1, 0, nX, 1, 0, nX,
0, 1, nY), 0, 1, nY),
NULL, nullptr,
Sequence<double>(4), Sequence<double>(4),
rendering::CompositeOperation::SOURCE); rendering::CompositeOperation::SOURCE);
@ -2014,7 +2014,7 @@ void PresenterSlideSorter::CurrentSlideFrameRenderer::PaintBitmapTiled(
geometry::AffineMatrix2D( geometry::AffineMatrix2D(
1, 0, nX0, 1, 0, nX0,
0, 1, nY0), 0, 1, nY0),
NULL, nullptr,
Sequence<double>(4), Sequence<double>(4),
rendering::CompositeOperation::SOURCE); rendering::CompositeOperation::SOURCE);

View File

@ -49,7 +49,7 @@ PresenterSprite::~PresenterSprite()
Reference<lang::XComponent> xComponent (mxSprite, UNO_QUERY); Reference<lang::XComponent> xComponent (mxSprite, UNO_QUERY);
if (xComponent.is()) if (xComponent.is())
xComponent->dispose(); xComponent->dispose();
mxSprite = NULL; mxSprite = nullptr;
} }
} }
@ -71,7 +71,7 @@ css::uno::Reference<css::rendering::XCanvas> PresenterSprite::GetCanvas()
if (mxSprite.is()) if (mxSprite.is())
return mxSprite->getContentCanvas(); return mxSprite->getContentCanvas();
else else
return NULL; return nullptr;
} }
void PresenterSprite::Show() void PresenterSprite::Show()
@ -107,10 +107,10 @@ void PresenterSprite::MoveTo (const css::geometry::RealPoint2D& rLocation)
maLocation, maLocation,
rendering::ViewState( rendering::ViewState(
geometry::AffineMatrix2D(1,0,0, 0,1,0), geometry::AffineMatrix2D(1,0,0, 0,1,0),
NULL), nullptr),
rendering::RenderState( rendering::RenderState(
geometry::AffineMatrix2D(1,0,0, 0,1,0), geometry::AffineMatrix2D(1,0,0, 0,1,0),
NULL, nullptr,
uno::Sequence<double>(4), uno::Sequence<double>(4),
rendering::CompositeOperation::SOURCE) rendering::CompositeOperation::SOURCE)
); );
@ -135,10 +135,10 @@ void PresenterSprite::ProvideSprite()
mxSprite->move(maLocation, mxSprite->move(maLocation,
rendering::ViewState( rendering::ViewState(
geometry::AffineMatrix2D(1,0,0, 0,1,0), geometry::AffineMatrix2D(1,0,0, 0,1,0),
NULL), nullptr),
rendering::RenderState( rendering::RenderState(
geometry::AffineMatrix2D(1,0,0, 0,1,0), geometry::AffineMatrix2D(1,0,0, 0,1,0),
NULL, nullptr,
uno::Sequence<double>(4), uno::Sequence<double>(4),
rendering::CompositeOperation::SOURCE) rendering::CompositeOperation::SOURCE)
); );
@ -158,7 +158,7 @@ void PresenterSprite::DisposeSprite()
Reference<lang::XComponent> xComponent (mxSprite, UNO_QUERY); Reference<lang::XComponent> xComponent (mxSprite, UNO_QUERY);
if (xComponent.is()) if (xComponent.is())
xComponent->dispose(); xComponent->dispose();
mxSprite = NULL; mxSprite = nullptr;
} }
} }

View File

@ -53,9 +53,9 @@ PresenterSpritePane::~PresenterSpritePane()
void PresenterSpritePane::disposing() void PresenterSpritePane::disposing()
{ {
mpSprite->SetFactory(NULL); mpSprite->SetFactory(nullptr);
mxParentWindow = NULL; mxParentWindow = nullptr;
mxParentCanvas = NULL; mxParentCanvas = nullptr;
PresenterPaneBase::disposing(); PresenterPaneBase::disposing();
} }

View File

@ -334,7 +334,7 @@ void PresenterTextView::Paint (
rendering::RenderState aRenderState ( rendering::RenderState aRenderState (
geometry::AffineMatrix2D(1,0,nX, 0,1,nY), geometry::AffineMatrix2D(1,0,nX, 0,1,nY),
NULL, nullptr,
Sequence<double>(4), Sequence<double>(4),
rendering::CompositeOperation::SOURCE); rendering::CompositeOperation::SOURCE);
PresenterCanvasHelper::SetDeviceColor(aRenderState, mpFont->mnColor); PresenterCanvasHelper::SetDeviceColor(aRenderState, mpFont->mnColor);

View File

@ -313,7 +313,7 @@ OUString PresenterTheme::GetStyleName (const OUString& rsResourceURL) const
{ {
OUString sStyleName; OUString sStyleName;
std::shared_ptr<Theme> pTheme (mpTheme); std::shared_ptr<Theme> pTheme (mpTheme);
while (sStyleName.isEmpty() && pTheme.get()!=NULL) while (sStyleName.isEmpty() && pTheme.get()!=nullptr)
{ {
sStyleName = pTheme->maStyleAssociations.GetStyleName(rsResourceURL); sStyleName = pTheme->maStyleAssociations.GetStyleName(rsResourceURL);
pTheme = pTheme->mpParentTheme; pTheme = pTheme->mpParentTheme;
@ -325,10 +325,10 @@ OUString PresenterTheme::GetStyleName (const OUString& rsResourceURL) const
const OUString& rsStyleName, const OUString& rsStyleName,
const bool bOuter) const const bool bOuter) const
{ {
OSL_ASSERT(mpTheme.get() != NULL); OSL_ASSERT(mpTheme.get() != nullptr);
SharedPaneStyle pPaneStyle (mpTheme->GetPaneStyle(rsStyleName)); SharedPaneStyle pPaneStyle (mpTheme->GetPaneStyle(rsStyleName));
if (pPaneStyle.get() != NULL) if (pPaneStyle.get() != nullptr)
if (bOuter) if (bOuter)
return pPaneStyle->maOuterBorderSize.ToVector(); return pPaneStyle->maOuterBorderSize.ToVector();
else else
@ -370,7 +370,7 @@ bool PresenterTheme::ConvertToColor (
std::shared_ptr<PresenterConfigurationAccess> PresenterTheme::GetNodeForViewStyle ( std::shared_ptr<PresenterConfigurationAccess> PresenterTheme::GetNodeForViewStyle (
const OUString& rsStyleName) const const OUString& rsStyleName) const
{ {
if (mpTheme.get() == NULL) if (mpTheme.get() == nullptr)
return std::shared_ptr<PresenterConfigurationAccess>(); return std::shared_ptr<PresenterConfigurationAccess>();
// Open configuration for writing. // Open configuration for writing.
@ -398,16 +398,16 @@ SharedBitmapDescriptor PresenterTheme::GetBitmap (
const OUString& rsStyleName, const OUString& rsStyleName,
const OUString& rsBitmapName) const const OUString& rsBitmapName) const
{ {
if (mpTheme.get() != NULL) if (mpTheme.get() != nullptr)
{ {
if (rsStyleName.isEmpty()) if (rsStyleName.isEmpty())
{ {
if (rsBitmapName == "Background") if (rsBitmapName == "Background")
{ {
std::shared_ptr<Theme> pTheme (mpTheme); std::shared_ptr<Theme> pTheme (mpTheme);
while (pTheme.get()!=NULL && pTheme->mpBackground.get()==NULL) while (pTheme.get()!=nullptr && pTheme->mpBackground.get()==nullptr)
pTheme = pTheme->mpParentTheme; pTheme = pTheme->mpParentTheme;
if (pTheme.get() != NULL) if (pTheme.get() != nullptr)
return pTheme->mpBackground; return pTheme->mpBackground;
else else
return SharedBitmapDescriptor(); return SharedBitmapDescriptor();
@ -416,18 +416,18 @@ SharedBitmapDescriptor PresenterTheme::GetBitmap (
else else
{ {
SharedPaneStyle pPaneStyle (mpTheme->GetPaneStyle(rsStyleName)); SharedPaneStyle pPaneStyle (mpTheme->GetPaneStyle(rsStyleName));
if (pPaneStyle.get() != NULL) if (pPaneStyle.get() != nullptr)
{ {
SharedBitmapDescriptor pBitmap (pPaneStyle->GetBitmap(rsBitmapName)); SharedBitmapDescriptor pBitmap (pPaneStyle->GetBitmap(rsBitmapName));
if (pBitmap.get() != NULL) if (pBitmap.get() != nullptr)
return pBitmap; return pBitmap;
} }
SharedViewStyle pViewStyle (mpTheme->GetViewStyle(rsStyleName)); SharedViewStyle pViewStyle (mpTheme->GetViewStyle(rsStyleName));
if (pViewStyle.get() != NULL) if (pViewStyle.get() != nullptr)
{ {
SharedBitmapDescriptor pBitmap (pViewStyle->GetBitmap(rsBitmapName)); SharedBitmapDescriptor pBitmap (pViewStyle->GetBitmap(rsBitmapName));
if (pBitmap.get() != NULL) if (pBitmap.get() != nullptr)
return pBitmap; return pBitmap;
} }
} }
@ -439,21 +439,21 @@ SharedBitmapDescriptor PresenterTheme::GetBitmap (
SharedBitmapDescriptor PresenterTheme::GetBitmap ( SharedBitmapDescriptor PresenterTheme::GetBitmap (
const OUString& rsBitmapName) const const OUString& rsBitmapName) const
{ {
if (mpTheme.get() != NULL) if (mpTheme.get() != nullptr)
{ {
if (rsBitmapName == "Background") if (rsBitmapName == "Background")
{ {
std::shared_ptr<Theme> pTheme (mpTheme); std::shared_ptr<Theme> pTheme (mpTheme);
while (pTheme.get()!=NULL && pTheme->mpBackground.get()==NULL) while (pTheme.get()!=nullptr && pTheme->mpBackground.get()==nullptr)
pTheme = pTheme->mpParentTheme; pTheme = pTheme->mpParentTheme;
if (pTheme.get() != NULL) if (pTheme.get() != nullptr)
return pTheme->mpBackground; return pTheme->mpBackground;
else else
return SharedBitmapDescriptor(); return SharedBitmapDescriptor();
} }
else else
{ {
if (mpTheme->mpIconContainer.get() != NULL) if (mpTheme->mpIconContainer.get() != nullptr)
return mpTheme->mpIconContainer->GetBitmap(rsBitmapName); return mpTheme->mpIconContainer->GetBitmap(rsBitmapName);
} }
} }
@ -463,7 +463,7 @@ SharedBitmapDescriptor PresenterTheme::GetBitmap (
std::shared_ptr<PresenterBitmapContainer> PresenterTheme::GetBitmapContainer() const std::shared_ptr<PresenterBitmapContainer> PresenterTheme::GetBitmapContainer() const
{ {
if (mpTheme.get() != NULL) if (mpTheme.get() != nullptr)
return mpTheme->mpIconContainer; return mpTheme->mpIconContainer;
else else
return std::shared_ptr<PresenterBitmapContainer>(); return std::shared_ptr<PresenterBitmapContainer>();
@ -472,18 +472,18 @@ std::shared_ptr<PresenterBitmapContainer> PresenterTheme::GetBitmapContainer() c
PresenterTheme::SharedFontDescriptor PresenterTheme::GetFont ( PresenterTheme::SharedFontDescriptor PresenterTheme::GetFont (
const OUString& rsStyleName) const const OUString& rsStyleName) const
{ {
if (mpTheme.get() != NULL) if (mpTheme.get() != nullptr)
{ {
SharedPaneStyle pPaneStyle (mpTheme->GetPaneStyle(rsStyleName)); SharedPaneStyle pPaneStyle (mpTheme->GetPaneStyle(rsStyleName));
if (pPaneStyle.get() != NULL) if (pPaneStyle.get() != nullptr)
return pPaneStyle->GetFont(); return pPaneStyle->GetFont();
SharedViewStyle pViewStyle (mpTheme->GetViewStyle(rsStyleName)); SharedViewStyle pViewStyle (mpTheme->GetViewStyle(rsStyleName));
if (pViewStyle.get() != NULL) if (pViewStyle.get() != nullptr)
return pViewStyle->GetFont(); return pViewStyle->GetFont();
std::shared_ptr<Theme> pTheme (mpTheme); std::shared_ptr<Theme> pTheme (mpTheme);
while (pTheme.get() != NULL) while (pTheme.get() != nullptr)
{ {
Theme::FontContainer::const_iterator iFont (pTheme->maFontContainer.find(rsStyleName)); Theme::FontContainer::const_iterator iFont (pTheme->maFontContainer.find(rsStyleName));
if (iFont != pTheme->maFontContainer.end()) if (iFont != pTheme->maFontContainer.end())
@ -508,7 +508,7 @@ PresenterTheme::FontDescriptor::FontDescriptor (
mnXOffset(0), mnXOffset(0),
mnYOffset(0) mnYOffset(0)
{ {
if (rpDescriptor.get() != NULL) if (rpDescriptor.get() != nullptr)
{ {
msFamilyName = rpDescriptor->msFamilyName; msFamilyName = rpDescriptor->msFamilyName;
msStyleName = rpDescriptor->msStyleName; msStyleName = rpDescriptor->msStyleName;
@ -644,7 +644,7 @@ void PresenterTheme::Theme::Read (
Reference<container::XNameAccess>( Reference<container::XNameAccess>(
PresenterConfigurationAccess::GetConfigurationNode(mxThemeRoot, "Bitmaps"), PresenterConfigurationAccess::GetConfigurationNode(mxThemeRoot, "Bitmaps"),
UNO_QUERY), UNO_QUERY),
mpParentTheme.get()!=NULL mpParentTheme.get()!=nullptr
? mpParentTheme->mpIconContainer ? mpParentTheme->mpIconContainer
: std::shared_ptr<PresenterBitmapContainer>(), : std::shared_ptr<PresenterBitmapContainer>(),
rReadContext.mxComponentContext, rReadContext.mxComponentContext,
@ -663,9 +663,9 @@ void PresenterTheme::Theme::Read (
SharedPaneStyle PresenterTheme::Theme::GetPaneStyle (const OUString& rsStyleName) const SharedPaneStyle PresenterTheme::Theme::GetPaneStyle (const OUString& rsStyleName) const
{ {
SharedPaneStyle pPaneStyle (maPaneStyles.GetPaneStyle(rsStyleName)); SharedPaneStyle pPaneStyle (maPaneStyles.GetPaneStyle(rsStyleName));
if (pPaneStyle.get() != NULL) if (pPaneStyle.get() != nullptr)
return pPaneStyle; return pPaneStyle;
else if (mpParentTheme.get() != NULL) else if (mpParentTheme.get() != nullptr)
return mpParentTheme->GetPaneStyle(rsStyleName); return mpParentTheme->GetPaneStyle(rsStyleName);
else else
return SharedPaneStyle(); return SharedPaneStyle();
@ -674,9 +674,9 @@ SharedPaneStyle PresenterTheme::Theme::GetPaneStyle (const OUString& rsStyleName
SharedViewStyle PresenterTheme::Theme::GetViewStyle (const OUString& rsStyleName) const SharedViewStyle PresenterTheme::Theme::GetViewStyle (const OUString& rsStyleName) const
{ {
SharedViewStyle pViewStyle (maViewStyles.GetViewStyle(rsStyleName)); SharedViewStyle pViewStyle (maViewStyles.GetViewStyle(rsStyleName));
if (pViewStyle.get() != NULL) if (pViewStyle.get() != nullptr)
return pViewStyle; return pViewStyle;
else if (mpParentTheme.get() != NULL) else if (mpParentTheme.get() != nullptr)
return mpParentTheme->GetViewStyle(rsStyleName); return mpParentTheme->GetViewStyle(rsStyleName);
else else
return SharedViewStyle(); return SharedViewStyle();
@ -819,7 +819,7 @@ std::shared_ptr<PresenterTheme::Theme> ReadContext::ReadTheme (
} }
} }
if (pTheme.get() != NULL) if (pTheme.get() != nullptr)
{ {
pTheme->Read(rConfiguration, *this); pTheme->Read(rConfiguration, *this);
} }
@ -907,7 +907,7 @@ void PaneStyleContainer::ProcessPaneStyle(
Reference<container::XNameAccess> xOuterBorderSizeNode (rValues[4], UNO_QUERY); Reference<container::XNameAccess> xOuterBorderSizeNode (rValues[4], UNO_QUERY);
pStyle->maOuterBorderSize = ReadContext::ReadBorderSize(xOuterBorderSizeNode); pStyle->maOuterBorderSize = ReadContext::ReadBorderSize(xOuterBorderSizeNode);
if (pStyle->mpParentStyle.get() != NULL) if (pStyle->mpParentStyle.get() != nullptr)
{ {
pStyle->maInnerBorderSize.Merge(pStyle->mpParentStyle->maInnerBorderSize); pStyle->maInnerBorderSize.Merge(pStyle->mpParentStyle->maInnerBorderSize);
pStyle->maOuterBorderSize.Merge(pStyle->mpParentStyle->maOuterBorderSize); pStyle->maOuterBorderSize.Merge(pStyle->mpParentStyle->maOuterBorderSize);
@ -918,7 +918,7 @@ void PaneStyleContainer::ProcessPaneStyle(
Reference<container::XNameAccess> xBitmapsNode (rValues[5], UNO_QUERY); Reference<container::XNameAccess> xBitmapsNode (rValues[5], UNO_QUERY);
pStyle->mpBitmaps.reset(new PresenterBitmapContainer( pStyle->mpBitmaps.reset(new PresenterBitmapContainer(
xBitmapsNode, xBitmapsNode,
pStyle->mpParentStyle.get()!=NULL pStyle->mpParentStyle.get()!=nullptr
? pStyle->mpParentStyle->mpBitmaps ? pStyle->mpParentStyle->mpBitmaps
: std::shared_ptr<PresenterBitmapContainer>(), : std::shared_ptr<PresenterBitmapContainer>(),
rReadContext.mxComponentContext, rReadContext.mxComponentContext,
@ -956,14 +956,14 @@ PaneStyle::~PaneStyle()
const SharedBitmapDescriptor PaneStyle::GetBitmap (const OUString& rsBitmapName) const const SharedBitmapDescriptor PaneStyle::GetBitmap (const OUString& rsBitmapName) const
{ {
if (mpBitmaps.get() != NULL) if (mpBitmaps.get() != nullptr)
{ {
const SharedBitmapDescriptor pBitmap = mpBitmaps->GetBitmap(rsBitmapName); const SharedBitmapDescriptor pBitmap = mpBitmaps->GetBitmap(rsBitmapName);
if (pBitmap.get() != NULL) if (pBitmap.get() != nullptr)
return pBitmap; return pBitmap;
} }
if (mpParentStyle.get() != NULL) if (mpParentStyle.get() != nullptr)
return mpParentStyle->GetBitmap(rsBitmapName); return mpParentStyle->GetBitmap(rsBitmapName);
else else
return SharedBitmapDescriptor(); return SharedBitmapDescriptor();
@ -971,9 +971,9 @@ const SharedBitmapDescriptor PaneStyle::GetBitmap (const OUString& rsBitmapName)
PresenterTheme::SharedFontDescriptor PaneStyle::GetFont() const PresenterTheme::SharedFontDescriptor PaneStyle::GetFont() const
{ {
if (mpFont.get() != NULL) if (mpFont.get() != nullptr)
return mpFont; return mpFont;
else if (mpParentStyle.get() != NULL) else if (mpParentStyle.get() != nullptr)
return mpParentStyle->GetFont(); return mpParentStyle->GetFont();
else else
return PresenterTheme::SharedFontDescriptor(); return PresenterTheme::SharedFontDescriptor();
@ -1031,7 +1031,7 @@ void ViewStyleContainer::ProcessViewStyle(
PresenterConfigurationAccess::GetProperty(rxProperties, "Font"), UNO_QUERY); PresenterConfigurationAccess::GetProperty(rxProperties, "Font"), UNO_QUERY);
PresenterTheme::SharedFontDescriptor pFont ( PresenterTheme::SharedFontDescriptor pFont (
ReadContext::ReadFont(xFontNode, sPathToFont, PresenterTheme::SharedFontDescriptor())); ReadContext::ReadFont(xFontNode, sPathToFont, PresenterTheme::SharedFontDescriptor()));
if (pFont.get() != NULL) if (pFont.get() != nullptr)
pStyle->mpFont = pFont; pStyle->mpFont = pFont;
Reference<container::XHierarchicalNameAccess> xBackgroundNode ( Reference<container::XHierarchicalNameAccess> xBackgroundNode (
@ -1043,7 +1043,7 @@ void ViewStyleContainer::ProcessViewStyle(
rReadContext.mxPresenterHelper, rReadContext.mxPresenterHelper,
rReadContext.mxCanvas, rReadContext.mxCanvas,
SharedBitmapDescriptor())); SharedBitmapDescriptor()));
if (pBackground.get() != NULL && pBackground->GetNormalBitmap().is()) if (pBackground.get() != nullptr && pBackground->GetNormalBitmap().is())
pStyle->mpBackground = pBackground; pStyle->mpBackground = pBackground;
mStyles.push_back(pStyle); mStyles.push_back(pStyle);
@ -1082,9 +1082,9 @@ const SharedBitmapDescriptor ViewStyle::GetBitmap (const OUString& rsBitmapName)
PresenterTheme::SharedFontDescriptor ViewStyle::GetFont() const PresenterTheme::SharedFontDescriptor ViewStyle::GetFont() const
{ {
if (mpFont.get() != NULL) if (mpFont.get() != nullptr)
return mpFont; return mpFont;
else if (mpParentStyle.get() != NULL) else if (mpParentStyle.get() != nullptr)
return mpParentStyle->GetFont(); return mpParentStyle->GetFont();
else else
return PresenterTheme::SharedFontDescriptor(); return PresenterTheme::SharedFontDescriptor();

View File

@ -149,7 +149,7 @@ sal_Int32 TimerScheduler::mnTaskId = PresenterTimer::NotAValidTaskId;
std::shared_ptr<TimerScheduler> TimerScheduler::Instance() std::shared_ptr<TimerScheduler> TimerScheduler::Instance()
{ {
::osl::MutexGuard aGuard (maInstanceMutex); ::osl::MutexGuard aGuard (maInstanceMutex);
if (mpInstance.get() == NULL) if (mpInstance.get() == nullptr)
{ {
mpInstance.reset(new TimerScheduler(), TimerScheduler::Deleter()); mpInstance.reset(new TimerScheduler(), TimerScheduler::Deleter());
mpInstance->create(); mpInstance->create();
@ -179,7 +179,7 @@ SharedTimerTask TimerScheduler::CreateTimerTask (
void TimerScheduler::ScheduleTask (const SharedTimerTask& rpTask) void TimerScheduler::ScheduleTask (const SharedTimerTask& rpTask)
{ {
if (rpTask.get() == NULL) if (rpTask.get() == nullptr)
return; return;
if (rpTask->mbIsCanceled) if (rpTask->mbIsCanceled)
return; return;
@ -214,7 +214,7 @@ void TimerScheduler::CancelTask (const sal_Int32 nTaskId)
// from being scheduled again and b) tries to prevent its execution. // from being scheduled again and b) tries to prevent its execution.
{ {
::osl::MutexGuard aGuard (maCurrentTaskMutex); ::osl::MutexGuard aGuard (maCurrentTaskMutex);
if (mpCurrentTask.get() != NULL if (mpCurrentTask.get() != nullptr
&& mpCurrentTask->mnTaskId == nTaskId) && mpCurrentTask->mnTaskId == nTaskId)
mpCurrentTask->mbIsCanceled = true; mpCurrentTask->mbIsCanceled = true;
} }
@ -264,7 +264,7 @@ void SAL_CALL TimerScheduler::run()
mpCurrentTask = pTask; mpCurrentTask = pTask;
} }
if (pTask.get() == NULL) if (pTask.get() == nullptr)
{ {
// Wait until the first task becomes due. // Wait until the first task becomes due.
TimeValue aTimeValue; TimeValue aTimeValue;
@ -403,7 +403,7 @@ PresenterClockTimer::~PresenterClockTimer()
Reference<lang::XComponent> xComponent (mxRequestCallback, UNO_QUERY); Reference<lang::XComponent> xComponent (mxRequestCallback, UNO_QUERY);
if (xComponent.is()) if (xComponent.is())
xComponent->dispose(); xComponent->dispose();
mxRequestCallback = NULL; mxRequestCallback = nullptr;
} }
void PresenterClockTimer::AddListener (const SharedListener& rListener) void PresenterClockTimer::AddListener (const SharedListener& rListener)
@ -440,7 +440,7 @@ void PresenterClockTimer::RemoveListener (const SharedListener& rListener)
PresenterTimer::CancelTask(mnTimerTaskId); PresenterTimer::CancelTask(mnTimerTaskId);
mnTimerTaskId = PresenterTimer::NotAValidTaskId; mnTimerTaskId = PresenterTimer::NotAValidTaskId;
} }
mpInstance = NULL; mpInstance = nullptr;
} }
} }

View File

@ -427,7 +427,7 @@ void SAL_CALL PresenterToolBar::disposing()
mxWindow->removePaintListener(this); mxWindow->removePaintListener(this);
mxWindow->removeMouseListener(this); mxWindow->removeMouseListener(this);
mxWindow->removeMouseMotionListener(this); mxWindow->removeMouseMotionListener(this);
mxWindow = NULL; mxWindow = nullptr;
} }
// Dispose tool bar elements. // Dispose tool bar elements.
@ -435,12 +435,12 @@ void SAL_CALL PresenterToolBar::disposing()
ElementContainer::const_iterator iEnd (maElementContainer.end()); ElementContainer::const_iterator iEnd (maElementContainer.end());
for ( ; iPart!=iEnd; ++iPart) for ( ; iPart!=iEnd; ++iPart)
{ {
OSL_ASSERT(iPart->get()!=NULL); OSL_ASSERT(iPart->get()!=nullptr);
ElementContainerPart::iterator iElement ((*iPart)->begin()); ElementContainerPart::iterator iElement ((*iPart)->begin());
ElementContainerPart::const_iterator iPartEnd ((*iPart)->end()); ElementContainerPart::const_iterator iPartEnd ((*iPart)->end());
for ( ; iElement!=iPartEnd; ++iElement) for ( ; iElement!=iPartEnd; ++iElement)
{ {
if (iElement->get() != NULL) if (iElement->get() != nullptr)
{ {
::rtl::Reference<Element> pElement (*iElement); ::rtl::Reference<Element> pElement (*iElement);
Reference<lang::XComponent> xComponent ( Reference<lang::XComponent> xComponent (
@ -502,7 +502,7 @@ void SAL_CALL PresenterToolBar::disposing (const lang::EventObject& rEventObject
throw (RuntimeException, std::exception) throw (RuntimeException, std::exception)
{ {
if (rEventObject.Source == mxWindow) if (rEventObject.Source == mxWindow)
mxWindow = NULL; mxWindow = nullptr;
} }
//----- XWindowListener ------------------------------------------------------- //----- XWindowListener -------------------------------------------------------
@ -710,7 +710,7 @@ void PresenterToolBar::ProcessEntry (
{ {
pElement->SetModes( pNormalMode, pMouseOverMode, pSelectedMode, pDisabledMode); pElement->SetModes( pNormalMode, pMouseOverMode, pSelectedMode, pDisabledMode);
pElement->UpdateState(); pElement->UpdateState();
if (mpCurrentContainerPart.get() != NULL) if (mpCurrentContainerPart.get() != nullptr)
mpCurrentContainerPart->push_back(pElement); mpCurrentContainerPart->push_back(pElement);
} }
} }
@ -850,7 +850,7 @@ geometry::RealSize2D PresenterToolBar::CalculatePartSize (
ElementContainerPart::const_iterator iElement; ElementContainerPart::const_iterator iElement;
for (iElement=rpPart->begin(); iElement!=rpPart->end(); ++iElement) for (iElement=rpPart->begin(); iElement!=rpPart->end(); ++iElement)
{ {
if (iElement->get() == NULL) if (iElement->get() == nullptr)
continue; continue;
const awt::Size aBSize ((*iElement)->GetBoundingSize(rxCanvas)); const awt::Size aBSize ((*iElement)->GetBoundingSize(rxCanvas));
@ -899,7 +899,7 @@ void PresenterToolBar::LayoutPart (
if(!AllSettings::GetLayoutRTL()){ if(!AllSettings::GetLayoutRTL()){
for (iElement=rpPart->begin(); iElement!=iEnd; ++iElement) for (iElement=rpPart->begin(); iElement!=iEnd; ++iElement)
{ {
if (iElement->get() == NULL) if (iElement->get() == nullptr)
continue; continue;
const awt::Size aElementSize ((*iElement)->GetBoundingSize(rxCanvas)); const awt::Size aElementSize ((*iElement)->GetBoundingSize(rxCanvas));
@ -932,7 +932,7 @@ void PresenterToolBar::LayoutPart (
else { else {
for (iElement=rpPart->end()-1; iElement!=iBegin-1; --iElement) for (iElement=rpPart->end()-1; iElement!=iBegin-1; --iElement)
{ {
if (iElement->get() == NULL) if (iElement->get() == nullptr)
continue; continue;
const awt::Size aElementSize ((*iElement)->GetBoundingSize(rxCanvas)); const awt::Size aElementSize ((*iElement)->GetBoundingSize(rxCanvas));
@ -993,7 +993,7 @@ void PresenterToolBar::Paint (
ElementContainerPart::const_iterator iPartEnd ((*iPart)->end()); ElementContainerPart::const_iterator iPartEnd ((*iPart)->end());
for (iElement=(*iPart)->begin(); iElement!=iPartEnd; ++iElement) for (iElement=(*iPart)->begin(); iElement!=iPartEnd; ++iElement)
{ {
if (iElement->get() != NULL) if (iElement->get() != nullptr)
{ {
if ( ! (*iElement)->IsOutside(rUpdateBox)) if ( ! (*iElement)->IsOutside(rUpdateBox))
(*iElement)->Paint(mxCanvas, rViewState); (*iElement)->Paint(mxCanvas, rViewState);
@ -1014,7 +1014,7 @@ void PresenterToolBar::UpdateSlideNumber()
ElementContainerPart::const_iterator iPartEnd ((*iPart)->end()); ElementContainerPart::const_iterator iPartEnd ((*iPart)->end());
for (iElement=(*iPart)->begin(); iElement!=iPartEnd; ++iElement) for (iElement=(*iPart)->begin(); iElement!=iPartEnd; ++iElement)
{ {
if (iElement->get() != NULL) if (iElement->get() != nullptr)
(*iElement)->CurrentSlideHasChanged(); (*iElement)->CurrentSlideHasChanged();
} }
} }
@ -1039,7 +1039,7 @@ void PresenterToolBar::CheckMouseOver (
ElementContainerPart::const_iterator iPartEnd ((*iPart)->end()); ElementContainerPart::const_iterator iPartEnd ((*iPart)->end());
for (iElement=(*iPart)->begin(); iElement!=iPartEnd; ++iElement) for (iElement=(*iPart)->begin(); iElement!=iPartEnd; ++iElement)
{ {
if (iElement->get() == NULL) if (iElement->get() == nullptr)
continue; continue;
awt::Rectangle aBox ((*iElement)->GetBoundingBox()); awt::Rectangle aBox ((*iElement)->GetBoundingBox());
@ -1112,7 +1112,7 @@ PresenterToolBarView::PresenterToolBarView (
} }
catch (RuntimeException&) catch (RuntimeException&)
{ {
mxViewId = NULL; mxViewId = nullptr;
throw; throw;
} }
} }
@ -1124,20 +1124,20 @@ PresenterToolBarView::~PresenterToolBarView()
void SAL_CALL PresenterToolBarView::disposing() void SAL_CALL PresenterToolBarView::disposing()
{ {
Reference<lang::XComponent> xComponent (static_cast<XWeak*>(mpToolBar.get()), UNO_QUERY); Reference<lang::XComponent> xComponent (static_cast<XWeak*>(mpToolBar.get()), UNO_QUERY);
mpToolBar = NULL; mpToolBar = nullptr;
if (xComponent.is()) if (xComponent.is())
xComponent->dispose(); xComponent->dispose();
if (mxWindow.is()) if (mxWindow.is())
{ {
mxWindow->removePaintListener(this); mxWindow->removePaintListener(this);
mxWindow = NULL; mxWindow = nullptr;
} }
mxCanvas = NULL; mxCanvas = nullptr;
mxViewId = NULL; mxViewId = nullptr;
mxPane = NULL; mxPane = nullptr;
mpPresenterController = NULL; mpPresenterController = nullptr;
mxSlideShowController = NULL; mxSlideShowController = nullptr;
} }
@ -1166,7 +1166,7 @@ void SAL_CALL PresenterToolBarView::disposing (const lang::EventObject& rEventOb
throw (RuntimeException, std::exception) throw (RuntimeException, std::exception)
{ {
if (rEventObject.Source == mxWindow) if (rEventObject.Source == mxWindow)
mxWindow = NULL; mxWindow = nullptr;
} }
//----- XResourceId ----------------------------------------------------------- //----- XResourceId -----------------------------------------------------------
@ -1196,7 +1196,7 @@ void SAL_CALL PresenterToolBarView::setCurrentPage (const Reference<drawing::XDr
Reference<drawing::XDrawPage> SAL_CALL PresenterToolBarView::getCurrentPage() Reference<drawing::XDrawPage> SAL_CALL PresenterToolBarView::getCurrentPage()
throw (RuntimeException, std::exception) throw (RuntimeException, std::exception)
{ {
return NULL; return nullptr;
} }
//===== PresenterToolBar::Element ============================================= //===== PresenterToolBar::Element =============================================
@ -1219,7 +1219,7 @@ Element::Element (
mbIsSelected(false), mbIsSelected(false),
mbIsEnabled(true) mbIsEnabled(true)
{ {
if (mpToolBar.get() != NULL) if (mpToolBar.get() != nullptr)
{ {
OSL_ASSERT(mpToolBar->GetPresenterController().is()); OSL_ASSERT(mpToolBar->GetPresenterController().is());
OSL_ASSERT(mpToolBar->GetPresenterController()->GetWindowManager().is()); OSL_ASSERT(mpToolBar->GetPresenterController()->GetWindowManager().is());
@ -1297,17 +1297,17 @@ bool Element::SetState (
if (bClicked && mbIsEnabled) if (bClicked && mbIsEnabled)
{ {
if (mpMode.get() != NULL) if (mpMode.get() != nullptr)
{ {
do do
{ {
if (mpMode->msAction.isEmpty()) if (mpMode->msAction.isEmpty())
break; break;
if (mpToolBar.get() == NULL) if (mpToolBar.get() == nullptr)
break; break;
if (mpToolBar->GetPresenterController().get() == NULL) if (mpToolBar->GetPresenterController().get() == nullptr)
break; break;
mpToolBar->GetPresenterController()->DispatchUnoCommand(mpMode->msAction); mpToolBar->GetPresenterController()->DispatchUnoCommand(mpMode->msAction);
@ -1353,10 +1353,10 @@ bool Element::IsFilling() const
void Element::UpdateState() void Element::UpdateState()
{ {
OSL_ASSERT(mpToolBar.get() != NULL); OSL_ASSERT(mpToolBar.get() != nullptr);
OSL_ASSERT(mpToolBar->GetPresenterController().get() != NULL); OSL_ASSERT(mpToolBar->GetPresenterController().get() != nullptr);
if (mpMode.get() == NULL) if (mpMode.get() == nullptr)
return; return;
util::URL aURL (mpToolBar->GetPresenterController()->CreateURLFromString(mpMode->msAction)); util::URL aURL (mpToolBar->GetPresenterController()->CreateURLFromString(mpMode->msAction));
@ -1429,7 +1429,7 @@ void ElementMode::ReadElementMode (
UNO_QUERY); UNO_QUERY);
Reference<beans::XPropertySet> xProperties ( Reference<beans::XPropertySet> xProperties (
PresenterConfigurationAccess::GetNodeProperties(xNode, OUString())); PresenterConfigurationAccess::GetNodeProperties(xNode, OUString()));
if ( ! xProperties.is() && rpDefaultMode.get()!=NULL) if ( ! xProperties.is() && rpDefaultMode.get()!=nullptr)
{ {
// The mode is not specified. Use the given, possibly empty, // The mode is not specified. Use the given, possibly empty,
// default mode instead. // default mode instead.
@ -1440,18 +1440,18 @@ void ElementMode::ReadElementMode (
// Read action. // Read action.
if ( ! (PresenterConfigurationAccess::GetProperty(xProperties, "Action") >>= msAction)) if ( ! (PresenterConfigurationAccess::GetProperty(xProperties, "Action") >>= msAction))
if (rpDefaultMode.get()!=NULL) if (rpDefaultMode.get()!=nullptr)
msAction = rpDefaultMode->msAction; msAction = rpDefaultMode->msAction;
// Read text and font // Read text and font
OUString sText (rpDefaultMode.get()!=NULL ? rpDefaultMode->maText.GetText() : OUString()); OUString sText (rpDefaultMode.get()!=nullptr ? rpDefaultMode->maText.GetText() : OUString());
PresenterConfigurationAccess::GetProperty(xProperties, "Text") >>= sText; PresenterConfigurationAccess::GetProperty(xProperties, "Text") >>= sText;
Reference<container::XHierarchicalNameAccess> xFontNode ( Reference<container::XHierarchicalNameAccess> xFontNode (
PresenterConfigurationAccess::GetProperty(xProperties, "Font"), UNO_QUERY); PresenterConfigurationAccess::GetProperty(xProperties, "Font"), UNO_QUERY);
PresenterTheme::SharedFontDescriptor pFont (PresenterTheme::ReadFont( PresenterTheme::SharedFontDescriptor pFont (PresenterTheme::ReadFont(
xFontNode, xFontNode,
"", "",
rpDefaultMode.get()!=NULL rpDefaultMode.get()!=nullptr
? rpDefaultMode->maText.GetFont() ? rpDefaultMode->maText.GetFont()
: PresenterTheme::SharedFontDescriptor())); : PresenterTheme::SharedFontDescriptor()));
maText = Text(sText,pFont); maText = Text(sText,pFont);
@ -1464,7 +1464,7 @@ void ElementMode::ReadElementMode (
"", "",
rContext.mxPresenterHelper, rContext.mxPresenterHelper,
rContext.mxCanvas, rContext.mxCanvas,
rpDefaultMode.get()!=NULL ? rpDefaultMode->mpIcon : SharedBitmapDescriptor()); rpDefaultMode.get()!=nullptr ? rpDefaultMode->mpIcon : SharedBitmapDescriptor());
} }
catch(Exception&) catch(Exception&)
{ {
@ -1491,7 +1491,7 @@ Button::Button (
: Element(rpToolBar), : Element(rpToolBar),
mbIsListenerRegistered(false) mbIsListenerRegistered(false)
{ {
OSL_ASSERT(mpToolBar.get() != NULL); OSL_ASSERT(mpToolBar.get() != nullptr);
OSL_ASSERT(mpToolBar->GetPresenterController().is()); OSL_ASSERT(mpToolBar->GetPresenterController().is());
OSL_ASSERT(mpToolBar->GetPresenterController()->GetWindowManager().is()); OSL_ASSERT(mpToolBar->GetPresenterController()->GetWindowManager().is());
} }
@ -1508,8 +1508,8 @@ void Button::Initialize()
void Button::disposing() void Button::disposing()
{ {
OSL_ASSERT(mpToolBar.get() != NULL); OSL_ASSERT(mpToolBar.get() != nullptr);
if (mpToolBar.get() != NULL if (mpToolBar.get() != nullptr
&& mbIsListenerRegistered) && mbIsListenerRegistered)
{ {
OSL_ASSERT(mpToolBar->GetPresenterController().is()); OSL_ASSERT(mpToolBar->GetPresenterController().is());
@ -1527,10 +1527,10 @@ void Button::Paint (
{ {
OSL_ASSERT(rxCanvas.is()); OSL_ASSERT(rxCanvas.is());
if (mpMode.get() == NULL) if (mpMode.get() == nullptr)
return; return;
if (mpMode->mpIcon.get() == NULL) if (mpMode->mpIcon.get() == nullptr)
return; return;
geometry::RealRectangle2D aTextBBox (mpMode->maText.GetBoundingBox(rxCanvas)); geometry::RealRectangle2D aTextBBox (mpMode->maText.GetBoundingBox(rxCanvas));
@ -1539,7 +1539,7 @@ void Button::Paint (
PaintIcon(rxCanvas, nTextHeight, rViewState); PaintIcon(rxCanvas, nTextHeight, rViewState);
awt::Point aOffset(0,0); awt::Point aOffset(0,0);
if ( ! IsEnabled()) if ( ! IsEnabled())
if (mpMode->mpIcon.get() != NULL) if (mpMode->mpIcon.get() != nullptr)
{ {
Reference<rendering::XBitmap> xBitmap (mpMode->mpIcon->GetNormalBitmap()); Reference<rendering::XBitmap> xBitmap (mpMode->mpIcon->GetNormalBitmap());
if (xBitmap.is()) if (xBitmap.is())
@ -1551,7 +1551,7 @@ void Button::Paint (
awt::Size Button::CreateBoundingSize ( awt::Size Button::CreateBoundingSize (
const Reference<rendering::XCanvas>& rxCanvas) const Reference<rendering::XCanvas>& rxCanvas)
{ {
if (mpMode.get() == NULL) if (mpMode.get() == nullptr)
return awt::Size(); return awt::Size();
geometry::RealRectangle2D aTextBBox (mpMode->maText.GetBoundingBox(rxCanvas)); geometry::RealRectangle2D aTextBBox (mpMode->maText.GetBoundingBox(rxCanvas));
@ -1559,7 +1559,7 @@ awt::Size Button::CreateBoundingSize (
sal_Int32 nTextHeight (sal::static_int_cast<sal_Int32>(0.5 + aTextBBox.Y2 - aTextBBox.Y1)); sal_Int32 nTextHeight (sal::static_int_cast<sal_Int32>(0.5 + aTextBBox.Y2 - aTextBBox.Y1));
sal_Int32 nTextWidth (sal::static_int_cast<sal_Int32>(0.5 + aTextBBox.X2 - aTextBBox.X1)); sal_Int32 nTextWidth (sal::static_int_cast<sal_Int32>(0.5 + aTextBBox.X2 - aTextBBox.X1));
Reference<rendering::XBitmap> xBitmap; Reference<rendering::XBitmap> xBitmap;
if (mpMode->mpIcon.get() != NULL) if (mpMode->mpIcon.get() != nullptr)
xBitmap = mpMode->mpIcon->GetNormalBitmap(); xBitmap = mpMode->mpIcon->GetNormalBitmap();
if (xBitmap.is()) if (xBitmap.is())
{ {
@ -1577,7 +1577,7 @@ void Button::PaintIcon (
const sal_Int32 nTextHeight, const sal_Int32 nTextHeight,
const rendering::ViewState& rViewState) const rendering::ViewState& rViewState)
{ {
if (mpMode.get() == NULL) if (mpMode.get() == nullptr)
return; return;
Reference<rendering::XBitmap> xBitmap (mpMode->mpIcon->GetBitmap(GetMode())); Reference<rendering::XBitmap> xBitmap (mpMode->mpIcon->GetBitmap(GetMode()));
@ -1591,7 +1591,7 @@ void Button::PaintIcon (
+ (maSize.Height - nTextHeight - xBitmap->getSize().Height) / 2); + (maSize.Height - nTextHeight - xBitmap->getSize().Height) / 2);
const rendering::RenderState aRenderState( const rendering::RenderState aRenderState(
geometry::AffineMatrix2D(1,0,nX, 0,1,nY), geometry::AffineMatrix2D(1,0,nX, 0,1,nY),
NULL, nullptr,
Sequence<double>(4), Sequence<double>(4),
rendering::CompositeOperation::OVER); rendering::CompositeOperation::OVER);
rxCanvas->drawBitmap(xBitmap, rViewState, aRenderState); rxCanvas->drawBitmap(xBitmap, rViewState, aRenderState);
@ -1603,7 +1603,7 @@ void Button::PaintIcon (
+ (maSize.Height - nTextHeight - xBitmap->getSize().Height) / 2); + (maSize.Height - nTextHeight - xBitmap->getSize().Height) / 2);
const rendering::RenderState aRenderState( const rendering::RenderState aRenderState(
geometry::AffineMatrix2D(-1,0,nX, 0,1,nY), geometry::AffineMatrix2D(-1,0,nX, 0,1,nY),
NULL, nullptr,
Sequence<double>(4), Sequence<double>(4),
rendering::CompositeOperation::OVER); rendering::CompositeOperation::OVER);
rxCanvas->drawBitmap(xBitmap, rViewState, aRenderState); rxCanvas->drawBitmap(xBitmap, rViewState, aRenderState);
@ -1647,7 +1647,7 @@ Label::Label (const ::rtl::Reference<PresenterToolBar>& rpToolBar)
awt::Size Label::CreateBoundingSize ( awt::Size Label::CreateBoundingSize (
const Reference<rendering::XCanvas>& rxCanvas) const Reference<rendering::XCanvas>& rxCanvas)
{ {
if (mpMode.get() == NULL) if (mpMode.get() == nullptr)
return awt::Size(0,0); return awt::Size(0,0);
geometry::RealRectangle2D aTextBBox (mpMode->maText.GetBoundingBox(rxCanvas)); geometry::RealRectangle2D aTextBBox (mpMode->maText.GetBoundingBox(rxCanvas));
@ -1658,8 +1658,8 @@ awt::Size Label::CreateBoundingSize (
void Label::SetText (const OUString& rsText) void Label::SetText (const OUString& rsText)
{ {
OSL_ASSERT(mpToolBar.get() != NULL); OSL_ASSERT(mpToolBar.get() != nullptr);
if (mpMode.get() == NULL) if (mpMode.get() == nullptr)
return; return;
const bool bRequestLayout (mpMode->maText.GetText().getLength() != rsText.getLength()); const bool bRequestLayout (mpMode->maText.GetText().getLength() != rsText.getLength());
@ -1679,7 +1679,7 @@ void Label::Paint (
const rendering::ViewState& rViewState) const rendering::ViewState& rViewState)
{ {
OSL_ASSERT(rxCanvas.is()); OSL_ASSERT(rxCanvas.is());
if (mpMode.get() == NULL) if (mpMode.get() == nullptr)
return; return;
mpMode->maText.Paint(rxCanvas, rViewState, GetBoundingBox(), awt::Point(0,0)); mpMode->maText.Paint(rxCanvas, rViewState, GetBoundingBox(), awt::Point(0,0));
@ -1739,7 +1739,7 @@ void Text::Paint (
if (msText.isEmpty()) if (msText.isEmpty())
return; return;
if (mpFont.get() == NULL) if (mpFont.get() == nullptr)
return; return;
if ( ! mpFont->mxFont.is()) if ( ! mpFont->mxFont.is())
@ -1761,7 +1761,7 @@ void Text::Paint (
rendering::RenderState aRenderState( rendering::RenderState aRenderState(
geometry::AffineMatrix2D(1,0,nX, 0,1,nY), geometry::AffineMatrix2D(1,0,nX, 0,1,nY),
NULL, nullptr,
Sequence<double>(4), Sequence<double>(4),
rendering::CompositeOperation::SOURCE); rendering::CompositeOperation::SOURCE);
PresenterCanvasHelper::SetDeviceColor(aRenderState, mpFont->mnColor); PresenterCanvasHelper::SetDeviceColor(aRenderState, mpFont->mnColor);
@ -1773,7 +1773,7 @@ void Text::Paint (
geometry::RealRectangle2D Text::GetBoundingBox (const Reference<rendering::XCanvas>& rxCanvas) geometry::RealRectangle2D Text::GetBoundingBox (const Reference<rendering::XCanvas>& rxCanvas)
{ {
if (mpFont.get() != NULL && !msText.isEmpty()) if (mpFont.get() != nullptr && !msText.isEmpty())
{ {
if ( ! mpFont->mxFont.is()) if ( ! mpFont->mxFont.is())
mpFont->PrepareFont(rxCanvas); mpFont->PrepareFont(rxCanvas);
@ -1910,7 +1910,7 @@ void CurrentTimeLabel::SetModes (
PresentationTimeLabel::~PresentationTimeLabel() PresentationTimeLabel::~PresentationTimeLabel()
{ {
mpToolBar->GetPresenterController()->SetPresentationTime(0); mpToolBar->GetPresenterController()->SetPresentationTime(nullptr);
} }
PresentationTimeLabel::PresentationTimeLabel ( PresentationTimeLabel::PresentationTimeLabel (
@ -1991,13 +1991,13 @@ void VerticalSeparator::Paint (
rendering::RenderState aRenderState( rendering::RenderState aRenderState(
geometry::AffineMatrix2D(1,0,0, 0,1,0), geometry::AffineMatrix2D(1,0,0, 0,1,0),
NULL, nullptr,
Sequence<double>(4), Sequence<double>(4),
rendering::CompositeOperation::OVER); rendering::CompositeOperation::OVER);
if (mpMode.get() != NULL) if (mpMode.get() != nullptr)
{ {
PresenterTheme::SharedFontDescriptor pFont (mpMode->maText.GetFont()); PresenterTheme::SharedFontDescriptor pFont (mpMode->maText.GetFont());
if (pFont.get() != NULL) if (pFont.get() != nullptr)
PresenterCanvasHelper::SetDeviceColor(aRenderState, pFont->mnColor); PresenterCanvasHelper::SetDeviceColor(aRenderState, pFont->mnColor);
} }
@ -2042,13 +2042,13 @@ void HorizontalSeparator::Paint (
rendering::RenderState aRenderState( rendering::RenderState aRenderState(
geometry::AffineMatrix2D(1,0,0, 0,1,0), geometry::AffineMatrix2D(1,0,0, 0,1,0),
NULL, nullptr,
Sequence<double>(4), Sequence<double>(4),
rendering::CompositeOperation::OVER); rendering::CompositeOperation::OVER);
if (mpMode.get() != NULL) if (mpMode.get() != nullptr)
{ {
PresenterTheme::SharedFontDescriptor pFont (mpMode->maText.GetFont()); PresenterTheme::SharedFontDescriptor pFont (mpMode->maText.GetFont());
if (pFont.get() != NULL) if (pFont.get() != nullptr)
PresenterCanvasHelper::SetDeviceColor(aRenderState, pFont->mnColor); PresenterCanvasHelper::SetDeviceColor(aRenderState, pFont->mnColor);
} }

View File

@ -58,11 +58,11 @@ void PresenterUIPainter::PaintHorizontalBitmapComposite (
// Prepare painting. // Prepare painting.
rendering::ViewState aViewState ( rendering::ViewState aViewState (
geometry::AffineMatrix2D(1,0,0, 0,1,0), geometry::AffineMatrix2D(1,0,0, 0,1,0),
NULL); nullptr);
rendering::RenderState aRenderState ( rendering::RenderState aRenderState (
geometry::AffineMatrix2D(1,0,0, 0,1,0), geometry::AffineMatrix2D(1,0,0, 0,1,0),
NULL, nullptr,
Sequence<double>(4), Sequence<double>(4),
rendering::CompositeOperation::SOURCE); rendering::CompositeOperation::SOURCE);
@ -160,11 +160,11 @@ void PresenterUIPainter::PaintVerticalBitmapComposite (
// Prepare painting. // Prepare painting.
rendering::ViewState aViewState ( rendering::ViewState aViewState (
geometry::AffineMatrix2D(1,0,0, 0,1,0), geometry::AffineMatrix2D(1,0,0, 0,1,0),
NULL); nullptr);
rendering::RenderState aRenderState ( rendering::RenderState aRenderState (
geometry::AffineMatrix2D(1,0,0, 0,1,0), geometry::AffineMatrix2D(1,0,0, 0,1,0),
NULL, nullptr,
Sequence<double>(4), Sequence<double>(4),
rendering::CompositeOperation::SOURCE); rendering::CompositeOperation::SOURCE);

View File

@ -169,7 +169,7 @@ void PresenterViewFactory::Register (const Reference<frame::XController>& rxCont
OSL_ASSERT(false); OSL_ASSERT(false);
if (mxConfigurationController.is()) if (mxConfigurationController.is())
mxConfigurationController->removeResourceFactoryForReference(this); mxConfigurationController->removeResourceFactoryForReference(this);
mxConfigurationController = NULL; mxConfigurationController = nullptr;
throw; throw;
} }
@ -184,9 +184,9 @@ void SAL_CALL PresenterViewFactory::disposing()
{ {
if (mxConfigurationController.is()) if (mxConfigurationController.is())
mxConfigurationController->removeResourceFactoryForReference(this); mxConfigurationController->removeResourceFactoryForReference(this);
mxConfigurationController = NULL; mxConfigurationController = nullptr;
if (mpResourceCache.get() != NULL) if (mpResourceCache.get() != nullptr)
{ {
// Dispose all views in the cache. // Dispose all views in the cache.
ResourceContainer::const_iterator iView (mpResourceCache->begin()); ResourceContainer::const_iterator iView (mpResourceCache->begin());
@ -223,13 +223,13 @@ Reference<XResource> SAL_CALL PresenterViewFactory::createResource (
mxConfigurationController->getResource(rxViewId->getAnchor()), mxConfigurationController->getResource(rxViewId->getAnchor()),
UNO_QUERY_THROW); UNO_QUERY_THROW);
xView = GetViewFromCache(rxViewId, xAnchorPane); xView = GetViewFromCache(rxViewId, xAnchorPane);
if (xView == NULL) if (xView == nullptr)
xView = CreateView(rxViewId, xAnchorPane); xView = CreateView(rxViewId, xAnchorPane);
// Activate the view. // Activate the view.
PresenterPaneContainer::SharedPaneDescriptor pDescriptor ( PresenterPaneContainer::SharedPaneDescriptor pDescriptor (
mpPresenterController->GetPaneContainer()->FindPaneId(rxViewId->getAnchor())); mpPresenterController->GetPaneContainer()->FindPaneId(rxViewId->getAnchor()));
if (pDescriptor.get() != NULL) if (pDescriptor.get() != nullptr)
pDescriptor->SetActivationState(true); pDescriptor->SetActivationState(true);
} }
@ -248,16 +248,16 @@ void SAL_CALL PresenterViewFactory::releaseResource (const Reference<XResource>&
PresenterPaneContainer::SharedPaneDescriptor pDescriptor ( PresenterPaneContainer::SharedPaneDescriptor pDescriptor (
mpPresenterController->GetPaneContainer()->FindPaneId( mpPresenterController->GetPaneContainer()->FindPaneId(
rxView->getResourceId()->getAnchor())); rxView->getResourceId()->getAnchor()));
if (pDescriptor.get() != NULL) if (pDescriptor.get() != nullptr)
pDescriptor->SetActivationState(false); pDescriptor->SetActivationState(false);
// Dispose only views that we can not put into the cache. // Dispose only views that we can not put into the cache.
CachablePresenterView* pView = dynamic_cast<CachablePresenterView*>(rxView.get()); CachablePresenterView* pView = dynamic_cast<CachablePresenterView*>(rxView.get());
if (pView == NULL || mpResourceCache.get()==NULL) if (pView == nullptr || mpResourceCache.get()==nullptr)
{ {
try try
{ {
if (pView != NULL) if (pView != nullptr)
pView->ReleaseView(); pView->ReleaseView();
Reference<lang::XComponent> xComponent (rxView, UNO_QUERY); Reference<lang::XComponent> xComponent (rxView, UNO_QUERY);
if (xComponent.is()) if (xComponent.is())
@ -292,8 +292,8 @@ Reference<XResource> PresenterViewFactory::GetViewFromCache(
const Reference<XResourceId>& rxViewId, const Reference<XResourceId>& rxViewId,
const Reference<XPane>& rxAnchorPane) const const Reference<XPane>& rxAnchorPane) const
{ {
if (mpResourceCache.get() == NULL) if (mpResourceCache.get() == nullptr)
return NULL; return nullptr;
try try
{ {
@ -310,7 +310,7 @@ Reference<XResource> PresenterViewFactory::GetViewFromCache(
{ {
CachablePresenterView* pView CachablePresenterView* pView
= dynamic_cast<CachablePresenterView*>(iView->second.first.get()); = dynamic_cast<CachablePresenterView*>(iView->second.first.get());
if (pView != NULL) if (pView != nullptr)
pView->ActivatePresenterView(); pView->ActivatePresenterView();
return Reference<XResource>(iView->second.first, UNO_QUERY); return Reference<XResource>(iView->second.first, UNO_QUERY);
} }
@ -321,7 +321,7 @@ Reference<XResource> PresenterViewFactory::GetViewFromCache(
catch (RuntimeException&) catch (RuntimeException&)
{ {
} }
return NULL; return nullptr;
} }
Reference<XResource> PresenterViewFactory::CreateView( Reference<XResource> PresenterViewFactory::CreateView(
@ -361,12 +361,12 @@ Reference<XResource> PresenterViewFactory::CreateView(
// Activate it. // Activate it.
CachablePresenterView* pView = dynamic_cast<CachablePresenterView*>(xView.get()); CachablePresenterView* pView = dynamic_cast<CachablePresenterView*>(xView.get());
if (pView != NULL) if (pView != nullptr)
pView->ActivatePresenterView(); pView->ActivatePresenterView();
} }
catch (RuntimeException&) catch (RuntimeException&)
{ {
xView = NULL; xView = nullptr;
} }
return xView; return xView;
@ -395,7 +395,7 @@ Reference<XView> PresenterViewFactory::CreateSlideShowView(
} }
catch (RuntimeException&) catch (RuntimeException&)
{ {
xView = NULL; xView = nullptr;
} }
return xView; return xView;
@ -424,7 +424,7 @@ Reference<XView> PresenterViewFactory::CreateSlidePreviewView(
} }
catch (RuntimeException&) catch (RuntimeException&)
{ {
xView = NULL; xView = nullptr;
} }
return xView; return xView;
@ -464,7 +464,7 @@ Reference<XView> PresenterViewFactory::CreateNotesView(
} }
catch (RuntimeException&) catch (RuntimeException&)
{ {
xView = NULL; xView = nullptr;
} }
return xView; return xView;
@ -490,14 +490,14 @@ Reference<XView> PresenterViewFactory::CreateSlideSorterView(
mpPresenterController)); mpPresenterController));
PresenterPaneContainer::SharedPaneDescriptor pDescriptor ( PresenterPaneContainer::SharedPaneDescriptor pDescriptor (
mpPresenterController->GetPaneContainer()->FindPaneId(rxViewId->getAnchor())); mpPresenterController->GetPaneContainer()->FindPaneId(rxViewId->getAnchor()));
if (pDescriptor.get() != NULL) if (pDescriptor.get() != nullptr)
pDescriptor->maActivator = ::boost::bind( pDescriptor->maActivator = ::boost::bind(
&PresenterSlideSorter::SetActiveState, _1); &PresenterSlideSorter::SetActiveState, _1);
xView = pView.get(); xView = pView.get();
} }
catch (RuntimeException&) catch (RuntimeException&)
{ {
xView = NULL; xView = nullptr;
} }
return xView; return xView;

View File

@ -97,12 +97,12 @@ void SAL_CALL PresenterWindowManager::disposing()
{ {
NotifyDisposing(); NotifyDisposing();
SetParentPane(NULL); SetParentPane(nullptr);
Reference<lang::XComponent> xComponent (mxPaneBorderManager, UNO_QUERY); Reference<lang::XComponent> xComponent (mxPaneBorderManager, UNO_QUERY);
if (xComponent.is()) if (xComponent.is())
xComponent->dispose(); xComponent->dispose();
mxPaneBorderManager = NULL; mxPaneBorderManager = nullptr;
PresenterPaneContainer::PaneList::const_iterator iPane; PresenterPaneContainer::PaneList::const_iterator iPane;
PresenterPaneContainer::PaneList::const_iterator iEnd (mpPaneContainer->maPanes.end()); PresenterPaneContainer::PaneList::const_iterator iEnd (mpPaneContainer->maPanes.end());
@ -129,8 +129,8 @@ void PresenterWindowManager::SetParentPane (
mxParentWindow->removeMouseListener(this); mxParentWindow->removeMouseListener(this);
mxParentWindow->removeFocusListener(this); mxParentWindow->removeFocusListener(this);
} }
mxParentWindow = NULL; mxParentWindow = nullptr;
mxParentCanvas = NULL; mxParentCanvas = nullptr;
if (rxPane.is()) if (rxPane.is())
{ {
@ -139,7 +139,7 @@ void PresenterWindowManager::SetParentPane (
} }
else else
{ {
mxParentWindow = NULL; mxParentWindow = nullptr;
} }
if (mxParentWindow.is()) if (mxParentWindow.is())
@ -162,7 +162,7 @@ void PresenterWindowManager::SetTheme (const std::shared_ptr<PresenterTheme>& rp
// Get background bitmap or background color from the theme. // Get background bitmap or background color from the theme.
if (mpTheme.get() != NULL) if (mpTheme.get() != nullptr)
{ {
mpBackgroundBitmap = mpTheme->GetBitmap(OUString(), "Background"); mpBackgroundBitmap = mpTheme->GetBitmap(OUString(), "Background");
} }
@ -172,8 +172,8 @@ void PresenterWindowManager::NotifyViewCreation (const Reference<XView>& rxView)
{ {
PresenterPaneContainer::SharedPaneDescriptor pDescriptor ( PresenterPaneContainer::SharedPaneDescriptor pDescriptor (
mpPaneContainer->FindPaneId(rxView->getResourceId()->getAnchor())); mpPaneContainer->FindPaneId(rxView->getResourceId()->getAnchor()));
OSL_ASSERT(pDescriptor.get() != NULL); OSL_ASSERT(pDescriptor.get() != nullptr);
if (pDescriptor.get() != NULL) if (pDescriptor.get() != nullptr)
{ {
Layout(); Layout();
@ -193,7 +193,7 @@ void PresenterWindowManager::SetPanePosSizeAbsolute (
{ {
PresenterPaneContainer::SharedPaneDescriptor pDescriptor ( PresenterPaneContainer::SharedPaneDescriptor pDescriptor (
mpPaneContainer->FindPaneURL(rsPaneURL)); mpPaneContainer->FindPaneURL(rsPaneURL));
if (pDescriptor.get() != NULL) if (pDescriptor.get() != nullptr)
{ {
awt::Rectangle aParentBox = mxParentWindow->getPosSize(); awt::Rectangle aParentBox = mxParentWindow->getPosSize();
if (aParentBox.Width > 0 && aParentBox.Height > 0) if (aParentBox.Width > 0 && aParentBox.Height > 0)
@ -280,7 +280,7 @@ void SAL_CALL PresenterWindowManager::windowPaint (const awt::PaintEvent& rEvent
if ( ! mxParentCanvas.is()) if ( ! mxParentCanvas.is())
return; return;
if (mpTheme.get()!=NULL) if (mpTheme.get()!=nullptr)
{ {
try try
{ {
@ -362,7 +362,7 @@ void SAL_CALL PresenterWindowManager::disposing (const lang::EventObject& rEvent
throw (RuntimeException, std::exception) throw (RuntimeException, std::exception)
{ {
if (rEvent.Source == mxParentWindow) if (rEvent.Source == mxParentWindow)
mxParentWindow = NULL; mxParentWindow = nullptr;
else else
{ {
Reference<awt::XWindow> xWindow (rEvent.Source, UNO_QUERY); Reference<awt::XWindow> xWindow (rEvent.Source, UNO_QUERY);
@ -429,7 +429,7 @@ bool PresenterWindowManager::PaintChildren (const awt::PaintEvent& rEvent) const
void PresenterWindowManager::SetLayoutMode (const LayoutMode eMode) void PresenterWindowManager::SetLayoutMode (const LayoutMode eMode)
{ {
OSL_ASSERT(mpPresenterController.get() != NULL); OSL_ASSERT(mpPresenterController.get() != nullptr);
if (meLayoutMode != eMode if (meLayoutMode != eMode
|| mbIsSlideSorterActive || mbIsSlideSorterActive
@ -613,8 +613,8 @@ void PresenterWindowManager::Layout()
{ {
mbIsLayoutPending = false; mbIsLayoutPending = false;
mbIsLayouting = true; mbIsLayouting = true;
mxScaledBackgroundBitmap = NULL; mxScaledBackgroundBitmap = nullptr;
mxClipPolygon = NULL; mxClipPolygon = nullptr;
try try
{ {
@ -660,7 +660,7 @@ void PresenterWindowManager::LayoutStandardMode()
// go over the inner pane size. // go over the inner pane size.
PresenterPaneContainer::SharedPaneDescriptor pPane ( PresenterPaneContainer::SharedPaneDescriptor pPane (
mpPaneContainer->FindPaneURL(PresenterPaneFactory::msCurrentSlidePreviewPaneURL)); mpPaneContainer->FindPaneURL(PresenterPaneFactory::msCurrentSlidePreviewPaneURL));
if (pPane.get() != NULL) if (pPane.get() != nullptr)
{ {
const awt::Size aCurrentSlideOuterBox(CalculatePaneSize( const awt::Size aCurrentSlideOuterBox(CalculatePaneSize(
nHorizontalSlideDivide - 1.5*nGap, nHorizontalSlideDivide - 1.5*nGap,
@ -682,7 +682,7 @@ void PresenterWindowManager::LayoutStandardMode()
// width. This takes into acount the slide aspect ratio and thus has to // width. This takes into acount the slide aspect ratio and thus has to
// go over the inner pane size. // go over the inner pane size.
pPane = mpPaneContainer->FindPaneURL(PresenterPaneFactory::msNextSlidePreviewPaneURL); pPane = mpPaneContainer->FindPaneURL(PresenterPaneFactory::msNextSlidePreviewPaneURL);
if (pPane.get() != NULL) if (pPane.get() != nullptr)
{ {
const awt::Size aNextSlideOuterBox (CalculatePaneSize( const awt::Size aNextSlideOuterBox (CalculatePaneSize(
aBox.Width - nHorizontalSlideDivide - 1.5*nGap, aBox.Width - nHorizontalSlideDivide - 1.5*nGap,
@ -721,7 +721,7 @@ void PresenterWindowManager::LayoutNotesMode()
// The notes view has no fixed aspect ratio. // The notes view has no fixed aspect ratio.
PresenterPaneContainer::SharedPaneDescriptor pPane ( PresenterPaneContainer::SharedPaneDescriptor pPane (
mpPaneContainer->FindPaneURL(PresenterPaneFactory::msNotesPaneURL)); mpPaneContainer->FindPaneURL(PresenterPaneFactory::msNotesPaneURL));
if (pPane.get() != NULL) if (pPane.get() != nullptr)
{ {
const geometry::RealSize2D aNotesViewOuterSize( const geometry::RealSize2D aNotesViewOuterSize(
nPrimaryWidth - 1.5*nGap + 0.5, nPrimaryWidth - 1.5*nGap + 0.5,
@ -745,7 +745,7 @@ void PresenterWindowManager::LayoutNotesMode()
// width. This takes into acount the slide aspect ratio and thus has to // width. This takes into acount the slide aspect ratio and thus has to
// go over the inner pane size. // go over the inner pane size.
pPane = mpPaneContainer->FindPaneURL(PresenterPaneFactory::msCurrentSlidePreviewPaneURL); pPane = mpPaneContainer->FindPaneURL(PresenterPaneFactory::msCurrentSlidePreviewPaneURL);
if (pPane.get() != NULL) if (pPane.get() != nullptr)
{ {
const awt::Size aCurrentSlideOuterBox(CalculatePaneSize( const awt::Size aCurrentSlideOuterBox(CalculatePaneSize(
nSecondaryWidth - 1.5*nGap, nSecondaryWidth - 1.5*nGap,
@ -766,7 +766,7 @@ void PresenterWindowManager::LayoutNotesMode()
// width. This takes into acount the slide aspect ratio and thus has to // width. This takes into acount the slide aspect ratio and thus has to
// go over the inner pane size. // go over the inner pane size.
pPane = mpPaneContainer->FindPaneURL(PresenterPaneFactory::msNextSlidePreviewPaneURL); pPane = mpPaneContainer->FindPaneURL(PresenterPaneFactory::msNextSlidePreviewPaneURL);
if (pPane.get() != NULL) if (pPane.get() != nullptr)
{ {
const awt::Size aNextSlideOuterBox (CalculatePaneSize( const awt::Size aNextSlideOuterBox (CalculatePaneSize(
nTertiaryWidth, nTertiaryWidth,
@ -825,11 +825,11 @@ geometry::RealRectangle2D PresenterWindowManager::LayoutToolBar()
// Get access to the tool bar. // Get access to the tool bar.
PresenterPaneContainer::SharedPaneDescriptor pDescriptor( PresenterPaneContainer::SharedPaneDescriptor pDescriptor(
mpPaneContainer->FindPaneURL(PresenterPaneFactory::msToolBarPaneURL)); mpPaneContainer->FindPaneURL(PresenterPaneFactory::msToolBarPaneURL));
if (pDescriptor.get() != NULL) if (pDescriptor.get() != nullptr)
{ {
PresenterToolBarView* pToolBarView PresenterToolBarView* pToolBarView
= dynamic_cast<PresenterToolBarView*>(pDescriptor->mxView.get()); = dynamic_cast<PresenterToolBarView*>(pDescriptor->mxView.get());
if (pToolBarView != NULL && pToolBarView->GetPresenterToolBar().is()) if (pToolBarView != nullptr && pToolBarView->GetPresenterToolBar().is())
{ {
geometry::RealSize2D aSize (pToolBarView->GetPresenterToolBar()->GetMinimalSize()); geometry::RealSize2D aSize (pToolBarView->GetPresenterToolBar()->GetMinimalSize());
@ -955,9 +955,9 @@ void PresenterWindowManager::UpdateWindowSize (const Reference<awt::XWindow>& rx
{ {
PresenterPaneContainer::SharedPaneDescriptor pDescriptor ( PresenterPaneContainer::SharedPaneDescriptor pDescriptor (
mpPaneContainer->FindBorderWindow(rxBorderWindow)); mpPaneContainer->FindBorderWindow(rxBorderWindow));
if (pDescriptor.get() != NULL) if (pDescriptor.get() != nullptr)
{ {
mxClipPolygon = NULL; mxClipPolygon = nullptr;
awt::Rectangle aParentBox = mxParentWindow->getPosSize(); awt::Rectangle aParentBox = mxParentWindow->getPosSize();
awt::Rectangle aBorderBox (pDescriptor->mxBorderWindow->getPosSize()); awt::Rectangle aBorderBox (pDescriptor->mxBorderWindow->getPosSize());
@ -1011,7 +1011,7 @@ void PresenterWindowManager::PaintBackground (const awt::Rectangle& rUpdateBox)
rendering::CompositeOperation::SOURCE); rendering::CompositeOperation::SOURCE);
// Paint the background. // Paint the background.
if (mpBackgroundBitmap.get() != NULL) if (mpBackgroundBitmap.get() != nullptr)
{ {
ProvideBackgroundBitmap(); ProvideBackgroundBitmap();
@ -1026,8 +1026,8 @@ void PresenterWindowManager::PaintBackground (const awt::Rectangle& rUpdateBox)
1, 1,
0, 0,
mxScaledBackgroundBitmap, mxScaledBackgroundBitmap,
NULL, nullptr,
NULL, nullptr,
rendering::StrokeAttributes(), rendering::StrokeAttributes(),
rendering::TexturingMode::REPEAT, rendering::TexturingMode::REPEAT,
rendering::TexturingMode::REPEAT); rendering::TexturingMode::REPEAT);
@ -1180,7 +1180,7 @@ void PresenterWindowManager::Invalidate()
} }
void PresenterWindowManager::Update() void PresenterWindowManager::Update()
{ {
mxClipPolygon = NULL; mxClipPolygon = nullptr;
mbIsLayoutPending = true; mbIsLayoutPending = true;
UpdateWindowList(); UpdateWindowList();