summaryrefslogtreecommitdiff
path: root/sw/source/uibase/uiview/viewdraw.cxx
diff options
context:
space:
mode:
authorNoel <noel.grandin@collabora.co.uk>2021-03-06 20:40:58 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-03-07 13:22:28 +0100
commite4e80ed313882f9ea1b309054e5aa3e839586516 (patch)
tree0d7e44c4456933d7e946a28c8f8d780372a4334f /sw/source/uibase/uiview/viewdraw.cxx
parent4c86b07f80740d609f1a1b04b9f53b19782be036 (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 'sw/source/uibase/uiview/viewdraw.cxx')
-rw-r--r--sw/source/uibase/uiview/viewdraw.cxx21
1 files changed, 11 insertions, 10 deletions
diff --git a/sw/source/uibase/uiview/viewdraw.cxx b/sw/source/uibase/uiview/viewdraw.cxx
index 766489bcf09c..f27000acbd71 100644
--- a/sw/source/uibase/uiview/viewdraw.cxx
+++ b/sw/source/uibase/uiview/viewdraw.cxx
@@ -473,17 +473,18 @@ bool SwView::EnterDrawTextMode(const Point& aDocPos)
if (pSdrView->IsMarkedHit(aDocPos) && !pSdrView->PickHandle(aDocPos) && IsTextTool())
pObj = pSdrView->PickObj(aDocPos, pSdrView->getHitTolLog(), pPV, SdrSearchOptions::PICKTEXTEDIT);
- if (pObj &&
- // To allow SwDrawVirtObj text objects to be activated, allow their type, too.
- ( dynamic_cast< const SdrTextObj *>( pObj ) != nullptr ||
- ( dynamic_cast< const SwDrawVirtObj *>( pObj ) != nullptr &&
- dynamic_cast< const SdrTextObj *>(&static_cast<SwDrawVirtObj*>(pObj)->GetReferencedObj() ) != nullptr ) ) &&
-
- m_pWrtShell->IsSelObjProtected(FlyProtectFlags::Content) == FlyProtectFlags::NONE)
+ if (pObj)
{
- // Refuse to edit editeng text of the shape if it has textbox attached.
- if (!lcl_isTextBox(pObj))
- bReturn = BeginTextEdit( pObj, pPV, m_pEditWin );
+ // To allow SwDrawVirtObj text objects to be activated, allow their type, too.
+ auto pVirtObj = dynamic_cast<SwDrawVirtObj*>( pObj );
+ if ( (pVirtObj && dynamic_cast< const SdrTextObj *>(&pVirtObj->GetReferencedObj() ) != nullptr &&
+ m_pWrtShell->IsSelObjProtected(FlyProtectFlags::Content) == FlyProtectFlags::NONE) ||
+ dynamic_cast< const SdrTextObj *>( pObj ) != nullptr )
+ {
+ // Refuse to edit editeng text of the shape if it has textbox attached.
+ if (!lcl_isTextBox(pObj))
+ bReturn = BeginTextEdit( pObj, pPV, m_pEditWin );
+ }
}
pSdrView->SetHitTolerancePixel( nOld );