Kaydet (Commit) c816cb84 authored tarafından Caolán McNamara's avatar Caolán McNamara

pvs-studio: V571 Recurring check

Change-Id: I1ad7bcfa557b38488adf26b434433e6bae259f43
Reviewed-on: https://gerrit.libreoffice.org/62190
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 7354da6c
......@@ -389,7 +389,7 @@ namespace unotools
// empty polygon - impossible to specify _any_
// legal value except 0 here!
if( !nPolyCount && nPointIndex )
if( !nPolyCount)
throw lang::IndexOutOfBoundsException();
nFirstPoint = nPointIndex;
......
......@@ -1312,7 +1312,7 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt )
DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper.get();
auto pChartWindow(GetChartWindow());
if(!pChartWindow || !pDrawViewWrapper)
if (!pChartWindow || !pDrawViewWrapper)
return bReturn;
// handle accelerators
......@@ -1433,7 +1433,7 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt )
// default 1 mm in each direction
double fGrowAmountX = 200.0;
double fGrowAmountY = 200.0;
if( bAlternate && pChartWindow )
if (bAlternate)
{
// together with Alt-key: 1 px in each direction
Size aPixelSize = pChartWindow->PixelToLogic( Size( 2, 2 ));
......@@ -1460,7 +1460,7 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt )
// default 1 mm
double fShiftAmountX = 100.0;
double fShiftAmountY = 100.0;
if( bAlternate && pChartWindow )
if (bAlternate)
{
// together with Alt-key: 1 px
Size aPixelSize = pChartWindow->PixelToLogic( Size( 1, 1 ));
......@@ -1562,7 +1562,7 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt )
bReturn = executeDispatch_Delete();
if( ! bReturn )
{
std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pChartWindow ? pChartWindow->GetFrameWeld() : nullptr,
std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pChartWindow->GetFrameWeld(),
VclMessageType::Info, VclButtonsType::Ok,
SchResId(STR_ACTION_NOTPOSSIBLE)));
xInfoBox->run();
......
......@@ -591,8 +591,6 @@ Reference< XNameAccess > getFieldsByCommandDescriptor( const Reference< XConnect
eState = FAILED;
OSL_ENSURE( xObjectCollection.is(), "::dbtools::getFieldsByCommandDescriptor: invalid connection (no sdb.Connection, or no Tables-/QueriesSupplier)!");
if ( xObjectCollection.is() )
{
if ( xObjectCollection.is() && xObjectCollection->hasByName( _rCommand ) )
{
xObjectCollection->getByName( _rCommand ) >>= xSupplyColumns;
......@@ -601,7 +599,6 @@ Reference< XNameAccess > getFieldsByCommandDescriptor( const Reference< XConnect
// next: go for the columns
eState = RETRIEVE_COLUMNS;
}
}
break;
case RETRIEVE_COLUMNS:
......
......@@ -347,9 +347,9 @@ void OTableContainer::dropObject(sal_Int32 _nPos, const OUString& _sElementName)
Reference<XPropertySet> xTable(getObject(_nPos),UNO_QUERY);
if ( xTable.is() && m_xMetaData.is() )
{
if( m_xMetaData.is() && m_xMetaData->supportsCatalogsInTableDefinitions() )
if (m_xMetaData->supportsCatalogsInTableDefinitions())
xTable->getPropertyValue(PROPERTY_CATALOGNAME) >>= sCatalog;
if( m_xMetaData.is() && m_xMetaData->supportsSchemasInTableDefinitions() )
if (m_xMetaData->supportsSchemasInTableDefinitions())
xTable->getPropertyValue(PROPERTY_SCHEMANAME) >>= sSchema;
xTable->getPropertyValue(PROPERTY_NAME) >>= sTable;
......
......@@ -4560,15 +4560,14 @@ OUString getDateStringForType(condformat::ScCondFormatDateType eType)
void ScXMLExport::ExportConditionalFormat(SCTAB nTab)
{
ScConditionalFormatList* pCondFormatList = pDoc->GetCondFormList(nTab);
if(pCondFormatList)
{
if(pCondFormatList && pCondFormatList->empty())
if(!pCondFormatList)
return;
if (pCondFormatList->empty())
return;
SvXMLElementExport aElementCondFormats(*this, XML_NAMESPACE_CALC_EXT, XML_CONDITIONAL_FORMATS, true, true);
if(pCondFormatList)
{
for(ScConditionalFormatList::const_iterator itr = pCondFormatList->begin();
itr != pCondFormatList->end(); ++itr)
{
......@@ -4856,8 +4855,6 @@ void ScXMLExport::ExportConditionalFormat(SCTAB nTab)
}
}
}
}
}
}
void ScXMLExport::WriteExternalRefCaches()
......
......@@ -140,11 +140,8 @@ const std::shared_ptr<PresenterSprite>& PresenterSpritePane::GetSprite()
void PresenterSpritePane::UpdateCanvases()
{
Reference<XComponent> xContentCanvasComponent (mxContentCanvas, UNO_QUERY);
if (xContentCanvasComponent.is())
{
if (xContentCanvasComponent.is())
xContentCanvasComponent->dispose();
}
// The border canvas is the content canvas of the sprite.
mxBorderCanvas = mpSprite->GetCanvas();
......
......@@ -536,8 +536,6 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat(
try
{
if( bNeedsPreparation && xPrepareDispatch.is() )
{
if ( xPrepareDispatch.is() )
{
try
{
......@@ -552,7 +550,6 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat(
{
}
}
}
//check if this is the pdf output filter (i#64555)
if( bSendAsPDF )
......
......@@ -1558,7 +1558,7 @@ bool SfxObjectShell::SaveTo_Impl
bTryToPreserveScriptSignature = ( SotStorage::GetVersion( rMedium.GetStorage() ) == SOFFICE_FILEFORMAT_60 );
uno::Reference< security::XDocumentDigitalSignatures > xDDSigns;
if ( bOk && bTryToPreserveScriptSignature )
if (bTryToPreserveScriptSignature)
{
// if the scripting code was not changed and it is signed the signature should be preserved
// unfortunately at this point we have only information whether the basic code has changed or not
......
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