diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-10-06 15:50:13 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-10-06 18:07:50 +0200 |
commit | e0d373bf5328bfe84079f094dd605bb8f4337330 (patch) | |
tree | f8cb0a10bebf5d4268c9b1837df61c1753392eb2 /sw | |
parent | c13a19d462ef595201447272e357a65f5c005521 (diff) |
tdf#101813 sw,sfx2: enable inserting master document as section
Traditionally only ordinary com.sun.star.text.TextDocument could be
inserted as a section but then commit
3da8f3680556e0163f660a0a159930337c8c32ff unintentionally enabled
inserting everything, including master documents
(com.sun.star.text.GlobalDocument).
I'm really not sure if this should be allowed or not but apparently
somebody finds it useful so here we add some crude hacks to enable it
(to be reverted in case it causes trouble).
(regression? from 805fd1ca343d6295b8114a24cc29bdac332f266d)
Change-Id: I439b2516fcbe54977ff04e487a920acd38c27152
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/ui/dialog/uiregionsw.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/app/docsh2.cxx | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx index 51f1c74608b4..496654aaeb76 100644 --- a/sw/source/ui/dialog/uiregionsw.cxx +++ b/sw/source/ui/dialog/uiregionsw.cxx @@ -1316,7 +1316,7 @@ IMPL_LINK( SwEditRegionDlg, DlgClosedHdl, sfx2::FileDialogHelper *, _pFileDlg, v OUString sFileName, sFilterName, sPassword; if ( _pFileDlg->GetError() == ERRCODE_NONE ) { - std::unique_ptr<SfxMedium> pMedium(m_pDocInserter->CreateMedium()); + std::unique_ptr<SfxMedium> pMedium(m_pDocInserter->CreateMedium("sglobal")); if ( pMedium ) { sFileName = pMedium->GetURLObject().GetMainURL( INetURLObject::NO_DECODE ); @@ -1783,7 +1783,7 @@ IMPL_LINK( SwInsertSectionTabPage, DlgClosedHdl, sfx2::FileDialogHelper *, _pFil { if ( _pFileDlg->GetError() == ERRCODE_NONE ) { - std::unique_ptr<SfxMedium> pMedium(m_pDocInserter->CreateMedium()); + std::unique_ptr<SfxMedium> pMedium(m_pDocInserter->CreateMedium("sglobal")); if ( pMedium ) { m_sFileName = pMedium->GetURLObject().GetMainURL( INetURLObject::NO_DECODE ); diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx index 92c6b1b83715..8b5a6d95f704 100644 --- a/sw/source/uibase/app/docsh2.cxx +++ b/sw/source/uibase/app/docsh2.cxx @@ -1574,7 +1574,9 @@ int SwFindDocShell( SfxObjectShellRef& xDocSh, std::shared_ptr<const SfxFilter> pSfxFlt; if (!xMed->GetError()) { - SfxFilterMatcher aMatcher( OUString::createFromAscii(SwDocShell::Factory().GetShortName()) ); + SfxFilterMatcher aMatcher( rFilter == "writerglobal8" + ? OUString::createFromAscii(SwGlobalDocShell::Factory().GetShortName()) + : OUString::createFromAscii(SwDocShell::Factory().GetShortName()) ); // No Filter, so search for it. Else test if the one passed is a valid one if( !rFilter.isEmpty() ) |