office-gobmx/sw/qa/uitest
Miklos Vajna a3150fc8a5 tdf#145972 sw image dialog: fix bad rel width w/ pt units and kept aspect ratio
Regression from commit 02c4350820 (sw keep
aspect ratio: add filter for this setting, 2021-06-07), once UI units
are set to poins (instead of cms), the image dialog for the bugdoc was
showing 5% width instead of 48%.

48% is roughtly correct, visually the image is taking half of the body
frame width. Previously the bad rel size didn't happen because we didn't
save the "keep aspect ratio" to documents, so it was off by the time the
dialog was initialized.

Fix the problem by introducing a new flag, so we can differentiate
between the user changine the width or height vs the dialog being
initialized. RelSizeClickHdl() is meant to adjust the other axis in the
user case, and this is not wanted in the init case.

A higher level fix would be to make sure once aspect ratio is kept,
that ratio is stored in documents explicitly, so we can say 50% wide
with e.g. 4:3 ratio, that would avoid all this trouble by even looking
at the calculated sizes when we want to work with percents. This storing
of the aspect ratio is not done here.

Change-Id: I901e7f6d5e6f7f1349d7beeb05985ddbf99a34a2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168015
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2024-05-24 13:58:07 +02:00
..
chapterNumbering
chart
classification
data
fieldDialog
findBar
findReplace
librelogo
macro_tests
navigator
options
sidebar
styleInspector
table
ui
uibase
writer_dialogs
writer_tests
writer_tests2
writer_tests3
writer_tests4
writer_tests5
writer_tests6
writer_tests7
writer_tests8