Open attachment 111363 [details] from bug 73797. The second image should be on the first page. It moves to second page because the top and bottom distance to text is too large. The error was reported in bug 143455. Considering the effectExtent at all (for to get distance for glow and shadow) was introduced with commit https://cgit.freedesktop.org/libreoffice/core/commit/?id=3262fc5ef3bde5b158909d11ccb008161ea95519. It needs some more fine tuning.
Moving to NEW
Created attachment 173772 [details] The example document in Word and Writer Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community Build ID: 0d4cbdbc9cd4ab06056cec66cffd292b41615b6e CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL: win Locale: hu-HU (hu_HU); UI: en-US Calc: CL
It seems, that a compatibility handling inside Word is involved. If I save the test document so, that I uncheck "keep compatibility with previous versions", then the document is rendered in Word the same as now in LibreOffice. In "compatible mode" Word adds the effectExtent to the unrotated image and has a space in the content of the line as large as the unrotated image. In non-compatible mode it adds the effectExent to the rotated image, and use the space of the rotated shape. From my experiments I guess the older behavior is for version <=14 and the newer behavior for version >=15. The example document uses 90deg rotation. ToDo: Examine whether there is a change in behavior at the 45deg threshold.
Word 2007 (=version 12) has the special feature, that for images, which are rotated between 45deg and 135deg or between 235deg and 315deg, the effectExtent values are based on an rectangle without swapped width and height. Because the current code assumes swapped width and height - as usual for newer versions and other objects - it calculates wrong wrap margins. That results in too large top and bottom margin in the example document, which leads to a page break, because the image has not enough space on the first page. The problem is not only with inline anchored images, but with other anchor types too. I have started work on a patch in https://gerrit.libreoffice.org/c/core/+/119482.
Regina Henschel committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/67f2a99229101757af4f40118f4d3c83ba38648b tdf#143475 consider Word 2007 rotated image speciality It will be available in 7.3.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Verified in Version: 7.3.0.0.alpha0+ / LibreOffice Community Build ID: 6e53e03f752c2f85283c4d47efaaf0683299783c CPU threads: 4; OS: Linux 5.7; UI render: default; VCL: gtk3 Locale: en-US (en_US.UTF-8); UI: en-US Calc: threaded @Regina, thanks for fixing this issue!!