summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-11-05 12:28:29 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-11-05 16:42:57 +0100
commite7872589d53d85cecd34914125e08e9af4e3d50c (patch)
tree1033c1b9bf707b1d92a5cc97c744b5768ce77694
parentcdedc00ff579980c73b3cdb5fee0c78c1e111361 (diff)
crashtesting: on import of ooo109115-1.ods
since... commit 1f0b3c7a40edfa81bbc7a58d123a6a2dfd83e4ca Date: Sat Oct 10 17:55:31 2020 +0200 Improve 'resize with cell' handling pObj is (amazingly) actually an E3dScene not a SdrPathObj. E3dScene::GetObjIdentifier is... sal_uInt16 E3dScene::GetObjIdentifier() const { return E3D_SCENE_ID; } and E3D_SCENE_ID is.. const sal_uInt16 E3D_SCENE_ID = 2; but OBJ_LINE is also 2 ! so this E3dScene is cast to a SdrPathObj which it isn't. Seems you can only rely on the ObjIdentifier when you know the SdrInventor of the object, which seems unfortunate. just use a dynamic_cast for now Change-Id: Ic3d86e59c74d4f0436e294ce10d432681f312f96 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105368 Tested-by: Jenkins Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sc/source/core/data/drwlayer.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index 35a377813b4e..7790bf81f58e 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -910,13 +910,16 @@ void ScDrawLayer::InitializeCellAnchoredObj(SdrObject* pObj, ScDrawObjData& rDat
const ScAnchorType aAnchorType = ScDrawLayer::GetAnchorType(*pObj);
if (aAnchorType == SCA_CELL_RESIZE)
{
+ SdrPathObj* pLineObj = nullptr;
if (pObj->GetObjIdentifier() == OBJ_LINE)
+ pLineObj = dynamic_cast<SdrPathObj*>(pObj);
+ if (pLineObj)
{
// Horizontal lines might have wrong start and end anchor because of erroneously applied
// 180deg rotation (tdf#137446). Other lines have wrong end anchor. Coordinates in
// object are correct. Use them for recreating the anchor.
const basegfx::B2DPolygon aPoly(
- reinterpret_cast<SdrPathObj*>(pObj)->GetPathPoly().getB2DPolygon(0));
+ pLineObj->GetPathPoly().getB2DPolygon(0));
const basegfx::B2DPoint aB2DPoint0(aPoly.getB2DPoint(0));
const basegfx::B2DPoint aB2DPoint1(aPoly.getB2DPoint(1));
const Point aPointLT(FRound(std::min(aB2DPoint0.getX(), aB2DPoint1.getX())),