Kaydet (Commit) 60c40af0 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

loplugin:nullptr (automatic rewrite)

Change-Id: I54bf272b404d2302cafbde73ec5061ea2cd966ab
üst de63cac2
...@@ -75,7 +75,7 @@ class SAX_DLLPUBLIC FastAttributeList : public ::cppu::WeakImplHelper1< css::xml ...@@ -75,7 +75,7 @@ class SAX_DLLPUBLIC FastAttributeList : public ::cppu::WeakImplHelper1< css::xml
{ {
public: public:
FastAttributeList( const css::uno::Reference< css::xml::sax::XFastTokenHandler >& xTokenHandler, FastAttributeList( const css::uno::Reference< css::xml::sax::XFastTokenHandler >& xTokenHandler,
FastTokenHandlerBase *pOptHandlerBase = NULL ); FastTokenHandlerBase *pOptHandlerBase = nullptr );
virtual ~FastAttributeList(); virtual ~FastAttributeList();
void clear(); void clear();
......
...@@ -82,7 +82,7 @@ namespace sax ...@@ -82,7 +82,7 @@ namespace sax
} }
DocumentHandlerAdapter(const css::uno::Reference< css::xml::sax::XDocumentHandler >& delegate); DocumentHandlerAdapter(const css::uno::Reference< css::xml::sax::XDocumentHandler >& delegate);
DocumentHandlerAdapter() : DocumentHandlerAdapter() :
m_handler(css::uno::Reference< css::xml::sax::XDocumentHandler > (0, css::uno::UNO_QUERY)) m_handler(css::uno::Reference< css::xml::sax::XDocumentHandler > (nullptr, css::uno::UNO_QUERY))
{ {
} }
; ;
...@@ -201,7 +201,7 @@ namespace sax ...@@ -201,7 +201,7 @@ namespace sax
} }
protected: protected:
ExtendedDocumentHandlerAdapter() : ExtendedDocumentHandlerAdapter() :
m_handler(css::uno::Reference< css::xml::sax::XExtendedDocumentHandler > (0, css::uno::UNO_QUERY)) m_handler(css::uno::Reference< css::xml::sax::XExtendedDocumentHandler > (nullptr, css::uno::UNO_QUERY))
{ {
} }
ExtendedDocumentHandlerAdapter( ExtendedDocumentHandlerAdapter(
......
...@@ -82,8 +82,8 @@ class XMLFile2UTFConverter ...@@ -82,8 +82,8 @@ class XMLFile2UTFConverter
public: public:
XMLFile2UTFConverter( ): XMLFile2UTFConverter( ):
m_bStarted( false ), m_bStarted( false ),
m_pText2Unicode( 0 ), m_pText2Unicode( nullptr ),
m_pUnicode2Text( 0 ) m_pUnicode2Text( nullptr )
{} {}
~XMLFile2UTFConverter(); ~XMLFile2UTFConverter();
......
...@@ -34,7 +34,7 @@ public: ...@@ -34,7 +34,7 @@ public:
void AttributesTest::test() 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(1, "1");
xAttributeList->add(2, OString("2")); xAttributeList->add(2, OString("2"));
......
...@@ -87,7 +87,7 @@ void ConverterTest::tearDown() ...@@ -87,7 +87,7 @@ void ConverterTest::tearDown()
} }
static void doTest(util::Duration const & rid, char const*const pis, 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); char const*const pos((i_pos) ? i_pos : pis);
util::Duration od; util::Duration od;
...@@ -163,18 +163,18 @@ static bool eqDateTime(const util::DateTime& a, const util::DateTime& b) { ...@@ -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, 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); char const*const pos((i_pos) ? i_pos : pis);
OUString is(OUString::createFromAscii(pis)); OUString is(OUString::createFromAscii(pis));
util::DateTime odt; util::DateTime odt;
SAL_INFO("sax.cppunit","about to convert '" << is << "'"); 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); 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(bSuccess);
CPPUNIT_ASSERT(eqDateTime(rdt, odt)); CPPUNIT_ASSERT(eqDateTime(rdt, odt));
OUStringBuffer buf; OUStringBuffer buf;
Converter::convertDateTime(buf, odt, 0, true); Converter::convertDateTime(buf, odt, nullptr, true);
SAL_INFO("sax.cppunit","" << buf.toString()); SAL_INFO("sax.cppunit","" << buf.toString());
CPPUNIT_ASSERT_EQUAL(OUString::createFromAscii(pos), CPPUNIT_ASSERT_EQUAL(OUString::createFromAscii(pos),
buf.makeStringAndClear()); buf.makeStringAndClear());
...@@ -183,7 +183,7 @@ static void doTest(util::DateTime const & rdt, char const*const pis, ...@@ -183,7 +183,7 @@ static void doTest(util::DateTime const & rdt, char const*const pis,
static void doTestDateTimeF(char const*const pis) static void doTestDateTimeF(char const*const pis)
{ {
util::DateTime odt; util::DateTime odt;
bool bSuccess = Converter::parseDateTime(odt, 0, bool bSuccess = Converter::parseDateTime(odt, nullptr,
OUString::createFromAscii(pis)); 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); 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); CPPUNIT_ASSERT(!bSuccess);
...@@ -258,18 +258,18 @@ void ConverterTest::testDateTime() ...@@ -258,18 +258,18 @@ void ConverterTest::testDateTime()
} }
static void doTestTime(util::DateTime const & rdt, char const*const pis, 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); char const*const pos((i_pos) ? i_pos : pis);
OUString is(OUString::createFromAscii(pis)); OUString is(OUString::createFromAscii(pis));
util::DateTime odt; util::DateTime odt;
SAL_INFO("sax.cppunit","about to convert '" << is << "'"); 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); 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(bSuccess);
CPPUNIT_ASSERT(eqDateTime(rdt, odt)); CPPUNIT_ASSERT(eqDateTime(rdt, odt));
OUStringBuffer buf; OUStringBuffer buf;
Converter::convertTimeOrDateTime(buf, odt, 0); Converter::convertTimeOrDateTime(buf, odt, nullptr);
SAL_INFO("sax.cppunit","" << buf.toString()); SAL_INFO("sax.cppunit","" << buf.toString());
CPPUNIT_ASSERT_EQUAL(OUString::createFromAscii(pos), CPPUNIT_ASSERT_EQUAL(OUString::createFromAscii(pos),
buf.makeStringAndClear()); buf.makeStringAndClear());
...@@ -278,7 +278,7 @@ static void doTestTime(util::DateTime const & rdt, char const*const pis, ...@@ -278,7 +278,7 @@ static void doTestTime(util::DateTime const & rdt, char const*const pis,
static void doTestTimeF(char const*const pis) static void doTestTimeF(char const*const pis)
{ {
util::DateTime odt; util::DateTime odt;
bool bSuccess = Converter::parseTimeOrDateTime(odt, 0, bool bSuccess = Converter::parseTimeOrDateTime(odt, nullptr,
OUString::createFromAscii(pis)); 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); 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); CPPUNIT_ASSERT_MESSAGE(pis, !bSuccess);
......
...@@ -435,7 +435,7 @@ void SaxExpatParser::parseStream( const InputSource& structSource) ...@@ -435,7 +435,7 @@ void SaxExpatParser::parseStream( const InputSource& structSource)
} }
// create parser with proper encoding // create parser with proper encoding
entity.pParser = XML_ParserCreate( 0 ); entity.pParser = XML_ParserCreate( nullptr );
if( ! entity.pParser ) if( ! entity.pParser )
{ {
throw SAXException("Couldn't create parser", throw SAXException("Couldn't create parser",
...@@ -457,7 +457,7 @@ void SaxExpatParser::parseStream( const InputSource& structSource) ...@@ -457,7 +457,7 @@ void SaxExpatParser::parseStream( const InputSource& structSource)
XML_SetNotationDeclHandler( entity.pParser, call_callbackNotationDecl ); XML_SetNotationDeclHandler( entity.pParser, call_callbackNotationDecl );
XML_SetExternalEntityRefHandler( entity.pParser, XML_SetExternalEntityRefHandler( entity.pParser,
call_callbackExternalEntityRef); call_callbackExternalEntityRef);
XML_SetUnknownEncodingHandler( entity.pParser, call_callbackUnknownEncoding ,0); XML_SetUnknownEncodingHandler( entity.pParser, call_callbackUnknownEncoding ,nullptr);
if( m_pImpl->rExtendedDocumentHandler.is() ) { if( m_pImpl->rExtendedDocumentHandler.is() ) {
...@@ -802,7 +802,7 @@ void SaxExpatParser_Impl::callbackEntityDecl( ...@@ -802,7 +802,7 @@ void SaxExpatParser_Impl::callbackEntityDecl(
XML_StopParser(pImpl->getEntity().pParser, XML_FALSE); XML_StopParser(pImpl->getEntity().pParser, XML_FALSE);
pImpl->exception = SAXParseException( pImpl->exception = SAXParseException(
"SaxExpatParser: internal entity declaration, stopping", "SaxExpatParser: internal entity declaration, stopping",
0, css::uno::Any(), nullptr, css::uno::Any(),
pImpl->rDocumentLocator->getPublicId(), pImpl->rDocumentLocator->getPublicId(),
pImpl->rDocumentLocator->getSystemId(), pImpl->rDocumentLocator->getSystemId(),
pImpl->rDocumentLocator->getLineNumber(), pImpl->rDocumentLocator->getLineNumber(),
...@@ -874,7 +874,7 @@ bool SaxExpatParser_Impl::callbackExternalEntityRef( ...@@ -874,7 +874,7 @@ bool SaxExpatParser_Impl::callbackExternalEntityRef(
} }
if( entity.structSource.aInputStream.is() ) { if( entity.structSource.aInputStream.is() ) {
entity.pParser = XML_ExternalEntityParserCreate( parser , context, 0 ); entity.pParser = XML_ExternalEntityParserCreate( parser , context, nullptr );
if( ! entity.pParser ) if( ! entity.pParser )
{ {
return false; return false;
......
...@@ -109,7 +109,7 @@ public: ...@@ -109,7 +109,7 @@ public:
explicit SaxWriterHelper(Reference< XOutputStream > m_TempOut) explicit SaxWriterHelper(Reference< XOutputStream > m_TempOut)
: m_out(m_TempOut) : m_out(m_TempOut)
, m_Sequence(SEQUENCESIZE) , m_Sequence(SEQUENCESIZE)
, mp_Sequence(NULL) , mp_Sequence(nullptr)
, nLastLineFeedPos(0) , nLastLineFeedPos(0)
, nCurrentPos(0) , nCurrentPos(0)
, m_bStartElementFinished(true) , m_bStartElementFinished(true)
...@@ -875,7 +875,7 @@ class SAXWriter : ...@@ -875,7 +875,7 @@ class SAXWriter :
{ {
public: public:
SAXWriter() SAXWriter()
: m_pSaxWriterHelper(NULL) : m_pSaxWriterHelper(nullptr)
, m_bDocStarted(false) , m_bDocStarted(false)
, m_bIsCDATA(false) , m_bIsCDATA(false)
, m_bForceLineBreak(false) , m_bForceLineBreak(false)
......
...@@ -347,8 +347,8 @@ void XMLFile2UTFConverter::initializeDecoding() ...@@ -347,8 +347,8 @@ void XMLFile2UTFConverter::initializeDecoding()
Text2UnicodeConverter::Text2UnicodeConverter( const OString &sEncoding ) Text2UnicodeConverter::Text2UnicodeConverter( const OString &sEncoding )
: m_convText2Unicode(NULL) : m_convText2Unicode(nullptr)
, m_contextText2Unicode(NULL) , m_contextText2Unicode(nullptr)
, m_rtlEncoding(RTL_TEXTENCODING_DONTKNOW) , m_rtlEncoding(RTL_TEXTENCODING_DONTKNOW)
{ {
rtl_TextEncoding encoding = rtl_getTextEncodingFromMimeCharset( sEncoding.getStr() ); rtl_TextEncoding encoding = rtl_getTextEncodingFromMimeCharset( sEncoding.getStr() );
......
...@@ -333,7 +333,7 @@ class FastLocatorImpl : public WeakImplHelper< XLocator > ...@@ -333,7 +333,7 @@ class FastLocatorImpl : public WeakImplHelper< XLocator >
public: public:
explicit FastLocatorImpl(FastSaxParserImpl *p) : mpParser(p) {} explicit FastLocatorImpl(FastSaxParserImpl *p) : mpParser(p) {}
void dispose() { mpParser = 0; } void dispose() { mpParser = nullptr; }
void checkDispose() throw (RuntimeException) { if( !mpParser ) throw DisposedException(); } void checkDispose() throw (RuntimeException) { if( !mpParser ) throw DisposedException(); }
//XLocator //XLocator
...@@ -371,7 +371,7 @@ OUString SAL_CALL FastLocatorImpl::getSystemId() throw (RuntimeException, std::e ...@@ -371,7 +371,7 @@ OUString SAL_CALL FastLocatorImpl::getSystemId() throw (RuntimeException, std::e
} }
ParserData::ParserData() ParserData::ParserData()
: mpTokenHandler( NULL ) : mpTokenHandler( nullptr )
{} {}
ParserData::~ParserData() ParserData::~ParserData()
...@@ -380,16 +380,16 @@ ParserData::~ParserData() ...@@ -380,16 +380,16 @@ ParserData::~ParserData()
Entity::Entity(const ParserData& rData) Entity::Entity(const ParserData& rData)
: ParserData(rData) : ParserData(rData)
, mnProducedEventsSize(0) , mnProducedEventsSize(0)
, mpProducedEvents(NULL) , mpProducedEvents(nullptr)
, mbEnableThreads(false) , mbEnableThreads(false)
, mpParser(NULL) , mpParser(nullptr)
{ {
} }
Entity::Entity(const Entity& e) Entity::Entity(const Entity& e)
: ParserData(e) : ParserData(e)
, mnProducedEventsSize(0) , mnProducedEventsSize(0)
, mpProducedEvents(NULL) , mpProducedEvents(nullptr)
, mbEnableThreads(e.mbEnableThreads) , mbEnableThreads(e.mbEnableThreads)
, maStructSource(e.maStructSource) , maStructSource(e.maStructSource)
, mpParser(e.mpParser) , mpParser(e.mpParser)
...@@ -413,7 +413,7 @@ void Entity::startElement( Event *pEvent ) ...@@ -413,7 +413,7 @@ void Entity::startElement( Event *pEvent )
const OUString& aElementName = pEvent->msElementName; const OUString& aElementName = pEvent->msElementName;
// Use un-wrapped pointers to avoid significant acquire/release overhead // Use un-wrapped pointers to avoid significant acquire/release overhead
XFastContextHandler *pParentContext = NULL; XFastContextHandler *pParentContext = nullptr;
if( !maContextStack.empty() ) if( !maContextStack.empty() )
{ {
pParentContext = maContextStack.top().mxContext.get(); pParentContext = maContextStack.top().mxContext.get();
...@@ -454,7 +454,7 @@ void Entity::startElement( Event *pEvent ) ...@@ -454,7 +454,7 @@ void Entity::startElement( Event *pEvent )
} }
// swap the reference we own in to avoid referencing thrash. // swap the reference we own in to avoid referencing thrash.
maContextStack.top().mxContext.set( static_cast<XFastContextHandler *>( xContext.get() ) ); 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&) catch (const Exception&)
{ {
...@@ -610,7 +610,7 @@ FastSaxParserImpl::FastSaxParserImpl( FastSaxParser* ) : ...@@ -610,7 +610,7 @@ FastSaxParserImpl::FastSaxParserImpl( FastSaxParser* ) :
#if 0 #if 0
mpFront(pFront), mpFront(pFront),
#endif #endif
mpTop(NULL) mpTop(nullptr)
{ {
mxDocumentLocator.set( new FastLocatorImpl( this ) ); mxDocumentLocator.set( new FastLocatorImpl( this ) );
} }
...@@ -902,7 +902,7 @@ void FastSaxParserImpl::produce( bool bForceFlush ) ...@@ -902,7 +902,7 @@ void FastSaxParserImpl::produce( bool bForceFlush )
} }
rEntity.maPendingEvents.push(rEntity.mpProducedEvents); rEntity.maPendingEvents.push(rEntity.mpProducedEvents);
rEntity.mpProducedEvents = 0; rEntity.mpProducedEvents = nullptr;
aGuard.clear(); // unlock aGuard.clear(); // unlock
...@@ -970,7 +970,7 @@ void FastSaxParserImpl::pushEntity( const Entity& rEntity ) ...@@ -970,7 +970,7 @@ void FastSaxParserImpl::pushEntity( const Entity& rEntity )
void FastSaxParserImpl::popEntity() void FastSaxParserImpl::popEntity()
{ {
maEntities.pop(); maEntities.pop();
mpTop = !maEntities.empty() ? &maEntities.top() : NULL; mpTop = !maEntities.empty() ? &maEntities.top() : nullptr;
} }
// starts parsing with actual parser ! // starts parsing with actual parser !
...@@ -997,7 +997,7 @@ void FastSaxParserImpl::parse() ...@@ -997,7 +997,7 @@ void FastSaxParserImpl::parse()
nRead = rEntity.maConverter.readAndConvert( seqOut, BUFFER_SIZE ); nRead = rEntity.maConverter.readAndConvert( seqOut, BUFFER_SIZE );
if( nRead <= 0 ) 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 ) if( xmlParseChunk( rEntity.mpParser, reinterpret_cast<const char*>(seqOut.getConstArray()), 0, 1 ) != XML_ERR_OK )
rEntity.throwException( mxDocumentLocator, true ); rEntity.throwException( mxDocumentLocator, true );
...@@ -1006,11 +1006,11 @@ void FastSaxParserImpl::parse() ...@@ -1006,11 +1006,11 @@ void FastSaxParserImpl::parse()
} }
bool bContinue = true; bool bContinue = true;
if( rEntity.mpParser == NULL ) if( rEntity.mpParser == nullptr )
{ {
// create parser with proper encoding (needs the first chunk of data) // create parser with proper encoding (needs the first chunk of data)
rEntity.mpParser = xmlCreatePushParserCtxt( &callbacks, this, rEntity.mpParser = xmlCreatePushParserCtxt( &callbacks, this,
reinterpret_cast<const char*>(seqOut.getConstArray()), nRead, NULL ); reinterpret_cast<const char*>(seqOut.getConstArray()), nRead, nullptr );
if( !rEntity.mpParser ) if( !rEntity.mpParser )
throw SAXException("Couldn't create parser", Reference< XInterface >(), Any() ); throw SAXException("Couldn't create parser", Reference< XInterface >(), Any() );
...@@ -1075,7 +1075,7 @@ void FastSaxParserImpl::callbackStartElement(const xmlChar *localName , const xm ...@@ -1075,7 +1075,7 @@ void FastSaxParserImpl::callbackStartElement(const xmlChar *localName , const xm
for (int i = 0; i < numNamespaces * 2; i += 2) for (int i = 0; i < numNamespaces * 2; i += 2)
{ {
// namespaces[] is (prefix/URI) // namespaces[] is (prefix/URI)
if( namespaces[ i ] != NULL ) if( namespaces[ i ] != nullptr )
{ {
DefineNamespace( OString( XML_CAST( namespaces[ i ] )), DefineNamespace( OString( XML_CAST( namespaces[ i ] )),
OUString( XML_CAST( namespaces[ i + 1 ] ), strlen( XML_CAST( namespaces[ i + 1 ] )), RTL_TEXTENCODING_UTF8 )); 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 ...@@ -1091,7 +1091,7 @@ void FastSaxParserImpl::callbackStartElement(const xmlChar *localName , const xm
// #158414# second: fill attribute list with other attributes // #158414# second: fill attribute list with other attributes
for (int i = 0; i < numAttributes * 5; i += 5) 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 ] ))); sal_Int32 nAttributeToken = GetTokenWithPrefix( attributes[ i + 1 ], strlen( XML_CAST( attributes[ i + 1 ] )), attributes[ i ], strlen( XML_CAST( attributes[ i ] )));
if( nAttributeToken != FastToken::DONTKNOW ) if( nAttributeToken != FastToken::DONTKNOW )
...@@ -1111,7 +1111,7 @@ void FastSaxParserImpl::callbackStartElement(const xmlChar *localName , const xm ...@@ -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 ))); rEvent.mnElementToken = GetTokenWithPrefix( prefix, strlen( XML_CAST( prefix )), localName, strlen( XML_CAST( localName )));
else if( !rEvent.msNamespace.isEmpty() ) else if( !rEvent.msNamespace.isEmpty() )
rEvent.mnElementToken = GetTokenWithContextNamespace( nNamespaceToken, localName, strlen( XML_CAST( localName ))); rEvent.mnElementToken = GetTokenWithContextNamespace( nNamespaceToken, localName, strlen( XML_CAST( localName )));
...@@ -1120,7 +1120,7 @@ void FastSaxParserImpl::callbackStartElement(const xmlChar *localName , const xm ...@@ -1120,7 +1120,7 @@ void FastSaxParserImpl::callbackStartElement(const xmlChar *localName , const xm
if( rEvent.mnElementToken == FastToken::DONTKNOW ) if( rEvent.mnElementToken == FastToken::DONTKNOW )
{ {
if( prefix != NULL ) if( prefix != nullptr )
{ {
rEvent.msNamespace = OUString( XML_CAST( URI ), strlen( XML_CAST( URI )), RTL_TEXTENCODING_UTF8 ); rEvent.msNamespace = OUString( XML_CAST( URI ), strlen( XML_CAST( URI )), RTL_TEXTENCODING_UTF8 );
nNamespaceToken = GetNamespaceToken( rEvent.msNamespace ); nNamespaceToken = GetNamespaceToken( rEvent.msNamespace );
......
...@@ -126,8 +126,8 @@ bool Converter::convertMeasure( sal_Int32& rValue, ...@@ -126,8 +126,8 @@ bool Converter::convertMeasure( sal_Int32& rValue,
{ {
OSL_ENSURE( MeasureUnit::TWIP == nTargetUnit || MeasureUnit::POINT == nTargetUnit || OSL_ENSURE( MeasureUnit::TWIP == nTargetUnit || MeasureUnit::POINT == nTargetUnit ||
MeasureUnit::MM_100TH == nTargetUnit || MeasureUnit::MM_10TH == nTargetUnit, "unit is not supported"); MeasureUnit::MM_100TH == nTargetUnit || MeasureUnit::MM_10TH == nTargetUnit, "unit is not supported");
const sal_Char *aCmpsL[2] = { 0, 0 }; const sal_Char *aCmpsL[2] = { nullptr, nullptr };
const sal_Char *aCmpsU[2] = { 0, 0 }; const sal_Char *aCmpsU[2] = { nullptr, nullptr };
double aScales[2] = { 1., 1. }; double aScales[2] = { 1., 1. };
if( MeasureUnit::TWIP == nTargetUnit ) if( MeasureUnit::TWIP == nTargetUnit )
...@@ -209,7 +209,7 @@ bool Converter::convertMeasure( sal_Int32& rValue, ...@@ -209,7 +209,7 @@ bool Converter::convertMeasure( sal_Int32& rValue,
} }
} }
if( aCmpsL[0] == NULL ) if( aCmpsL[0] == nullptr )
return false; return false;
double nScale = 0.; double nScale = 0.;
...@@ -286,7 +286,7 @@ void Converter::convertMeasure( OUStringBuffer& rBuffer, ...@@ -286,7 +286,7 @@ void Converter::convertMeasure( OUStringBuffer& rBuffer,
long nMul = 1000; long nMul = 1000;
long nDiv = 1; long nDiv = 1;
long nFac = 100; long nFac = 100;
const sal_Char* psUnit = 0; const sal_Char* psUnit = nullptr;
switch( nSourceUnit ) switch( nSourceUnit )
{ {
case MeasureUnit::TWIP: case MeasureUnit::TWIP:
...@@ -1409,7 +1409,7 @@ bool Converter::parseDateTime( util::DateTime& rDateTime, ...@@ -1409,7 +1409,7 @@ bool Converter::parseDateTime( util::DateTime& rDateTime,
const OUString& rString ) const OUString& rString )
{ {
bool isDateTime; bool isDateTime;
return parseDateOrDateTime(0, rDateTime, isDateTime, pTimeZoneOffset, return parseDateOrDateTime(nullptr, rDateTime, isDateTime, pTimeZoneOffset,
rString); rString);
} }
...@@ -1864,7 +1864,7 @@ bool Converter::parseTimeOrDateTime( ...@@ -1864,7 +1864,7 @@ bool Converter::parseTimeOrDateTime(
{ {
bool dummy; bool dummy;
return lcl_parseDateTime( 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 */ /** convert ISO "date" or "dateTime" string to util::DateTime or util::Date */
...@@ -2094,7 +2094,7 @@ double Converter::GetConversionFactor(OUStringBuffer& rUnit, sal_Int16 nSourceUn ...@@ -2094,7 +2094,7 @@ double Converter::GetConversionFactor(OUStringBuffer& rUnit, sal_Int16 nSourceUn
if(nSourceUnit != nTargetUnit) if(nSourceUnit != nTargetUnit)
{ {
const sal_Char* psUnit = 0; const sal_Char* psUnit = nullptr;
switch(nSourceUnit) switch(nSourceUnit)
{ {
...@@ -2610,7 +2610,7 @@ bool Converter::convertAny(OUStringBuffer& rsValue, ...@@ -2610,7 +2610,7 @@ bool Converter::convertAny(OUStringBuffer& rsValue,
aTempValue.Seconds = 0; aTempValue.Seconds = 0;
aTempValue.Minutes = 0; aTempValue.Minutes = 0;
aTempValue.Hours = 0; aTempValue.Hours = 0;
::sax::Converter::convertDateTime(rsValue, aTempValue, 0); ::sax::Converter::convertDateTime(rsValue, aTempValue, nullptr);
} }
else else
if (rValue >>= aTime) if (rValue >>= aTime)
...@@ -2632,7 +2632,7 @@ bool Converter::convertAny(OUStringBuffer& rsValue, ...@@ -2632,7 +2632,7 @@ bool Converter::convertAny(OUStringBuffer& rsValue,
{ {
rsType.append("date"); rsType.append("date");
bConverted = true; bConverted = true;
::sax::Converter::convertDateTime(rsValue, aDateTime, 0); ::sax::Converter::convertDateTime(rsValue, aDateTime, nullptr);
} }
} }
break; break;
......
...@@ -59,7 +59,7 @@ namespace sax_fastparser { ...@@ -59,7 +59,7 @@ namespace sax_fastparser {
: maCachedOutputStream() : maCachedOutputStream()
, maMarkStack() , maMarkStack()
, mbMarkStackEmpty(true) , mbMarkStackEmpty(true)
, mpDoubleStr(NULL) , mpDoubleStr(nullptr)
, mnDoubleStrCapacity(RTL_STR_MAX_VALUEOFDOUBLE) , mnDoubleStrCapacity(RTL_STR_MAX_VALUEOFDOUBLE)
{ {
rtl_string_new_WithLength(&mpDoubleStr, mnDoubleStrCapacity); rtl_string_new_WithLength(&mpDoubleStr, mnDoubleStrCapacity);
...@@ -83,7 +83,7 @@ namespace sax_fastparser { ...@@ -83,7 +83,7 @@ namespace sax_fastparser {
{ {
rtl_math_doubleToString( rtl_math_doubleToString(
&mpDoubleStr, &mnDoubleStrCapacity, 0, value, rtl_math_StringFormat_G, &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); 0, sal_True);
write(mpDoubleStr->buffer, mpDoubleStr->length); write(mpDoubleStr->buffer, mpDoubleStr->length);
......
...@@ -80,7 +80,7 @@ public: ...@@ -80,7 +80,7 @@ public:
from the element. 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. /** receives notification of the end of an known element.
@see startFastElement @see startFastElement
...@@ -104,7 +104,7 @@ public: ...@@ -104,7 +104,7 @@ public:
from the element. from the element.
*/ */
void singleFastElement( ::sal_Int32 Element, FastAttributeList* pAttrList = NULL ); void singleFastElement( ::sal_Int32 Element, FastAttributeList* pAttrList = nullptr );
// C++ helpers // C++ helpers
void writeId( ::sal_Int32 Element ); void writeId( ::sal_Int32 Element );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment