diff --git a/sd/inc/drawdoc.hxx b/sd/inc/drawdoc.hxx index 7d4c3c92ce5c..80a79955537f 100644 --- a/sd/inc/drawdoc.hxx +++ b/sd/inc/drawdoc.hxx @@ -108,6 +108,7 @@ namespace sd bool mbAnimationAllowed; sal_Int32 mnPauseTimeout; bool mbShowPauseLogo; + bool mbStartCustomShow; PresentationSettings(); }; diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx index 8fa1622d6197..444677fdda41 100644 --- a/sd/qa/unit/uiimpress.cxx +++ b/sd/qa/unit/uiimpress.cxx @@ -49,6 +49,7 @@ #include #include #include +#include using namespace ::com::sun::star; @@ -717,6 +718,22 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testSearchAllInDocumentAndNotes) Scheduler::ProcessEventsToIdle(); } +CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf142589) +{ + mxComponent = loadFromDesktop("private:factory/simpress", + "com.sun.star.presentation.PresentationDocument"); + CPPUNIT_ASSERT(mxComponent.is()); + + auto pImpressDocument = dynamic_cast(mxComponent.get()); + sd::ViewShell* pViewShell = pImpressDocument->GetDocShell()->GetViewShell(); + + SfxRequest aRequest(pViewShell->GetViewFrame(), SID_PRESENTATION); + pImpressDocument->GetDoc()->getPresentationSettings().mbCustomShow = true; + pImpressDocument->GetDoc()->getPresentationSettings().mbStartCustomShow = true; + sd::slideshowhelp::ShowSlideShow(aRequest, *pImpressDocument->GetDoc()); + CPPUNIT_ASSERT_EQUAL(false, pImpressDocument->GetDoc()->getPresentationSettings().mbCustomShow); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx index 4e7c6c5dbd88..baf1d57fea18 100644 --- a/sd/source/core/drawdoc.cxx +++ b/sd/source/core/drawdoc.cxx @@ -109,7 +109,8 @@ PresentationSettings::PresentationSettings() mbFullScreen( true ), mbAnimationAllowed( true ), mnPauseTimeout( 0 ), - mbShowPauseLogo( false ) + mbShowPauseLogo( false ), + mbStartCustomShow( false ) { } diff --git a/sd/source/ui/dlg/custsdlg.cxx b/sd/source/ui/dlg/custsdlg.cxx index afa9e0be21be..db2414a51fa2 100644 --- a/sd/source/ui/dlg/custsdlg.cxx +++ b/sd/source/ui/dlg/custsdlg.cxx @@ -38,7 +38,6 @@ SdCustomShowDlg::SdCustomShowDlg(weld::Window* pWindow, SdDrawDocument& rDrawDoc , pCustomShowList(nullptr) , bModified(false) , m_xLbCustomShows(m_xBuilder->weld_tree_view("customshowlist")) - , m_xCbxUseCustomShow(m_xBuilder->weld_check_button("usecustomshows")) , m_xBtnNew(m_xBuilder->weld_button("new")) , m_xBtnEdit(m_xBuilder->weld_button("edit")) , m_xBtnRemove(m_xBuilder->weld_button("delete")) @@ -55,7 +54,6 @@ SdCustomShowDlg::SdCustomShowDlg(weld::Window* pWindow, SdDrawDocument& rDrawDoc m_xBtnEdit->connect_clicked( aLink ); m_xBtnRemove->connect_clicked( aLink ); m_xBtnCopy->connect_clicked( aLink ); - m_xCbxUseCustomShow->connect_toggled(LINK(this, SdCustomShowDlg, ToggleButtonHdl)); m_xLbCustomShows->connect_changed( LINK( this, SdCustomShowDlg, SelectListBoxHdl ) ); m_xBtnStartShow->connect_clicked( LINK( this, SdCustomShowDlg, StartShowHdl ) ); // for test @@ -76,8 +74,6 @@ SdCustomShowDlg::SdCustomShowDlg(weld::Window* pWindow, SdDrawDocument& rDrawDoc pCustomShowList->Seek( nPosToSelect ); } - m_xCbxUseCustomShow->set_active(pCustomShowList && rDoc.getPresentationSettings().mbCustomShow); - CheckState(); } @@ -93,18 +89,12 @@ void SdCustomShowDlg::CheckState() m_xBtnEdit->set_sensitive( bEnable ); m_xBtnRemove->set_sensitive( bEnable ); m_xBtnCopy->set_sensitive( bEnable ); - m_xCbxUseCustomShow->set_sensitive( bEnable ); - m_xBtnStartShow->set_sensitive(true); + m_xBtnStartShow->set_sensitive(bEnable); if (bEnable && pCustomShowList) pCustomShowList->Seek( nPos ); } -IMPL_LINK( SdCustomShowDlg, ToggleButtonHdl, weld::Toggleable&, r, void ) -{ - SelectHdl(&r); -} - IMPL_LINK( SdCustomShowDlg, ClickButtonHdl, weld::Button&, r, void ) { SelectHdl(&r); @@ -241,10 +231,6 @@ void SdCustomShowDlg::SelectHdl(void const *p) bModified = true; } - else if( p == m_xCbxUseCustomShow.get() ) - { - bModified = true; - } CheckState(); } @@ -258,7 +244,10 @@ IMPL_LINK_NOARG(SdCustomShowDlg, StartShowHdl, weld::Button&, void) // CheckState bool SdCustomShowDlg::IsCustomShow() const { - return (m_xCbxUseCustomShow->get_sensitive() && m_xCbxUseCustomShow->get_active()); + if (!pCustomShowList->empty()) + return true; + else + return false; } // SdDefineCustomShowDlg diff --git a/sd/source/ui/func/fucushow.cxx b/sd/source/ui/func/fucushow.cxx index a87076b8ed6f..8c63d0215776 100644 --- a/sd/source/ui/func/fucushow.cxx +++ b/sd/source/ui/func/fucushow.cxx @@ -55,21 +55,32 @@ void FuCustomShowDlg::DoExecute( SfxRequest& ) vcl::Window* pWin = mpViewShell->GetActiveWindow(); ScopedVclPtr pDlg( pFact->CreateSdCustomShowDlg(pWin ? pWin->GetFrameWeld() : nullptr, *mpDoc) ); sal_uInt16 nRet = pDlg->Execute(); - if( pDlg->IsModified() ) - { - mpDoc->SetChanged(); - sd::PresentationSettings& rSettings = mpDoc->getPresentationSettings(); - rSettings.mbCustomShow = pDlg->IsCustomShow(); - } - pDlg.disposeAndClear(); + mpDoc->SetChanged(); + sd::PresentationSettings& rSettings = mpDoc->getPresentationSettings(); if( nRet == RET_YES ) { + // If the custom show is not set by default + if (!rSettings.mbCustomShow) + { + rSettings.mbStartCustomShow = true; + rSettings.mbCustomShow = pDlg->IsCustomShow(); + } + mpViewShell->SetStartShowWithDialog(true); mpViewShell->GetViewFrame()->GetDispatcher()->Execute( SID_PRESENTATION, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD ); } + if (nRet == RET_OK) + { + if (!pDlg->IsCustomShow()) + { + rSettings.mbCustomShow = false; + rSettings.mbAll = true; + } + } + pDlg.disposeAndClear(); } } // end of namespace diff --git a/sd/source/ui/func/fusldlg.cxx b/sd/source/ui/func/fusldlg.cxx index 484aa5f1f9b7..4fcc5fd9f5ce 100644 --- a/sd/source/ui/func/fusldlg.cxx +++ b/sd/source/ui/func/fusldlg.cxx @@ -141,6 +141,7 @@ void FuSlideShowDlg::DoExecute( SfxRequest& ) { bValuesChanged = true; rPresentationSettings.mbCustomShow = bValue; + rPresentationSettings.mbStartCustomShow = false; } bValue = ITEMVALUE( aDlgSet, ATTR_PRESENT_ENDLESS, SfxBoolItem ); diff --git a/sd/source/ui/inc/custsdlg.hxx b/sd/source/ui/inc/custsdlg.hxx index 3ef3cfb1cd66..cd25983e9528 100644 --- a/sd/source/ui/inc/custsdlg.hxx +++ b/sd/source/ui/inc/custsdlg.hxx @@ -33,7 +33,6 @@ private: bool bModified; std::unique_ptr m_xLbCustomShows; - std::unique_ptr m_xCbxUseCustomShow; std::unique_ptr m_xBtnNew; std::unique_ptr m_xBtnEdit; std::unique_ptr m_xBtnRemove; @@ -45,7 +44,6 @@ private: void CheckState(); DECL_LINK( ClickButtonHdl, weld::Button&, void ); - DECL_LINK( ToggleButtonHdl, weld::Toggleable&, void ); DECL_LINK( SelectListBoxHdl, weld::TreeView&, void ); DECL_LINK( StartShowHdl, weld::Button&, void ); void SelectHdl(void const *); diff --git a/sd/source/ui/inc/slideshow.hxx b/sd/source/ui/inc/slideshow.hxx index a1eef4689da8..68fe77125647 100644 --- a/sd/source/ui/inc/slideshow.hxx +++ b/sd/source/ui/inc/slideshow.hxx @@ -32,6 +32,7 @@ #include #include +#include namespace com::sun::star { namespace drawing { @@ -208,7 +209,7 @@ private: namespace slideshowhelp { - void ShowSlideShow(SfxRequest const & rReq, SdDrawDocument &rDoc); + SD_DLLPUBLIC void ShowSlideShow(SfxRequest const& rReq, SdDrawDocument& rDoc); } } diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx index 9fb69869a0da..5e5a3ff38514 100644 --- a/sd/source/ui/view/drviewse.cxx +++ b/sd/source/ui/view/drviewse.cxx @@ -1653,6 +1653,10 @@ namespace slideshowhelp //use it whether or not we've been asked to //start from the current or first slide xPresentation->start(); + + // if the custom show not set by default, only show it. + if (rDoc.getPresentationSettings().mbStartCustomShow) + rDoc.getPresentationSettings().mbCustomShow = false; } else if (SID_PRESENTATION_CURRENT_SLIDE == rReq.GetSlot()) { diff --git a/sd/uiconfig/simpress/ui/customslideshows.ui b/sd/uiconfig/simpress/ui/customslideshows.ui index 5e0ac35717b4..f2ca42650068 100644 --- a/sd/uiconfig/simpress/ui/customslideshows.ui +++ b/sd/uiconfig/simpress/ui/customslideshows.ui @@ -146,26 +146,6 @@ 0 - - - _Use custom slide show - True - True - False - True - True - - - Runs the custom slide show you selected when you click Start. Otherwise, the entire presentation is shown. - - - - - False - True - 1 - - True