summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-08-16 15:32:07 +0100
committerAndras Timar <andras.timar@collabora.com>2021-08-24 14:50:52 +0200
commit6ae7561d25a1920ebc4ffb14dcfb1fc25c03b7e1 (patch)
treec91c44c277b027014db3847ff5ce7dfaeb8307b7 /sw
parent093f3e41f632429ff1899432d533b128e04b4dc8 (diff)
tdf#143778 these async callbacks expect to have SdrModel::IsChanged of false
when they are entered. They are adapted from the original non-async SwDrawShell::ExecDrawDlg where the start of SwDrawShell::ExecDrawDlg has... bool bChanged = pDoc->IsChanged(); pDoc->SetChanged(false); and the end has if (pDoc->IsChanged()) GetShell().SetModified(); else if (bChanged) pDoc->SetChanged(); and before async dialogs the start and end happened before and after the dialog appeared and disappeared. The intent seems to be unset the sdrmodel-changed and restore its original state if the dialogs caused nothing to happen and to explicitly set SetModified on the document if something did. Now the async dialogs callback happens after SwDrawShell::ExecDrawDlg has ended and so the callbacks start with SdrModel::IsChanged at its original value (restored by the end of ExecDrawDlg), not the "false" they were originally written to expect. For simplicity set the SdrModel IsChanged to false at the start of the callbacks and continue to restore to the passed in bChanged state if there was no changes by the callback. Change-Id: I671b35acab6d1b391fa7e6590c09f8be135449b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120548 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit c64f221fc2e22ffa60c4d78240893f7f04531b3e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120576 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/shells/drawdlg.cxx9
-rw-r--r--sw/source/uibase/shells/drwbassh.cxx2
2 files changed, 8 insertions, 3 deletions
diff --git a/sw/source/uibase/shells/drawdlg.cxx b/sw/source/uibase/shells/drawdlg.cxx
index 114b7f33b055..c80f4960f657 100644
--- a/sw/source/uibase/shells/drawdlg.cxx
+++ b/sw/source/uibase/shells/drawdlg.cxx
@@ -115,6 +115,8 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq)
pDlg->StartExecuteAsync([bChanged, bHasMarked, pDoc, pDlg, pSh, pView, this](
sal_Int32 nResult){
+ pDoc->SetChanged(false);
+
if (nResult == RET_OK)
{
pSh->StartAction();
@@ -168,6 +170,8 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq)
pDlg->StartExecuteAsync([bChanged, bHasMarked, pDoc, pDlg, pSh, pView, this](
sal_Int32 nResult){
+ pDoc->SetChanged(false);
+
if (nResult == RET_OK)
{
pSh->StartAction();
@@ -210,9 +214,8 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq)
if (pDoc->IsChanged())
GetShell().SetModified();
- else
- if (bChanged)
- pDoc->SetChanged();
+ else if (bChanged)
+ pDoc->SetChanged();
}
namespace
diff --git a/sw/source/uibase/shells/drwbassh.cxx b/sw/source/uibase/shells/drwbassh.cxx
index f901f32cc15d..274a60c52028 100644
--- a/sw/source/uibase/shells/drwbassh.cxx
+++ b/sw/source/uibase/shells/drwbassh.cxx
@@ -235,6 +235,8 @@ void SwDrawBaseShell::Execute(SfxRequest const &rReq)
pDlg->StartExecuteAsync([bCaption, bChanged, pDlg, pFrameFormat, pSdrView,
pSh, &rMarkList, this](
sal_Int32 nResult){
+ pSdrView->GetModel()->SetChanged(false);
+
if (nResult == RET_OK)
{
SwFormatVertOrient aVOrientFinal(pFrameFormat->GetFormatAttr(RES_VERT_ORIENT));