summaryrefslogtreecommitdiff
path: root/include/registry
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-11-10 10:21:10 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-11-10 10:31:33 +0100
commit16f0c1315bf29b9da342d669709da28eb22b8390 (patch)
tree2d9e4043dafe3526fafba13ce43fe326328366a5 /include/registry
parent87686af6b85f3bb06c0d75dd870455236506cb7b (diff)
loplugin:nullptr (automatic rewrite)
Change-Id: Ie5a37a49f1b1c08a20f89e167ca415fc645ed40d
Diffstat (limited to 'include/registry')
-rw-r--r--include/registry/reader.hxx68
-rw-r--r--include/registry/registry.hxx22
-rw-r--r--include/registry/writer.hxx4
3 files changed, 47 insertions, 47 deletions
diff --git a/include/registry/reader.hxx b/include/registry/reader.hxx
index 67888df4f6f9..0e2da0735431 100644
--- a/include/registry/reader.hxx
+++ b/include/registry/reader.hxx
@@ -45,7 +45,7 @@ public:
/**
Creates an invalid type reader.
*/
- Reader(): m_handle(0) {}
+ Reader(): m_handle(nullptr) {}
/**
Creates a type reader.
@@ -119,7 +119,7 @@ public:
@return true iff this type reader is valid
*/
bool isValid() const {
- return m_handle != 0;
+ return m_handle != nullptr;
}
/**
@@ -142,9 +142,9 @@ public:
@exception std::bad_alloc is raised if an out-of-memory condition occurs
*/
rtl::OUString getDocumentation() const {
- rtl_uString * s = 0;
+ rtl_uString * s = nullptr;
typereg_reader_getDocumentation(m_handle, &s);
- if (s == 0) {
+ if (s == nullptr) {
throw std::bad_alloc();
}
return rtl::OUString(s, SAL_NO_ACQUIRE);
@@ -160,9 +160,9 @@ public:
@deprecated
*/
rtl::OUString getFileName() const {
- rtl_uString * s = 0;
+ rtl_uString * s = nullptr;
typereg_reader_getFileName(m_handle, &s);
- if (s == 0) {
+ if (s == nullptr) {
throw std::bad_alloc();
}
return rtl::OUString(s, SAL_NO_ACQUIRE);
@@ -201,9 +201,9 @@ public:
@exception std::bad_alloc is raised if an out-of-memory condition occurs
*/
rtl::OUString getTypeName() const {
- rtl_uString * s = 0;
+ rtl_uString * s = nullptr;
typereg_reader_getTypeName(m_handle, &s);
- if (s == 0) {
+ if (s == nullptr) {
throw std::bad_alloc();
}
return rtl::OUString(s, SAL_NO_ACQUIRE);
@@ -230,9 +230,9 @@ public:
@exception std::bad_alloc is raised if an out-of-memory condition occurs
*/
rtl::OUString getSuperTypeName(sal_uInt16 index) const {
- rtl_uString * s = 0;
+ rtl_uString * s = nullptr;
typereg_reader_getSuperTypeName(m_handle, &s, index);
- if (s == 0) {
+ if (s == nullptr) {
throw std::bad_alloc();
}
return rtl::OUString(s, SAL_NO_ACQUIRE);
@@ -258,9 +258,9 @@ public:
@exception std::bad_alloc is raised if an out-of-memory condition occurs
*/
rtl::OUString getFieldDocumentation(sal_uInt16 index) const {
- rtl_uString * s = 0;
+ rtl_uString * s = nullptr;
typereg_reader_getFieldDocumentation(m_handle, &s, index);
- if (s == 0) {
+ if (s == nullptr) {
throw std::bad_alloc();
}
return rtl::OUString(s, SAL_NO_ACQUIRE);
@@ -277,9 +277,9 @@ public:
@deprecated
*/
rtl::OUString getFieldFileName(sal_uInt16 index) const {
- rtl_uString * s = 0;
+ rtl_uString * s = nullptr;
typereg_reader_getFieldFileName(m_handle, &s, index);
- if (s == 0) {
+ if (s == nullptr) {
throw std::bad_alloc();
}
return rtl::OUString(s, SAL_NO_ACQUIRE);
@@ -306,9 +306,9 @@ public:
@exception std::bad_alloc is raised if an out-of-memory condition occurs
*/
rtl::OUString getFieldName(sal_uInt16 index) const {
- rtl_uString * s = 0;
+ rtl_uString * s = nullptr;
typereg_reader_getFieldName(m_handle, &s, index);
- if (s == 0) {
+ if (s == nullptr) {
throw std::bad_alloc();
}
return rtl::OUString(s, SAL_NO_ACQUIRE);
@@ -324,9 +324,9 @@ public:
@exception std::bad_alloc is raised if an out-of-memory condition occurs
*/
rtl::OUString getFieldTypeName(sal_uInt16 index) const {
- rtl_uString * s = 0;
+ rtl_uString * s = nullptr;
typereg_reader_getFieldTypeName(m_handle, &s, index);
- if (s == 0) {
+ if (s == nullptr) {
throw std::bad_alloc();
}
return rtl::OUString(s, SAL_NO_ACQUIRE);
@@ -371,9 +371,9 @@ public:
@exception std::bad_alloc is raised if an out-of-memory condition occurs
*/
rtl::OUString getMethodDocumentation(sal_uInt16 index) const {
- rtl_uString * s = 0;
+ rtl_uString * s = nullptr;
typereg_reader_getMethodDocumentation(m_handle, &s, index);
- if (s == 0) {
+ if (s == nullptr) {
throw std::bad_alloc();
}
return rtl::OUString(s, SAL_NO_ACQUIRE);
@@ -400,9 +400,9 @@ public:
@exception std::bad_alloc is raised if an out-of-memory condition occurs
*/
rtl::OUString getMethodName(sal_uInt16 index) const {
- rtl_uString * s = 0;
+ rtl_uString * s = nullptr;
typereg_reader_getMethodName(m_handle, &s, index);
- if (s == 0) {
+ if (s == nullptr) {
throw std::bad_alloc();
}
return rtl::OUString(s, SAL_NO_ACQUIRE);
@@ -418,9 +418,9 @@ public:
@exception std::bad_alloc is raised if an out-of-memory condition occurs
*/
rtl::OUString getMethodReturnTypeName(sal_uInt16 index) const {
- rtl_uString * s = 0;
+ rtl_uString * s = nullptr;
typereg_reader_getMethodReturnTypeName(m_handle, &s, index);
- if (s == 0) {
+ if (s == nullptr) {
throw std::bad_alloc();
}
return rtl::OUString(s, SAL_NO_ACQUIRE);
@@ -471,10 +471,10 @@ public:
rtl::OUString getMethodParameterName(
sal_uInt16 methodIndex, sal_uInt16 parameterIndex) const
{
- rtl_uString * s = 0;
+ rtl_uString * s = nullptr;
typereg_reader_getMethodParameterName(
m_handle, &s, methodIndex, parameterIndex);
- if (s == 0) {
+ if (s == nullptr) {
throw std::bad_alloc();
}
return rtl::OUString(s, SAL_NO_ACQUIRE);
@@ -496,10 +496,10 @@ public:
rtl::OUString getMethodParameterTypeName(
sal_uInt16 methodIndex, sal_uInt16 parameterIndex) const
{
- rtl_uString * s = 0;
+ rtl_uString * s = nullptr;
typereg_reader_getMethodParameterTypeName(
m_handle, &s, methodIndex, parameterIndex);
- if (s == 0) {
+ if (s == nullptr) {
throw std::bad_alloc();
}
return rtl::OUString(s, SAL_NO_ACQUIRE);
@@ -532,10 +532,10 @@ public:
rtl::OUString getMethodExceptionTypeName(
sal_uInt16 methodIndex, sal_uInt16 exceptionIndex) const
{
- rtl_uString * s = 0;
+ rtl_uString * s = nullptr;
typereg_reader_getMethodExceptionTypeName(
m_handle, &s, methodIndex, exceptionIndex);
- if (s == 0) {
+ if (s == nullptr) {
throw std::bad_alloc();
}
return rtl::OUString(s, SAL_NO_ACQUIRE);
@@ -562,9 +562,9 @@ public:
@exception std::bad_alloc is raised if an out-of-memory condition occurs
*/
rtl::OUString getReferenceDocumentation(sal_uInt16 index) const {
- rtl_uString * s = 0;
+ rtl_uString * s = nullptr;
typereg_reader_getReferenceDocumentation(m_handle, &s, index);
- if (s == 0) {
+ if (s == nullptr) {
throw std::bad_alloc();
}
return rtl::OUString(s, SAL_NO_ACQUIRE);
@@ -605,9 +605,9 @@ public:
@exception std::bad_alloc is raised if an out-of-memory condition occurs
*/
rtl::OUString getReferenceTypeName(sal_uInt16 index) const {
- rtl_uString * s = 0;
+ rtl_uString * s = nullptr;
typereg_reader_getReferenceTypeName(m_handle, &s, index);
- if (s == 0) {
+ if (s == nullptr) {
throw std::bad_alloc();
}
return rtl::OUString(s, SAL_NO_ACQUIRE);
diff --git a/include/registry/registry.hxx b/include/registry/registry.hxx
index e12e64e5f476..76ffe26df0c1 100644
--- a/include/registry/registry.hxx
+++ b/include/registry/registry.hxx
@@ -606,7 +606,7 @@ protected:
inline RegistryKeyArray::RegistryKeyArray()
: m_length(0)
- , m_phKeys(NULL)
+ , m_phKeys(nullptr)
{
}
@@ -640,7 +640,7 @@ inline void RegistryKeyArray::setKeyHandles(Registry& registry,
inline RegistryKeyNames::RegistryKeyNames()
: m_length(0)
- , m_pKeyNames(NULL)
+ , m_pKeyNames(nullptr)
{
}
@@ -674,7 +674,7 @@ inline void RegistryKeyNames::setKeyNames(Registry& registry,
}
inline RegistryKey::RegistryKey()
- : m_hImpl(NULL)
+ : m_hImpl(nullptr)
{ }
/// @cond INTERNAL
@@ -722,7 +722,7 @@ inline RegistryKey& RegistryKey::operator = (const RegistryKey& toAssign)
}
inline bool RegistryKey::isValid() const
- { return (m_hImpl != NULL); }
+ { return (m_hImpl != nullptr); }
inline bool RegistryKey::isReadOnly() const
{
@@ -826,7 +826,7 @@ inline RegError RegistryKey::closeKey()
RegError ret = m_registry.m_pApi->closeKey(m_hImpl);
if (ret == RegError::NO_ERROR)
{
- m_hImpl = NULL;
+ m_hImpl = nullptr;
m_registry = Registry();
}
return ret;
@@ -836,9 +836,9 @@ inline RegError RegistryKey::closeKey()
inline void RegistryKey::releaseKey()
{
- if (m_registry.isValid() && (m_hImpl != 0))
+ if (m_registry.isValid() && (m_hImpl != nullptr))
{
- m_registry.m_pApi->releaseKey(m_hImpl), m_hImpl = 0;
+ m_registry.m_pApi->releaseKey(m_hImpl), m_hImpl = nullptr;
}
}
@@ -1028,7 +1028,7 @@ inline rtl::OUString RegistryKey::getRegistryName()
inline Registry::Registry()
: m_pApi(initRegistry_Api())
- , m_hImpl(NULL)
+ , m_hImpl(nullptr)
{ }
inline Registry::Registry(const Registry& toCopy)
@@ -1060,7 +1060,7 @@ inline Registry& Registry::operator = (const Registry& toAssign)
}
inline bool Registry::isValid() const
- { return ( m_hImpl != NULL ); }
+ { return ( m_hImpl != nullptr ); }
inline bool Registry::isReadOnly() const
{ return m_pApi->isReadOnly(m_hImpl); }
@@ -1097,7 +1097,7 @@ inline RegError Registry::close()
{
RegError ret = m_pApi->closeRegistry(m_hImpl);
if (ret == RegError::NO_ERROR)
- m_hImpl = NULL;
+ m_hImpl = nullptr;
return ret;
}
@@ -1105,7 +1105,7 @@ inline RegError Registry::destroy(const rtl::OUString& registryName)
{
RegError ret = m_pApi->destroyRegistry(m_hImpl, registryName.pData);
if ( ret == RegError::NO_ERROR && registryName.isEmpty() )
- m_hImpl = NULL;
+ m_hImpl = nullptr;
return ret;
}
diff --git a/include/registry/writer.hxx b/include/registry/writer.hxx
index d7c94faf7dd5..dc3ce97c4f0f 100644
--- a/include/registry/writer.hxx
+++ b/include/registry/writer.hxx
@@ -81,7 +81,7 @@ public:
published, typeName.pData, superTypeCount, fieldCount,
methodCount, referenceCount))
{
- if (m_handle == 0) {
+ if (m_handle == nullptr) {
throw std::bad_alloc();
}
}
@@ -271,7 +271,7 @@ public:
*/
void const * getBlob(sal_uInt32 * size) {
void const * p = typereg_writer_getBlob(m_handle, size);
- if (p == 0) {
+ if (p == nullptr) {
throw std::bad_alloc();
}
return p;