summaryrefslogtreecommitdiff
path: root/package/source/xstor
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-11-10 10:20:43 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-11-10 10:31:33 +0100
commit1fc2fe74f2db49b17abc3c4df7feec4f215052ca (patch)
tree0844e3989c0febb1774b5471458314c9c592b103 /package/source/xstor
parent72d944181179fa3287a49cf72edb135a77782198 (diff)
loplugin:nullptr (automatic rewrite)
Change-Id: I1e5338558bc57afe51db57655550e9b7246f7214
Diffstat (limited to 'package/source/xstor')
-rw-r--r--package/source/xstor/disposelistener.cxx2
-rw-r--r--package/source/xstor/ocompinstream.cxx10
-rw-r--r--package/source/xstor/ohierarchyholder.cxx4
-rw-r--r--package/source/xstor/ohierarchyholder.hxx2
-rw-r--r--package/source/xstor/oseekinstream.cxx6
-rw-r--r--package/source/xstor/owriteablestream.cxx12
-rw-r--r--package/source/xstor/owriteablestream.hxx2
-rw-r--r--package/source/xstor/register.cxx2
-rw-r--r--package/source/xstor/switchpersistencestream.cxx6
-rw-r--r--package/source/xstor/xstorage.cxx62
-rw-r--r--package/source/xstor/xstorage.hxx2
11 files changed, 55 insertions, 55 deletions
diff --git a/package/source/xstor/disposelistener.cxx b/package/source/xstor/disposelistener.cxx
index 63978f0fa7cf..6ffafe946d7a 100644
--- a/package/source/xstor/disposelistener.cxx
+++ b/package/source/xstor/disposelistener.cxx
@@ -32,7 +32,7 @@ OChildDispListener_Impl::~OChildDispListener_Impl()
void OChildDispListener_Impl::OwnerIsDisposed()
{
::osl::MutexGuard aGuard( m_aMutex );
- m_pStorage = NULL;
+ m_pStorage = nullptr;
}
void SAL_CALL OChildDispListener_Impl::disposing( const lang::EventObject& Source )
diff --git a/package/source/xstor/ocompinstream.cxx b/package/source/xstor/ocompinstream.cxx
index c772cbe472c1..6c98e3ba106a 100644
--- a/package/source/xstor/ocompinstream.cxx
+++ b/package/source/xstor/ocompinstream.cxx
@@ -35,7 +35,7 @@ OInputCompStream::OInputCompStream( OWriteStream_Impl& aImpl,
: m_pImpl( &aImpl )
, m_rMutexRef( m_pImpl->m_rMutexRef )
, m_xStream( xStream )
-, m_pInterfaceContainer( NULL )
+, m_pInterfaceContainer( nullptr )
, m_aProperties( aProps )
, m_bDisposed( false )
, m_nStorageType( nStorageType )
@@ -50,10 +50,10 @@ OInputCompStream::OInputCompStream( OWriteStream_Impl& aImpl,
OInputCompStream::OInputCompStream( uno::Reference < io::XInputStream > xStream,
const uno::Sequence< beans::PropertyValue >& aProps,
sal_Int32 nStorageType )
-: m_pImpl( NULL )
+: m_pImpl( nullptr )
, m_rMutexRef( new SotMutexHolder )
, m_xStream( xStream )
-, m_pInterfaceContainer( NULL )
+, m_pInterfaceContainer( nullptr )
, m_aProperties( aProps )
, m_bDisposed( false )
, m_nStorageType( nStorageType )
@@ -228,7 +228,7 @@ void OInputCompStream::InternalDispose()
catch( uno::Exception& )
{}
- m_pImpl = NULL;
+ m_pImpl = nullptr;
m_bDisposed = true;
}
@@ -253,7 +253,7 @@ void SAL_CALL OInputCompStream::dispose( )
if ( m_pImpl )
{
m_pImpl->InputStreamDisposed( this );
- m_pImpl = NULL;
+ m_pImpl = nullptr;
}
m_bDisposed = true;
diff --git a/package/source/xstor/ohierarchyholder.cxx b/package/source/xstor/ohierarchyholder.cxx
index 73c50b0ad781..4d84e2d6758b 100644
--- a/package/source/xstor/ohierarchyholder.cxx
+++ b/package/source/xstor/ohierarchyholder.cxx
@@ -138,7 +138,7 @@ uno::Reference< embed::XExtendedStorageStream > OHierarchyElement_Impl::GetStrea
if ( !xChildStorage.is() )
throw uno::RuntimeException();
- aElement = new OHierarchyElement_Impl( NULL, xChildStorage );
+ aElement = new OHierarchyElement_Impl( nullptr, xChildStorage );
}
xResult = aElement->GetStreamHierarchically( nStorageMode, aListPath, nStreamMode, aEncryptionData );
@@ -195,7 +195,7 @@ void OHierarchyElement_Impl::RemoveStreamHierarchically( OStringList_Impl& aList
if ( !xChildStorage.is() )
throw uno::RuntimeException();
- aElement = new OHierarchyElement_Impl( NULL, xChildStorage );
+ aElement = new OHierarchyElement_Impl( nullptr, xChildStorage );
}
aElement->RemoveStreamHierarchically( aListPath );
diff --git a/package/source/xstor/ohierarchyholder.hxx b/package/source/xstor/ohierarchyholder.hxx
index 6813fa1e13cb..006b2e22d4a4 100644
--- a/package/source/xstor/ohierarchyholder.hxx
+++ b/package/source/xstor/ohierarchyholder.hxx
@@ -71,7 +71,7 @@ public:
{}
explicit OHierarchyElement_Impl( const css::uno::WeakReference< css::embed::XStorage >& xWeakStorage )
- : m_rParent( NULL )
+ : m_rParent( nullptr )
, m_xWeakOwnStorage( xWeakStorage )
{}
diff --git a/package/source/xstor/oseekinstream.cxx b/package/source/xstor/oseekinstream.cxx
index 4d6521aecbfc..074f08f5d4e7 100644
--- a/package/source/xstor/oseekinstream.cxx
+++ b/package/source/xstor/oseekinstream.cxx
@@ -53,13 +53,13 @@ OInputSeekStream::~OInputSeekStream()
uno::Sequence< uno::Type > SAL_CALL OInputSeekStream::getTypes()
throw ( uno::RuntimeException, std::exception )
{
- static ::cppu::OTypeCollection* pTypeCollection = NULL ;
+ static ::cppu::OTypeCollection* pTypeCollection = nullptr ;
- if ( pTypeCollection == NULL )
+ if ( pTypeCollection == nullptr )
{
::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ) ;
- if ( pTypeCollection == NULL )
+ if ( pTypeCollection == nullptr )
{
static ::cppu::OTypeCollection aTypeCollection(
cppu::UnoType<io::XSeekable>::get(),
diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx
index 4967e23a96f5..822ab1856f7a 100644
--- a/package/source/xstor/owriteablestream.cxx
+++ b/package/source/xstor/owriteablestream.cxx
@@ -263,7 +263,7 @@ OWriteStream_Impl::OWriteStream_Impl( OStorage_Impl* pParent,
sal_Int32 nStorageType,
bool bDefaultCompress,
const uno::Reference< io::XInputStream >& xRelInfoStream )
-: m_pAntiImpl( NULL )
+: m_pAntiImpl( nullptr )
, m_bHasDataToFlush( false )
, m_bFlushed( false )
, m_xPackageStream( xPackageStream )
@@ -491,9 +491,9 @@ void OWriteStream_Impl::DisposeWrappers()
AddLog( "Quiet exception" );
}
- m_pAntiImpl = NULL;
+ m_pAntiImpl = nullptr;
}
- m_pParent = NULL;
+ m_pParent = nullptr;
if ( !m_aInputStreamsList.empty() )
{
@@ -503,7 +503,7 @@ void OWriteStream_Impl::DisposeWrappers()
if ( (*pStreamIter) )
{
(*pStreamIter)->InternalDispose();
- (*pStreamIter) = NULL;
+ (*pStreamIter) = nullptr;
}
}
@@ -2459,7 +2459,7 @@ void SAL_CALL OWriteStream::dispose()
m_xSeekable.clear();
- m_pImpl->m_pAntiImpl = NULL;
+ m_pImpl->m_pAntiImpl = nullptr;
if ( !m_bInitOnDemand )
{
@@ -2487,7 +2487,7 @@ void SAL_CALL OWriteStream::dispose()
}
}
- m_pImpl = NULL;
+ m_pImpl = nullptr;
}
// the listener might try to get rid of parent storage, and the storage would delete this object;
diff --git a/package/source/xstor/owriteablestream.hxx b/package/source/xstor/owriteablestream.hxx
index 98e305742836..d34f1fb89cb9 100644
--- a/package/source/xstor/owriteablestream.hxx
+++ b/package/source/xstor/owriteablestream.hxx
@@ -161,7 +161,7 @@ public:
bool HasTempFile_Impl() const { return ( m_aTempURL.getLength() != 0 ); }
bool IsTransacted();
- bool HasWriteOwner_Impl() const { return ( m_pAntiImpl != NULL ); }
+ bool HasWriteOwner_Impl() const { return ( m_pAntiImpl != nullptr ); }
void InsertIntoPackageFolder(
const OUString& aName,
diff --git a/package/source/xstor/register.cxx b/package/source/xstor/register.cxx
index 65cd33fa0559..1d06531ab61b 100644
--- a/package/source/xstor/register.cxx
+++ b/package/source/xstor/register.cxx
@@ -30,7 +30,7 @@ extern "C" {
SAL_DLLPUBLIC_EXPORT void * SAL_CALL xstor_component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ )
{
- void * pRet = 0;
+ void * pRet = nullptr;
OUString aImplName( OUString::createFromAscii( pImplName ) );
uno::Reference< lang::XSingleServiceFactory > xFactory;
diff --git a/package/source/xstor/switchpersistencestream.cxx b/package/source/xstor/switchpersistencestream.cxx
index 1eca85ff62ef..88a5ab0988f7 100644
--- a/package/source/xstor/switchpersistencestream.cxx
+++ b/package/source/xstor/switchpersistencestream.cxx
@@ -67,7 +67,7 @@ SwitchablePersistenceStream::SwitchablePersistenceStream(
const uno::Reference< uno::XComponentContext >& xContext,
const uno::Reference< io::XStream >& xStream )
: m_xContext( xContext )
-, m_pStreamData( NULL )
+, m_pStreamData( nullptr )
{
SwitchPersistenceTo( xStream );
}
@@ -76,7 +76,7 @@ SwitchablePersistenceStream::SwitchablePersistenceStream(
const uno::Reference< uno::XComponentContext >& xContext,
const uno::Reference< io::XInputStream >& xInputStream )
: m_xContext( xContext )
-, m_pStreamData( NULL )
+, m_pStreamData( nullptr )
{
SwitchPersistenceTo( xInputStream );
}
@@ -203,7 +203,7 @@ void SwitchablePersistenceStream::CloseAll_Impl()
if ( m_pStreamData )
{
delete m_pStreamData;
- m_pStreamData = NULL;
+ m_pStreamData = nullptr;
}
}
diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx
index 3c37bba00551..5a275fc177c5 100644
--- a/package/source/xstor/xstorage.cxx
+++ b/package/source/xstor/xstorage.cxx
@@ -168,8 +168,8 @@ SotElement_Impl::SotElement_Impl( const OUString& rName, bool bStor, bool bNew )
, m_bIsRemoved( false )
, m_bIsInserted( bNew )
, m_bIsStorage( bStor )
-, m_pStorage( NULL )
-, m_pStream( NULL )
+, m_pStorage( nullptr )
+, m_pStream( nullptr )
{
}
@@ -186,7 +186,7 @@ OStorage_Impl::OStorage_Impl( uno::Reference< io::XInputStream > xInputStream,
uno::Reference< uno::XComponentContext > xContext,
sal_Int32 nStorageType )
: m_rMutexRef( new SotMutexHolder )
-, m_pAntiImpl( NULL )
+, m_pAntiImpl( nullptr )
, m_nStorageMode( nMode & ~embed::ElementModes::SEEKABLE )
, m_bIsModified( ( nMode & ( embed::ElementModes::WRITE | embed::ElementModes::TRUNCATE ) ) == ( embed::ElementModes::WRITE | embed::ElementModes::TRUNCATE ) )
, m_bBroadcastModified( false )
@@ -197,13 +197,13 @@ OStorage_Impl::OStorage_Impl( uno::Reference< io::XInputStream > xInputStream,
, m_xContext( xContext )
, m_xProperties( xProperties )
, m_bHasCommonEncryptionData( false )
-, m_pParent( NULL )
+, m_pParent( nullptr )
, m_bControlMediaType( false )
, m_bMTFallbackUsed( false )
, m_bControlVersion( false )
-, m_pSwitchStream( NULL )
+, m_pSwitchStream( nullptr )
, m_nStorageType( nStorageType )
-, m_pRelStorElement( NULL )
+, m_pRelStorElement( nullptr )
, m_nRelInfoStatus( RELINFO_NO_INIT )
{
// all the checks done below by assertion statements must be done by factory
@@ -226,7 +226,7 @@ OStorage_Impl::OStorage_Impl( uno::Reference< io::XStream > xStream,
uno::Reference< uno::XComponentContext > xContext,
sal_Int32 nStorageType )
: m_rMutexRef( new SotMutexHolder )
-, m_pAntiImpl( NULL )
+, m_pAntiImpl( nullptr )
, m_nStorageMode( nMode & ~embed::ElementModes::SEEKABLE )
, m_bIsModified( ( nMode & ( embed::ElementModes::WRITE | embed::ElementModes::TRUNCATE ) ) == ( embed::ElementModes::WRITE | embed::ElementModes::TRUNCATE ) )
, m_bBroadcastModified( false )
@@ -237,13 +237,13 @@ OStorage_Impl::OStorage_Impl( uno::Reference< io::XStream > xStream,
, m_xContext( xContext )
, m_xProperties( xProperties )
, m_bHasCommonEncryptionData( false )
-, m_pParent( NULL )
+, m_pParent( nullptr )
, m_bControlMediaType( false )
, m_bMTFallbackUsed( false )
, m_bControlVersion( false )
-, m_pSwitchStream( NULL )
+, m_pSwitchStream( nullptr )
, m_nStorageType( nStorageType )
-, m_pRelStorElement( NULL )
+, m_pRelStorElement( nullptr )
, m_nRelInfoStatus( RELINFO_NO_INIT )
{
// all the checks done below by assertion statements must be done by factory
@@ -268,7 +268,7 @@ OStorage_Impl::OStorage_Impl( OStorage_Impl* pParent,
uno::Reference< uno::XComponentContext > xContext,
sal_Int32 nStorageType )
: m_rMutexRef( new SotMutexHolder )
-, m_pAntiImpl( NULL )
+, m_pAntiImpl( nullptr )
, m_nStorageMode( nMode & ~embed::ElementModes::SEEKABLE )
, m_bIsModified( ( nMode & ( embed::ElementModes::WRITE | embed::ElementModes::TRUNCATE ) ) == ( embed::ElementModes::WRITE | embed::ElementModes::TRUNCATE ) )
, m_bBroadcastModified( false )
@@ -284,9 +284,9 @@ OStorage_Impl::OStorage_Impl( OStorage_Impl* pParent,
, m_bControlMediaType( false )
, m_bMTFallbackUsed( false )
, m_bControlVersion( false )
-, m_pSwitchStream( NULL )
+, m_pSwitchStream( nullptr )
, m_nStorageType( nStorageType )
-, m_pRelStorElement( NULL )
+, m_pRelStorElement( nullptr )
, m_nRelInfoStatus( RELINFO_NO_INIT )
{
SAL_WARN_IF( !xPackageFolder.is(), "package.xstor", "No package folder!" );
@@ -308,7 +308,7 @@ OStorage_Impl::~OStorage_Impl()
AddLog( rException.Message );
AddLog( THROW_WHERE "Quiet exception" );
}
- m_pAntiImpl = NULL;
+ m_pAntiImpl = nullptr;
}
else if ( !m_aReadOnlyWrapList.empty() )
{
@@ -329,7 +329,7 @@ OStorage_Impl::~OStorage_Impl()
m_aReadOnlyWrapList.clear();
}
- m_pParent = NULL;
+ m_pParent = nullptr;
}
std::for_each(m_aChildrenList.begin(), m_aChildrenList.end(), boost::checked_deleter<SotElement_Impl>());
@@ -341,7 +341,7 @@ OStorage_Impl::~OStorage_Impl()
if ( m_nStorageType == embed::StorageFormats::OFOPXML && m_pRelStorElement )
{
delete m_pRelStorElement;
- m_pRelStorElement = NULL;
+ m_pRelStorElement = nullptr;
}
m_xPackageFolder.clear();
@@ -996,7 +996,7 @@ void OStorage_Impl::CopyLastCommitTo( const uno::Reference< embed::XStorage >& x
if ( !m_xPackageFolder.is() )
throw uno::RuntimeException( THROW_WHERE );
- OStorage_Impl aTempRepresent( NULL,
+ OStorage_Impl aTempRepresent( nullptr,
embed::ElementModes::READ,
m_xPackageFolder,
m_xPackage,
@@ -1072,7 +1072,7 @@ void OStorage_Impl::Commit()
if ( m_bCommited || m_bIsRoot )
xNewPackageFolder->removeByName( (*pDeletedIter)->m_aOriginalName );
delete *pDeletedIter;
- *pDeletedIter = NULL;
+ *pDeletedIter = nullptr;
}
m_aDeletedList.clear();
@@ -1373,7 +1373,7 @@ SotElement_Impl* OStorage_Impl::FindElement( const OUString& rName )
return *pElementIter;
}
- return NULL;
+ return nullptr;
}
SotElement_Impl* OStorage_Impl::InsertStream( const OUString& aName, bool bEncr )
@@ -1491,11 +1491,11 @@ SotElement_Impl* OStorage_Impl::InsertStorage( const OUString& aName, sal_Int32
SotElement_Impl* OStorage_Impl::InsertElement( const OUString& aName, bool bIsStorage )
{
- OSL_ENSURE( FindElement( aName ) == NULL, "Should not try to insert existing element" );
+ OSL_ENSURE( FindElement( aName ) == nullptr, "Should not try to insert existing element" );
::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() );
- SotElement_Impl* pDeletedElm = NULL;
+ SotElement_Impl* pDeletedElm = nullptr;
for ( SotElementList_Impl::iterator pElementIter = m_aChildrenList.begin();
pElementIter != m_aChildrenList.end(); ++pElementIter )
@@ -1630,13 +1630,13 @@ void OStorage_Impl::ClearElement( SotElement_Impl* pElement )
if ( pElement->m_pStorage )
{
delete pElement->m_pStorage;
- pElement->m_pStorage = NULL;
+ pElement->m_pStorage = nullptr;
}
if ( pElement->m_pStream )
{
delete pElement->m_pStream;
- pElement->m_pStream = NULL;
+ pElement->m_pStream = nullptr;
}
}
@@ -1712,7 +1712,7 @@ void OStorage_Impl::CreateRelStorage()
m_pRelStorElement = new SotElement_Impl( "_rels", true, true );
m_pRelStorElement->m_pStorage = CreateNewStorageImpl( embed::ElementModes::WRITE );
if ( m_pRelStorElement->m_pStorage )
- m_pRelStorElement->m_pStorage->m_pParent = NULL; // the relation storage is completely controlled by parent
+ m_pRelStorElement->m_pStorage->m_pParent = nullptr; // the relation storage is completely controlled by parent
}
if ( !m_pRelStorElement->m_pStorage )
@@ -1863,7 +1863,7 @@ void OStorage_Impl::CommitRelInfo( const uno::Reference< container::XNameContain
{
// the empty relations storage should not be created
delete m_pRelStorElement;
- m_pRelStorElement = NULL;
+ m_pRelStorElement = nullptr;
m_xRelStorage.clear();
}
else if ( m_pRelStorElement && m_pRelStorElement->m_pStorage && xNewPackageFolder.is() )
@@ -1984,7 +1984,7 @@ void SAL_CALL OStorage::InternalDispose( bool bNotifyImpl )
}
else
{
- m_pImpl->m_pAntiImpl = NULL;
+ m_pImpl->m_pAntiImpl = nullptr;
if ( bNotifyImpl )
{
@@ -1998,7 +1998,7 @@ void SAL_CALL OStorage::InternalDispose( bool bNotifyImpl )
}
}
- m_pImpl = NULL;
+ m_pImpl = nullptr;
}
void OStorage::ChildIsDisposed( const uno::Reference< uno::XInterface >& xChild )
@@ -2905,7 +2905,7 @@ sal_Bool SAL_CALL OStorage::isStreamElement( const OUString& aElementName )
if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aElementName == "_rels" )
throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 1 ); // unacceptable name
- SotElement_Impl* pElement = NULL;
+ SotElement_Impl* pElement = nullptr;
try
{
@@ -2972,7 +2972,7 @@ sal_Bool SAL_CALL OStorage::isStorageElement( const OUString& aElementName )
if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aElementName == "_rels" )
throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 1 );
- SotElement_Impl* pElement = NULL;
+ SotElement_Impl* pElement = nullptr;
try
{
@@ -4282,7 +4282,7 @@ sal_Bool SAL_CALL OStorage::hasByName( const OUString& aName )
if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aName == "_rels" )
return sal_False;
- SotElement_Impl* pElement = NULL;
+ SotElement_Impl* pElement = nullptr;
try
{
pElement = m_pImpl->FindElement( aName );
@@ -4304,7 +4304,7 @@ sal_Bool SAL_CALL OStorage::hasByName( const OUString& aName )
aCaught );
}
- return ( pElement != NULL );
+ return ( pElement != nullptr );
}
uno::Type SAL_CALL OStorage::getElementType()
diff --git a/package/source/xstor/xstorage.hxx b/package/source/xstor/xstorage.hxx
index 24ea11832ac5..e5130e288eeb 100644
--- a/package/source/xstor/xstorage.hxx
+++ b/package/source/xstor/xstorage.hxx
@@ -136,7 +136,7 @@ struct OStorage_Impl
oslInterlockedCount m_nModifiedListenerCount;
bool HasModifiedListener()
{
- return m_nModifiedListenerCount > 0 && m_pAntiImpl != NULL;
+ return m_nModifiedListenerCount > 0 && m_pAntiImpl != nullptr;
}
SotElementList_Impl m_aChildrenList;