From 60ae45f5846f69857c46b74d153fea1ef14d3c4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Thu, 3 Dec 2020 14:52:22 +0000 Subject: [PATCH] cid#1470396 Unchecked dynamic_cast MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Caolán McNamara --- sc/source/core/data/drwlayer.cxx | 4 ++-- 1 file 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(pObj); + SdrMeasureObj* pMeasureObj = static_cast(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(&rObj)->TakeUnrotatedSnapRect(aObjRect2); + static_cast(rObj).TakeUnrotatedSnapRect(aObjRect2); } else aObjRect2 = rObj.GetLogicRect();