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

New commits:
commit 5bf7df62645f73ad69772f318ea3058dfd6fce12
Author:     Justin Luth <justin.l...@collabora.com>
AuthorDate: Mon Mar 25 16:01:44 2024 -0400
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Tue Mar 26 13:29:13 2024 +0100

    tdf#131253 sw: draw frame text boundary on when show formatting marks
    
    It is infuriating to see a border around your image
    when there is no border defined. View - Text boundaries
    does NOT sound like something that would apply to images,
    and it is NOT nice to turn that off because then you also
    lose the body text markers as well as the header/footer indicators.
    
    Instead, do the same thing as the page boundaries - only show
    the (full) boundary when show formatting marks is turned on
    (and there are no partial boundaries for frames...)
    
    I tried to write a GDIMetaFile unit test,
    but the dumps were identical - failing to capture this screen artifact.
    
    Change-Id: I7954effc46d977e1761cba71758f7a7af2072807
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165294
    Reviewed-by: Justin Luth <jl...@mail.com>
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index 042c4f3be4a7..9a0776631f01 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -7479,6 +7479,26 @@ void SwLayoutFrame::PaintSubsidiaryLines( const 
SwPageFrame *pPage,
     const bool bFlys = pPage->GetSortedObjs() != nullptr;
 
     const bool bCell = IsCellFrame();
+
+    if (!bCell && IsFlyFrame())
+    {
+        // particularly with images (but also plausible for any kind of frame),
+        // it is very disconcerting to see a fake border,
+        // so (just like the page boundary) only show fly "text boundaries"
+        // when "Show Formatting Marks" is turned on
+        if (!gProp.pSGlobalShell->GetViewOptions()->IsViewMetaChars())
+            return;
+
+        // if the frame is wrap none or wrap through, then text boundary lines 
have no meaning
+        const text::WrapTextMode aSurround = 
GetFormat()->GetSurround().GetSurround();
+        if (GetFormat()->GetAnchor().GetAnchorId() != RndStdIds::FLY_AS_CHAR
+            && (aSurround == text::WrapTextMode::WrapTextMode_THROUGH
+                || aSurround == text::WrapTextMode::WrapTextMode_NONE))
+        {
+            return;
+        }
+    }
+
     //  #i3662# - use frame area for cells for section use also frame area
     const bool bUseFrameArea = bCell || IsSctFrame();
     SwRect aOriginal( bUseFrameArea ? getFrameArea() : getFramePrintArea() );

Reply via email to