summaryrefslogtreecommitdiff
path: root/sw/source/uibase
diff options
context:
space:
mode:
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