Commit aea2ec8f authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

Return 0 not false for pointers

parent 7407ccb8
...@@ -67,7 +67,7 @@ QTextDocument* Converter::convert( const QString &fileName ) ...@@ -67,7 +67,7 @@ QTextDocument* Converter::convert( const QString &fileName )
Document fbDocument( fileName ); Document fbDocument( fileName );
if ( !fbDocument.open() ) { if ( !fbDocument.open() ) {
emit error( fbDocument.lastErrorString(), -1 ); emit error( fbDocument.lastErrorString(), -1 );
return false; return 0;
} }
mTextDocument = new QTextDocument; mTextDocument = new QTextDocument;
...@@ -97,7 +97,7 @@ QTextDocument* Converter::convert( const QString &fileName ) ...@@ -97,7 +97,7 @@ QTextDocument* Converter::convert( const QString &fileName )
if ( documentElement.tagName() != QLatin1String( "FictionBook" ) ) { if ( documentElement.tagName() != QLatin1String( "FictionBook" ) ) {
emit error( i18n( "Document is not a valid FictionBook" ), -1 ); emit error( i18n( "Document is not a valid FictionBook" ), -1 );
delete mCursor; delete mCursor;
return false; return 0;
} }
/** /**
...@@ -108,7 +108,7 @@ QTextDocument* Converter::convert( const QString &fileName ) ...@@ -108,7 +108,7 @@ QTextDocument* Converter::convert( const QString &fileName )
if ( element.tagName() == QLatin1String( "binary" ) ) { if ( element.tagName() == QLatin1String( "binary" ) ) {
if ( !convertBinary( element ) ) { if ( !convertBinary( element ) ) {
delete mCursor; delete mCursor;
return false; return 0;
} }
} }
...@@ -123,7 +123,7 @@ QTextDocument* Converter::convert( const QString &fileName ) ...@@ -123,7 +123,7 @@ QTextDocument* Converter::convert( const QString &fileName )
if ( element.tagName() == QLatin1String( "description" ) ) { if ( element.tagName() == QLatin1String( "description" ) ) {
if ( !convertDescription( element ) ) { if ( !convertDescription( element ) ) {
delete mCursor; delete mCursor;
return false; return 0;
} }
} else if ( element.tagName() == QLatin1String( "body" ) ) { } else if ( element.tagName() == QLatin1String( "body" ) ) {
if ( !mTitleInfo->mCoverPage.isNull() ) { if ( !mTitleInfo->mCoverPage.isNull() ) {
...@@ -165,7 +165,7 @@ QTextDocument* Converter::convert( const QString &fileName ) ...@@ -165,7 +165,7 @@ QTextDocument* Converter::convert( const QString &fileName )
if ( !convertBody( element ) ) { if ( !convertBody( element ) ) {
delete mCursor; delete mCursor;
return false; return 0;
} }
} }
......
...@@ -96,7 +96,7 @@ QTextDocument* Converter::convert( const QString &fileName ) ...@@ -96,7 +96,7 @@ QTextDocument* Converter::convert( const QString &fileName )
if ( !document.setContent( &source, &reader, &errorMsg ) ) { if ( !document.setContent( &source, &reader, &errorMsg ) ) {
emit error( i18n( "Invalid XML document: %1", errorMsg ), -1 ); emit error( i18n( "Invalid XML document: %1", errorMsg ), -1 );
delete mCursor; delete mCursor;
return false; return 0;
} }
mStyleInformation = new StyleInformation(); mStyleInformation = new StyleInformation();
...@@ -109,7 +109,7 @@ QTextDocument* Converter::convert( const QString &fileName ) ...@@ -109,7 +109,7 @@ QTextDocument* Converter::convert( const QString &fileName )
if ( !styleParser.parse() ) { if ( !styleParser.parse() ) {
emit error( i18n( "Unable to read style information" ), -1 ); emit error( i18n( "Unable to read style information" ), -1 );
delete mCursor; delete mCursor;
return false; return 0;
} }
/** /**
...@@ -156,7 +156,7 @@ QTextDocument* Converter::convert( const QString &fileName ) ...@@ -156,7 +156,7 @@ QTextDocument* Converter::convert( const QString &fileName )
if ( !convertBody( element ) ) { if ( !convertBody( element ) ) {
emit error( i18n( "Unable to convert document content" ), -1 ); emit error( i18n( "Unable to convert document content" ), -1 );
delete mCursor; delete mCursor;
return false; return 0;
} }
} }
......
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