diff options
author | Justin Luth <justin.luth@collabora.com> | 2020-09-02 18:32:51 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-09-09 14:29:31 +0200 |
commit | d30fdc737919bb16301351da8a59af9478eb4393 (patch) | |
tree | 31fb1e2c8487c80005f2c083100a4f296cc1267c /sw | |
parent | 0c9e914dc98179190994ee45405a1b38825cc4bc (diff) |
tdf#132841 sw UI: setting contour should not change wrap
LEFT, RIGHT,and OPTIMAL all can legitimately use contour wrap,
so don't reset it to PARALLEL unless it is currently NONE
or THROUGH. (And in that case, the UI already has contour
hidden, but just to keep each part individually correct,
it seems to make sense to check for that case.)
The original import included the dead code
if (nSurround == SURROUND_THROUGH)
nSurround = SURROUND_PARALLEL;
which probably ought to have been
if (nOldSurround == SURROUND_THROUGH)
So that tells me that someone was at least thinking about
the situation, but very poorly implemented it.
Indeed, several followup patches add nOldSurround code,
but unfortunately they didn't catch this situation.
Change-Id: I971a31582ec600bc3416bef46ba17e7b0c3a6543
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101947
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth@sil.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/shells/basesh.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx index 59faca317408..4dfd92584a0e 100644 --- a/sw/source/uibase/shells/basesh.cxx +++ b/sw/source/uibase/shells/basesh.cxx @@ -1940,6 +1940,13 @@ void SwBaseShell::SetWrapMode( sal_uInt16 nSlot ) break; case FN_FRAME_WRAP_CONTOUR: aWrap.SetContour(!aWrap.IsContour()); + // Contour is meaningless in no-wrap or wrap-through context. Otherwise keep existing wrap. + if ( !aWrap.IsContour() || + ( nOldSurround != css::text::WrapTextMode_NONE && + nOldSurround != css::text::WrapTextMode_THROUGH ) ) + { + nSurround = nOldSurround; + } break; case FN_FRAME_WRAPTHRU_TRANSP: case FN_FRAME_WRAPTHRU_TOGGLE: |