[Libreoffice-commits] core.git: sd/source
Jan Holesovsky
kendy at collabora.com
Thu Mar 15 17:41:06 UTC 2018
sd/source/ui/func/fuarea.cxx | 9 +++------
sd/source/ui/func/fuline.cxx | 8 ++------
sd/source/ui/func/futransf.cxx | 8 +-------
sd/source/ui/view/drviews2.cxx | 12 +++++++++---
4 files changed, 15 insertions(+), 22 deletions(-)
New commits:
commit 5372d8022dd8ce8aaa3090014b319727e88b17f1
Author: Jan Holesovsky <kendy at collabora.com>
Date: Thu Mar 15 16:04:05 2018 +0100
tdf#115675: Shape selection was breaking when changing pos/size from sidebar.
Fixes also other potential breakages with the same root cause.
Change-Id: I09b3650189f6edb28ab64652cd411b1dca7dca89
Reviewed-on: https://gerrit.libreoffice.org/51342
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Jan Holesovsky <kendy at collabora.com>
diff --git a/sd/source/ui/func/fuarea.cxx b/sd/source/ui/func/fuarea.cxx
index 29d8cb5311a3..6311bf13c716 100644
--- a/sd/source/ui/func/fuarea.cxx
+++ b/sd/source/ui/func/fuarea.cxx
@@ -56,10 +56,7 @@ void FuArea::DoExecute( SfxRequest& rReq )
const SfxItemSet* pArgs = rReq.GetArgs();
if (pArgs)
- {
- mpViewShell->Cancel();
return;
- }
SfxItemSet aNewAttr( mpDoc->GetPool() );
mpView->GetAttributes( aNewAttr );
@@ -67,10 +64,7 @@ void FuArea::DoExecute( SfxRequest& rReq )
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
VclPtr<AbstractSvxAreaTabDialog> pDlg(pFact ? pFact->CreateSvxAreaTabDialog(mpViewShell->GetActiveWindow(), &aNewAttr, mpDoc, true) : nullptr);
if (!pDlg)
- {
- mpViewShell->Cancel();
return;
- }
pDlg->StartExecuteAsync([=](sal_Int32 nResult){
if (nResult == RET_OK)
@@ -90,6 +84,9 @@ void FuArea::DoExecute( SfxRequest& rReq )
mpViewShell->GetViewFrame()->GetBindings().Invalidate( SidArray );
}
+
+ // deferred until the dialog ends
+ mpViewShell->Cancel();
});
}
diff --git a/sd/source/ui/func/fuline.cxx b/sd/source/ui/func/fuline.cxx
index d4511fdcc610..71a35f4ec42e 100644
--- a/sd/source/ui/func/fuline.cxx
+++ b/sd/source/ui/func/fuline.cxx
@@ -64,10 +64,7 @@ void FuLine::DoExecute( SfxRequest& rReq )
const SfxItemSet* pArgs = rReq.GetArgs();
if (pArgs)
- {
- mpViewShell->Cancel();
return;
- }
const SdrObject* pObj = nullptr;
const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
@@ -81,10 +78,7 @@ void FuLine::DoExecute( SfxRequest& rReq )
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
VclPtr<SfxAbstractTabDialog> pDlg(pFact ? pFact->CreateSvxLineTabDialog(mpViewShell->GetActiveWindow(), pNewAttr.get(), mpDoc, pObj, bHasMarked) : nullptr);
if (!pDlg)
- {
- mpViewShell->Cancel();
return;
- }
pDlg->StartExecuteAsync([=](sal_Int32 nResult){
if (nResult == RET_OK)
@@ -106,6 +100,8 @@ void FuLine::DoExecute( SfxRequest& rReq )
mpViewShell->GetViewFrame()->GetBindings().Invalidate( SidArray );
}
+
+ // deferred until the dialog ends
mpViewShell->Cancel();
});
}
diff --git a/sd/source/ui/func/futransf.cxx b/sd/source/ui/func/futransf.cxx
index ef2894cc37f5..33d4b0d2796f 100644
--- a/sd/source/ui/func/futransf.cxx
+++ b/sd/source/ui/func/futransf.cxx
@@ -67,12 +67,6 @@ void setUndo(::sd::View* pView, const SfxItemSet* pArgs)
void FuTransform::DoExecute( SfxRequest& rReq )
{
- comphelper::ScopeGuard guard([&]() {
- // cleanup when leaving
- mpViewShell->Invalidate(SID_RULER_OBJECT);
- mpViewShell->Cancel();
- });
-
if (!mpView->AreObjectsMarked())
return;
@@ -124,7 +118,6 @@ void FuTransform::DoExecute( SfxRequest& rReq )
std::shared_ptr<SfxRequest> pRequest(new SfxRequest(rReq));
rReq.Ignore(); // the 'old' request is not relevant any more
- guard.dismiss(); // we'll invalidate explicitly after the dialog ends
pDlg->StartExecuteAsync([=](sal_Int32 nResult){
if (nResult == RET_OK)
@@ -133,6 +126,7 @@ void FuTransform::DoExecute( SfxRequest& rReq )
setUndo(mpView, pRequest->GetArgs());
}
+ // deferred until the dialog ends
mpViewShell->Invalidate(SID_RULER_OBJECT);
mpViewShell->Cancel();
});
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index f3bbb1ee5117..2c8a71bd3a18 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -1374,21 +1374,27 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
case SID_ATTRIBUTES_LINE: // BASIC
{
SetCurrentFunction( FuLine::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
- // Cancel() called directly in FuTransform::Create()
+ if (rReq.GetArgs())
+ Cancel();
}
break;
case SID_ATTRIBUTES_AREA: // BASIC
{
SetCurrentFunction( FuArea::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
- // Cancel() called directly in FuTransform::Create()
+ if (rReq.GetArgs())
+ Cancel();
}
break;
case SID_ATTR_TRANSFORM:
{
SetCurrentFunction( FuTransform::Create( this, GetActiveWindow(), mpDrawView, GetDoc(), rReq ) );
- // Cancel() and Invalidate() called directly in FuTransform::Create()
+ if (rReq.GetArgs())
+ {
+ Invalidate(SID_RULER_OBJECT);
+ Cancel();
+ }
}
break;
More information about the Libreoffice-commits
mailing list