Bug 140470 - Image placed above text (instead of below)
Summary: Image placed above text (instead of below)
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.1.0.4 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
: 141093 (view as bug list)
Depends on:
Blocks: Writer-Images
  Show dependency treegraph
 
Reported: 2021-02-17 10:05 UTC by Telesto
Modified: 2024-08-07 11:20 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2021-02-17 10:05:11 UTC
Description:
Image sized to page marging (so not next to text) and placed above text (instead of below)

Steps to Reproduce:
1. Open the attached file (attachment 169809 [details])
2. Download the image (attachment 169810 [details])
3. Place cursor after yellow text
4. Press Insert -> Image
5. Image will be above text
6. Pick a corner and shrink it.. Image will be next to text. 
7. Downsize the image attached to dimensions fitting on the page (next to text)
8. Insert again -> now it's next to the text

No default anchoring is matter of relevance. It's configurable today. Default 'to character'. Older versions had it fixed on insertion to 'to paragraph'

Actual Results:
Image larger to 'canvas' or page margins is downsized to fit within page margins (but not next to text.. not sure if this OK or not).
Secondly the image is position above, where I would argue below

Expected Results:
See actual results


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.2.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 28555fc345ac2ccdda0e4e0f3c812c646befe68b
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL
Comment 1 Telesto 2021-02-17 10:11:02 UTC
Also in
Versie: 4.1.0.4 
Build ID: 89ea49ddacd9aa532507cbf852f2bb22b1ace28
Comment 2 Telesto 2021-02-17 10:12:17 UTC
The anchoring apparently doesn't matter.. also happening with To Paragraph

It's fine with:
Versie 4.0.0.3 (Bouw-id: 7545bee9c2a0782548772a21bc84a9dcc583b89)
Comment 3 mulla.tasanim 2021-03-08 18:59:53 UTC
Thank you for reporting the bug. 

I can confirm the bug present in 

Version: 7.0.3.1 (x64)
Build ID: d7547858d014d4cf69878db179d326fc3483e082
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: nb-NO (en_US); UI: en-US
Calc: CL

Version: 7.2.0.0.alpha0+ (x64)
Build ID: 761a672d62df1891b9f4f367a499b220ab2b33fa
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL
Comment 4 raal 2021-10-02 16:50:38 UTC
This seems to have begun at the below commit.
 cf30741edff0b744b93018f0e2a9791854aa5417 is the first bad commit
commit cf30741edff0b744b93018f0e2a9791854aa5417
Author: Matthew Francis <mjay.francis@gmail.com>
Date:   Fri Sep 18 10:43:56 2015 +0800

    source-hash-83ba821c10392c08334f7d8d3775fe3e8d08f8fd
    
    commit 83ba821c10392c08334f7d8d3775fe3e8d08f8fd
    Author:     Jian Hong Cheng <chengjh@apache.org>
    AuthorDate: Wed Nov 28 00:33:42 2012 +0000
    Commit:     Fridrich Štrba <fridrich.strba@bluewin.ch>
    CommitDate: Wed Mar 13 12:54:51 2013 +0100
    
        Fix #i120928: Import Graphic Bullets of MS Word Document
Comment 5 Buovjaga 2024-08-07 11:12:28 UTC
*** Bug 141093 has been marked as a duplicate of this bug. ***
Comment 6 Buovjaga 2024-08-07 11:20:46 UTC
(In reply to raal from comment #4)
> This seems to have begun at the below commit.
>  cf30741edff0b744b93018f0e2a9791854aa5417 is the first bad commit
> commit cf30741edff0b744b93018f0e2a9791854aa5417
> Author: Matthew Francis <mjay.francis@gmail.com>
> Date:   Fri Sep 18 10:43:56 2015 +0800
> 
>     source-hash-83ba821c10392c08334f7d8d3775fe3e8d08f8fd
>     
>     commit 83ba821c10392c08334f7d8d3775fe3e8d08f8fd
>     Author:     Jian Hong Cheng <chengjh@apache.org>
>     AuthorDate: Wed Nov 28 00:33:42 2012 +0000
>     Commit:     Fridrich Štrba <fridrich.strba@bluewin.ch>
>     CommitDate: Wed Mar 13 12:54:51 2013 +0100
>     
>         Fix #i120928: Import Graphic Bullets of MS Word Document

The change in SwWrtShell::Insert seems like the exact culprit:
https://git.libreoffice.org/core/+/83ba821c10392c08334f7d8d3775fe3e8d08f8fd%5E%21/#F23

Looks like the function is here now, renamed to SwWrtShell::InsertGraphic:
https://git.libreoffice.org/core/+/f9c4fd0b981d7a0ebf76d3110955e16809dd6068/sw/source/uibase/wrtsh/wrtsh1.cxx#295