From 9fb9bd54a82ee20f5916aa68e428e0fb67f02ed6 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Wed, 8 May 2024 14:20:26 +0200 Subject: tdf#156484 svx,sw: fix visibility of shapes in header/footer Similar to commit ae132145ff42a95dc24fb124847c04af4b8c8dab, also forward IsVisible() and IsPrintable() from SdrVirtObj to its real object; evidently the properties aren't copied when creating SdrVirtObj but there is no reason for that to have these properties independent. This triggers an assert in VOCOfDrawVirtObj::createPrimitive2DSequence() because that is called during layout from getObjectRange(); the assert was added in commit ae3ec0d53a22ae5d2b7fb244a6056d0627b71873 and intended for painting, but this isn't painting, and it's not easily possible to detect if the function is called during painting, so remove the assert. Change-Id: Id2a04a5d07f43b86eb9c524b30ba74ecaf6a95c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167350 Reviewed-by: Michael Stahl Tested-by: Jenkins --- svx/source/svdraw/svdobj.cxx | 10 ++++++++++ svx/source/svdraw/svdovirt.cxx | 20 ++++++++++++++++++++ 2 files changed, 30 insertions(+) (limited to 'svx') diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index ccc79daed1dd..43bc417163cf 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -2665,6 +2665,11 @@ void SdrObject::SetResizeProtect(bool bProt) } } +bool SdrObject::IsPrintable() const +{ + return !m_bNoPrint; +} + void SdrObject::SetPrintable(bool bPrn) { if( bPrn == m_bNoPrint ) @@ -2679,6 +2684,11 @@ void SdrObject::SetPrintable(bool bPrn) } } +bool SdrObject::IsVisible() const +{ + return mbVisible; +} + void SdrObject::SetVisible(bool bVisible) { if( bVisible != mbVisible ) diff --git a/svx/source/svdraw/svdovirt.cxx b/svx/source/svdraw/svdovirt.cxx index b1fe6f5cb9bb..2e1641d3864e 100644 --- a/svx/source/svdraw/svdovirt.cxx +++ b/svx/source/svdraw/svdovirt.cxx @@ -97,6 +97,26 @@ void SdrVirtObj::NbcSetAnchorPos(const Point& rAnchorPos) m_aAnchor=rAnchorPos; } +bool SdrVirtObj::IsPrintable() const +{ + return mxRefObj->IsPrintable(); +} + +void SdrVirtObj::SetPrintable(bool const isPrintable) +{ + mxRefObj->SetPrintable(isPrintable); +} + +bool SdrVirtObj::IsVisible() const +{ + return mxRefObj->IsVisible(); +} + +void SdrVirtObj::SetVisible(bool const isVisible) +{ + mxRefObj->SetVisible(isVisible); +} + void SdrVirtObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const { mxRefObj->TakeObjInfo(rInfo); -- cgit