summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2020-02-26 13:15:53 +0300
committerMiklos Vajna <vmiklos@collabora.com>2020-03-05 10:01:19 +0100
commit1052acae9a599c54e518c8fc17d6a994d8778757 (patch)
treeff5a096000cf625cb0223789afc976861d9c1424
parentbef317ec9d00beb70d6b59c2af3b61ef2544b4a5 (diff)
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@sil.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
-rw-r--r--sw/source/core/layout/frmtool.cxx3
1 files changed, 2 insertions, 1 deletions
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 );