diff options
author | Justin Luth <justin.luth@collabora.com> | 2024-03-25 16:01:44 -0400 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2024-04-02 09:07:57 +0200 |
commit | a1214585c7cb849c7d47591ec6bc0d68ea9a7ba8 (patch) | |
tree | 580a2696692ffeb69013b4fd3e2bbdb8cc8cdbe4 /sw | |
parent | 4b224658980087558706968c19a8170ecef5620b (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/+/165463
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/layout/paintfrm.cxx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 46c9189f0dfd..ff5abcfcf898 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -7488,6 +7488,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() ); |