summaryrefslogtreecommitdiff
path: root/writerperfect/source/common
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-11-10 10:28:53 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-11-10 10:32:00 +0100
commit42e2262cdd05718a3286f813da6f53805846da02 (patch)
tree12caa143a9a41dabbe097377d9ef3aa7919c5100 /writerperfect/source/common
parent0a1c17a30cd98892e0e60b512200ac07ff1ab320 (diff)
loplugin:nullptr (automatic rewrite)
Change-Id: Ie4d4ce386f2810244fb97bf909870a839256971d
Diffstat (limited to 'writerperfect/source/common')
-rw-r--r--writerperfect/source/common/DirectoryStream.cxx20
-rw-r--r--writerperfect/source/common/WPXSvInputStream.cxx42
2 files changed, 31 insertions, 31 deletions
diff --git a/writerperfect/source/common/DirectoryStream.cxx b/writerperfect/source/common/DirectoryStream.cxx
index 064f51c76c11..0f57a66f1f42 100644
--- a/writerperfect/source/common/DirectoryStream.cxx
+++ b/writerperfect/source/common/DirectoryStream.cxx
@@ -106,7 +106,7 @@ DirectoryStream::Impl::Impl(const uno::Reference<ucb::XContent> &rxContent)
}
DirectoryStream::DirectoryStream(const com::sun::star::uno::Reference<com::sun::star::ucb::XContent> &xContent)
- : m_pImpl(isDirectory(xContent) ? new Impl(xContent) : 0)
+ : m_pImpl(isDirectory(xContent) ? new Impl(xContent) : nullptr)
{
}
@@ -120,9 +120,9 @@ DirectoryStream *DirectoryStream::createForParent(const com::sun::star::uno::Ref
try
{
if (!xContent.is())
- return 0;
+ return nullptr;
- DirectoryStream *pDir(0);
+ DirectoryStream *pDir(nullptr);
const uno::Reference<container::XChild> xChild(xContent, uno::UNO_QUERY);
if (xChild.is())
@@ -134,7 +134,7 @@ DirectoryStream *DirectoryStream::createForParent(const com::sun::star::uno::Ref
if (!pDir->isStructured())
{
delete pDir;
- pDir = 0;
+ pDir = nullptr;
}
}
}
@@ -143,7 +143,7 @@ DirectoryStream *DirectoryStream::createForParent(const com::sun::star::uno::Ref
}
catch (...)
{
- return 0;
+ return nullptr;
}
}
@@ -180,7 +180,7 @@ unsigned DirectoryStream::subStreamCount()
const char *DirectoryStream::subStreamName(unsigned /* id */)
{
// TODO: implement me
- return 0;
+ return nullptr;
}
bool DirectoryStream::existsSubStream(const char * /* name */)
@@ -192,26 +192,26 @@ bool DirectoryStream::existsSubStream(const char * /* name */)
librevenge::RVNGInputStream *DirectoryStream::getSubStreamByName(const char *const pName)
{
if (!m_pImpl)
- return 0;
+ return nullptr;
ucbhelper::Content aContent(m_pImpl->xContent, uno::Reference<ucb::XCommandEnvironment>(), comphelper::getProcessComponentContext());
const uno::Reference<io::XInputStream> xInputStream(findStream(aContent, rtl::OUString::createFromAscii(pName)));
if (xInputStream.is())
return new WPXSvInputStream(xInputStream);
- return 0;
+ return nullptr;
}
librevenge::RVNGInputStream *DirectoryStream::getSubStreamById(unsigned /* id */)
{
// TODO: implement me
- return 0;
+ return nullptr;
}
const unsigned char *DirectoryStream::read(unsigned long, unsigned long &nNumBytesRead)
{
nNumBytesRead = 0;
- return 0;
+ return nullptr;
}
int DirectoryStream::seek(long, librevenge::RVNG_SEEK_TYPE)
diff --git a/writerperfect/source/common/WPXSvInputStream.cxx b/writerperfect/source/common/WPXSvInputStream.cxx
index 99a01069a43e..52d5824530ee 100644
--- a/writerperfect/source/common/WPXSvInputStream.cxx
+++ b/writerperfect/source/common/WPXSvInputStream.cxx
@@ -254,7 +254,7 @@ tools::SvRef<SotStorageStream> OLEStorageImpl::createStream(const rtl::OUString
const OLEStorageMap_t::const_iterator aIt = maStorageMap.find(aDir);
if (maStorageMap.end() == aIt)
- return 0;
+ return nullptr;
return aIt->second.ref->OpenSotStream(aName, STREAM_STD_READ);
}
@@ -452,7 +452,7 @@ WPXSvInputStreamImpl::WPXSvInputStreamImpl(Reference< XInputStream > xStream) :
mbCheckedOLE(false),
mbCheckedZip(false),
mnLength(0),
- mpReadBuffer(0),
+ mpReadBuffer(nullptr),
mnReadBufferLength(0),
mnReadBufferPos(0)
{
@@ -488,11 +488,11 @@ const unsigned char *WPXSvInputStreamImpl::read(unsigned long numBytes, unsigned
numBytesRead = 0;
if (numBytes == 0 || isEnd())
- return 0;
+ return nullptr;
numBytesRead = mxStream->readSomeBytes(maData, numBytes);
if (numBytesRead == 0)
- return 0;
+ return nullptr;
return reinterpret_cast<const unsigned char *>(maData.getConstArray());
}
@@ -584,7 +584,7 @@ unsigned WPXSvInputStreamImpl::subStreamCount()
const char *WPXSvInputStreamImpl::subStreamName(const unsigned id)
{
if ((mnLength == 0) || !mxStream.is() || !mxSeekable.is())
- return 0;
+ return nullptr;
PositionHolder pos(mxSeekable);
mxSeekable->seek(0);
@@ -594,7 +594,7 @@ const char *WPXSvInputStreamImpl::subStreamName(const unsigned id)
ensureOLEIsInitialized();
if (mpOLEStorage->maStreams.size() <= id)
- return 0;
+ return nullptr;
return mpOLEStorage->maStreams[id].name.getStr();
}
@@ -606,12 +606,12 @@ const char *WPXSvInputStreamImpl::subStreamName(const unsigned id)
ensureZipIsInitialized();
if (mpZipStorage->maStreams.size() <= id)
- return 0;
+ return nullptr;
return mpZipStorage->maStreams[id].aName.getStr();
}
- return 0;
+ return nullptr;
}
bool WPXSvInputStreamImpl::existsSubStream(const char *const name)
@@ -647,10 +647,10 @@ bool WPXSvInputStreamImpl::existsSubStream(const char *const name)
librevenge::RVNGInputStream *WPXSvInputStreamImpl::getSubStreamByName(const char *const name)
{
if (!name)
- return 0;
+ return nullptr;
if ((mnLength == 0) || !mxStream.is() || !mxSeekable.is())
- return 0;
+ return nullptr;
PositionHolder pos(mxSeekable);
mxSeekable->seek(0);
@@ -679,13 +679,13 @@ librevenge::RVNGInputStream *WPXSvInputStreamImpl::getSubStreamByName(const char
}
}
- return 0;
+ return nullptr;
}
librevenge::RVNGInputStream *WPXSvInputStreamImpl::getSubStreamById(const unsigned id)
{
if ((mnLength == 0) || !mxStream.is() || !mxSeekable.is())
- return 0;
+ return nullptr;
PositionHolder pos(mxSeekable);
mxSeekable->seek(0);
@@ -695,7 +695,7 @@ librevenge::RVNGInputStream *WPXSvInputStreamImpl::getSubStreamById(const unsign
ensureOLEIsInitialized();
if (mpOLEStorage->maStreams.size() <= id)
- return 0;
+ return nullptr;
return createWPXStream(mpOLEStorage->getStream(id));
}
@@ -707,7 +707,7 @@ librevenge::RVNGInputStream *WPXSvInputStreamImpl::getSubStreamById(const unsign
ensureZipIsInitialized();
if (mpZipStorage->maStreams.size() <= id)
- return 0;
+ return nullptr;
try
{
@@ -718,7 +718,7 @@ librevenge::RVNGInputStream *WPXSvInputStreamImpl::getSubStreamById(const unsign
// nothing needed
}
}
- return 0;
+ return nullptr;
}
void WPXSvInputStreamImpl::invalidateReadBuffer()
@@ -726,7 +726,7 @@ void WPXSvInputStreamImpl::invalidateReadBuffer()
if (mpReadBuffer)
{
seek((long) tell() + (long)mnReadBufferPos - (long)mnReadBufferLength);
- mpReadBuffer = 0;
+ mpReadBuffer = nullptr;
mnReadBufferPos = 0;
mnReadBufferLength = 0;
}
@@ -739,7 +739,7 @@ librevenge::RVNGInputStream *WPXSvInputStreamImpl::createWPXStream(const tools::
Reference < XInputStream > xContents(new utl::OSeekableInputStreamWrapper(rxStorage));
return new WPXSvInputStream(xContents);
}
- return 0;
+ return nullptr;
}
librevenge::RVNGInputStream *WPXSvInputStreamImpl::createWPXStream(const Reference<XInputStream> &rxStream)
@@ -747,7 +747,7 @@ librevenge::RVNGInputStream *WPXSvInputStreamImpl::createWPXStream(const Referen
if (rxStream.is())
return new WPXSvInputStream(rxStream);
else
- return 0;
+ return nullptr;
}
bool WPXSvInputStreamImpl::isOLE()
@@ -827,7 +827,7 @@ const unsigned char *WPXSvInputStream::read(unsigned long numBytes, unsigned lon
numBytesRead = 0;
if (numBytes == 0 || numBytes > (std::numeric_limits<unsigned long>::max)()/2)
- return 0;
+ return nullptr;
if (mpImpl->mpReadBuffer)
{
@@ -844,7 +844,7 @@ const unsigned char *WPXSvInputStream::read(unsigned long numBytes, unsigned lon
unsigned long curpos = (unsigned long) mpImpl->tell();
if (curpos == (unsigned long)-1) // returned ERROR
- return 0;
+ return nullptr;
if ((curpos + numBytes < curpos) /*overflow*/ ||
(curpos + numBytes >= (sal_uInt64)mpImpl->mnLength)) /*reading more than available*/
@@ -869,7 +869,7 @@ const unsigned char *WPXSvInputStream::read(unsigned long numBytes, unsigned lon
mpImpl->mnReadBufferPos = 0;
if (!mpImpl->mnReadBufferLength)
- return 0;
+ return nullptr;
numBytesRead = numBytes;