diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2022-03-17 17:36:18 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2022-03-17 19:03:42 +0100 |
commit | 9e8712ed6f9fb5dbd971e352a5709bd45fadc74f (patch) | |
tree | 2863c51ee2897d9e1a859db7fff64439230799f5 /cui | |
parent | 52a695d2ceb4231a9fcc419959e29023ecef037b (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.
Change-Id: I4b987bd3e3818ee737e37ea10861f9043c25bc93
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131714
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
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 eb98f14ab7d1..d9b071dcff66 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; |