[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sc/source sw/source
Muhammet Kara (via logerrit)
logerrit at kemper.freedesktop.org
Sat Jun 29 12:01:36 UTC 2019
sc/source/ui/drawfunc/drawsh.cxx | 26 ++++++++++------
sw/source/uibase/shells/drawdlg.cxx | 56 +++++++++++++++++++++---------------
sw/source/uibase/shells/frmsh.cxx | 52 +++++++++++++++++----------------
3 files changed, 76 insertions(+), 58 deletions(-)
New commits:
commit cd8576920665bcd34745e5799c06232db8fc3b3a
Author: Muhammet Kara <muhammet.kara at collabora.com>
AuthorDate: Thu Jun 27 18:06:06 2019 +0300
Commit: Muhammet Kara <muhammet.kara at collabora.com>
CommitDate: Sat Jun 29 14:00:54 2019 +0200
lokdialog: Convert the Format -> Area... to async exec.
For sw and sc
Change-Id: I83ad76658545d8df135e1a08abff4d0b5a81b46a
Reviewed-on: https://gerrit.libreoffice.org/74808
Tested-by: Jenkins
Reviewed-by: Muhammet Kara <muhammet.kara at collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/74865
Tested-by: Muhammet Kara <muhammet.kara at collabora.com>
diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index 4d68e8365fd2..aeabba5c8212 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -410,26 +410,32 @@ void ScDrawShell::ExecuteAreaDlg( SfxRequest& rReq )
ScDrawView* pView = pViewData->GetScDrawView();
bool bHasMarked = pView->AreObjectsMarked();
+ std::shared_ptr<SfxRequest> pRequest;
+ pRequest.reset(new SfxRequest(rReq));
+
SfxItemSet aNewAttr( pView->GetDefaultAttr() );
if( bHasMarked )
pView->MergeAttrFromMarked( aNewAttr, false );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
vcl::Window* pWin = pViewData->GetDialogParent();
- ScopedVclPtr<AbstractSvxAreaTabDialog> pDlg(pFact->CreateSvxAreaTabDialog(
+ VclPtr<AbstractSvxAreaTabDialog> pDlg(pFact->CreateSvxAreaTabDialog(
pWin ? pWin->GetFrameWeld() : nullptr, &aNewAttr,
pViewData->GetDocument()->GetDrawLayer(), true));
- if ( pDlg->Execute() == RET_OK )
- {
- if( bHasMarked )
- pView->SetAttrToMarked( *pDlg->GetOutputItemSet(), false );
- else
- pView->SetDefaultAttr( *pDlg->GetOutputItemSet(), false );
+ pDlg->StartExecuteAsync([=](sal_Int32 nResult){
+ if ( nResult == RET_OK )
+ {
+ if( bHasMarked )
+ pView->SetAttrToMarked( *pDlg->GetOutputItemSet(), false );
+ else
+ pView->SetDefaultAttr( *pDlg->GetOutputItemSet(), false );
- pView->InvalidateAttribs();
- rReq.Done();
- }
+ pView->InvalidateAttribs();
+ pRequest->Done();
+ }
+ pDlg->disposeOnce();
+ });
}
void ScDrawShell::ExecuteTextAttrDlg( SfxRequest& rReq )
diff --git a/sw/source/uibase/shells/drawdlg.cxx b/sw/source/uibase/shells/drawdlg.cxx
index 71fb6b17d4a1..27c2ea6b9b91 100644
--- a/sw/source/uibase/shells/drawdlg.cxx
+++ b/sw/source/uibase/shells/drawdlg.cxx
@@ -92,34 +92,44 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq)
bool bHasMarked = pView->AreObjectsMarked();
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- ScopedVclPtr<AbstractSvxAreaTabDialog> pDlg(pFact->CreateSvxAreaTabDialog(rReq.GetFrameWeld(),
+ VclPtr<AbstractSvxAreaTabDialog> pDlg(pFact->CreateSvxAreaTabDialog(rReq.GetFrameWeld(),
&aNewAttr,
pDoc,
true));
- if (pDlg->Execute() == RET_OK)
- {
- pSh->StartAction();
- if (bHasMarked)
- pView->SetAttributes(*pDlg->GetOutputItemSet());
- else
- pView->SetDefaultAttr(*pDlg->GetOutputItemSet(), false);
- pSh->EndAction();
- static sal_uInt16 aInval[] =
+ pDlg->StartExecuteAsync([=](sal_Int32 nResult){
+ if (nResult == RET_OK)
{
- SID_ATTR_FILL_STYLE,
- SID_ATTR_FILL_COLOR,
- SID_ATTR_FILL_TRANSPARENCE,
- SID_ATTR_FILL_FLOATTRANSPARENCE,
- 0
- };
- SfxBindings &rBnd = GetView().GetViewFrame()->GetBindings();
- rBnd.Invalidate(aInval);
- rBnd.Update(SID_ATTR_FILL_STYLE);
- rBnd.Update(SID_ATTR_FILL_COLOR);
- rBnd.Update(SID_ATTR_FILL_TRANSPARENCE);
- rBnd.Update(SID_ATTR_FILL_FLOATTRANSPARENCE);
- }
+ pSh->StartAction();
+ if (bHasMarked)
+ pView->SetAttributes(*pDlg->GetOutputItemSet());
+ else
+ pView->SetDefaultAttr(*pDlg->GetOutputItemSet(), false);
+ pSh->EndAction();
+
+ static sal_uInt16 aInval[] =
+ {
+ SID_ATTR_FILL_STYLE,
+ SID_ATTR_FILL_COLOR,
+ SID_ATTR_FILL_TRANSPARENCE,
+ SID_ATTR_FILL_FLOATTRANSPARENCE,
+ 0
+ };
+ SfxBindings &rBnd = GetView().GetViewFrame()->GetBindings();
+ rBnd.Invalidate(aInval);
+ rBnd.Update(SID_ATTR_FILL_STYLE);
+ rBnd.Update(SID_ATTR_FILL_COLOR);
+ rBnd.Update(SID_ATTR_FILL_TRANSPARENCE);
+ rBnd.Update(SID_ATTR_FILL_FLOATTRANSPARENCE);
+ }
+
+ if (pDoc->IsChanged())
+ GetShell().SetModified();
+ else if (bChanged)
+ pDoc->SetChanged();
+
+ pDlg->disposeOnce();
+ });
}
break;
diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx
index b2a6d4a0885a..2a43d349d143 100644
--- a/sw/source/uibase/shells/frmsh.cxx
+++ b/sw/source/uibase/shells/frmsh.cxx
@@ -1286,42 +1286,44 @@ void SwFrameShell::ExecDrawDlgTextFrame(SfxRequest const & rReq)
if(rSh.IsFrameSelected())
{
- SdrView* pView = rSh.GetDrawView();
- SdrModel* pDoc = pView->GetModel();
+ SdrModel* pDoc = rSh.GetDrawView()->GetModel();
SfxItemSet aNewAttr(pDoc->GetItemPool());
// get attributes from FlyFrame
rSh.GetFlyFrameAttr(aNewAttr);
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- ScopedVclPtr<AbstractSvxAreaTabDialog> pDlg(pFact->CreateSvxAreaTabDialog(
- nullptr,
+ VclPtr<AbstractSvxAreaTabDialog> pDlg(pFact->CreateSvxAreaTabDialog(
+ GetView().GetFrameWeld(),
&aNewAttr,
pDoc,
false));
- if(RET_OK == pDlg->Execute())
- {
- // set attributes at FlyFrame
- rSh.SetFlyFrameAttr(const_cast< SfxItemSet& >(*pDlg->GetOutputItemSet()));
-
- static sal_uInt16 aInval[] =
+ pDlg->StartExecuteAsync([=](sal_Int32 nResult){
+ if(nResult == RET_OK)
{
- SID_ATTR_FILL_STYLE,
- SID_ATTR_FILL_COLOR,
- SID_ATTR_FILL_TRANSPARENCE,
- SID_ATTR_FILL_FLOATTRANSPARENCE,
- 0
- };
-
- SfxBindings &rBnd = GetView().GetViewFrame()->GetBindings();
-
- rBnd.Invalidate(aInval);
- rBnd.Update(SID_ATTR_FILL_STYLE);
- rBnd.Update(SID_ATTR_FILL_COLOR);
- rBnd.Update(SID_ATTR_FILL_TRANSPARENCE);
- rBnd.Update(SID_ATTR_FILL_FLOATTRANSPARENCE);
- }
+ // set attributes at FlyFrame
+ GetShell().SetFlyFrameAttr(const_cast< SfxItemSet& >(*pDlg->GetOutputItemSet()));
+
+ static sal_uInt16 aInval[] =
+ {
+ SID_ATTR_FILL_STYLE,
+ SID_ATTR_FILL_COLOR,
+ SID_ATTR_FILL_TRANSPARENCE,
+ SID_ATTR_FILL_FLOATTRANSPARENCE,
+ 0
+ };
+
+ SfxBindings &rBnd = GetView().GetViewFrame()->GetBindings();
+
+ rBnd.Invalidate(aInval);
+ rBnd.Update(SID_ATTR_FILL_STYLE);
+ rBnd.Update(SID_ATTR_FILL_COLOR);
+ rBnd.Update(SID_ATTR_FILL_TRANSPARENCE);
+ rBnd.Update(SID_ATTR_FILL_FLOATTRANSPARENCE);
+ }
+ pDlg->disposeOnce();
+ });
}
break;
More information about the Libreoffice-commits
mailing list