summaryrefslogtreecommitdiffstats
path: root/i18npool/inc
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2024-05-22 08:47:32 +0200
committerMiklos Vajna <vmiklos@collabora.com>2024-05-22 10:27:36 +0200
commit080afd6a345e5dffd924100b5a3ff9c028f5b094 (patch)
tree60142f82c48c42b9ab879496ed4693db23567fb0 /i18npool/inc
parenttdf#158110 - Paste special: Remove special ADDNOTES flag handling (diff)
downloadcore-master.tar.gz
core-master.zip
Related: tdf#145972 sw images: fix rounding error in relative size calculation HEADmaster
Open the bugdoc, see that the image is roughly half of the page width, right click, properties, UI shows that the width of the image is 5% of the width of the entire page. This only happens if tools -> options -> writer -> general sets the UI units to points, the default cm case is fine. This went wrong with commit 9e8712ed6f9fb5dbd971e352a5709bd45fadc74f (sw image dialog: fix fallback width/height for images with relative sizes, 2022-03-17), because the layout size started to matter more after that commit. This lead to the nWidth != m_xWidthED->get_value(FieldUnit::TWIP) check in SwFramePage::Init() to be true, because 11906 * 0.48 is 5714.88, so you got 5714 in the layout, but got 5715 with rounding in SwFramePage::Reset() (which tries to calc the page width based on the 48% and the fly width). And once we had that mismatch, we went down the wrong path. Fix the problem by using rtl::math::round() in SwFlyFrame::CalcRel(), so the relative width twips value is 5715 everywhere: once we have consisteny, the UI value is correct, too. Note that the original bugdoc needs more fixing, this just fixes the bugdoc where KeepRatio is false. Change-Id: I1e8782c95a0cf9d97375c36d41134735c01f3e46 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167916 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'i18npool/inc')
0 files changed, 0 insertions, 0 deletions