summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2024-03-25 16:01:44 -0400
committerMiklos Vajna <vmiklos@collabora.com>2024-04-02 09:08:25 +0200
commitf53df0c693d8e73e86ddd986e5b861a0af28e62b (patch)
tree3fbd93a03ef61391f678e166165020b882e7c619
parenta4a5c6b63599bca1f084bb90875f6fd8e15184ac (diff)
tdf#131253 sw: draw frame text boundary only if show formatting marks
This squashed backport includes c51f9f15b8c308e62b4839cc13d623fdab0486c2 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...) These text boundaries around AT-anchored flies only became visible in LO 6.0. 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> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165428 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
-rw-r--r--sw/source/core/layout/paintfrm.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 92d8f087ec36..5ca89df04ba8 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -7331,6 +7331,28 @@ 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
+ // (unless the frame itself contains text)
+ const text::WrapTextMode aSurround = GetFormat()->GetSurround().GetSurround();
+ if (GetFormat()->GetAnchor().GetAnchorId() != RndStdIds::FLY_AS_CHAR
+ && (!Lower() || !Lower()->IsTextFrame())
+ && (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() );