sw/source/filter/ww8/ww8graf.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
New commits: commit 6e2b10c735381babb1ed5df624462735b84a3c64 Author: Justin Luth <jl...@mail.com> AuthorDate: Tue Jun 6 10:51:46 2023 -0400 Commit: Justin Luth <jl...@mail.com> CommitDate: Tue Jun 6 20:23:45 2023 +0200 tdf#135709 doc import: force dynamic wrap on inline images Wrapping is irrelevant for inline images, so it is safe to do this in terms of writer layout. The benefit is clearly seen when the user changes from inline to anchored. In all other formats, that results in Parallel wrapping, but in DOC format the text "disappears" behind the image since it wraps through. Change-Id: Ia4827814f9c9a3b8865bf8d0d72552b2b44a0207 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152682 Tested-by: Jenkins Reviewed-by: Justin Luth <jl...@mail.com> diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index 4e7a454ab773..7768680d8b2c 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -2629,7 +2629,11 @@ SwFrameFormat* SwWW8ImplReader::Read_GrafLayer( tools::Long nGrafAnchorCp ) eSurround = css::text::WrapTextMode_NONE; break; case 3: // 3 wrap as if no object present - eSurround = css::text::WrapTextMode_THROUGH; + // Special case: on export, inline images are wrapped through as a hack for old formats. + // That is irrelevant for Writer, so instead use the default wrap in that case, + // so that when the user changes it into an anchor, it wraps nicely, and not through. + if (!IsInlineEscherHack()) + eSurround = css::text::WrapTextMode_THROUGH; break; case 4: // 4 wrap tightly around object case 5: // 5 wrap tightly, but allow holes