diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 10:28:53 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 10:32:00 +0100 |
commit | 42e2262cdd05718a3286f813da6f53805846da02 (patch) | |
tree | 12caa143a9a41dabbe097377d9ef3aa7919c5100 /writerperfect | |
parent | 0a1c17a30cd98892e0e60b512200ac07ff1ab320 (diff) |
loplugin:nullptr (automatic rewrite)
Change-Id: Ie4d4ce386f2810244fb97bf909870a839256971d
Diffstat (limited to 'writerperfect')
9 files changed, 61 insertions, 61 deletions
diff --git a/writerperfect/qa/unit/DirectoryStreamTest.cxx b/writerperfect/qa/unit/DirectoryStreamTest.cxx index 6ab8d384e20c..effedf8c5e4e 100644 --- a/writerperfect/qa/unit/DirectoryStreamTest.cxx +++ b/writerperfect/qa/unit/DirectoryStreamTest.cxx @@ -106,7 +106,7 @@ void lcl_testDataOperations(RVNGInputStream &rStream) CPPUNIT_ASSERT_EQUAL(-1, rStream.seek(0, librevenge::RVNG_SEEK_CUR)); unsigned long numBytesRead = 0; - CPPUNIT_ASSERT(0 == rStream.read(1, numBytesRead)); + CPPUNIT_ASSERT(nullptr == rStream.read(1, numBytesRead)); CPPUNIT_ASSERT_EQUAL(0UL, numBytesRead); } diff --git a/writerperfect/qa/unit/WPXSvStreamTest.cxx b/writerperfect/qa/unit/WPXSvStreamTest.cxx index 3723d483f357..2ac9f28af307 100644 --- a/writerperfect/qa/unit/WPXSvStreamTest.cxx +++ b/writerperfect/qa/unit/WPXSvStreamTest.cxx @@ -122,7 +122,7 @@ void WPXSvStreamTest::testRead() const unsigned long nLen = sizeof aText; unsigned long nReadBytes = 0; - const unsigned char *pData = 0; + const unsigned char *pData = nullptr; const unsigned char *const pTextOrig = reinterpret_cast<const unsigned char *>(aText); const unsigned char *pText = pTextOrig; @@ -174,7 +174,7 @@ void WPXSvStreamTest::testRead() pData = pInput->read(0UL, nReadBytes); CPPUNIT_ASSERT_EQUAL(0UL, nReadBytes); CPPUNIT_ASSERT_EQUAL(0L, pInput->tell()); - CPPUNIT_ASSERT_EQUAL(pData, static_cast<const unsigned char *>(0)); + CPPUNIT_ASSERT_EQUAL(pData, static_cast<const unsigned char *>(nullptr)); CPPUNIT_ASSERT(!pInput->isEnd()); } @@ -340,9 +340,9 @@ void WPXSvStreamTest::testStructured() CPPUNIT_ASSERT(!pInput->isStructured()); CPPUNIT_ASSERT(0 == pInput->subStreamCount()); CPPUNIT_ASSERT(!pInput->existsSubStream("foo")); - CPPUNIT_ASSERT(0 == pInput->getSubStreamByName("foo")); - CPPUNIT_ASSERT(0 == pInput->getSubStreamById(42)); - CPPUNIT_ASSERT(0 == pInput->subStreamName(42)); + CPPUNIT_ASSERT(nullptr == pInput->getSubStreamByName("foo")); + CPPUNIT_ASSERT(nullptr == pInput->getSubStreamById(42)); + CPPUNIT_ASSERT(nullptr == pInput->subStreamName(42)); } } diff --git a/writerperfect/source/calc/wpftcalc_genericfilter.cxx b/writerperfect/source/calc/wpftcalc_genericfilter.cxx index 7ebe8f5dc554..87296a02f3b1 100644 --- a/writerperfect/source/calc/wpftcalc_genericfilter.cxx +++ b/writerperfect/source/calc/wpftcalc_genericfilter.cxx @@ -41,19 +41,19 @@ static cppu::ImplementationEntry const services[] = { &MSWorksCalcImportFilter_createInstance, &MSWorksCalcImportFilter_getImplementationName, &MSWorksCalcImportFilter_getSupportedServiceNames, - &cppu::createSingleComponentFactory, 0, 0 + &cppu::createSingleComponentFactory, nullptr, 0 }, { &MWAWCalcImportFilter_createInstance, &MWAWCalcImportFilter_getImplementationName, &MWAWCalcImportFilter_getSupportedServiceNames, - &cppu::createSingleComponentFactory, 0, 0 + &cppu::createSingleComponentFactory, nullptr, 0 }, { &NumbersImportFilter_createInstance, &NumbersImportFilter_getImplementationName, &NumbersImportFilter_getSupportedServiceNames, - &cppu::createSingleComponentFactory, 0, 0 + &cppu::createSingleComponentFactory, nullptr, 0 }, - { 0, 0, 0, 0, 0, 0 } + { nullptr, nullptr, nullptr, nullptr, nullptr, 0 } }; } 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; diff --git a/writerperfect/source/draw/wpftdraw_genericfilter.cxx b/writerperfect/source/draw/wpftdraw_genericfilter.cxx index 920660f8598f..af3b14761b85 100644 --- a/writerperfect/source/draw/wpftdraw_genericfilter.cxx +++ b/writerperfect/source/draw/wpftdraw_genericfilter.cxx @@ -46,49 +46,49 @@ static cppu::ImplementationEntry const services[] = { &CDRImportFilter_createInstance, &CDRImportFilter_getImplementationName, &CDRImportFilter_getSupportedServiceNames, - &cppu::createSingleComponentFactory, 0, 0 + &cppu::createSingleComponentFactory, nullptr, 0 }, { &CMXImportFilter_createInstance, &CMXImportFilter_getImplementationName, &CMXImportFilter_getSupportedServiceNames, - &cppu::createSingleComponentFactory, 0, 0 + &cppu::createSingleComponentFactory, nullptr, 0 }, { &FreehandImportFilter_createInstance, &FreehandImportFilter_getImplementationName, &FreehandImportFilter_getSupportedServiceNames, - &cppu::createSingleComponentFactory, 0, 0 + &cppu::createSingleComponentFactory, nullptr, 0 }, { &PageMakerImportFilter_createInstance, &PageMakerImportFilter_getImplementationName, &PageMakerImportFilter_getSupportedServiceNames, - &cppu::createSingleComponentFactory, 0, 0 + &cppu::createSingleComponentFactory, nullptr, 0 }, { &MSPUBImportFilter_createInstance, &MSPUBImportFilter_getImplementationName, &MSPUBImportFilter_getSupportedServiceNames, - &cppu::createSingleComponentFactory, 0, 0 + &cppu::createSingleComponentFactory, nullptr, 0 }, { &MWAWDrawImportFilter_createInstance, &MWAWDrawImportFilter_getImplementationName, &MWAWDrawImportFilter_getSupportedServiceNames, - &cppu::createSingleComponentFactory, 0, 0 + &cppu::createSingleComponentFactory, nullptr, 0 }, { &VisioImportFilter_createInstance, &VisioImportFilter_getImplementationName, &VisioImportFilter_getSupportedServiceNames, - &cppu::createSingleComponentFactory, 0, 0 + &cppu::createSingleComponentFactory, nullptr, 0 }, { &WPGImportFilter_createInstance, &WPGImportFilter_getImplementationName, &WPGImportFilter_getSupportedServiceNames, - &cppu::createSingleComponentFactory, 0, 0 + &cppu::createSingleComponentFactory, nullptr, 0 }, - { 0, 0, 0, 0, 0, 0 } + { nullptr, nullptr, nullptr, nullptr, nullptr, 0 } }; } diff --git a/writerperfect/source/impress/wpftimpress_genericfilter.cxx b/writerperfect/source/impress/wpftimpress_genericfilter.cxx index 3a1129d9b9a9..2f50025fefed 100644 --- a/writerperfect/source/impress/wpftimpress_genericfilter.cxx +++ b/writerperfect/source/impress/wpftimpress_genericfilter.cxx @@ -36,15 +36,15 @@ static cppu::ImplementationEntry const services[] = { &KeynoteImportFilter_createInstance, &KeynoteImportFilter_getImplementationName, &KeynoteImportFilter_getSupportedServiceNames, - &cppu::createSingleComponentFactory, 0, 0 + &cppu::createSingleComponentFactory, nullptr, 0 }, { &MWAWPresentationImportFilter_createInstance, &MWAWPresentationImportFilter_getImplementationName, &MWAWPresentationImportFilter_getSupportedServiceNames, - &cppu::createSingleComponentFactory, 0, 0 + &cppu::createSingleComponentFactory, nullptr, 0 }, - { 0, 0, 0, 0, 0, 0 } + { nullptr, nullptr, nullptr, nullptr, nullptr, 0 } }; } diff --git a/writerperfect/source/writer/WordPerfectImportFilter.cxx b/writerperfect/source/writer/WordPerfectImportFilter.cxx index 7bbb36f352a7..867ea03a1f94 100644 --- a/writerperfect/source/writer/WordPerfectImportFilter.cxx +++ b/writerperfect/source/writer/WordPerfectImportFilter.cxx @@ -155,7 +155,7 @@ throw (RuntimeException, std::exception) collector.addDocumentHandler(&xHandler, ODF_FLAT_XML); collector.registerEmbeddedObjectHandler("image/x-wpg", &handleEmbeddedWPGObject); collector.registerEmbeddedImageHandler("image/x-wpg", &handleEmbeddedWPGImage); - if (libwpd::WPD_OK == libwpd::WPDocument::parse(&input, &collector, aUtf8Passwd.isEmpty() ? 0 : aUtf8Passwd.getStr())) + if (libwpd::WPD_OK == libwpd::WPDocument::parse(&input, &collector, aUtf8Passwd.isEmpty() ? nullptr : aUtf8Passwd.getStr())) return true; return false; } diff --git a/writerperfect/source/writer/wpftwriter_genericfilter.cxx b/writerperfect/source/writer/wpftwriter_genericfilter.cxx index 3f508c49f40d..68411178d437 100644 --- a/writerperfect/source/writer/wpftwriter_genericfilter.cxx +++ b/writerperfect/source/writer/wpftwriter_genericfilter.cxx @@ -46,34 +46,34 @@ static cppu::ImplementationEntry const services[] = { &AbiWordImportFilter_createInstance, &AbiWordImportFilter_getImplementationName, &AbiWordImportFilter_getSupportedServiceNames, - &cppu::createSingleComponentFactory, 0, 0 + &cppu::createSingleComponentFactory, nullptr, 0 }, { &WordPerfectImportFilter_createInstance, &WordPerfectImportFilter_getImplementationName, &WordPerfectImportFilter_getSupportedServiceNames, - &cppu::createSingleComponentFactory, 0, 0 + &cppu::createSingleComponentFactory, nullptr, 0 }, { &MSWorksImportFilter_createInstance, &MSWorksImportFilter_getImplementationName, &MSWorksImportFilter_getSupportedServiceNames, - &cppu::createSingleComponentFactory, 0, 0 + &cppu::createSingleComponentFactory, nullptr, 0 }, { &MWAWImportFilter_createInstance, &MWAWImportFilter_getImplementationName, &MWAWImportFilter_getSupportedServiceNames, - &cppu::createSingleComponentFactory, 0, 0 + &cppu::createSingleComponentFactory, nullptr, 0 }, { &EBookImportFilter_createInstance, &EBookImportFilter_getImplementationName, &EBookImportFilter_getSupportedServiceNames, - &cppu::createSingleComponentFactory, 0, 0 + &cppu::createSingleComponentFactory, nullptr, 0 }, { &PagesImportFilter_createInstance, &PagesImportFilter_getImplementationName, &PagesImportFilter_getSupportedServiceNames, - &cppu::createSingleComponentFactory, 0, 0 + &cppu::createSingleComponentFactory, nullptr, 0 }, - { 0, 0, 0, 0, 0, 0 } + { nullptr, nullptr, nullptr, nullptr, nullptr, 0 } }; } |