summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2024-03-25 16:01:44 -0400
committerMiklos Vajna <vmiklos@collabora.com>2024-03-26 13:29:13 +0100
commit5bf7df62645f73ad69772f318ea3058dfd6fce12 (patch)
tree1e63850730d5b3b0b3fcbd1dce2aa6819cc393f7 /sw/source
parentc58b2070f1653454e9e6e4821f9688b3d623039e (diff)
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 <jluth@mail.com> Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/layout/paintfrm.cxx20
1 files changed, 20 insertions, 0 deletions
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() );