summaryrefslogtreecommitdiff
path: root/sw/source/uibase
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2022-03-17 17:36:18 +0100
committerMiklos Vajna <vmiklos@collabora.com>2022-03-17 19:03:42 +0100
commit9e8712ed6f9fb5dbd971e352a5709bd45fadc74f (patch)
tree2863c51ee2897d9e1a859db7fff64439230799f5 /sw/source/uibase
parent52a695d2ceb4231a9fcc419959e29023ecef037b (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 'sw/source/uibase')
-rw-r--r--sw/source/uibase/shells/grfsh.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx
index bb60338f1ce0..86dde1851c3a 100644
--- a/sw/source/uibase/shells/grfsh.cxx
+++ b/sw/source/uibase/shells/grfsh.cxx
@@ -63,6 +63,7 @@
#include <swslots.hxx>
#include <swabstdlg.hxx>
#include <unocrsr.hxx>
+#include <flyfrm.hxx>
#include <memory>
constexpr OUStringLiteral TOOLBOX_NAME = u"colorbar";
@@ -317,6 +318,15 @@ void SwGrfShell::Execute(SfxRequest &rReq)
aSet.Put( aFrameSize );
aSet.Put( aMgr.GetAttrSet() );
+ SwFlyFrame* pFly = rSh.GetSelectedFlyFrame();
+ if (pFly)
+ {
+ // Work with the up to date layout size if possible.
+ SwFormatFrameSize aSize = aSet.Get(RES_FRM_SIZE);
+ aSize.SetWidth(pFly->getFrameArea().Width());
+ aSize.SetHeight(pFly->getFrameArea().Height());
+ aSet.Put(aSize);
+ }
aSet.SetParent( aMgr.GetAttrSet().GetParent() );
// At percentage values initialize size