desktop/source/app/app.cxx | 1 desktop/source/app/cmdlineargs.cxx | 4 ++- desktop/source/app/cmdlineargs.hxx | 2 + desktop/source/app/cmdlinehelp.cxx | 3 +- desktop/source/app/dispatchwatcher.cxx | 10 ++++---- desktop/source/app/dispatchwatcher.hxx | 2 - desktop/source/app/officeipcthread.cxx | 3 +- desktop/source/app/officeipcthread.hxx | 1 include/sfx2/sfxsids.hrc | 2 - sd/inc/drawdoc.hxx | 8 +++--- sd/qa/unit/tiledrendering/tiledrendering.cxx | 2 - sd/sdi/sdraw.sdi | 2 - sd/source/core/drawdoc.cxx | 6 ++-- sd/source/ui/docshell/docshel4.cxx | 33 ++++++++++++++------------- sd/source/ui/slideshow/slideshowimpl.cxx | 7 +++-- sd/source/ui/view/ViewShellBase.cxx | 15 ++++++++---- sd/source/ui/view/drviewse.cxx | 7 ++++- sfx2/source/appl/appuno.cxx | 8 +++--- sfx2/source/doc/objstor.cxx | 2 - 19 files changed, 71 insertions(+), 47 deletions(-)
New commits: commit 90eb9ea881a7497bb2ec348b3e4cba5aa5d51fa8 Author: Justin Luth <justin.l...@collabora.com> AuthorDate: Fri May 3 08:32:27 2024 -0400 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Wed May 8 09:38:59 2024 +0200 tdf#69192: add StartingSlide to SID_PRESENTATION and cmdline show= Allow the user to start the presentation at a specific slide using command-line parameters. This patch depends on the previous variable renaming patch. Change-Id: I87797cbccb463904e5d2fe9b078e3921be27c91a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167066 Tested-by: Jenkins Reviewed-by: Justin Luth <jl...@mail.com> Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 1dcc49f56d7c..eff8b46d069f 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -2094,6 +2094,7 @@ void Desktop::OpenClients() aRequest.aConversionParams = rArgs.GetConversionParams(); aRequest.aConversionOut = rArgs.GetConversionOut(); aRequest.aImageConversionType = rArgs.GetImageConversionType(); + aRequest.aStartListParams = rArgs.GetStartListParams(); aRequest.aInFilter = rArgs.GetInFilter(); aRequest.bTextCat = rArgs.IsTextCat(); aRequest.bScriptCat = rArgs.IsScriptCat(); diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx index ba5a3da5a6c3..09a0cd212947 100644 --- a/desktop/source/app/cmdlineargs.cxx +++ b/desktop/source/app/cmdlineargs.cxx @@ -537,10 +537,12 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier ) // open in viewmode eCurrentEvent = CommandLineEvent::View; } - else if ( oArg == "show" ) + else if (oArg == "show" || oArg.startsWith("show=", &rest)) { // open in viewmode eCurrentEvent = CommandLineEvent::Start; + // start on the first slide unless a valid starting slide # was provided + m_startListParams = rest.toUInt32() > 0 ? rest : "1"; } else if ( oArg == "display" ) { diff --git a/desktop/source/app/cmdlineargs.hxx b/desktop/source/app/cmdlineargs.hxx index 59cd741a8c3f..d5d94abd67f2 100644 --- a/desktop/source/app/cmdlineargs.hxx +++ b/desktop/source/app/cmdlineargs.hxx @@ -114,6 +114,7 @@ class CommandLineArgs const OUString& GetConversionParams() const { return m_conversionparams;} OUString GetConversionOut() const; OUString const & GetImageConversionType() const { return m_convertimages; } + const OUString& GetStartListParams() const { return m_startListParams; } const OUString& GetPidfileName() const { return m_pidfile;} // Special analyzed states (does not match directly to a command line parameter!) @@ -177,6 +178,7 @@ class CommandLineArgs OUString m_conversionparams; OUString m_conversionout; // contains external URIs OUString m_convertimages; // The format in which images should be converted + OUString m_startListParams; std::vector< OUString > m_infilter; OUString m_language; OUString m_pidfile; diff --git a/desktop/source/app/cmdlinehelp.cxx b/desktop/source/app/cmdlinehelp.cxx index 9c9fd940f233..10b3e5c48cbb 100644 --- a/desktop/source/app/cmdlinehelp.cxx +++ b/desktop/source/app/cmdlinehelp.cxx @@ -145,8 +145,9 @@ namespace desktop " not appear. If the file name contains spaces, then it " " must be enclosed in quotation marks. " " --view Opens following files in viewer mode (read-only). " - " --show Opens and starts the following presentation documents " + " --show{=slide#} Opens and starts the following presentation documents " " of each immediately. Files are closed after the showing. " + " If a slide # is provided, they start at that slide. " " Files other than Impress documents are opened in " " default mode , regardless of previous mode. " " --convert-to OutputFileExtension[:OutputFilterName] \ " diff --git a/desktop/source/app/dispatchwatcher.cxx b/desktop/source/app/dispatchwatcher.cxx index 7a5db6b9319b..6851cd69c553 100644 --- a/desktop/source/app/dispatchwatcher.cxx +++ b/desktop/source/app/dispatchwatcher.cxx @@ -502,7 +502,9 @@ bool DispatchWatcher::executeDispatchRequests( const std::vector<DispatchRequest // if we are called with --show set Start in mediadescriptor if(aDispatchRequest.aRequestType == REQUEST_START) { - aArgs.emplace_back("StartPresentation", 0, Any(true), PropertyState_DIRECT_VALUE); + const sal_Int32 nStartingSlide = aDispatchRequest.aParam.toInt32(); + const sal_uInt16 nSlide = nStartingSlide > 0 ? nStartingSlide : 1; + aArgs.emplace_back("StartPresentation", 0, Any(nSlide), PropertyState_DIRECT_VALUE); } // Force input filter, if possible diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx index 9fa0b36342af..9775c4c60fa9 100644 --- a/desktop/source/app/officeipcthread.cxx +++ b/desktop/source/app/officeipcthread.cxx @@ -984,6 +984,7 @@ bool IpcThread::process(OString const & arguments, bool * waitProcessed) { pRequest->aConversionParams = aCmdLineArgs->GetConversionParams(); pRequest->aConversionOut = aCmdLineArgs->GetConversionOut(); pRequest->aImageConversionType = aCmdLineArgs->GetImageConversionType(); + pRequest->aStartListParams = aCmdLineArgs->GetStartListParams(); pRequest->aInFilter = aCmdLineArgs->GetInFilter(); pRequest->bTextCat = aCmdLineArgs->IsTextCat(); pRequest->bScriptCat = aCmdLineArgs->IsScriptCat(); @@ -1309,7 +1310,7 @@ bool RequestHandler::ExecuteCmdLineRequests( AddToDispatchList( aDispatchList, aRequest.aCwdUrl, aRequest.aInFilter, DispatchWatcher::REQUEST_INFILTER, u""_ustr, aRequest.aModule ); AddToDispatchList( aDispatchList, aRequest.aCwdUrl, aRequest.aOpenList, DispatchWatcher::REQUEST_OPEN, u""_ustr, aRequest.aModule ); AddToDispatchList( aDispatchList, aRequest.aCwdUrl, aRequest.aViewList, DispatchWatcher::REQUEST_VIEW, u""_ustr, aRequest.aModule ); - AddToDispatchList( aDispatchList, aRequest.aCwdUrl, aRequest.aStartList, DispatchWatcher::REQUEST_START, u""_ustr, aRequest.aModule ); + AddToDispatchList( aDispatchList, aRequest.aCwdUrl, aRequest.aStartList, DispatchWatcher::REQUEST_START, aRequest.aStartListParams, aRequest.aModule ); AddToDispatchList( aDispatchList, aRequest.aCwdUrl, aRequest.aPrintList, DispatchWatcher::REQUEST_PRINT, u""_ustr, aRequest.aModule ); AddToDispatchList( aDispatchList, aRequest.aCwdUrl, aRequest.aPrintToList, DispatchWatcher::REQUEST_PRINTTO, aRequest.aPrinterName, aRequest.aModule ); AddToDispatchList( aDispatchList, aRequest.aCwdUrl, aRequest.aForceOpenList, DispatchWatcher::REQUEST_FORCEOPEN, u""_ustr, aRequest.aModule ); diff --git a/desktop/source/app/officeipcthread.hxx b/desktop/source/app/officeipcthread.hxx index a233c18e012b..fc95b42668bc 100644 --- a/desktop/source/app/officeipcthread.hxx +++ b/desktop/source/app/officeipcthread.hxx @@ -60,6 +60,7 @@ struct ProcessDocumentsRequest OUString aConversionParams; OUString aConversionOut; OUString aImageConversionType; + OUString aStartListParams; std::vector< OUString > aInFilter; ::osl::Condition *pcProcessed; // pointer condition to be set when the request has been processed bool* mpbSuccess = nullptr; // pointer to boolean receiving if the processing was successful diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc index f863d7cb3233..5639c21d44ca 100644 --- a/include/sfx2/sfxsids.hrc +++ b/include/sfx2/sfxsids.hrc @@ -345,7 +345,7 @@ class SvxZoomItem; #define SID_MODIFIER TypedWhichId<SfxUInt16Item>(SID_SFX_START + 669) #define SID_SETOPTIONS (SID_SFX_START + 670) #define SID_SOURCEVIEW (SID_SFX_START + 675) -#define SID_DOC_STARTPRESENTATION TypedWhichId<SfxBoolItem>(SID_SFX_START + 695) +#define SID_DOC_STARTPRESENTATION TypedWhichId<SfxUInt16Item>(SID_SFX_START + 695) #define SID_DDE_RECONNECT_ONLOAD TypedWhichId<SfxBoolItem>(SID_SFX_START + 696) #define SID_DOCTEMPLATE (SID_SFX_START + 538) diff --git a/sd/inc/drawdoc.hxx b/sd/inc/drawdoc.hxx index f2a28131f888..6491cd56f62a 100644 --- a/sd/inc/drawdoc.hxx +++ b/sd/inc/drawdoc.hxx @@ -154,8 +154,8 @@ private: bool mbOnlineSpell; bool mbSummationOfParagraphs; - bool mbStartWithPresentation; ///< is set to true when starting with command line parameter -start - bool mbExitAfterPresenting; ///< true if mbStartWithPresentation AND Presentation was shown fully + sal_uInt16 mnStartWithPresentation; ///< 1-based starting slide# when presenting via command line parameter --show + bool mbExitAfterPresenting; ///< true if GetStartWithPresentation AND Presentation was shown fully LanguageType meLanguage; LanguageType meLanguageCJK; LanguageType meLanguageCTL; @@ -284,8 +284,8 @@ public: ::sd::DrawDocShell* pBookmarkDocSh, Point const * pObjPos); - SAL_DLLPRIVATE bool IsStartWithPresentation() const { return mbStartWithPresentation;} - SAL_DLLPRIVATE void SetStartWithPresentation( bool bStartWithPresentation ); + SAL_DLLPRIVATE sal_uInt16 GetStartWithPresentation() const { return mnStartWithPresentation; } + SAL_DLLPRIVATE void SetStartWithPresentation(sal_uInt16 nStartingSlide); SAL_DLLPRIVATE bool IsExitAfterPresenting() const { return mbExitAfterPresenting;} SAL_DLLPRIVATE void SetExitAfterPresenting( bool bExitAfterPresenting ); diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx index 7f8c4fa19338..c013df072c17 100644 --- a/sd/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx @@ -2987,7 +2987,7 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testStartPresentation) { SdXImpressDocument* pXImpressDocument = createDoc("test.ppsx"); ViewCallback aView; - CPPUNIT_ASSERT(pXImpressDocument->GetDoc()->IsStartWithPresentation()); + CPPUNIT_ASSERT(pXImpressDocument->GetDoc()->GetStartWithPresentation()); Scheduler::ProcessEventsToIdle(); const auto it = aView.m_aStateChanges.find(".uno:StartWithPresentation"); diff --git a/sd/sdi/sdraw.sdi b/sd/sdi/sdraw.sdi index 9c2493ea2476..a765a1fd943d 100644 --- a/sd/sdi/sdraw.sdi +++ b/sd/sdi/sdraw.sdi @@ -3192,7 +3192,7 @@ SfxBoolItem PickThrough SID_PICK_THROUGH ] SfxVoidItem Presentation SID_PRESENTATION -() +(SfxUInt16Item StartingSlide FN_PARAM_1) [ AutoUpdate = FALSE, FastCall = FALSE, diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx index 1ed511467158..5def1937684d 100644 --- a/sd/source/core/drawdoc.cxx +++ b/sd/source/core/drawdoc.cxx @@ -123,7 +123,7 @@ SdDrawDocument::SdDrawDocument(DocumentType eType, SfxObjectShell* pDrDocSh) , mbInitialOnlineSpellingEnabled(true) , mbNewOrLoadCompleted(false) , mbOnlineSpell(false) -, mbStartWithPresentation( false ) +, mnStartWithPresentation(0) , mbExitAfterPresenting( false ) , meLanguage( LANGUAGE_SYSTEM ) , meLanguageCJK( LANGUAGE_SYSTEM ) @@ -1054,9 +1054,9 @@ void SdDrawDocument::SetPrinterIndependentLayout (sal_Int32 nMode) } } -void SdDrawDocument::SetStartWithPresentation( bool bStartWithPresentation ) +void SdDrawDocument::SetStartWithPresentation(sal_uInt16 nStartingSlide) { - mbStartWithPresentation = bStartWithPresentation; + mnStartWithPresentation = nStartingSlide; } void SdDrawDocument::SetExitAfterPresenting( bool bExitAfterPresenting ) diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx index 742614d101c1..514409ec755b 100644 --- a/sd/source/ui/docshell/docshel4.cxx +++ b/sd/source/ui/docshell/docshel4.cxx @@ -284,11 +284,11 @@ bool DrawDocShell::Load( SfxMedium& rMedium ) mpDoc->SetStarDrawPreviewMode( true ); } - if( SfxItemState::SET == rSet.GetItemState(SID_DOC_STARTPRESENTATION)&& - rSet.Get( SID_DOC_STARTPRESENTATION ).GetValue() ) + if (SfxItemState::SET == rSet.GetItemState(SID_DOC_STARTPRESENTATION)) { - bStartPresentation = true; - mpDoc->SetStartWithPresentation( true ); + const sal_uInt16 nStartingSlide = rSet.Get(SID_DOC_STARTPRESENTATION).GetValue(); + bStartPresentation = nStartingSlide; + mpDoc->SetStartWithPresentation(nStartingSlide); } bRet = SfxObjectShell::Load( rMedium ); @@ -421,15 +421,18 @@ bool DrawDocShell::ImportFrom(SfxMedium &rMedium, const bool bRet = SfxObjectShell::ImportFrom(rMedium, xInsertPosition); SfxItemSet& rSet = rMedium.GetItemSet(); - if( SfxItemState::SET == rSet.GetItemState(SID_DOC_STARTPRESENTATION)&& - rSet.Get( SID_DOC_STARTPRESENTATION ).GetValue() ) + if (SfxItemState::SET == rSet.GetItemState(SID_DOC_STARTPRESENTATION)) { - mpDoc->SetStartWithPresentation( true ); - - // tell SFX to change viewshell when in preview mode - if( IsPreview() ) + const sal_uInt16 nStartingSlide = rSet.Get(SID_DOC_STARTPRESENTATION).GetValue(); + if (nStartingSlide) { - GetMedium()->GetItemSet().Put( SfxUInt16Item( SID_VIEW_ID, 1 ) ); + mpDoc->SetStartWithPresentation(nStartingSlide); + + // tell SFX to change viewshell when in preview mode + if (IsPreview()) + { + GetMedium()->GetItemSet().Put(SfxUInt16Item(SID_VIEW_ID, 1)); + } } } @@ -453,11 +456,11 @@ bool DrawDocShell::ConvertFrom( SfxMedium& rMedium ) mpDoc->SetStarDrawPreviewMode( true ); } - if( SfxItemState::SET == rSet.GetItemState(SID_DOC_STARTPRESENTATION)&& - rSet.Get( SID_DOC_STARTPRESENTATION ).GetValue() ) + if (SfxItemState::SET == rSet.GetItemState(SID_DOC_STARTPRESENTATION)) { - bStartPresentation = true; - mpDoc->SetStartWithPresentation( true ); + const sal_uInt16 nStartingSlide = rSet.Get(SID_DOC_STARTPRESENTATION).GetValue(); + bStartPresentation = nStartingSlide; + mpDoc->SetStartWithPresentation(nStartingSlide); } if( aFilterName == pFilterPowerPoint97 diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index e11d42a89be9..b096fd53a1f1 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -1047,7 +1047,8 @@ bool SlideshowImpl::startShow( PresentationSettingsEx const * pPresSettings ) return false; // Autoplay (pps/ppsx) - if (mpViewShell->GetDoc()->IsStartWithPresentation()){ + if (mpViewShell->GetDoc()->GetStartWithPresentation()) + { mpViewShell->GetDoc()->SetExitAfterPresenting(true); } @@ -2245,7 +2246,7 @@ IMPL_LINK_NOARG(SlideshowImpl, ContextMenuHdl, void*, void) const ShowWindowMode eMode = mpShowWindow->GetShowWindowMode(); xMenu->set_visible("next", mpSlideController->getNextSlideIndex() != -1); xMenu->set_visible("prev", (mpSlideController->getPreviousSlideIndex() != -1 ) || (eMode == SHOWWINDOWMODE_END) || (eMode == SHOWWINDOWMODE_PAUSE) || (eMode == SHOWWINDOWMODE_BLANK)); - xMenu->set_visible("edit", mpViewShell->GetDoc()->IsStartWithPresentation()); + xMenu->set_visible("edit", mpViewShell->GetDoc()->GetStartWithPresentation() != 0); std::unique_ptr<weld::Menu> xPageMenu(xBuilder->weld_menu("gotomenu")); OUString sFirstImage(BMP_MENU_FIRST), sLastImage(BMP_MENU_LAST); @@ -3115,7 +3116,7 @@ void SAL_CALL SlideshowImpl::gotoNextSlide( ) if( mpShowWindow ) { mpShowWindow->SetEndMode(); - if( !mpViewShell->GetDoc()->IsStartWithPresentation() ) + if (!mpViewShell->GetDoc()->GetStartWithPresentation()) pause(); } } diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx index a86a448900f4..1d7bf8caadd9 100644 --- a/sd/source/ui/view/ViewShellBase.cxx +++ b/sd/source/ui/view/ViewShellBase.cxx @@ -64,6 +64,7 @@ #include <sfx2/msg.hxx> #include <sfx2/objface.hxx> #include <sfx2/viewfrm.hxx> +#include <svl/intitem.hxx> #include <svl/whiter.hxx> #include <svx/theme/ThemeColorChangerCommon.hxx> #include <vcl/commandinfoprovider.hxx> @@ -413,13 +414,17 @@ void ViewShellBase::Notify(SfxBroadcaster& rBC, const SfxHint& rHint) switch (static_cast<const SfxEventHint&>(rHint).GetEventId()) { case SfxEventHintId::OpenDoc: - if( GetDocument() && GetDocument()->IsStartWithPresentation() ) + { + const sal_uInt16 nStartingSlide + = GetDocument() ? GetDocument()->GetStartWithPresentation() : 0; + if (nStartingSlide) { - GetViewFrame().GetDispatcher()->Execute( - SID_PRESENTATION, SfxCallMode::ASYNCHRON ); + SfxUInt16Item aItem(FN_PARAM_1, nStartingSlide); + GetViewFrame().GetDispatcher()->ExecuteList( + SID_PRESENTATION, SfxCallMode::ASYNCHRON, { &aItem }); } break; - + } default: break; } @@ -1034,7 +1039,7 @@ void ViewShellBase::afterCallbackRegistered() svx::theme::notifyLOK(pThemeColors, aDocumentColors); } - if (mpDocument && mpDocument->IsStartWithPresentation()) + if (mpDocument && mpDocument->GetStartWithPresentation()) { // Be consistent with SidebarController, emit JSON. boost::property_tree::ptree aTree; diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx index d7cc62eb9ce0..f83976e27782 100644 --- a/sd/source/ui/view/drviewse.cxx +++ b/sd/source/ui/view/drviewse.cxx @@ -1709,8 +1709,13 @@ namespace slideshowhelp { //Start at page 0, this would blow away any custom //show settings if any were set + const SfxUInt16Item* pStartingSlide = rReq.GetArg<SfxUInt16Item>(FN_PARAM_1); + const sal_uInt16 nStartingSlide = pStartingSlide ? pStartingSlide->GetValue() - 1 : 0; + SdPage* pSlide = rDoc.GetSdPage(nStartingSlide, PageKind::Standard); + const OUString& rStartingSlide = pSlide ? pSlide->GetName() : OUString(); + Sequence< PropertyValue > aArguments{ comphelper::makePropertyValue("FirstPage", - OUString("0")) }; + rStartingSlide) }; xPresentation->startWithArguments( aArguments ); } sfx2::SfxNotebookBar::UnlockNotebookBar(); diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx index 948b8d7abb4d..75104462e777 100644 --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -543,11 +543,11 @@ void TransformParameters( sal_uInt16 nSlotId, const uno::Sequence<beans::Propert } else if ( aName == sStartPresentation ) { - bool bVal = false; - bool bOK = (rProp.Value >>= bVal); + sal_uInt16 nVal = 0; + bool bOK = (rProp.Value >>= nVal); DBG_ASSERT( bOK, "invalid type for StartPresentation" ); if (bOK) - rSet.Put( SfxBoolItem( SID_DOC_STARTPRESENTATION, bVal ) ); + rSet.Put(SfxUInt16Item(SID_DOC_STARTPRESENTATION, nVal)); } else if ( aName == sSelectionOnly ) { @@ -1489,7 +1489,7 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, uno::Sequence<b pValue[nActProp].Name = sDdeReconnect; pValue[nActProp++].Value <<= pItem->GetValue(); } - if ( const SfxBoolItem *pItem = rSet.GetItemIfSet( SID_DOC_STARTPRESENTATION, false) ) + if (const SfxUInt16Item* pItem = rSet.GetItemIfSet(SID_DOC_STARTPRESENTATION, false)) { pValue[nActProp].Name = sStartPresentation; pValue[nActProp++].Value <<= pItem->GetValue(); diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index a85ba7097b66..32f5083e0a75 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -651,7 +651,7 @@ bool SfxObjectShell::DoLoad( SfxMedium *pMed ) SetError(nError); if (pMedium->GetFilter()->GetFilterFlags() & SfxFilterFlags::STARTPRESENTATION) - rSet.Put( SfxBoolItem( SID_DOC_STARTPRESENTATION, true) ); + rSet.Put(SfxUInt16Item(SID_DOC_STARTPRESENTATION, 1)); } EnableSetModified( false ); commit ddc4cd3d0cf9e8bde440df3e92e98a2a2017c797 Author: Justin Luth <justin.l...@collabora.com> AuthorDate: Fri May 3 09:01:42 2024 -0400 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Wed May 8 09:38:54 2024 +0200 NFC dispatchwatcher.hxx: rename aPrinterName to aParam It is rather confusing to have a generic parameter variable named aPrinterName. I'm going to use that in my patch, so first clean it up separately. Change-Id: I3e73eeddbc506d369ba5d6e2b569d30eef78bfb6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167059 Tested-by: Jenkins Reviewed-by: Justin Luth <jl...@mail.com> Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/desktop/source/app/dispatchwatcher.cxx b/desktop/source/app/dispatchwatcher.cxx index 3b112cdc298b..7a5db6b9319b 100644 --- a/desktop/source/app/dispatchwatcher.cxx +++ b/desktop/source/app/dispatchwatcher.cxx @@ -565,7 +565,7 @@ bool DispatchWatcher::executeDispatchRequests( const std::vector<DispatchRequest // FIXME: factor out into a method ... Reference< XStorable > xStorable( xDoc, UNO_QUERY ); if ( xStorable.is() ) { - OUString aParam = aDispatchRequest.aPrinterName; + const OUString& aParam = aDispatchRequest.aParam; sal_Int32 nPathIndex = aParam.lastIndexOf( ';' ); sal_Int32 nFilterIndex = aParam.indexOf( ':' ); sal_Int32 nImgFilterIndex = aParam.lastIndexOf( '|' ); @@ -745,7 +745,7 @@ bool DispatchWatcher::executeDispatchRequests( const std::vector<DispatchRequest } else if ( aDispatchRequest.aRequestType == REQUEST_BATCHPRINT ) { - batchPrint( aDispatchRequest.aPrinterName, xDoc, aObj, aName ); + batchPrint(aDispatchRequest.aParam, xDoc, aObj, aName); } else { @@ -753,7 +753,7 @@ bool DispatchWatcher::executeDispatchRequests( const std::vector<DispatchRequest { // create the printer Sequence < PropertyValue > aPrinterArgs{ comphelper::makePropertyValue( - u"Name"_ustr, aDispatchRequest.aPrinterName) }; + u"Name"_ustr, aDispatchRequest.aParam) }; xDoc->setPrinter( aPrinterArgs ); } diff --git a/desktop/source/app/dispatchwatcher.hxx b/desktop/source/app/dispatchwatcher.hxx index 70a7fd42e679..9a970cf82dce 100644 --- a/desktop/source/app/dispatchwatcher.hxx +++ b/desktop/source/app/dispatchwatcher.hxx @@ -59,7 +59,7 @@ class DispatchWatcher : public ::cppu::WeakImplHelper< css::frame::XDispatchResu RequestType aRequestType; OUString aURL; std::optional< OUString > aCwdUrl; - OUString aPrinterName; // also conversion params + OUString aParam; OUString aPreselectedFactory; };