summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authormert <mert.tumer@collabora.com>2021-03-04 12:17:27 +0300
committerMert Tumer <mert.tumer@collabora.com>2021-03-12 04:36:28 +0100
commit2246b6a2887b90efc712c4479b19609cf9307a3d (patch)
tree004a118a3b6e5caaa98cb934d2670ab370dcea84 /sd
parent4a4a38d31a287f78d4c7226fe85aafb6e6c6c0ac (diff)
Fix wrong position on move when page has margin
Change-Id: I9ac2d9914b86210ca2148b44488c2c70cc5870d4 Signed-off-by: mert <mert.tumer@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111949 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111929 Tested-by: Jenkins
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/func/futransf.cxx13
1 files changed, 8 insertions, 5 deletions
diff --git a/sd/source/ui/func/futransf.cxx b/sd/source/ui/func/futransf.cxx
index fa7398e48b43..6c07e0e70be6 100644
--- a/sd/source/ui/func/futransf.cxx
+++ b/sd/source/ui/func/futransf.cxx
@@ -28,6 +28,7 @@
#include <sdresid.hxx>
#include <drawdoc.hxx>
#include <svx/svxdlg.hxx>
+#include <comphelper/lok.hxx>
#include <memory>
@@ -48,14 +49,13 @@ rtl::Reference<FuPoor> FuTransform::Create( ViewShell* pViewSh, ::sd::Window* pW
namespace {
-void setUndo(::sd::View* pView, const SfxItemSet* pArgs)
+void setUndo(::sd::View* pView, const SfxItemSet* pArgs, bool addPageMargin)
{
// Undo
OUString aString = pView->GetDescriptionOfMarkedObjects() +
" " + SdResId(STR_TRANSFORM);
pView->BegUndo(aString);
-
- pView->SetGeoAttrToMarked(*pArgs);
+ pView->SetGeoAttrToMarked(*pArgs, addPageMargin);
pView->SetAttributes(*pArgs);
pView->EndUndo();
}
@@ -71,7 +71,9 @@ void FuTransform::DoExecute( SfxRequest& rReq )
if (pArgs)
{
- setUndo(mpView, pArgs);
+ // If this comes from LOK, that means the shape is moved by mouse
+ // only then pArgs is pre-set.
+ setUndo(mpView, pArgs, comphelper::LibreOfficeKit::isActive());
return;
}
@@ -115,7 +117,8 @@ void FuTransform::DoExecute( SfxRequest& rReq )
if (nResult == RET_OK)
{
pRequest->Done(*(pDlg->GetOutputItemSet()));
- setUndo(mpView, pRequest->GetArgs());
+ // Page margin is already calculated at this point.
+ setUndo(mpView, pRequest->GetArgs(), false);
}
// deferred until the dialog ends