ODF-imported textboxes identify themselves as such

at least those that are created by SwTextBoxHelper::create

Change-Id: I252ba397570eec2d3b240d0ac388f4391e1bb930
Reviewed-on: https://gerrit.libreoffice.org/77103
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx
index 423b41e..72f62d3 100644
--- a/sw/source/core/draw/dflyobj.cxx
+++ b/sw/source/core/draw/dflyobj.cxx
@@ -126,7 +126,8 @@ std::unique_ptr<sdr::contact::ViewContact> SwFlyDrawObj::CreateObjectSpecificVie
}

SwFlyDrawObj::SwFlyDrawObj(SdrModel& rSdrModel)
:   SdrObject(rSdrModel)
:   SdrObject(rSdrModel),
    mbIsTextBox(false)
{
}

@@ -145,12 +146,6 @@ sal_uInt16 SwFlyDrawObj::GetObjIdentifier() const
    return SwFlyDrawObjIdentifier;
}

bool SwFlyDrawObj::IsTextBox() const
{
    const SwFrameFormat* pFrameFormat = FindFrameFormat(this);
    return SwTextBoxHelper::isTextBox(pFrameFormat, RES_FLYFRMFMT);
}

// TODO: Need own primitive to get the FlyFrame paint working
namespace drawinglayer
{
diff --git a/sw/source/core/inc/dflyobj.hxx b/sw/source/core/inc/dflyobj.hxx
index d96029b..b5a0357 100644
--- a/sw/source/core/inc/dflyobj.hxx
+++ b/sw/source/core/inc/dflyobj.hxx
@@ -35,6 +35,7 @@ class SwFlyDrawObj : public SdrObject
{
private:
    virtual std::unique_ptr<sdr::properties::BaseProperties> CreateObjectSpecificProperties() override;
    bool mbIsTextBox;

protected:
    // #i95264# SwFlyDrawObj needs an own VC since createViewIndependentPrimitive2DSequence()
@@ -50,7 +51,8 @@ public:
    // for instantiation of this class while loading (via factory)
    virtual SdrInventor GetObjInventor()     const override;
    virtual sal_uInt16  GetObjIdentifier()   const override;
    bool IsTextBox() const override;
    virtual bool IsTextBox() const override { return mbIsTextBox; }
    virtual void SetTextBox(bool bIsTextBox) { mbIsTextBox = bIsTextBox; }
};

// virtual objects for Flys
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index f657bf5..0014d84 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -2490,6 +2490,16 @@ void SwFrameFormat::SetOtherTextBoxFormat( SwFrameFormat *pFormat )
        assert( nullptr != m_pOtherTextBoxFormat );
    }
    m_pOtherTextBoxFormat = pFormat;

    SdrObject* pObj = FindSdrObject();

    if (pObj)
    {
        SwFlyDrawObj* pSwFlyDraw = dynamic_cast<SwFlyDrawObj*>(pObj);

        if (pSwFlyDraw)
            pSwFlyDraw->SetTextBox(true);
    }
}

bool SwFrameFormat::supportsFullDrawingLayerFillAttributeSet() const