sw/source/core/layout/paintfrm.cxx |    9 +++++++++
 1 file changed, 9 insertions(+)

New commits:
commit 13495926390ba54fbcd45ec00fbe613b1f2b734b
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Thu Aug 22 12:45:22 2024 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Thu Aug 22 15:15:10 2024 +0200

    sw: do not paint hidden frames
    
    Table frames in hidden sections may still paint their border lines.
    
    Check that the height (or width, if vertical) is not 0 before painting.
    
    (regression from commit ff7f1b59e22092d8548459e75fe912db852f056f)
    
    Change-Id: I6ace6d6608d5e23ff2f3c5a61d37e3f6da958977
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172250
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index f8c657d16784..de4c8cb522e8 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -3718,6 +3718,11 @@ SwShortCut::SwShortCut( const SwFrame& rFrame, const 
SwRect& rRect )
 
 void SwLayoutFrame::PaintSwFrame(vcl::RenderContext& rRenderContext, SwRect 
const& rRect, PaintFrameMode ePaintFrameMode, SwPrintData const*const) const
 {
+    if (!getFramePrintArea().HasArea())
+    {
+        return; // do not paint hidden frame
+    }
+
     // #i16816# tagged pdf support
     Frame_Info aFrameInfo(*this, false);
     SwTaggedPDFHelper aTaggedPDFHelper( nullptr,
@@ -4668,6 +4673,10 @@ void SwTextFrame::PaintOutlineContentVisibilityButton() 
const
 
 void SwTabFrame::PaintSwFrame(vcl::RenderContext& rRenderContext, SwRect 
const& rRect, PaintFrameMode, SwPrintData const*const) const
 {
+    if (!getFramePrintArea().HasArea())
+    {
+        return; // do not paint hidden frame
+    }
     const SwViewOption* pViewOption = gProp.pSGlobalShell->GetViewOptions();
     if (pViewOption->IsTable())
     {

Reply via email to