sc/source/core/data/drwlayer.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit e7872589d53d85cecd34914125e08e9af4e3d50c
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Nov 5 12:28:29 2020 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Thu Nov 5 16:42:57 2020 +0100

    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 <caol...@redhat.com>
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

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())),
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to