[Libreoffice-commits] core.git: sw/source

Justin Luth (via logerrit) logerrit at kemper.freedesktop.org
Wed Sep 9 12:30:12 UTC 2020


 sw/source/uibase/shells/basesh.cxx |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit d30fdc737919bb16301351da8a59af9478eb4393
Author:     Justin Luth <justin.luth at collabora.com>
AuthorDate: Wed Sep 2 18:32:51 2020 +0300
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Wed Sep 9 14:29:31 2020 +0200

    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 at sil.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

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:


More information about the Libreoffice-commits mailing list