summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2022-11-29 13:11:25 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2022-11-29 16:11:44 +0100
commitae132145ff42a95dc24fb124847c04af4b8c8dab (patch)
tree584b1e6a94901f461a72f80d06a61cc3bf892e7e /svx/source
parente180a37b663d9bc1a5219e2cb3a00ae167827325 (diff)
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.stahl@allotropia.de>
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/sdr/contact/viewobjectcontact.cxx4
-rw-r--r--svx/source/svdraw/svdovirt.cxx30
2 files changed, 34 insertions, 0 deletions
diff --git a/svx/source/sdr/contact/viewobjectcontact.cxx b/svx/source/sdr/contact/viewobjectcontact.cxx
index 9831cf3bfd59..8580603850ea 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 != DynCastSdrTextObj(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 23193d6e4aa4..ab95fd633b16 100644
--- a/svx/source/svdraw/svdovirt.cxx
+++ b/svx/source/svdraw/svdovirt.cxx
@@ -111,6 +111,36 @@ SdrObjList* SdrVirtObj::GetSubList() const
return mxRefObj->GetSubList();
}
+void SdrVirtObj::SetName(const OUString& rStr, const bool bSetChanged)
+{
+ return mxRefObj->SetName(rStr, bSetChanged);
+}
+
+const OUString & SdrVirtObj::GetName() const
+{
+ return mxRefObj->GetName();
+}
+
+void SdrVirtObj::SetTitle(const OUString& rStr)
+{
+ return mxRefObj->SetTitle(rStr);
+}
+
+OUString SdrVirtObj::GetTitle() const
+{
+ return mxRefObj->GetTitle();
+}
+
+void SdrVirtObj::SetDescription(const OUString& rStr)
+{
+ return mxRefObj->SetDescription(rStr);
+}
+
+OUString SdrVirtObj::GetDescription() const
+{
+ return mxRefObj->GetDescription();
+}
+
const tools::Rectangle& SdrVirtObj::GetCurrentBoundRect() const
{
auto aRectangle = mxRefObj->GetCurrentBoundRect(); // TODO: Optimize this.