Kaydet (Commit) fff501a3 authored tarafından Mike Kaganski's avatar Mike Kaganski

tdf#120703 PVS: V560 A part of conditional expression is always true/false

Change-Id: I38f3e3243f8cb891c9a0fe2f4c68bc76acd1ef44
Reviewed-on: https://gerrit.libreoffice.org/64020
Tested-by: Jenkins
Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst af843af4
...@@ -1771,7 +1771,7 @@ void SAL_CALL OCommonEmbeddedObject::breakLink( const uno::Reference< embed::XSt ...@@ -1771,7 +1771,7 @@ void SAL_CALL OCommonEmbeddedObject::breakLink( const uno::Reference< embed::XSt
if ( m_bDisposed ) if ( m_bDisposed )
throw lang::DisposedException(); // TODO throw lang::DisposedException(); // TODO
if ( !m_bIsLink ) if (!m_bIsLink || m_nObjectState == -1)
{ {
// it must be a linked initialized object // it must be a linked initialized object
throw embed::WrongStateException( throw embed::WrongStateException(
...@@ -1791,14 +1791,6 @@ void SAL_CALL OCommonEmbeddedObject::breakLink( const uno::Reference< embed::XSt ...@@ -1791,14 +1791,6 @@ void SAL_CALL OCommonEmbeddedObject::breakLink( const uno::Reference< embed::XSt
static_cast< ::cppu::OWeakObject* >(this), static_cast< ::cppu::OWeakObject* >(this),
2 ); 2 );
if ( !m_bIsLink || m_nObjectState == -1 )
{
// it must be a linked initialized object
throw embed::WrongStateException(
"The object is not a valid linked object!",
static_cast< ::cppu::OWeakObject* >(this) );
}
if ( m_bWaitSaveCompleted ) if ( m_bWaitSaveCompleted )
throw embed::WrongStateException( throw embed::WrongStateException(
"The object waits for saveCompleted() call!", "The object waits for saveCompleted() call!",
......
...@@ -311,9 +311,8 @@ static int write_addStreams( const char* pInFile, const char* pOutFile, PDFFile* ...@@ -311,9 +311,8 @@ static int write_addStreams( const char* pInFile, const char* pOutFile, PDFFile*
static int write_fonts( const char* i_pInFile, const char* i_pOutFile, PDFFile* i_pPDFFile ) static int write_fonts( const char* i_pInFile, const char* i_pOutFile, PDFFile* i_pPDFFile )
{ {
int nRet = 0;
unsigned int nElements = i_pPDFFile->m_aSubElements.size(); unsigned int nElements = i_pPDFFile->m_aSubElements.size();
for( unsigned i = 0; i < nElements && nRet == 0; i++ ) for (unsigned i = 0; i < nElements; i++)
{ {
// search FontDescriptors // search FontDescriptors
PDFObject* pObj = dynamic_cast<PDFObject*>(i_pPDFFile->m_aSubElements[i].get()); PDFObject* pObj = dynamic_cast<PDFObject*>(i_pPDFFile->m_aSubElements[i].get());
...@@ -390,16 +389,15 @@ static int write_fonts( const char* i_pInFile, const char* i_pOutFile, PDFFile* ...@@ -390,16 +389,15 @@ static int write_fonts( const char* i_pInFile, const char* i_pOutFile, PDFFile*
aContext.m_bDecrypt = i_pPDFFile->isEncrypted(); aContext.m_bDecrypt = i_pPDFFile->isEncrypted();
pStream->writeStream( aContext, i_pPDFFile ); pStream->writeStream( aContext, i_pPDFFile );
} }
return nRet; return 0;
} }
static std::vector< std::pair< sal_Int32, sal_Int32 > > s_aEmitObjects; static std::vector< std::pair< sal_Int32, sal_Int32 > > s_aEmitObjects;
static int write_objects( const char* i_pInFile, const char* i_pOutFile, PDFFile* i_pPDFFile ) static int write_objects( const char* i_pInFile, const char* i_pOutFile, PDFFile* i_pPDFFile )
{ {
int nRet = 0;
unsigned int nElements = s_aEmitObjects.size(); unsigned int nElements = s_aEmitObjects.size();
for( unsigned i = 0; i < nElements && nRet == 0; i++ ) for (unsigned i = 0; i < nElements; i++)
{ {
sal_Int32 nObject = s_aEmitObjects[i].first; sal_Int32 nObject = s_aEmitObjects[i].first;
sal_Int32 nGeneration = s_aEmitObjects[i].second; sal_Int32 nGeneration = s_aEmitObjects[i].second;
...@@ -419,7 +417,7 @@ static int write_objects( const char* i_pInFile, const char* i_pOutFile, PDFFile ...@@ -419,7 +417,7 @@ static int write_objects( const char* i_pInFile, const char* i_pOutFile, PDFFile
aContext.m_bDecrypt = i_pPDFFile->isEncrypted(); aContext.m_bDecrypt = i_pPDFFile->isEncrypted();
pStream->writeStream( aContext, i_pPDFFile ); pStream->writeStream( aContext, i_pPDFFile );
} }
return nRet; return 0;
} }
SAL_IMPLEMENT_MAIN_WITH_ARGS( argc, argv ) SAL_IMPLEMENT_MAIN_WITH_ARGS( argc, argv )
......
...@@ -59,7 +59,7 @@ void add_include(struct filepointer *filep, struct inclist *file, struct inclist ...@@ -59,7 +59,7 @@ void add_include(struct filepointer *filep, struct inclist *file, struct inclist
if (newfile) { if (newfile) {
/* Only add new dependency files if they don't have "/usr/include" in them. */ /* Only add new dependency files if they don't have "/usr/include" in them. */
if (!(newfile && newfile->i_file && strstr(newfile->i_file, "/usr/"))) { if (!(newfile->i_file && strstr(newfile->i_file, "/usr/"))) {
included_by(file, newfile); included_by(file, newfile);
} }
......
...@@ -1510,7 +1510,7 @@ sal_Int32 SwScriptInfo::MaskHiddenRanges( const SwTextNode& rNode, OUStringBuffe ...@@ -1510,7 +1510,7 @@ sal_Int32 SwScriptInfo::MaskHiddenRanges( const SwTextNode& rNode, OUStringBuffe
while ( nHiddenStart < nHiddenEnd && nHiddenStart < nEnd ) while ( nHiddenStart < nHiddenEnd && nHiddenStart < nEnd )
{ {
if ( nHiddenStart >= nStt && nHiddenStart < nEnd ) if (nHiddenStart >= nStt)
{ {
rText[nHiddenStart] = cChar; rText[nHiddenStart] = cChar;
++nNumOfHiddenChars; ++nNumOfHiddenChars;
...@@ -1605,7 +1605,7 @@ bool SwScriptInfo::GetBoundsOfHiddenRange( const SwTextNode& rNode, sal_Int32 nP ...@@ -1605,7 +1605,7 @@ bool SwScriptInfo::GetBoundsOfHiddenRange( const SwTextNode& rNode, sal_Int32 nP
if ( nHiddenStart > nPos ) if ( nHiddenStart > nPos )
break; break;
if ( nHiddenStart <= nPos && nPos < nHiddenEnd ) if (nPos < nHiddenEnd)
{ {
rnStartPos = nHiddenStart; rnStartPos = nHiddenStart;
rnEndPos = std::min<sal_Int32>(nHiddenEnd, rnEndPos = std::min<sal_Int32>(nHiddenEnd,
...@@ -1644,7 +1644,7 @@ bool SwScriptInfo::GetBoundsOfHiddenRange(TextFrameIndex nPos, ...@@ -1644,7 +1644,7 @@ bool SwScriptInfo::GetBoundsOfHiddenRange(TextFrameIndex nPos,
if ( nHiddenStart > nPos ) if ( nHiddenStart > nPos )
break; break;
if ( nHiddenStart <= nPos && nPos < nHiddenEnd ) if (nPos < nHiddenEnd)
{ {
rnStartPos = nHiddenStart; rnStartPos = nHiddenStart;
rnEndPos = nHiddenEnd; rnEndPos = nHiddenEnd;
......
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