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 <jluth@mail.com>
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index 4e7a454..7768680 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