summaryrefslogtreecommitdiff
path: root/sax
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-11-10 10:22:34 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-11-10 10:31:35 +0100
commit60c40af090e420a8619b5236bde1ff4ef79100c6 (patch)
treeec8f50b4325045bec03708e14dcd996631c6c828 /sax
parentde63cac20fba1e7661687a4f1c1ce91182f4dfa0 (diff)
loplugin:nullptr (automatic rewrite)
Change-Id: I54bf272b404d2302cafbde73ec5061ea2cd966ab
Diffstat (limited to 'sax')
-rw-r--r--sax/inc/xml2utf.hxx4
-rw-r--r--sax/qa/cppunit/attributes.cxx2
-rw-r--r--sax/qa/cppunit/test_converter.cxx18
-rw-r--r--sax/source/expatwrap/sax_expat.cxx8
-rw-r--r--sax/source/expatwrap/saxwriter.cxx4
-rw-r--r--sax/source/expatwrap/xml2utf.cxx4
-rw-r--r--sax/source/fastparser/fastparser.cxx34
-rw-r--r--sax/source/tools/converter.cxx18
-rw-r--r--sax/source/tools/fastserializer.cxx4
-rw-r--r--sax/source/tools/fastserializer.hxx4
10 files changed, 50 insertions, 50 deletions
diff --git a/sax/inc/xml2utf.hxx b/sax/inc/xml2utf.hxx
index a2781d5e56cd..76cd10dab85f 100644
--- a/sax/inc/xml2utf.hxx
+++ b/sax/inc/xml2utf.hxx
@@ -82,8 +82,8 @@ class XMLFile2UTFConverter
public:
XMLFile2UTFConverter( ):
m_bStarted( false ),
- m_pText2Unicode( 0 ),
- m_pUnicode2Text( 0 )
+ m_pText2Unicode( nullptr ),
+ m_pUnicode2Text( nullptr )
{}
~XMLFile2UTFConverter();
diff --git a/sax/qa/cppunit/attributes.cxx b/sax/qa/cppunit/attributes.cxx
index c76fd6556bf4..716b7b2c2389 100644
--- a/sax/qa/cppunit/attributes.cxx
+++ b/sax/qa/cppunit/attributes.cxx
@@ -34,7 +34,7 @@ public:
void AttributesTest::test()
{
- uno::Reference<sax_fastparser::FastAttributeList> xAttributeList( new sax_fastparser::FastAttributeList(NULL) );
+ uno::Reference<sax_fastparser::FastAttributeList> xAttributeList( new sax_fastparser::FastAttributeList(nullptr) );
xAttributeList->add(1, "1");
xAttributeList->add(2, OString("2"));
diff --git a/sax/qa/cppunit/test_converter.cxx b/sax/qa/cppunit/test_converter.cxx
index 1e3061e8090f..ecaa92e9c9b1 100644
--- a/sax/qa/cppunit/test_converter.cxx
+++ b/sax/qa/cppunit/test_converter.cxx
@@ -87,7 +87,7 @@ void ConverterTest::tearDown()
}
static void doTest(util::Duration const & rid, char const*const pis,
- char const*const i_pos = 0)
+ char const*const i_pos = nullptr)
{
char const*const pos((i_pos) ? i_pos : pis);
util::Duration od;
@@ -163,18 +163,18 @@ static bool eqDateTime(const util::DateTime& a, const util::DateTime& b) {
}
static void doTest(util::DateTime const & rdt, char const*const pis,
- char const*const i_pos = 0)
+ char const*const i_pos = nullptr)
{
char const*const pos((i_pos) ? i_pos : pis);
OUString is(OUString::createFromAscii(pis));
util::DateTime odt;
SAL_INFO("sax.cppunit","about to convert '" << is << "'");
- bool bSuccess( Converter::parseDateTime(odt, 0, is) );
+ bool bSuccess( Converter::parseDateTime(odt, nullptr, is) );
SAL_INFO("sax.cppunit","Y:" << odt.Year << " M:" << odt.Month << " D:" << odt.Day << " H:" << odt.Hours << " M:" << odt.Minutes << " S:" << odt.Seconds << " nS:" << odt.NanoSeconds << " UTC: " << (bool)odt.IsUTC);
CPPUNIT_ASSERT(bSuccess);
CPPUNIT_ASSERT(eqDateTime(rdt, odt));
OUStringBuffer buf;
- Converter::convertDateTime(buf, odt, 0, true);
+ Converter::convertDateTime(buf, odt, nullptr, true);
SAL_INFO("sax.cppunit","" << buf.toString());
CPPUNIT_ASSERT_EQUAL(OUString::createFromAscii(pos),
buf.makeStringAndClear());
@@ -183,7 +183,7 @@ static void doTest(util::DateTime const & rdt, char const*const pis,
static void doTestDateTimeF(char const*const pis)
{
util::DateTime odt;
- bool bSuccess = Converter::parseDateTime(odt, 0,
+ bool bSuccess = Converter::parseDateTime(odt, nullptr,
OUString::createFromAscii(pis));
SAL_INFO("sax.cppunit","Y:" << odt.Year << " M:" << odt.Month << " D:" << odt.Day << " H:" << odt.Hours << "H M:" << odt.Minutes << " S:" << odt.Seconds << " nS:" << odt.NanoSeconds);
CPPUNIT_ASSERT(!bSuccess);
@@ -258,18 +258,18 @@ void ConverterTest::testDateTime()
}
static void doTestTime(util::DateTime const & rdt, char const*const pis,
- char const*const i_pos = 0)
+ char const*const i_pos = nullptr)
{
char const*const pos((i_pos) ? i_pos : pis);
OUString is(OUString::createFromAscii(pis));
util::DateTime odt;
SAL_INFO("sax.cppunit","about to convert '" << is << "'");
- bool bSuccess( Converter::parseTimeOrDateTime(odt, 0, is) );
+ bool bSuccess( Converter::parseTimeOrDateTime(odt, nullptr, is) );
SAL_INFO("sax.cppunit","Y:" << odt.Year << " M:" << odt.Month << " D:" << odt.Day << " H:" << odt.Hours << " M:" << odt.Minutes << " S:" << odt.Seconds << " nS:" << odt.NanoSeconds << " UTC: " << (bool)odt.IsUTC);
CPPUNIT_ASSERT(bSuccess);
CPPUNIT_ASSERT(eqDateTime(rdt, odt));
OUStringBuffer buf;
- Converter::convertTimeOrDateTime(buf, odt, 0);
+ Converter::convertTimeOrDateTime(buf, odt, nullptr);
SAL_INFO("sax.cppunit","" << buf.toString());
CPPUNIT_ASSERT_EQUAL(OUString::createFromAscii(pos),
buf.makeStringAndClear());
@@ -278,7 +278,7 @@ static void doTestTime(util::DateTime const & rdt, char const*const pis,
static void doTestTimeF(char const*const pis)
{
util::DateTime odt;
- bool bSuccess = Converter::parseTimeOrDateTime(odt, 0,
+ bool bSuccess = Converter::parseTimeOrDateTime(odt, nullptr,
OUString::createFromAscii(pis));
SAL_INFO("sax.cppunit","Y:" << odt.Year << " M:" << odt.Month << " D:" << odt.Day << " H:" << odt.Hours << "H M:" << odt.Minutes << " S:" << odt.Seconds << " nS:" << odt.NanoSeconds);
CPPUNIT_ASSERT_MESSAGE(pis, !bSuccess);
diff --git a/sax/source/expatwrap/sax_expat.cxx b/sax/source/expatwrap/sax_expat.cxx
index 51f72f7b5c64..71bb2575818a 100644
--- a/sax/source/expatwrap/sax_expat.cxx
+++ b/sax/source/expatwrap/sax_expat.cxx
@@ -435,7 +435,7 @@ void SaxExpatParser::parseStream( const InputSource& structSource)
}
// create parser with proper encoding
- entity.pParser = XML_ParserCreate( 0 );
+ entity.pParser = XML_ParserCreate( nullptr );
if( ! entity.pParser )
{
throw SAXException("Couldn't create parser",
@@ -457,7 +457,7 @@ void SaxExpatParser::parseStream( const InputSource& structSource)
XML_SetNotationDeclHandler( entity.pParser, call_callbackNotationDecl );
XML_SetExternalEntityRefHandler( entity.pParser,
call_callbackExternalEntityRef);
- XML_SetUnknownEncodingHandler( entity.pParser, call_callbackUnknownEncoding ,0);
+ XML_SetUnknownEncodingHandler( entity.pParser, call_callbackUnknownEncoding ,nullptr);
if( m_pImpl->rExtendedDocumentHandler.is() ) {
@@ -802,7 +802,7 @@ void SaxExpatParser_Impl::callbackEntityDecl(
XML_StopParser(pImpl->getEntity().pParser, XML_FALSE);
pImpl->exception = SAXParseException(
"SaxExpatParser: internal entity declaration, stopping",
- 0, css::uno::Any(),
+ nullptr, css::uno::Any(),
pImpl->rDocumentLocator->getPublicId(),
pImpl->rDocumentLocator->getSystemId(),
pImpl->rDocumentLocator->getLineNumber(),
@@ -874,7 +874,7 @@ bool SaxExpatParser_Impl::callbackExternalEntityRef(
}
if( entity.structSource.aInputStream.is() ) {
- entity.pParser = XML_ExternalEntityParserCreate( parser , context, 0 );
+ entity.pParser = XML_ExternalEntityParserCreate( parser , context, nullptr );
if( ! entity.pParser )
{
return false;
diff --git a/sax/source/expatwrap/saxwriter.cxx b/sax/source/expatwrap/saxwriter.cxx
index 9c5b94f53301..2c5c56bee475 100644
--- a/sax/source/expatwrap/saxwriter.cxx
+++ b/sax/source/expatwrap/saxwriter.cxx
@@ -109,7 +109,7 @@ public:
explicit SaxWriterHelper(Reference< XOutputStream > m_TempOut)
: m_out(m_TempOut)
, m_Sequence(SEQUENCESIZE)
- , mp_Sequence(NULL)
+ , mp_Sequence(nullptr)
, nLastLineFeedPos(0)
, nCurrentPos(0)
, m_bStartElementFinished(true)
@@ -875,7 +875,7 @@ class SAXWriter :
{
public:
SAXWriter()
- : m_pSaxWriterHelper(NULL)
+ : m_pSaxWriterHelper(nullptr)
, m_bDocStarted(false)
, m_bIsCDATA(false)
, m_bForceLineBreak(false)
diff --git a/sax/source/expatwrap/xml2utf.cxx b/sax/source/expatwrap/xml2utf.cxx
index 64e0c1407e39..68b44f6461cb 100644
--- a/sax/source/expatwrap/xml2utf.cxx
+++ b/sax/source/expatwrap/xml2utf.cxx
@@ -347,8 +347,8 @@ void XMLFile2UTFConverter::initializeDecoding()
Text2UnicodeConverter::Text2UnicodeConverter( const OString &sEncoding )
- : m_convText2Unicode(NULL)
- , m_contextText2Unicode(NULL)
+ : m_convText2Unicode(nullptr)
+ , m_contextText2Unicode(nullptr)
, m_rtlEncoding(RTL_TEXTENCODING_DONTKNOW)
{
rtl_TextEncoding encoding = rtl_getTextEncodingFromMimeCharset( sEncoding.getStr() );
diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx
index b68f6e6f7886..3c353d95bd53 100644
--- a/sax/source/fastparser/fastparser.cxx
+++ b/sax/source/fastparser/fastparser.cxx
@@ -333,7 +333,7 @@ class FastLocatorImpl : public WeakImplHelper< XLocator >
public:
explicit FastLocatorImpl(FastSaxParserImpl *p) : mpParser(p) {}
- void dispose() { mpParser = 0; }
+ void dispose() { mpParser = nullptr; }
void checkDispose() throw (RuntimeException) { if( !mpParser ) throw DisposedException(); }
//XLocator
@@ -371,7 +371,7 @@ OUString SAL_CALL FastLocatorImpl::getSystemId() throw (RuntimeException, std::e
}
ParserData::ParserData()
- : mpTokenHandler( NULL )
+ : mpTokenHandler( nullptr )
{}
ParserData::~ParserData()
@@ -380,16 +380,16 @@ ParserData::~ParserData()
Entity::Entity(const ParserData& rData)
: ParserData(rData)
, mnProducedEventsSize(0)
- , mpProducedEvents(NULL)
+ , mpProducedEvents(nullptr)
, mbEnableThreads(false)
- , mpParser(NULL)
+ , mpParser(nullptr)
{
}
Entity::Entity(const Entity& e)
: ParserData(e)
, mnProducedEventsSize(0)
- , mpProducedEvents(NULL)
+ , mpProducedEvents(nullptr)
, mbEnableThreads(e.mbEnableThreads)
, maStructSource(e.maStructSource)
, mpParser(e.mpParser)
@@ -413,7 +413,7 @@ void Entity::startElement( Event *pEvent )
const OUString& aElementName = pEvent->msElementName;
// Use un-wrapped pointers to avoid significant acquire/release overhead
- XFastContextHandler *pParentContext = NULL;
+ XFastContextHandler *pParentContext = nullptr;
if( !maContextStack.empty() )
{
pParentContext = maContextStack.top().mxContext.get();
@@ -454,7 +454,7 @@ void Entity::startElement( Event *pEvent )
}
// swap the reference we own in to avoid referencing thrash.
maContextStack.top().mxContext.set( static_cast<XFastContextHandler *>( xContext.get() ) );
- xContext.set( NULL, UNO_REF_NO_ACQUIRE );
+ xContext.set( nullptr, UNO_REF_NO_ACQUIRE );
}
catch (const Exception&)
{
@@ -610,7 +610,7 @@ FastSaxParserImpl::FastSaxParserImpl( FastSaxParser* ) :
#if 0
mpFront(pFront),
#endif
- mpTop(NULL)
+ mpTop(nullptr)
{
mxDocumentLocator.set( new FastLocatorImpl( this ) );
}
@@ -902,7 +902,7 @@ void FastSaxParserImpl::produce( bool bForceFlush )
}
rEntity.maPendingEvents.push(rEntity.mpProducedEvents);
- rEntity.mpProducedEvents = 0;
+ rEntity.mpProducedEvents = nullptr;
aGuard.clear(); // unlock
@@ -970,7 +970,7 @@ void FastSaxParserImpl::pushEntity( const Entity& rEntity )
void FastSaxParserImpl::popEntity()
{
maEntities.pop();
- mpTop = !maEntities.empty() ? &maEntities.top() : NULL;
+ mpTop = !maEntities.empty() ? &maEntities.top() : nullptr;
}
// starts parsing with actual parser !
@@ -997,7 +997,7 @@ void FastSaxParserImpl::parse()
nRead = rEntity.maConverter.readAndConvert( seqOut, BUFFER_SIZE );
if( nRead <= 0 )
{
- if( rEntity.mpParser != NULL )
+ if( rEntity.mpParser != nullptr )
{
if( xmlParseChunk( rEntity.mpParser, reinterpret_cast<const char*>(seqOut.getConstArray()), 0, 1 ) != XML_ERR_OK )
rEntity.throwException( mxDocumentLocator, true );
@@ -1006,11 +1006,11 @@ void FastSaxParserImpl::parse()
}
bool bContinue = true;
- if( rEntity.mpParser == NULL )
+ if( rEntity.mpParser == nullptr )
{
// create parser with proper encoding (needs the first chunk of data)
rEntity.mpParser = xmlCreatePushParserCtxt( &callbacks, this,
- reinterpret_cast<const char*>(seqOut.getConstArray()), nRead, NULL );
+ reinterpret_cast<const char*>(seqOut.getConstArray()), nRead, nullptr );
if( !rEntity.mpParser )
throw SAXException("Couldn't create parser", Reference< XInterface >(), Any() );
@@ -1075,7 +1075,7 @@ void FastSaxParserImpl::callbackStartElement(const xmlChar *localName , const xm
for (int i = 0; i < numNamespaces * 2; i += 2)
{
// namespaces[] is (prefix/URI)
- if( namespaces[ i ] != NULL )
+ if( namespaces[ i ] != nullptr )
{
DefineNamespace( OString( XML_CAST( namespaces[ i ] )),
OUString( XML_CAST( namespaces[ i + 1 ] ), strlen( XML_CAST( namespaces[ i + 1 ] )), RTL_TEXTENCODING_UTF8 ));
@@ -1091,7 +1091,7 @@ void FastSaxParserImpl::callbackStartElement(const xmlChar *localName , const xm
// #158414# second: fill attribute list with other attributes
for (int i = 0; i < numAttributes * 5; i += 5)
{
- if( attributes[ i + 1 ] != NULL )
+ if( attributes[ i + 1 ] != nullptr )
{
sal_Int32 nAttributeToken = GetTokenWithPrefix( attributes[ i + 1 ], strlen( XML_CAST( attributes[ i + 1 ] )), attributes[ i ], strlen( XML_CAST( attributes[ i ] )));
if( nAttributeToken != FastToken::DONTKNOW )
@@ -1111,7 +1111,7 @@ void FastSaxParserImpl::callbackStartElement(const xmlChar *localName , const xm
}
}
- if( prefix != NULL )
+ if( prefix != nullptr )
rEvent.mnElementToken = GetTokenWithPrefix( prefix, strlen( XML_CAST( prefix )), localName, strlen( XML_CAST( localName )));
else if( !rEvent.msNamespace.isEmpty() )
rEvent.mnElementToken = GetTokenWithContextNamespace( nNamespaceToken, localName, strlen( XML_CAST( localName )));
@@ -1120,7 +1120,7 @@ void FastSaxParserImpl::callbackStartElement(const xmlChar *localName , const xm
if( rEvent.mnElementToken == FastToken::DONTKNOW )
{
- if( prefix != NULL )
+ if( prefix != nullptr )
{
rEvent.msNamespace = OUString( XML_CAST( URI ), strlen( XML_CAST( URI )), RTL_TEXTENCODING_UTF8 );
nNamespaceToken = GetNamespaceToken( rEvent.msNamespace );
diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx
index 911da6ff79f7..b4eb276813ee 100644
--- a/sax/source/tools/converter.cxx
+++ b/sax/source/tools/converter.cxx
@@ -126,8 +126,8 @@ bool Converter::convertMeasure( sal_Int32& rValue,
{
OSL_ENSURE( MeasureUnit::TWIP == nTargetUnit || MeasureUnit::POINT == nTargetUnit ||
MeasureUnit::MM_100TH == nTargetUnit || MeasureUnit::MM_10TH == nTargetUnit, "unit is not supported");
- const sal_Char *aCmpsL[2] = { 0, 0 };
- const sal_Char *aCmpsU[2] = { 0, 0 };
+ const sal_Char *aCmpsL[2] = { nullptr, nullptr };
+ const sal_Char *aCmpsU[2] = { nullptr, nullptr };
double aScales[2] = { 1., 1. };
if( MeasureUnit::TWIP == nTargetUnit )
@@ -209,7 +209,7 @@ bool Converter::convertMeasure( sal_Int32& rValue,
}
}
- if( aCmpsL[0] == NULL )
+ if( aCmpsL[0] == nullptr )
return false;
double nScale = 0.;
@@ -286,7 +286,7 @@ void Converter::convertMeasure( OUStringBuffer& rBuffer,
long nMul = 1000;
long nDiv = 1;
long nFac = 100;
- const sal_Char* psUnit = 0;
+ const sal_Char* psUnit = nullptr;
switch( nSourceUnit )
{
case MeasureUnit::TWIP:
@@ -1409,7 +1409,7 @@ bool Converter::parseDateTime( util::DateTime& rDateTime,
const OUString& rString )
{
bool isDateTime;
- return parseDateOrDateTime(0, rDateTime, isDateTime, pTimeZoneOffset,
+ return parseDateOrDateTime(nullptr, rDateTime, isDateTime, pTimeZoneOffset,
rString);
}
@@ -1864,7 +1864,7 @@ bool Converter::parseTimeOrDateTime(
{
bool dummy;
return lcl_parseDateTime(
- 0, rDateTime, dummy, pTimeZoneOffset, rString, true);
+ nullptr, rDateTime, dummy, pTimeZoneOffset, rString, true);
}
/** convert ISO "date" or "dateTime" string to util::DateTime or util::Date */
@@ -2094,7 +2094,7 @@ double Converter::GetConversionFactor(OUStringBuffer& rUnit, sal_Int16 nSourceUn
if(nSourceUnit != nTargetUnit)
{
- const sal_Char* psUnit = 0;
+ const sal_Char* psUnit = nullptr;
switch(nSourceUnit)
{
@@ -2610,7 +2610,7 @@ bool Converter::convertAny(OUStringBuffer& rsValue,
aTempValue.Seconds = 0;
aTempValue.Minutes = 0;
aTempValue.Hours = 0;
- ::sax::Converter::convertDateTime(rsValue, aTempValue, 0);
+ ::sax::Converter::convertDateTime(rsValue, aTempValue, nullptr);
}
else
if (rValue >>= aTime)
@@ -2632,7 +2632,7 @@ bool Converter::convertAny(OUStringBuffer& rsValue,
{
rsType.append("date");
bConverted = true;
- ::sax::Converter::convertDateTime(rsValue, aDateTime, 0);
+ ::sax::Converter::convertDateTime(rsValue, aDateTime, nullptr);
}
}
break;
diff --git a/sax/source/tools/fastserializer.cxx b/sax/source/tools/fastserializer.cxx
index 56d2fe82b1b6..37ed847c6066 100644
--- a/sax/source/tools/fastserializer.cxx
+++ b/sax/source/tools/fastserializer.cxx
@@ -59,7 +59,7 @@ namespace sax_fastparser {
: maCachedOutputStream()
, maMarkStack()
, mbMarkStackEmpty(true)
- , mpDoubleStr(NULL)
+ , mpDoubleStr(nullptr)
, mnDoubleStrCapacity(RTL_STR_MAX_VALUEOFDOUBLE)
{
rtl_string_new_WithLength(&mpDoubleStr, mnDoubleStrCapacity);
@@ -83,7 +83,7 @@ namespace sax_fastparser {
{
rtl_math_doubleToString(
&mpDoubleStr, &mnDoubleStrCapacity, 0, value, rtl_math_StringFormat_G,
- RTL_STR_MAX_VALUEOFDOUBLE - RTL_CONSTASCII_LENGTH("-x.E-xxx"), '.', 0,
+ RTL_STR_MAX_VALUEOFDOUBLE - RTL_CONSTASCII_LENGTH("-x.E-xxx"), '.', nullptr,
0, sal_True);
write(mpDoubleStr->buffer, mpDoubleStr->length);
diff --git a/sax/source/tools/fastserializer.hxx b/sax/source/tools/fastserializer.hxx
index 7a56524c0f22..e73b4021d1cf 100644
--- a/sax/source/tools/fastserializer.hxx
+++ b/sax/source/tools/fastserializer.hxx
@@ -80,7 +80,7 @@ public:
from the element.
*/
- void startFastElement( ::sal_Int32 Element, FastAttributeList* pAttrList = NULL );
+ void startFastElement( ::sal_Int32 Element, FastAttributeList* pAttrList = nullptr );
/** receives notification of the end of an known element.
@see startFastElement
@@ -104,7 +104,7 @@ public:
from the element.
*/
- void singleFastElement( ::sal_Int32 Element, FastAttributeList* pAttrList = NULL );
+ void singleFastElement( ::sal_Int32 Element, FastAttributeList* pAttrList = nullptr );
// C++ helpers
void writeId( ::sal_Int32 Element );