Unittest: How to exit slideshow mode?
Regina Henschel
rb.henschel at t-online.de
Sun Jul 27 21:22:50 UTC 2025
Hi all,
Regina Henschel schrieb am 26.07.2025 um 00:09:
> Hi all,
>
> This is about bug 166647. The fix itself is in
> https://bugs.documentfoundation.org/show_bug.cgi?id=166647. But I have
> no unit test yet.
>
> I think, I can enter slideshow mode via dispatcher with command
> ".uno:Presentation".
It seems, I fail already in starting the slideshow.
In sd/qa/unit/uiimpress.cxx I have added a test that starts with loading
the test document:
createSdImpressDoc("odp/tdf166647_userpaint.odp");
Then I have tried
dispatchCommand(mxComponent, u".uno:Presentation"_ustr, {});
But with CPPUNITTRACE=TRUE, I see that dispatch returns with a
isDone()=false
The uno-command itself is the correct one. The following Basic macro works:
sub StartPresentation
dim document as object
dim dispatcher as object
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dispatcher.executeDispatch(document, ".uno:Presentation", "", 0, Array())
end sub
Then I have tried
auto pXImpressDocument =
dynamic_cast<SdXImpressDocument*>(mxComponent.get());
SdDrawDocument* pDoc = pXImpressDocument->GetDoc();
uno::Reference<presentation::XPresentation2 >
xPresentation(pDoc->getPresentation(),
uno::UNO_QUERY);
xPresentation->start();
But xPresentation->isRunning() results in false.
So how to start and end a slideshow in a unit test? Or is it impossible?
Kind regards,
Regina
More information about the LibreOffice
mailing list