diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-03-09 08:37:24 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-03-11 07:13:11 +0100 |
commit | f011a01d4b1fc6fd9cdd4178dd2651a51cd897dc (patch) | |
tree | 3374e999e464f54c7bde5f2530067ae86cf0f4a0 /sd/source/ui/dlg/sdtreelb.cxx | |
parent | 87b44efa2a21279d22a3350b3a3d497284621d52 (diff) |
loplugin:constantparam
Change-Id: Ibe167c208844b4cdd10df80ae804b1e5bfa6aa13
Reviewed-on: https://gerrit.libreoffice.org/68998
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source/ui/dlg/sdtreelb.cxx')
-rw-r--r-- | sd/source/ui/dlg/sdtreelb.cxx | 33 |
1 files changed, 5 insertions, 28 deletions
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx index 2fa3dc9c4e42..f2152e704a9d 100644 --- a/sd/source/ui/dlg/sdtreelb.cxx +++ b/sd/source/ui/dlg/sdtreelb.cxx @@ -1462,42 +1462,19 @@ std::vector<OUString> SdPageObjsTLV::GetSelectEntryList(const int nDepth) const * Checks if it is a draw file and opens the BookmarkDoc depending of * the provided Docs */ -SdDrawDocument* SdPageObjsTLV::GetBookmarkDoc(SfxMedium* pMed) +SdDrawDocument* SdPageObjsTLV::GetBookmarkDoc() { - if ( - !m_pBookmarkDoc || - (pMed && (!m_pOwnMedium || m_pOwnMedium->GetName() != pMed->GetName())) - ) + if (!m_pBookmarkDoc) { // create a new BookmarkDoc if now one exists or if a new Medium is provided - if (m_pOwnMedium != pMed) + if (m_pOwnMedium != nullptr) { CloseBookmarkDoc(); } - if (pMed) - { - // it looks that it is undefined if a Medium was set by Fill() already - DBG_ASSERT( !m_pMedium, "SfxMedium confusion!" ); - delete m_pMedium; - m_pMedium = nullptr; + DBG_ASSERT( m_pMedium, "No SfxMedium provided!" ); - // take over this Medium (currently used only be Navigator) - m_pOwnMedium = pMed; - } - - DBG_ASSERT( m_pMedium || pMed, "No SfxMedium provided!" ); - - if( pMed ) - { - // in this mode the document is also owned and controlled by this instance - m_xBookmarkDocShRef = new ::sd::DrawDocShell(SfxObjectCreateMode::STANDARD, true, DocumentType::Impress); - if (m_xBookmarkDocShRef->DoLoad(pMed)) - m_pBookmarkDoc = m_xBookmarkDocShRef->GetDoc(); - else - m_pBookmarkDoc = nullptr; - } - else if ( m_pMedium ) + if ( m_pMedium ) // in this mode the document is owned and controlled by the SdDrawDocument // it can be released by calling the corresponding CloseBookmarkDoc method // successful creation of a document makes this the owner of the medium |