include/svx/svdobj.hxx | 12 +++++----- include/svx/svdovirt.hxx | 6 +++++ svx/source/sdr/contact/viewobjectcontact.cxx | 4 +++ svx/source/svdraw/svdovirt.cxx | 30 +++++++++++++++++++++++++++ 4 files changed, 46 insertions(+), 6 deletions(-)
New commits: commit 40253b20de74e2a289c89367189fd5b32b20d676 Author: Michael Stahl <michael.st...@allotropia.de> AuthorDate: Tue Nov 29 13:11:25 2022 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Sat Dec 3 21:03:06 2022 +0000 tdf#141386 svx,sw: fix setting name/title/description on SwVirtFlyDrawObj The problem is that setting the title via the dialog in Writer calls SwFlyFrameFormat::SetObjTitle() which sets SwFrameFormat::msTitle and SdrObject::m_pPlusData::aObjTitle on the master SwFlyDrawObj. Now ViewContactOfSdrObj::embedToObjectSpecificInformation() is called for the SwVirtFlyDrawObj, not the SwFlyDrawObj, because that one is not on the SdrPage. However, SwFlyFrameFormat::GetObjTitle() will return SwFrameFormat::msTitle as a fallback. So what's missing here is SwVirtFlyDrawObj must forward calls that get/set model properties to its associated SwFlyDrawObj - implement that in base class SdrVirtObj. But note that this does not fix the reported PDF export bug - that was already fixed by commit 122b4264d23df8b11419839ba700b88c4f936a6c in sw and this fix is for other users of ObjectInfoPrimitive2D. Change-Id: Id306c44c67c069777373e5e4d55415176b513afc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143465 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@allotropia.de> (cherry picked from commit ae132145ff42a95dc24fb124847c04af4b8c8dab) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143440 Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx index 373b1fe537ae..4c8fce88b9f3 100644 --- a/include/svx/svdobj.hxx +++ b/include/svx/svdobj.hxx @@ -377,14 +377,14 @@ public: // An object may have a user-set Name (Get/SetName()), e.g SdrGrafObj, SdrObjGroup // or SdrOle2Obj. // It may also have a Title and a Description for accessibility purposes. - void SetName(const OUString& rStr, const bool bSetChanged = true); - const OUString & GetName() const; + virtual void SetName(const OUString& rStr, const bool bSetChanged = true); + virtual const OUString & GetName() const; void MakeNameUnique(); void MakeNameUnique(std::unordered_set<OUString>& rNameSet); - void SetTitle(const OUString& rStr); - OUString GetTitle() const; - void SetDescription(const OUString& rStr); - OUString GetDescription() const; + virtual void SetTitle(const OUString& rStr); + virtual OUString GetTitle() const; + virtual void SetDescription(const OUString& rStr); + virtual OUString GetDescription() const; // for group objects bool IsGroupObject() const; diff --git a/include/svx/svdovirt.hxx b/include/svx/svdovirt.hxx index fa2f935f34e5..1114d858afdc 100644 --- a/include/svx/svdovirt.hxx +++ b/include/svx/svdovirt.hxx @@ -62,6 +62,12 @@ public: virtual SdrInventor GetObjInventor() const override; virtual SdrObjKind GetObjIdentifier() const override; virtual SdrObjList* GetSubList() const override; + virtual void SetName(const OUString& rStr, const bool bSetChanged = true) override; + virtual const OUString& GetName() const override; + virtual void SetTitle(const OUString& rStr) override; + virtual OUString GetTitle() const override; + virtual void SetDescription(const OUString& rStr) override; + virtual OUString GetDescription() const override; virtual const tools::Rectangle& GetCurrentBoundRect() const override; virtual const tools::Rectangle& GetLastBoundRect() const override; diff --git a/svx/source/sdr/contact/viewobjectcontact.cxx b/svx/source/sdr/contact/viewobjectcontact.cxx index 65889f4ce037..95c1c01ca34b 100644 --- a/svx/source/sdr/contact/viewobjectcontact.cxx +++ b/svx/source/sdr/contact/viewobjectcontact.cxx @@ -392,6 +392,10 @@ drawinglayer::primitive2d::Primitive2DContainer const & ViewObjectContact::getPr const SdrObjKind nIdentifier(pSdrObj->GetObjIdentifier()); const bool bIsTextObj(nullptr != dynamic_cast<const SdrTextObj *>(pSdrObj)); + // Note: SwFlyDrawObj/SwVirtFlyDrawObj have SdrInventor::Swg - these + // are *not* handled here because not all of them are painted + // completely with primitives, so a tag here does not encapsulate them. + // The tag must be created by SwTaggedPDFHelper until this is fixed. if ( nInventor == SdrInventor::Default ) { if ( nIdentifier == SdrObjKind::Group ) diff --git a/svx/source/svdraw/svdovirt.cxx b/svx/source/svdraw/svdovirt.cxx index 7d68e4840ff9..372756cce49b 100644 --- a/svx/source/svdraw/svdovirt.cxx +++ b/svx/source/svdraw/svdovirt.cxx @@ -111,6 +111,36 @@ SdrObjList* SdrVirtObj::GetSubList() const return rRefObj.GetSubList(); } +void SdrVirtObj::SetName(const OUString& rStr, const bool bSetChanged) +{ + return rRefObj.SetName(rStr, bSetChanged); +} + +const OUString & SdrVirtObj::GetName() const +{ + return rRefObj.GetName(); +} + +void SdrVirtObj::SetTitle(const OUString& rStr) +{ + return rRefObj.SetTitle(rStr); +} + +OUString SdrVirtObj::GetTitle() const +{ + return rRefObj.GetTitle(); +} + +void SdrVirtObj::SetDescription(const OUString& rStr) +{ + return rRefObj.SetDescription(rStr); +} + +OUString SdrVirtObj::GetDescription() const +{ + return rRefObj.GetDescription(); +} + const tools::Rectangle& SdrVirtObj::GetCurrentBoundRect() const { m_aOutRect = rRefObj.GetCurrentBoundRect(); // TODO: Optimize this.