summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2020-07-20 13:04:11 +0200
committerSzymon Kłos <szymon.klos@collabora.com>2020-07-27 10:57:50 +0200
commit721120ff44ef619b032003374109b6db447ab327 (patch)
treeeeb2217d0790b8c66fb03de9f1c718b9b88a3bd3 /sw
parent66c8463e69bffc0460d778e2686f78a17575d663 (diff)
Make Bookmarks dialog async
Change-Id: I820019f6906fef57743886fb1ba9c98217955370 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99041 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99350 Tested-by: Jenkins
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/swabstdlg.hxx2
-rw-r--r--sw/source/ui/dialog/swdlgfact.cxx4
-rw-r--r--sw/source/ui/dialog/swdlgfact.hxx2
-rw-r--r--sw/source/ui/misc/bookmark.cxx7
-rw-r--r--sw/source/uibase/inc/bookmark.hxx3
-rw-r--r--sw/source/uibase/shells/textsh1.cxx6
6 files changed, 10 insertions, 14 deletions
diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx
index 0b530d170e77..82540628fb06 100644
--- a/sw/inc/swabstdlg.hxx
+++ b/sw/inc/swabstdlg.hxx
@@ -378,7 +378,7 @@ public:
virtual VclPtr<SfxAbstractDialog> CreateSwAddressAbstractDlg(weld::Window* pParent, const SfxItemSet& rSet) = 0;
virtual VclPtr<AbstractSwAsciiFilterDlg> CreateSwAsciiFilterDlg(weld::Window* pParent, SwDocShell& rDocSh,
SvStream* pStream) = 0;
- virtual VclPtr<VclAbstractDialog> CreateSwInsertBookmarkDlg(weld::Window *pParent, SwWrtShell &rSh, SfxRequest& rReq) = 0;
+ virtual VclPtr<VclAbstractDialog> CreateSwInsertBookmarkDlg(weld::Window *pParent, SwWrtShell &rSh) = 0;
virtual std::shared_ptr<AbstractSwBreakDlg> CreateSwBreakDlg(weld::Window *pParent, SwWrtShell &rSh) = 0;
virtual VclPtr<VclAbstractDialog> CreateSwChangeDBDlg(SwView& rVw) = 0;
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index 639fb25d598c..bd767d220019 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -819,9 +819,9 @@ VclPtr<AbstractSwAsciiFilterDlg> SwAbstractDialogFactory_Impl::CreateSwAsciiFilt
}
VclPtr<VclAbstractDialog> SwAbstractDialogFactory_Impl::CreateSwInsertBookmarkDlg(weld::Window *pParent,
- SwWrtShell &rSh, SfxRequest& rReq)
+ SwWrtShell &rSh)
{
- return VclPtr<AbstractGenericDialog_Impl>::Create(std::make_shared<SwInsertBookmarkDlg>(pParent, rSh, rReq));
+ return VclPtr<AbstractGenericDialog_Impl>::Create(std::make_shared<SwInsertBookmarkDlg>(pParent, rSh));
}
std::shared_ptr<AbstractSwBreakDlg> SwAbstractDialogFactory_Impl::CreateSwBreakDlg(weld::Window* pParent, SwWrtShell &rSh)
diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx
index 5c8f0cb0c4e0..bd285ff22fa7 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -658,7 +658,7 @@ public:
virtual VclPtr<SfxAbstractDialog> CreateSwAddressAbstractDlg(weld::Window* pParent, const SfxItemSet& rSet) override;
virtual VclPtr<AbstractSwAsciiFilterDlg> CreateSwAsciiFilterDlg(weld::Window* pParent, SwDocShell& rDocSh,
SvStream* pStream) override;
- virtual VclPtr<VclAbstractDialog> CreateSwInsertBookmarkDlg(weld::Window *pParent, SwWrtShell &rSh, SfxRequest& rReq) override;
+ virtual VclPtr<VclAbstractDialog> CreateSwInsertBookmarkDlg(weld::Window *pParent, SwWrtShell &rSh) override;
virtual std::shared_ptr<AbstractSwBreakDlg> CreateSwBreakDlg(weld::Window *pParent, SwWrtShell &rSh) override;
virtual VclPtr<VclAbstractDialog> CreateSwChangeDBDlg(SwView& rVw) override;
virtual VclPtr<SfxAbstractTabDialog> CreateSwCharDlg(weld::Window* pParent, SwView& pVw, const SfxItemSet& rCoreSet,
diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx
index 29f090f94ff6..14c3714d3e48 100644
--- a/sw/source/ui/misc/bookmark.cxx
+++ b/sw/source/ui/misc/bookmark.cxx
@@ -210,10 +210,6 @@ IMPL_LINK_NOARG(SwInsertBookmarkDlg, InsertHdl, weld::Button&, void)
{
OUString sBookmark = m_xEditBox->get_text();
rSh.SetBookmark2(vcl::KeyCode(), sBookmark, m_xHideCB->get_active(), m_xConditionED->get_text());
- rReq.AppendItem(SfxStringItem(FN_INSERT_BOOKMARK, sBookmark));
- rReq.Done();
- if (!rReq.IsDone())
- rReq.Ignore();
m_xDialog->response(RET_OK);
}
@@ -295,10 +291,9 @@ void SwInsertBookmarkDlg::PopulateTable()
m_nLastBookmarksCount = pMarkAccess->getBookmarksCount();
}
-SwInsertBookmarkDlg::SwInsertBookmarkDlg(weld::Window* pParent, SwWrtShell& rS, SfxRequest& rRequest)
+SwInsertBookmarkDlg::SwInsertBookmarkDlg(weld::Window* pParent, SwWrtShell& rS)
: SfxDialogController(pParent, "modules/swriter/ui/insertbookmark.ui", "InsertBookmarkDialog")
, rSh(rS)
- , rReq(rRequest)
, m_nLastBookmarksCount(0)
, m_bSorted(false)
, m_xEditBox(m_xBuilder->weld_entry("name"))
diff --git a/sw/source/uibase/inc/bookmark.hxx b/sw/source/uibase/inc/bookmark.hxx
index 3a8ee1506d58..a2000ce9a730 100644
--- a/sw/source/uibase/inc/bookmark.hxx
+++ b/sw/source/uibase/inc/bookmark.hxx
@@ -65,7 +65,6 @@ public:
class SwInsertBookmarkDlg : public SfxDialogController
{
SwWrtShell& rSh;
- SfxRequest& rReq;
std::vector<std::pair<sw::mark::IMark*, OUString>> aTableBookmarks;
sal_Int32 m_nLastBookmarksCount;
bool m_bSorted;
@@ -103,7 +102,7 @@ class SwInsertBookmarkDlg : public SfxDialogController
void GotoSelectedBookmark();
public:
- SwInsertBookmarkDlg(weld::Window* pParent, SwWrtShell& rSh, SfxRequest& rReq);
+ SwInsertBookmarkDlg(weld::Window* pParent, SwWrtShell& rSh);
virtual ~SwInsertBookmarkDlg() override;
};
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index ea797594053c..322209a71382 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -673,8 +673,10 @@ void SwTextShell::Execute(SfxRequest &rReq)
else
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- ScopedVclPtr<VclAbstractDialog> pDlg(pFact->CreateSwInsertBookmarkDlg(GetView().GetFrameWeld(), rWrtSh, rReq));
- pDlg->Execute();
+ ScopedVclPtr<VclAbstractDialog> pDlg(pFact->CreateSwInsertBookmarkDlg(GetView().GetFrameWeld(), rWrtSh));
+ VclAbstractDialog::AsyncContext aContext;
+ aContext.maEndDialogFn = [](sal_Int32){};
+ pDlg->StartExecuteAsync(aContext);
}
break;