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 ...@@ -389,7 +389,7 @@ namespace unotools
// empty polygon - impossible to specify _any_ // empty polygon - impossible to specify _any_
// legal value except 0 here! // legal value except 0 here!
if( !nPolyCount && nPointIndex ) if( !nPolyCount)
throw lang::IndexOutOfBoundsException(); throw lang::IndexOutOfBoundsException();
nFirstPoint = nPointIndex; nFirstPoint = nPointIndex;
......
...@@ -1312,7 +1312,7 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt ) ...@@ -1312,7 +1312,7 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt )
DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper.get(); DrawViewWrapper* pDrawViewWrapper = m_pDrawViewWrapper.get();
auto pChartWindow(GetChartWindow()); auto pChartWindow(GetChartWindow());
if(!pChartWindow || !pDrawViewWrapper) if (!pChartWindow || !pDrawViewWrapper)
return bReturn; return bReturn;
// handle accelerators // handle accelerators
...@@ -1433,7 +1433,7 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt ) ...@@ -1433,7 +1433,7 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt )
// default 1 mm in each direction // default 1 mm in each direction
double fGrowAmountX = 200.0; double fGrowAmountX = 200.0;
double fGrowAmountY = 200.0; double fGrowAmountY = 200.0;
if( bAlternate && pChartWindow ) if (bAlternate)
{ {
// together with Alt-key: 1 px in each direction // together with Alt-key: 1 px in each direction
Size aPixelSize = pChartWindow->PixelToLogic( Size( 2, 2 )); Size aPixelSize = pChartWindow->PixelToLogic( Size( 2, 2 ));
...@@ -1460,7 +1460,7 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt ) ...@@ -1460,7 +1460,7 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt )
// default 1 mm // default 1 mm
double fShiftAmountX = 100.0; double fShiftAmountX = 100.0;
double fShiftAmountY = 100.0; double fShiftAmountY = 100.0;
if( bAlternate && pChartWindow ) if (bAlternate)
{ {
// together with Alt-key: 1 px // together with Alt-key: 1 px
Size aPixelSize = pChartWindow->PixelToLogic( Size( 1, 1 )); Size aPixelSize = pChartWindow->PixelToLogic( Size( 1, 1 ));
...@@ -1562,7 +1562,7 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt ) ...@@ -1562,7 +1562,7 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt )
bReturn = executeDispatch_Delete(); bReturn = executeDispatch_Delete();
if( ! bReturn ) 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, VclMessageType::Info, VclButtonsType::Ok,
SchResId(STR_ACTION_NOTPOSSIBLE))); SchResId(STR_ACTION_NOTPOSSIBLE)));
xInfoBox->run(); xInfoBox->run();
......
...@@ -591,16 +591,13 @@ Reference< XNameAccess > getFieldsByCommandDescriptor( const Reference< XConnect ...@@ -591,16 +591,13 @@ Reference< XNameAccess > getFieldsByCommandDescriptor( const Reference< XConnect
eState = FAILED; eState = FAILED;
OSL_ENSURE( xObjectCollection.is(), "::dbtools::getFieldsByCommandDescriptor: invalid connection (no sdb.Connection, or no Tables-/QueriesSupplier)!"); OSL_ENSURE( xObjectCollection.is(), "::dbtools::getFieldsByCommandDescriptor: invalid connection (no sdb.Connection, or no Tables-/QueriesSupplier)!");
if ( xObjectCollection.is() ) if ( xObjectCollection.is() && xObjectCollection->hasByName( _rCommand ) )
{ {
if ( xObjectCollection.is() && xObjectCollection->hasByName( _rCommand ) ) xObjectCollection->getByName( _rCommand ) >>= xSupplyColumns;
{ // (xSupplyColumns being NULL will be handled in the next state)
xObjectCollection->getByName( _rCommand ) >>= xSupplyColumns;
// (xSupplyColumns being NULL will be handled in the next state)
// next: go for the columns // next: go for the columns
eState = RETRIEVE_COLUMNS; eState = RETRIEVE_COLUMNS;
}
} }
break; break;
......
...@@ -347,9 +347,9 @@ void OTableContainer::dropObject(sal_Int32 _nPos, const OUString& _sElementName) ...@@ -347,9 +347,9 @@ void OTableContainer::dropObject(sal_Int32 _nPos, const OUString& _sElementName)
Reference<XPropertySet> xTable(getObject(_nPos),UNO_QUERY); Reference<XPropertySet> xTable(getObject(_nPos),UNO_QUERY);
if ( xTable.is() && m_xMetaData.is() ) if ( xTable.is() && m_xMetaData.is() )
{ {
if( m_xMetaData.is() && m_xMetaData->supportsCatalogsInTableDefinitions() ) if (m_xMetaData->supportsCatalogsInTableDefinitions())
xTable->getPropertyValue(PROPERTY_CATALOGNAME) >>= sCatalog; xTable->getPropertyValue(PROPERTY_CATALOGNAME) >>= sCatalog;
if( m_xMetaData.is() && m_xMetaData->supportsSchemasInTableDefinitions() ) if (m_xMetaData->supportsSchemasInTableDefinitions())
xTable->getPropertyValue(PROPERTY_SCHEMANAME) >>= sSchema; xTable->getPropertyValue(PROPERTY_SCHEMANAME) >>= sSchema;
xTable->getPropertyValue(PROPERTY_NAME) >>= sTable; xTable->getPropertyValue(PROPERTY_NAME) >>= sTable;
......
...@@ -141,10 +141,7 @@ void PresenterSpritePane::UpdateCanvases() ...@@ -141,10 +141,7 @@ void PresenterSpritePane::UpdateCanvases()
{ {
Reference<XComponent> xContentCanvasComponent (mxContentCanvas, UNO_QUERY); Reference<XComponent> xContentCanvasComponent (mxContentCanvas, UNO_QUERY);
if (xContentCanvasComponent.is()) if (xContentCanvasComponent.is())
{ xContentCanvasComponent->dispose();
if (xContentCanvasComponent.is())
xContentCanvasComponent->dispose();
}
// The border canvas is the content canvas of the sprite. // The border canvas is the content canvas of the sprite.
mxBorderCanvas = mpSprite->GetCanvas(); mxBorderCanvas = mpSprite->GetCanvas();
......
...@@ -537,20 +537,17 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat( ...@@ -537,20 +537,17 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat(
{ {
if( bNeedsPreparation && xPrepareDispatch.is() ) if( bNeedsPreparation && xPrepareDispatch.is() )
{ {
if ( xPrepareDispatch.is() ) try
{
css::uno::Sequence< css::beans::PropertyValue > aDispatchArgs;
xPrepareDispatch->dispatch( aPrepareURL, aDispatchArgs );
}
catch ( css::uno::RuntimeException& )
{
throw;
}
catch ( css::uno::Exception& )
{ {
try
{
css::uno::Sequence< css::beans::PropertyValue > aDispatchArgs;
xPrepareDispatch->dispatch( aPrepareURL, aDispatchArgs );
}
catch ( css::uno::RuntimeException& )
{
throw;
}
catch ( css::uno::Exception& )
{
}
} }
} }
......
...@@ -1558,7 +1558,7 @@ bool SfxObjectShell::SaveTo_Impl ...@@ -1558,7 +1558,7 @@ bool SfxObjectShell::SaveTo_Impl
bTryToPreserveScriptSignature = ( SotStorage::GetVersion( rMedium.GetStorage() ) == SOFFICE_FILEFORMAT_60 ); bTryToPreserveScriptSignature = ( SotStorage::GetVersion( rMedium.GetStorage() ) == SOFFICE_FILEFORMAT_60 );
uno::Reference< security::XDocumentDigitalSignatures > xDDSigns; 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 // 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 // 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