summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-05-10 19:24:40 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-05-10 20:50:24 +0200
commit5aa48d61f82b2cbaa8995350e8c8d448d300c264 (patch)
tree5dc779a816b69d4a10cd2aacecb07da45a67a7e8 /svx
parente368cc61fa715e98fbc448c5b0edc781915f8385 (diff)
reduce frequency of dynamic_cast
by checking cheaper things first Change-Id: I0c93021966ee09967f0ce2e265adafb279b669bd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115356 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/unodraw/unoshtxt.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/svx/source/unodraw/unoshtxt.cxx b/svx/source/unodraw/unoshtxt.cxx
index 39cad52c073b..0cc8baffa233 100644
--- a/svx/source/unodraw/unoshtxt.cxx
+++ b/svx/source/unodraw/unoshtxt.cxx
@@ -108,8 +108,10 @@ private:
bool HasView() const { return mpView != nullptr; }
bool IsEditMode() const
{
+ if (!mbShapeIsEditMode)
+ return false;
SdrTextObj* pTextObj = dynamic_cast<SdrTextObj*>( mpObject );
- return mbShapeIsEditMode && pTextObj && pTextObj->IsTextEditActive();
+ return pTextObj && pTextObj->IsTextEditActive();
}
void dispose();