diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-12-03 14:52:22 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-12-03 17:40:24 +0100 |
commit | 60ae45f5846f69857c46b74d153fea1ef14d3c4d (patch) | |
tree | 3efe9b279daf7321eadb7fddf8de280a578de6a4 /sc | |
parent | a18217c04ba2c927669bd0512eaf57a9f07ba9c4 (diff) |
cid#1470396 Unchecked dynamic_cast
a static_cast should be sufficient here after the GetObjIdentifier() ==
OBJ_MEASURE check
Change-Id: Idaded0a08fd908f3fa62acfe0d6efd98e8b1503a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107169
Tested-by: Jenkins
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/drwlayer.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx index b372967806ce..5d8f50d14be1 100644 --- a/sc/source/core/data/drwlayer.cxx +++ b/sc/source/core/data/drwlayer.cxx @@ -934,7 +934,7 @@ void ScDrawLayer::InitializeCellAnchoredObj(SdrObject* pObj, ScDrawObjData& rDat { // Measure lines might have got wrong start and end anchor from XML import. Recreate // anchor from start and end point. - SdrMeasureObj* pMeasureObj = dynamic_cast<SdrMeasureObj*>(pObj); + SdrMeasureObj* pMeasureObj = static_cast<SdrMeasureObj*>(pObj); // tdf#137576. The logic rectangle has likely no current values here, but only the // 1cm x 1cm default size. The call of TakeUnrotatedSnapRect is currently (LO 7.2) // the only way to force a recalc of the logic rectangle. @@ -2231,7 +2231,7 @@ void ScDrawLayer::SetCellAnchoredFromPosition( SdrObject &rObj, const ScDocument { // tdf#137576. A SdrMeasureObj might have a wrong logic rect here. TakeUnrotatedSnapRect // calculates the current unrotated snap rectangle, sets logic rectangle and returns it. - static_cast<SdrMeasureObj*>(&rObj)->TakeUnrotatedSnapRect(aObjRect2); + static_cast<SdrMeasureObj&>(rObj).TakeUnrotatedSnapRect(aObjRect2); } else aObjRect2 = rObj.GetLogicRect(); |