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

Justin Luth (via logerrit) logerrit at kemper.freedesktop.org
Thu Mar 5 09:01:51 UTC 2020


 sw/source/core/layout/frmtool.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 1052acae9a599c54e518c8fc17d6a994d8778757
Author:     Justin Luth <justin.luth at collabora.com>
AuthorDate: Wed Feb 26 13:15:53 2020 +0300
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Thu Mar 5 10:01:19 2020 +0100

    tdf#119748 sw layout: ConsiderTextWrap on initial positioning
    
    The specific thing failing was that, for a .doc or .docx file,
    text wrapping didn't layout around a pasted image until
    resizing or re-anchoring or anything that modified the image.
    Menu-inserted images worked fine, but it looks like that
    happened "by accident" during an EndAllAction().
    
    An earlier patch (long ago) also suppressed restart of the
    layout process, so doing so is not without precident.
    FAR_AWAY would generally be true only on initial insert,
    RIGHT? A few lines earlier there was a similar exception
    when the position was set for the first time. So it seems
    logical to avoid a restart here too during the first
    positioning of the fly.
    
    QA's pdf-changes test should be able to quickly detect
    whether this would cause any regressions. There are
    no unit test examples of importing an image into
    the clipboard. I tried putting an image in the header
    and then copying that object to the clipboard, but
    that didn't reproduce the problem and so proved nothing.
    
    tdf#107391 is also fixed by this. However, the unit
    test saw 7 pages, while interactively it was only 4,
    so I can't use that document as a test either.
    So all of my attempts to create a unit test for this failed.
    
    Change-Id: Idda75d9f147bd2456d78be476749be38a61e31ac
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89586
    Tested-by: Jenkins
    Tested-by: Justin Luth <justin_luth at sil.org>
    Reviewed-by: Justin Luth <justin_luth at sil.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index d59d121786ef..5585f3f88d2e 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -702,7 +702,8 @@ SwFlyNotify::~SwFlyNotify()
         // #i54138# - suppress restart of the layout process
         // on changed frame height.
         // Note: It doesn't seem to be necessary and can cause layout loops.
-        if ( bPosChgd )
+        // Also suppress on initial positioning - required to trigger text wrapping (tdf#119748).
+        if ( bPosChgd && maFrame.Pos().X() != FAR_AWAY )
         {
             // indicate a restart of the layout process
             pFly->SetRestartLayoutProcess( true );


More information about the Libreoffice-commits mailing list