[Libreoffice-commits] core.git: sw/source

Katarina Behrens (via logerrit) logerrit at kemper.freedesktop.org
Thu Oct 24 14:56:47 UTC 2019


 sw/source/core/draw/dflyobj.cxx  |    9 ++-------
 sw/source/core/inc/dflyobj.hxx   |    4 +++-
 sw/source/core/layout/atrfrm.cxx |   10 ++++++++++
 3 files changed, 15 insertions(+), 8 deletions(-)

New commits:
commit 0648aba5740a9ab62a98695a493ea9d1edbc7207
Author:     Katarina Behrens <Katarina.Behrens at cib.de>
AuthorDate: Wed Aug 7 13:48:19 2019 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Thu Oct 24 16:55:16 2019 +0200

    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 at collabora.com>

diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx
index 423b41ed64e9..72f62d3ff101 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 d96029be3eeb..b5a0357187f6 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 f657bf55db93..0014d84249b0 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


More information about the Libreoffice-commits mailing list