diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-11-06 10:12:29 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2018-11-10 12:23:42 +0100 |
commit | 065edb4c8e91170017df482843d0c3eb8d4db114 (patch) | |
tree | 1d030ec9868a56b375a563c9d6e6d81c6115d717 /sd | |
parent | 0b34a5dd39e177ba99cd21b639d67ac8123b8458 (diff) |
tdf#120703 PVS: V547 Expression is always true/false
Change-Id: I0b3c407331bfa1fa0c5003250d327d4f26de3643
Reviewed-on: https://gerrit.libreoffice.org/63235
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/slidesorter/controller/SlideSorterController.cxx | 26 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unomodel.cxx | 15 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unopback.cxx | 21 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unosrch.cxx | 7 | ||||
-rw-r--r-- | sd/source/ui/view/sdview3.cxx | 12 | ||||
-rw-r--r-- | sd/source/ui/view/viewshel.cxx | 11 |
6 files changed, 32 insertions, 60 deletions
diff --git a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx index 207d288c29f3..6d9bf0bd1de3 100644 --- a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx +++ b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx @@ -368,22 +368,18 @@ bool SlideSorterController::Command ( } } - if (pViewShell != nullptr) + if (SfxDispatcher* pDispatcher = pViewShell->GetDispatcher()) { - SfxDispatcher* pDispatcher = pViewShell->GetDispatcher(); - if (pDispatcher != nullptr) - { - mbContextMenuOpen = true; - if (!rEvent.IsMouseEvent()) - pDispatcher->ExecutePopup(aPopupId, pWindow, &aMenuLocation); - else - pDispatcher->ExecutePopup(aPopupId); - mbContextMenuOpen = false; - mrSlideSorter.GetView().UpdatePageUnderMouse(); - ::rtl::Reference<SelectionFunction> pFunction(GetCurrentSelectionFunction()); - if (pFunction.is()) - pFunction->ResetMouseAnchor(); - } + mbContextMenuOpen = true; + if (!rEvent.IsMouseEvent()) + pDispatcher->ExecutePopup(aPopupId, pWindow, &aMenuLocation); + else + pDispatcher->ExecutePopup(aPopupId); + mbContextMenuOpen = false; + mrSlideSorter.GetView().UpdatePageUnderMouse(); + ::rtl::Reference<SelectionFunction> pFunction(GetCurrentSelectionFunction()); + if (pFunction.is()) + pFunction->ResetMouseAnchor(); } if (pPage == nullptr) { diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index bdd61533eb38..c7b8b6b4950a 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -797,13 +797,10 @@ uno::Reference< drawing::XDrawPage > SAL_CALL SdXImpressDocument::getHandoutMast uno::Reference< drawing::XDrawPage > xPage; - if( mpDoc ) - { - initializeDocument(); - SdPage* pPage = mpDoc->GetMasterSdPage( 0, PageKind::Handout ); - if( pPage ) - xPage.set( pPage->getUnoPage(), uno::UNO_QUERY ); - } + initializeDocument(); + SdPage* pPage = mpDoc->GetMasterSdPage(0, PageKind::Handout); + if (pPage) + xPage.set(pPage->getUnoPage(), uno::UNO_QUERY); return xPage; } @@ -956,7 +953,7 @@ css::uno::Reference<css::uno::XInterface> SdXImpressDocument::create( if( aServiceSpecifier == "com.sun.star.document.ExportEmbeddedObjectResolver" ) { - ::comphelper::IEmbeddedHelper *pPersist = mpDoc ? mpDoc->GetPersist() : nullptr; + comphelper::IEmbeddedHelper* pPersist = mpDoc->GetPersist(); if( nullptr == pPersist ) throw lang::DisposedException(); @@ -965,7 +962,7 @@ css::uno::Reference<css::uno::XInterface> SdXImpressDocument::create( if( aServiceSpecifier == "com.sun.star.document.ImportEmbeddedObjectResolver" ) { - ::comphelper::IEmbeddedHelper *pPersist = mpDoc ? mpDoc->GetPersist() : nullptr; + comphelper::IEmbeddedHelper* pPersist = mpDoc->GetPersist(); if( nullptr == pPersist ) throw lang::DisposedException(); diff --git a/sd/source/ui/unoidl/unopback.cxx b/sd/source/ui/unoidl/unopback.cxx index 1f0a1a0cb16e..aed0fb2eec6b 100644 --- a/sd/source/ui/unoidl/unopback.cxx +++ b/sd/source/ui/unoidl/unopback.cxx @@ -402,20 +402,17 @@ uno::Any SAL_CALL SdUnoPageBackground::getPropertyDefault( const OUString& aProp throw beans::UnknownPropertyException( aPropertyName, static_cast<cppu::OWeakObject*>(this)); uno::Any aAny; - if( mpSet ) + if (pEntry->nWID == OWN_ATTR_FILLBMP_MODE) { - if( pEntry->nWID == OWN_ATTR_FILLBMP_MODE ) - { - aAny <<= drawing::BitmapMode_REPEAT; - } - else - { - SfxItemPool& rPool = *mpSet->GetPool(); - SfxItemSet aSet( rPool, {{pEntry->nWID, pEntry->nWID}}); - aSet.Put( rPool.GetDefaultItem( pEntry->nWID ) ); + aAny <<= drawing::BitmapMode_REPEAT; + } + else + { + SfxItemPool& rPool = *mpSet->GetPool(); + SfxItemSet aSet(rPool, { { pEntry->nWID, pEntry->nWID } }); + aSet.Put(rPool.GetDefaultItem(pEntry->nWID)); - aAny = SvxItemPropertySet_getPropertyValue( pEntry, aSet ); - } + aAny = SvxItemPropertySet_getPropertyValue(pEntry, aSet); } return aAny; } diff --git a/sd/source/ui/unoidl/unosrch.cxx b/sd/source/ui/unoidl/unosrch.cxx index d4c65435fd1a..7be7281816bf 100644 --- a/sd/source/ui/unoidl/unosrch.cxx +++ b/sd/source/ui/unoidl/unosrch.cxx @@ -789,14 +789,11 @@ sal_Int32 SAL_CALL SdUnoFindAllAccess::getCount() uno::Any SAL_CALL SdUnoFindAllAccess::getByIndex( sal_Int32 Index ) { - uno::Any aAny; - if( Index < 0 || Index >= getCount() ) throw lang::IndexOutOfBoundsException(); - const uno::Reference< uno::XInterface > *pRefs = maSequence.getConstArray(); - if(pRefs) - aAny <<= pRefs[ Index ]; + uno::Any aAny; + aAny <<= maSequence[Index]; return aAny; } diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index ccf09ff1db67..d9fe8fb46367 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -935,18 +935,6 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, { svt::EmbeddedObjectRef aObjRef( xObj, aObjDesc.mnViewAspect ); - // try to get the replacement image from the clipboard - Graphic aGraphic; - SotClipboardFormatId nGrFormat = SotClipboardFormatId::NONE; - - // insert replacement image ( if there is one ) into the object helper - if ( nGrFormat != SotClipboardFormatId::NONE ) - { - datatransfer::DataFlavor aDataFlavor; - SotExchange::GetFormatDataFlavor( nGrFormat, aDataFlavor ); - aObjRef.SetGraphic( aGraphic, aDataFlavor.MimeType ); - } - Size aSize; if ( aObjDesc.mnViewAspect == embed::Aspects::MSOLE_ICON ) { diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx index 0398ff0488f5..5b4bc878393a 100644 --- a/sd/source/ui/view/viewshel.cxx +++ b/sd/source/ui/view/viewshel.cxx @@ -399,13 +399,10 @@ bool ViewShell::KeyInput(const KeyEvent& rKEvt, ::sd::Window* pWin) if(pWin) SetActiveWindow(pWin); - if(!bReturn) - { - // give key input first to SfxViewShell to give CTRL+Key - // (e.g. CTRL+SHIFT+'+', to front) priority. - OSL_ASSERT (GetViewShell()!=nullptr); - bReturn = GetViewShell()->KeyInput(rKEvt); - } + // give key input first to SfxViewShell to give CTRL+Key + // (e.g. CTRL+SHIFT+'+', to front) priority. + OSL_ASSERT(GetViewShell() != nullptr); + bReturn = GetViewShell()->KeyInput(rKEvt); const size_t OriCount = GetView()->GetMarkedObjectList().GetMarkCount(); if(!bReturn) |