diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2022-03-17 17:36:18 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2022-03-23 08:12:15 +0100 |
commit | aad0f86a30a57bebe3704c3525db7c4338a9684a (patch) | |
tree | 4c1ab24367e139d2c355d06a87077fed9ed6b08f /cui | |
parent | f5eaa816bb7b05a2ae4befccd4b770cfb3bc50bb (diff) |
sw image dialog: fix fallback width/height for images with relative sizes
Make sure that we work with the up to date layout size of the image in
the dialog, otherwise 80% shows up as 237%.
Also fix SfxMacroTabPage::FillItemSet() to not put anything to the
output item set when the macro table is empty, this way clicking OK in
the image dialog results in an unmodified document when the user doesn't
change anything.
(cherry picked from commit 9e8712ed6f9fb5dbd971e352a5709bd45fadc74f)
Change-Id: I4b987bd3e3818ee737e37ea10861f9043c25bc93
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131925
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/tabpages/macroass.cxx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/cui/source/tabpages/macroass.cxx b/cui/source/tabpages/macroass.cxx index 94143e310ebd..d752a043077b 100644 --- a/cui/source/tabpages/macroass.cxx +++ b/cui/source/tabpages/macroass.cxx @@ -155,9 +155,14 @@ bool SfxMacroTabPage::FillItemSet( SfxItemSet* rSet ) SvxMacroItem aItem( GetWhich( aPageRg[0] ) ); const_cast<SvxMacroTableDtor&>(aItem.GetMacroTable()) = aTbl; - const SfxPoolItem* pItem; - if( SfxItemState::SET != GetItemSet().GetItemState( aItem.Which(), true, &pItem ) - || aItem != *static_cast<const SvxMacroItem*>(pItem) ) + const SfxPoolItem* pItem = nullptr; + SfxItemState eState = GetItemSet().GetItemState(aItem.Which(), true, &pItem); + if (eState == SfxItemState::DEFAULT && aTbl.empty()) + { + // Don't touch the item set if there was no input and our table is empty. + return false; + } + if (SfxItemState::SET != eState || aItem != *static_cast<const SvxMacroItem*>(pItem)) { rSet->Put( aItem ); return true; |