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

New commits:
commit 00ad650a213406466b8ccd5d7907ed069326ef07
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Thu Aug 22 12:45:22 2024 +0200
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Thu Aug 22 19:52:47 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>
    (cherry picked from commit 13495926390ba54fbcd45ec00fbe613b1f2b734b)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172200
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index 2375fae0db3c..db2e567d5543 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -3703,6 +3703,11 @@ SwShortCut::SwShortCut( const SwFrame& rFrame, const 
SwRect& rRect )
 
 void SwLayoutFrame::PaintSwFrame(vcl::RenderContext& rRenderContext, SwRect 
const& rRect, 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, &aFrameInfo, nullptr, 
rRenderContext );
@@ -4642,6 +4647,10 @@ void SwTextFrame::PaintOutlineContentVisibilityButton() 
const
 
 void SwTabFrame::PaintSwFrame(vcl::RenderContext& rRenderContext, SwRect 
const& rRect, 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