Kaydet (Commit) 273a60af authored tarafından jailletc36's avatar jailletc36 Kaydeden (comit) Tor Lillqvist

cppCheck: clarifyCondition

Remove some warnings about:
   Boolean result is used in bitwise operation
   Suspicious condition (assignment + comparison)

Also reduce scope of a variable.

Change-Id: I553e5a09ed1d6276be61efbbb2c28d165a69af39
Signed-off-by: 's avatarjailletc36 <christophe.jaillet@wanadoo.fr>
Reviewed-on: https://gerrit.libreoffice.org/1031Reviewed-by: 's avatarTor Lillqvist <tml@iki.fi>
Tested-by: 's avatarTor Lillqvist <tml@iki.fi>
üst fb9522a2
...@@ -1307,7 +1307,7 @@ void SAXWriter::startCDATA(void) throw(SAXException, RuntimeException) ...@@ -1307,7 +1307,7 @@ void SAXWriter::startCDATA(void) throw(SAXException, RuntimeException)
void SAXWriter::endCDATA(void) throw (RuntimeException) void SAXWriter::endCDATA(void) throw (RuntimeException)
{ {
if( ! m_bDocStarted | ! m_bIsCDATA) if( ! m_bDocStarted || ! m_bIsCDATA)
{ {
SAXException except; SAXException except;
except.Message = OUString( "endCDATA was called without startCDATA" ); except.Message = OUString( "endCDATA was called without startCDATA" );
......
...@@ -402,7 +402,7 @@ SvTreeListEntry* ScAcceptChgDlg::InsertChangeAction( ...@@ -402,7 +402,7 @@ SvTreeListEntry* ScAcceptChgDlg::InsertChangeAction(
pNewData->nActionNo=pScChangeAction->GetActionNumber(); pNewData->nActionNo=pScChangeAction->GetActionNumber();
pNewData->bIsAcceptable=pScChangeAction->IsClickable(); pNewData->bIsAcceptable=pScChangeAction->IsClickable();
pNewData->bIsRejectable=pScChangeAction->IsRejectable(); pNewData->bIsRejectable=pScChangeAction->IsRejectable();
pNewData->bDisabled=!pNewData->bIsAcceptable | bDisabled; pNewData->bDisabled=!pNewData->bIsAcceptable || bDisabled;
pNewData->aDateTime=aDateTime; pNewData->aDateTime=aDateTime;
pNewData->nRow = aRef.aStart.Row(); pNewData->nRow = aRef.aStart.Row();
pNewData->nCol = aRef.aStart.Col(); pNewData->nCol = aRef.aStart.Col();
...@@ -579,7 +579,7 @@ SvTreeListEntry* ScAcceptChgDlg::InsertFilteredAction( ...@@ -579,7 +579,7 @@ SvTreeListEntry* ScAcceptChgDlg::InsertFilteredAction(
pNewData->nActionNo=pScChangeAction->GetActionNumber(); pNewData->nActionNo=pScChangeAction->GetActionNumber();
pNewData->bIsAcceptable=pScChangeAction->IsClickable(); pNewData->bIsAcceptable=pScChangeAction->IsClickable();
pNewData->bIsRejectable=pScChangeAction->IsRejectable(); pNewData->bIsRejectable=pScChangeAction->IsRejectable();
pNewData->bDisabled=!pNewData->bIsAcceptable | bDisabled; pNewData->bDisabled=!pNewData->bIsAcceptable || bDisabled;
pNewData->aDateTime=aDateTime; pNewData->aDateTime=aDateTime;
pNewData->nRow = aRef.aStart.Row(); pNewData->nRow = aRef.aStart.Row();
pNewData->nCol = aRef.aStart.Col(); pNewData->nCol = aRef.aStart.Col();
......
...@@ -3464,12 +3464,12 @@ eF_ResT SwWW8ImplReader::Read_F_Hyperlink( WW8FieldDesc* /*pF*/, String& rStr ) ...@@ -3464,12 +3464,12 @@ eF_ResT SwWW8ImplReader::Read_F_Hyperlink( WW8FieldDesc* /*pF*/, String& rStr )
String sURL, sTarget, sMark; String sURL, sTarget, sMark;
bool bDataImport = false; bool bDataImport = false;
//HYPERLINK "filename" [switches] //HYPERLINK "filename" [switches]
bool bOptions=false;
rStr = comphelper::string::stripEnd(rStr, 1); rStr = comphelper::string::stripEnd(rStr, 1);
if (!bDataImport) if (!bDataImport)
{ {
bool bOptions = false;
long nRet; long nRet;
_ReadFieldParams aReadParam( rStr ); _ReadFieldParams aReadParam( rStr );
while( -1 != ( nRet = aReadParam.SkipToNextToken() )) while( -1 != ( nRet = aReadParam.SkipToNextToken() ))
...@@ -3477,7 +3477,7 @@ eF_ResT SwWW8ImplReader::Read_F_Hyperlink( WW8FieldDesc* /*pF*/, String& rStr ) ...@@ -3477,7 +3477,7 @@ eF_ResT SwWW8ImplReader::Read_F_Hyperlink( WW8FieldDesc* /*pF*/, String& rStr )
switch( nRet ) switch( nRet )
{ {
case -2: case -2:
if (!sURL.Len() & !bOptions) if (!sURL.Len() && !bOptions)
ConvertFFileName(sURL, aReadParam.GetResult()); ConvertFFileName(sURL, aReadParam.GetResult());
break; break;
......
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