diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2019-04-01 00:25:16 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2019-04-01 00:49:12 +0200 |
commit | 85456fae54029edd26df2277a9eec5e2fe3d9739 (patch) | |
tree | fd55ad48b34c66f0b839edcbc952a8a5a0752c72 /chart2 | |
parent | 1d35b89e7581e12024769d19bfb6d6eb2c3274b8 (diff) |
tdf#120703 PVS: Silence V522 warnings
V522 There might be dereferencing of a potential null pointer.
Change-Id: Ie617b41a8f8d334022cf5313b242a236baedba48
Reviewed-on: https://gerrit.libreoffice.org/70017
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/controller/main/ChartController.cxx | 3 | ||||
-rw-r--r-- | chart2/source/controller/main/ChartController_TextEdit.cxx | 6 | ||||
-rw-r--r-- | chart2/source/controller/main/ChartController_Window.cxx | 3 |
3 files changed, 7 insertions, 5 deletions
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx index bffd841f415d..533029f3024a 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -396,7 +396,8 @@ void SAL_CALL ChartController::attachFrame( uno::Reference<ui::XSidebar> xSidebar = getSidebarFromModel(getModel()); if (xSidebar.is()) { - sfx2::sidebar::SidebarController* pSidebar = dynamic_cast<sfx2::sidebar::SidebarController*>(xSidebar.get()); + assert(dynamic_cast<sfx2::sidebar::SidebarController*>(xSidebar.get())); + auto pSidebar = static_cast<sfx2::sidebar::SidebarController*>(xSidebar.get()); sfx2::sidebar::SidebarController::registerSidebarForFrame(pSidebar, this); pSidebar->updateModel(getModel()); css::lang::EventObject aEvent; diff --git a/chart2/source/controller/main/ChartController_TextEdit.cxx b/chart2/source/controller/main/ChartController_TextEdit.cxx index 71f9f02a28b3..a8148e3929b8 100644 --- a/chart2/source/controller/main/ChartController_TextEdit.cxx +++ b/chart2/source/controller/main/ChartController_TextEdit.cxx @@ -174,9 +174,9 @@ void ChartController::executeDispatch_InsertSpecialCharacter() const SfxItemSet* pSet = pDlg->GetOutputItemSet(); const SfxPoolItem* pItem=nullptr; OUString aString; - if ( pSet && pSet->GetItemState( SID_CHARMAP, true, &pItem) == SfxItemState::SET && - dynamic_cast< const SfxStringItem* >(pItem) != nullptr ) - aString = dynamic_cast<const SfxStringItem*>(pItem)->GetValue(); + if (pSet && pSet->GetItemState(SID_CHARMAP, true, &pItem) == SfxItemState::SET) + if (auto pStringItem = dynamic_cast<const SfxStringItem*>(pItem)) + aString = pStringItem->GetValue(); OutlinerView* pOutlinerView = m_pDrawViewWrapper->GetTextEditOutlinerView(); SdrOutliner* pOutliner = m_pDrawViewWrapper->getOutliner(); diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx index d2c7dfbd69a3..06e870dc05ae 100644 --- a/chart2/source/controller/main/ChartController_Window.cxx +++ b/chart2/source/controller/main/ChartController_Window.cxx @@ -852,7 +852,8 @@ void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt ) m_xUndoManager ); bool bChanged = false; - ChartModel* pModel = dynamic_cast<ChartModel*>(getModel().get()); + assert(dynamic_cast<ChartModel*>(getModel().get())); + ChartModel* pModel = static_cast<ChartModel*>(getModel().get()); if ( eObjectType == OBJECTTYPE_LEGEND ) bChanged = DiagramHelper::switchDiagramPositioningToExcludingPositioning( *pModel, false , true ); |