diff options
author | Noel <noel.grandin@collabora.co.uk> | 2021-03-06 20:40:58 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-03-07 13:22:28 +0100 |
commit | e4e80ed313882f9ea1b309054e5aa3e839586516 (patch) | |
tree | 0d7e44c4456933d7e946a28c8f8d780372a4334f /svx/source/form | |
parent | 4c86b07f80740d609f1a1b04b9f53b19782be036 (diff) |
loplugin:staticdynamic now with extra salt
because it wasn't quite there yet - now checks for casts with and
without const, because const doesn't really matter here.
Change-Id: I319025b2095a803fcaad2a7a696d2730b7fd2f81
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112098
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/form')
-rw-r--r-- | svx/source/form/fmview.cxx | 6 | ||||
-rw-r--r-- | svx/source/form/navigatortree.cxx | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/svx/source/form/fmview.cxx b/svx/source/form/fmview.cxx index b8a0ed479719..756fa8d2b21e 100644 --- a/svx/source/form/fmview.cxx +++ b/svx/source/form/fmview.cxx @@ -76,9 +76,9 @@ void FmFormView::Init() SdrModel* pModel = GetModel(); DBG_ASSERT( dynamic_cast<const FmFormModel*>( pModel) != nullptr, "Wrong model" ); - if( dynamic_cast<const FmFormModel*>( pModel) == nullptr ) return; - FmFormModel* pFormModel = static_cast<FmFormModel*>(pModel); - + FmFormModel* pFormModel = dynamic_cast<FmFormModel*>(pModel); + if( !pFormModel ) + return; // get DesignMode from model bool bInitDesignMode = pFormModel->GetOpenInDesignMode(); diff --git a/svx/source/form/navigatortree.cxx b/svx/source/form/navigatortree.cxx index 5cde1645f4cf..bade46460186 100644 --- a/svx/source/form/navigatortree.cxx +++ b/svx/source/form/navigatortree.cxx @@ -1602,19 +1602,19 @@ namespace svxform FmEntryData* pCurrent = reinterpret_cast<FmEntryData*>(m_xTreeView->get_id(*rIter).toInt64()); // a form ? - bool bIsForm = dynamic_cast<const FmFormData*>( pCurrent) != nullptr; + auto pFormData = dynamic_cast<FmFormData*>(pCurrent); // because deletion is done by the view, and i build on its MarkList, // but normally only direct controls, no indirect ones, are marked in a marked form, // I have to do it later - if (bIsForm) - MarkViewObj(static_cast<FmFormData*>(pCurrent), true/*deep*/); + if (pFormData) + MarkViewObj(pFormData, true/*deep*/); // a hidden control ? bool bIsHidden = IsHiddenControl(pCurrent); // keep forms and hidden controls, the rest not - if (!bIsForm && !bIsHidden) + if (!pFormData && !bIsHidden) { // well, no form and no hidden control -> we can remove it from m_arrCurrentSelection, as it will // be deleted automatically. This is because for every model (except forms and hidden control models) |