summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-05-29 10:02:58 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-05-29 14:56:04 +0200
commitaa687b22991e6c674b1d8653d52fbe9a50080174 (patch)
tree9e048b07ba05362a99ea79cc79065afc4f45c734 /sw
parentb7b78dfc0719c3aa0e250b2992d3b04e135a26be (diff)
weld SfxDocumentInfoDialog
Change-Id: I79d5d8973a19c0e639081ec61ac596620518d0b5 Reviewed-on: https://gerrit.libreoffice.org/73145 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/docsh.hxx3
-rw-r--r--sw/source/uibase/app/docsh2.cxx12
2 files changed, 7 insertions, 8 deletions
diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx
index ea856f80d9c4..291b20455c17 100644
--- a/sw/inc/docsh.hxx
+++ b/sw/inc/docsh.hxx
@@ -117,7 +117,8 @@ class SW_DLLPUBLIC SwDocShell
override;
/// Make DocInfo known to the Doc.
- SAL_DLLPRIVATE virtual VclPtr<SfxDocumentInfoDialog> CreateDocumentInfoDialog(const SfxItemSet &) override;
+ SAL_DLLPRIVATE virtual std::unique_ptr<SfxDocumentInfoDialog> CreateDocumentInfoDialog(weld::Window* pParent,
+ const SfxItemSet &rSet) override;
/// OLE-stuff
SAL_DLLPRIVATE virtual void Draw( OutputDevice*, const JobSetup&, sal_uInt16 nAspect) override;
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index 2139a02a5240..771972fb63d5 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -147,11 +147,9 @@ using namespace ::com::sun::star;
using namespace ::sfx2;
// create DocInfo (virtual)
-VclPtr<SfxDocumentInfoDialog> SwDocShell::CreateDocumentInfoDialog(const SfxItemSet &rSet)
+std::unique_ptr<SfxDocumentInfoDialog> SwDocShell::CreateDocumentInfoDialog(weld::Window* pParent, const SfxItemSet &rSet)
{
- SfxViewShell* pViewShell = GetView() ? GetView() : SfxViewShell::Current();
- vcl::Window* pWindow = pViewShell ? &pViewShell->GetViewFrame()->GetWindow() : nullptr;
- VclPtr<SfxDocumentInfoDialog> pDlg = VclPtr<SfxDocumentInfoDialog>::Create(pWindow, rSet);
+ std::unique_ptr<SfxDocumentInfoDialog> xDlg = std::make_unique<SfxDocumentInfoDialog>(pParent, rSet);
//only with statistics, when this document is being shown, not
//from within the Doc-Manager
SwDocShell* pDocSh = static_cast<SwDocShell*>( SfxObjectShell::Current());
@@ -162,11 +160,11 @@ VclPtr<SfxDocumentInfoDialog> SwDocShell::CreateDocumentInfoDialog(const SfxItem
if ( pVSh && dynamic_cast< const SwSrcView *>( pVSh ) == nullptr )
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- pDlg->AddFontTabPage();
- pDlg->AddTabPage(RID_SW_TP_DOC_STAT, SwResId(STR_DOC_STAT), pFact->GetTabPageCreatorFunc(RID_SW_TP_DOC_STAT));
+ xDlg->AddFontTabPage();
+ xDlg->AddTabPage("writerstats", SwResId(STR_DOC_STAT), pFact->GetTabPageCreatorFunc(RID_SW_TP_DOC_STAT));
}
}
- return pDlg;
+ return xDlg;
}
void SwDocShell::ToggleLayoutMode(SwView* pView)