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

tdf#120703 (PVS): V519 The variable is assigned values twice successively

Change-Id: I9265425a215609ef6bf4298ba39c8399f215ce27
Reviewed-on: https://gerrit.libreoffice.org/62406
Tested-by: Jenkins
Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst 5690acdb
......@@ -117,8 +117,7 @@ System::Object^ Cli_environment::getRegisteredInterface(System::String^ oid,
System::Type^ type)
{
//try if it is a UNO interface
System::Object^ ret = nullptr;
ret = m_objects[oid];
System::Object^ ret = m_objects[oid];
if (! ret)
{
//try if it is a proxy for a cli object
......
......@@ -124,7 +124,6 @@ Statics & getStatics()
statics.NO_NULLS = "NO_NULLS";
statics.NULABLE = "NULABLE";
statics.NULLABLE_UNKNOWN = "NULLABLE_UNKNOWN";
statics.cPERCENT = "%";
statics.TYPE = "Type";
statics.TYPE_NAME = "TypeName";
......
......@@ -756,11 +756,7 @@ void OPropertySetHelper::fire
if( !bVetoable )
{
OInterfaceContainerHelper * pCont = nullptr;
pCont = rBHelper.aLC.getContainer(
getPropertiesTypeIdentifier( )
);
if( pCont )
if (auto pCont = rBHelper.aLC.getContainer(getPropertiesTypeIdentifier()))
{
// Here is a Bug, unbound properties are also fired
OInterfaceIteratorHelper aIt( *pCont );
......
......@@ -258,7 +258,7 @@ bool ODbDataSourceAdministrationHelper::getCurrentSettings(Sequence< PropertyVal
AuthenticationRequest aRequest;
aRequest.ServerName = sName;
aRequest.Diagnostic = sLoginRequest;
aRequest.HasRealm = aRequest.HasAccount = false;
aRequest.HasRealm = false;
// aRequest.Realm
aRequest.HasUserName = pUser != nullptr;
aRequest.UserName = pUser ? pUser->GetValue() : OUString();
......
......@@ -161,8 +161,8 @@ RegError ORegKey::getKeyNames(const OUString& keyName,
sal_uInt32 nSubKeys = pKey->countSubKeys();
*pnSubKeys = nSubKeys;
rtl_uString** pSubKeys = nullptr;
pSubKeys = static_cast<rtl_uString**>(rtl_allocateZeroMemory(nSubKeys * sizeof(rtl_uString*)));
rtl_uString** pSubKeys
= static_cast<rtl_uString**>(rtl_allocateZeroMemory(nSubKeys * sizeof(rtl_uString*)));
OStoreDirectory::iterator iter;
OStoreDirectory rStoreDir(pKey->getStoreDir());
......
......@@ -326,8 +326,7 @@ rtlDigestError SAL_CALL rtl_digest_MD2(
rtlDigest SAL_CALL rtl_digest_createMD2() SAL_THROW_EXTERN_C()
{
DigestMD2_Impl *pImpl = nullptr;
pImpl = RTL_DIGEST_CREATE(DigestMD2_Impl);
DigestMD2_Impl *pImpl = RTL_DIGEST_CREATE(DigestMD2_Impl);
if (pImpl)
{
pImpl->m_digest = MD2;
......@@ -664,8 +663,7 @@ rtlDigestError SAL_CALL rtl_digest_MD5(
rtlDigest SAL_CALL rtl_digest_createMD5() SAL_THROW_EXTERN_C()
{
DigestMD5_Impl *pImpl = nullptr;
pImpl = RTL_DIGEST_CREATE(DigestMD5_Impl);
DigestMD5_Impl *pImpl = RTL_DIGEST_CREATE(DigestMD5_Impl);
if (pImpl)
{
pImpl->m_digest = MD5;
......@@ -1107,8 +1105,7 @@ rtlDigestError SAL_CALL rtl_digest_SHA(
rtlDigest SAL_CALL rtl_digest_createSHA() SAL_THROW_EXTERN_C()
{
DigestSHA_Impl *pImpl = nullptr;
pImpl = RTL_DIGEST_CREATE(DigestSHA_Impl);
DigestSHA_Impl *pImpl = RTL_DIGEST_CREATE(DigestSHA_Impl);
if (pImpl)
{
pImpl->m_digest = SHA_0;
......@@ -1267,8 +1264,7 @@ rtlDigestError SAL_CALL rtl_digest_SHA1(
rtlDigest SAL_CALL rtl_digest_createSHA1() SAL_THROW_EXTERN_C()
{
DigestSHA_Impl *pImpl = nullptr;
pImpl = RTL_DIGEST_CREATE(DigestSHA_Impl);
DigestSHA_Impl *pImpl = RTL_DIGEST_CREATE(DigestSHA_Impl);
if (pImpl)
{
pImpl->m_digest = SHA_1;
......@@ -1482,8 +1478,7 @@ rtlDigestError SAL_CALL rtl_digest_HMAC_MD5(
rtlDigest SAL_CALL rtl_digest_createHMAC_MD5() SAL_THROW_EXTERN_C()
{
DigestHMAC_MD5_Impl *pImpl = nullptr;
pImpl = RTL_DIGEST_CREATE(DigestHMAC_MD5_Impl);
DigestHMAC_MD5_Impl *pImpl = RTL_DIGEST_CREATE(DigestHMAC_MD5_Impl);
if (pImpl)
{
pImpl->m_digest = HMAC_MD5;
......@@ -1678,8 +1673,7 @@ rtlDigestError SAL_CALL rtl_digest_HMAC_SHA1(
rtlDigest SAL_CALL rtl_digest_createHMAC_SHA1() SAL_THROW_EXTERN_C()
{
DigestHMAC_SHA1_Impl *pImpl = nullptr;
pImpl = RTL_DIGEST_CREATE(DigestHMAC_SHA1_Impl);
DigestHMAC_SHA1_Impl *pImpl = RTL_DIGEST_CREATE(DigestHMAC_SHA1_Impl);
if (pImpl)
{
pImpl->m_digest = HMAC_SHA1;
......
......@@ -176,8 +176,7 @@ void testFormats(ScBootstrapFixture* pTest, ScDocument* pDoc, sal_Int32 nFormat)
//formatting for B5: # ??/100 gets lost during import
//test Sheet2
const ScPatternAttr* pPattern = nullptr;
pPattern = pDoc->GetPattern(0,0,1);
const ScPatternAttr* pPattern = pDoc->GetPattern(0, 0, 1);
vcl::Font aFont;
pPattern->GetFont(aFont,SC_AUTOCOL_RAW);
CPPUNIT_ASSERT_EQUAL_MESSAGE("font size should be 10", 200l, aFont.GetFontSize().getHeight());
......
......@@ -78,7 +78,6 @@ const char* aFuncStrIds[] = // matching enum ScSubTotalFunc
bool lcl_SearchMember( const std::vector<std::unique_ptr<ScDPResultMember>>& list, SCROW nOrder, SCROW& rIndex)
{
rIndex = list.size();
bool bFound = false;
SCROW nLo = 0;
SCROW nHi = list.size() - 1;
......
......@@ -1733,10 +1733,8 @@ void ScInterpreter::ScSumXMY2()
if ( !MustHaveParamCount( GetByte(), 2 ) )
return;
ScMatrixRef pMat1 = nullptr;
ScMatrixRef pMat2 = nullptr;
pMat2 = GetMatrix();
pMat1 = GetMatrix();
ScMatrixRef pMat2 = GetMatrix();
ScMatrixRef pMat1 = GetMatrix();
if (!pMat2 || !pMat1)
{
PushIllegalParameter();
......
......@@ -626,7 +626,7 @@ bool SdTransferable::WriteObject( tools::SvRef<SotStorageStream>& rxOStm, void*
pEmbObj->SetupStorage( xWorkStore, SOFFICE_FILEFORMAT_CURRENT, false );
// mba: no relative URLs for clipboard!
SfxMedium aMedium( xWorkStore, OUString() );
bRet = pEmbObj->DoSaveObjectAs( aMedium, false );
pEmbObj->DoSaveObjectAs( aMedium, false );
pEmbObj->DoSaveCompleted();
uno::Reference< embed::XTransactedObject > xTransact( xWorkStore, uno::UNO_QUERY );
......
......@@ -1198,9 +1198,10 @@ void SfxApplication::MiscState_Impl(SfxItemSet &rSet)
if ( xLayoutManager.is() )
{
bool bState = true;
bState = xLayoutManager->getElement( "private:resource/menubar/menubar" ).is()
&& xLayoutManager->isElementVisible( "private:resource/menubar/menubar" );
const bool bState
= xLayoutManager->getElement("private:resource/menubar/menubar").is()
&& xLayoutManager->isElementVisible(
"private:resource/menubar/menubar");
SfxBoolItem aItem( SID_MENUBAR, bState );
rSet.Put( aItem );
......
......@@ -1736,8 +1736,6 @@ std::unique_ptr<SmStructureNode> SmParser::DoUnOper()
aNodeToken.cMathChar = MS_VERTLINE;
std::unique_ptr<SmNode> xLeft(new SmMathSymbolNode(aNodeToken));
aNodeToken.cMathChar = MS_VERTLINE;
std::unique_ptr<SmNode> xRight(new SmMathSymbolNode(aNodeToken));
xSNode->SetSubNodes(xLeft.release(), xArg.release(), xRight.release());
......
......@@ -931,7 +931,6 @@ void FmXFormShell::disposing()
m_xExternalViewController = nullptr;
m_xExtViewTriggerController = nullptr;
m_xExternalDisplayedForm = nullptr;
m_xLastGridFound = nullptr;
InterfaceBag aEmpty;
m_aCurrentSelection.swap( aEmpty );
......
......@@ -146,7 +146,6 @@ void ParaPropertyPanel::InitToolBoxIndent()
mpFLineIndent->SetModifyHdl( aLink );
m_eLRSpaceUnit = maLRSpaceControl.GetCoreMetric();
m_eLRSpaceUnit = maLRSpaceControl.GetCoreMetric();
}
void ParaPropertyPanel::InitToolBoxSpacing()
......
......@@ -207,7 +207,6 @@ bool SdrDragView::BegDragObj(const Point& rPnt, OutputDevice* pOut, SdrHdl* pHdl
SetDragWithCopy(false);
//TODO: aAni.Reset();
mpCurrentSdrDragMethod=nullptr;
mbDragLimit=false;
SdrDragMode eTmpMode=meDragMode;
if (eTmpMode==SdrDragMode::Move && pHdl!=nullptr && pHdl->GetKind()!=SdrHdlKind::Move) {
eTmpMode=SdrDragMode::Resize;
......
......@@ -2909,8 +2909,8 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan
(*pStreamName) >>= sStreamName;
pDoc->GetIDocumentUndoRedo().StartUndo(SwUndoId::INSERT, nullptr);
SwFlyFrameFormat* pFrameFormat = nullptr;
pFrameFormat = pDoc->getIDocumentContentOperations().InsertOLE( aPam, sStreamName, m_nDrawAspect, &aFrameSet, nullptr );
SwFlyFrameFormat* pFrameFormat = pDoc->getIDocumentContentOperations().InsertOLE(
aPam, sStreamName, m_nDrawAspect, &aFrameSet, nullptr);
// store main document name to show in the title bar
SwOLENode* pNd = nullptr;
......@@ -2956,9 +2956,8 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan
OUString rName;
rPers.GetEmbeddedObjectContainer().InsertEmbeddedObject( obj, rName );
SwFlyFrameFormat* pFrameFormat = nullptr;
pFrameFormat = pDoc->getIDocumentContentOperations().InsertEmbObject(
aPam, xObj, &aFrameSet);
SwFlyFrameFormat* pFrameFormat
= pDoc->getIDocumentContentOperations().InsertEmbObject(aPam, xObj, &aFrameSet);
pDoc->GetIDocumentUndoRedo().EndUndo(SwUndoId::INSERT, nullptr);
pFrameFormat->Add(this);
if(!m_sName.isEmpty())
......
......@@ -399,12 +399,11 @@ namespace sw
else
{
dyaHdrTop = dyaHdrBottom = 0;
dyaHdrBottom = 0;
}
const SvxULSpaceItem &rUL =
ItemGet<SvxULSpaceItem>(rPage, RES_UL_SPACE);
dyaHdrTop = dyaHdrTop + rUL.GetUpper();
dyaHdrBottom = dyaHdrBottom + rUL.GetLower();
dyaHdrTop += rUL.GetUpper();
dyaHdrBottom += rUL.GetLower();
dyaTop = dyaHdrTop;
dyaBottom = dyaHdrBottom;
......
......@@ -1382,8 +1382,8 @@ void SwWW8FltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
SwTextNode *pTextNode = static_cast<SwTextNode*>(pNode);
const SwNumFormat *pNum = nullptr;
pNum = GetNumFormatFromStack( *aRegion.GetPoint(), *pTextNode );
const SwNumFormat* pNum
= GetNumFormatFromStack(*aRegion.GetPoint(), *pTextNode);
if (!pNum)
{
pNum = GetNumFormatFromTextNode(*pTextNode);
......
......@@ -245,7 +245,6 @@ void SwXDispatch::dispatch(const util::URL& aURL,
else if(aURL.Complete == cInternalDBChangeNotification)
{
frame::FeatureStateEvent aEvent;
aEvent.IsEnabled = true;
aEvent.Source = *static_cast<cppu::OWeakObject*>(this);
const SwDBData& rData = m_pView->GetWrtShell().GetDBDesc();
......
......@@ -162,8 +162,8 @@ sal_Int32 SAL_CALL
ScVbaCommandBar::Type()
{
// #FIXME support msoBarTypePopup
sal_Int32 nType = office::MsoBarType::msoBarTypePopup;
nType = m_bIsMenu? office::MsoBarType::msoBarTypeNormal : office::MsoBarType::msoBarTypeMenuBar;
sal_Int32 nType
= m_bIsMenu ? office::MsoBarType::msoBarTypeNormal : office::MsoBarType::msoBarTypeMenuBar;
return nType;
}
......
......@@ -3808,8 +3808,8 @@ void DisclosureButton::ImplDrawCheckBoxState(vcl::RenderContext& rRenderContext)
if (!rCtrlData.mpDisclosureMinus)
rCtrlData.mpDisclosureMinus.reset(new Image(BitmapEx(SV_DISCLOSURE_MINUS)));
Image* pImg = nullptr;
pImg = IsChecked() ? rCtrlData.mpDisclosureMinus.get() : rCtrlData.mpDisclosurePlus.get();
Image* pImg
= IsChecked() ? rCtrlData.mpDisclosureMinus.get() : rCtrlData.mpDisclosurePlus.get();
SAL_WARN_IF(!pImg, "vcl", "no disclosure image");
if (!pImg)
......
......@@ -551,7 +551,6 @@ void ImpGraphic::ImplSetPrepared(bool bAnimated)
maSwapInfo.maSizePixel = aDescriptor.GetSizePixel();
}
maSwapInfo.mnAnimationLoopCount = 0;
maSwapInfo.mbIsAnimated = false;
maSwapInfo.mbIsEPS = false;
maSwapInfo.mbIsTransparent = false;
maSwapInfo.mbIsAlpha = false;
......
......@@ -3481,8 +3481,6 @@ static bool ImplHandleKeyMsg( HWND hWnd, UINT nMsg,
nLastModKeyCode = ModKeyFlags::NONE; // make sure no modkey messages are sent if they belong to a hotkey (see above)
aKeyEvt.mnCharCode = 0;
aKeyEvt.mnCode = 0;
aKeyEvt.mnCode = ImplSalGetKeyCode( wParam );
if ( !bKeyUp )
{
......@@ -4487,8 +4485,6 @@ static LRESULT ImplDrawItem(HWND, WPARAM wParam, LPARAM lParam )
// Set the appropriate foreground and background colors.
RECT aRect = pDI->rcItem;
clrPrevBkgnd = SetBkColor( pDI->hDC, GetSysColor( COLOR_MENU ) );
if ( fDisabled )
clrPrevText = SetTextColor( pDI->hDC, GetSysColor( COLOR_GRAYTEXT ) );
else
......
......@@ -666,8 +666,7 @@ SvXMLImportContext *SdXMLImport::CreateMetaContext(const sal_Int32 /*nElement*/,
SvXMLImportContext *SdXMLImport::CreateBodyContext(const OUString& rLocalName,
const uno::Reference<xml::sax::XAttributeList>&)
{
SvXMLImportContext *pContext = nullptr;
pContext = new SdXMLBodyContext(*this, rLocalName);
SvXMLImportContext* pContext = new SdXMLBodyContext(*this, rLocalName);
return pContext;
}
......
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