summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTibor Nagy <tibor.nagy.extern@allotropia.de>2024-09-06 23:15:21 +0200
committerNagy Tibor <tibor.nagy.extern@allotropia.de>2024-09-09 23:07:00 +0200
commit9c0cd7c60b138fa5265969dae3847a5e8e1ca923 (patch)
tree4804ef36293f5d22303d4068743d82792c38b4d2
parent6ca8cf32d2f879dbead2f402eeef60edd3f0266e (diff)
tdf#76981 sd: opening linked presentation in slideshow mode
If an Impress presentation(odp) is opened via a document link while in slideshow mode, the linked presentation should open in slideshow mode and close when finished. If it is opened while in editing mode, the linked presentation should open in editing mode. Change-Id: I3fd410872472ed6391b2150151810b5da32fa29b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172984 Tested-by: Jenkins Reviewed-by: Nagy Tibor <tibor.nagy.extern@allotropia.de>
-rw-r--r--sd/source/ui/docshell/docshel4.cxx30
1 files changed, 22 insertions, 8 deletions
diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx
index 76562ed093ca..3b60fd176367 100644
--- a/sd/source/ui/docshell/docshel4.cxx
+++ b/sd/source/ui/docshell/docshel4.cxx
@@ -285,13 +285,6 @@ bool DrawDocShell::Load( SfxMedium& rMedium )
mpDoc->SetStarDrawPreviewMode( true );
}
- if (SfxItemState::SET == rSet.GetItemState(SID_DOC_STARTPRESENTATION))
- {
- const sal_uInt16 nStartingSlide = rSet.Get(SID_DOC_STARTPRESENTATION).GetValue();
- bStartPresentation = nStartingSlide;
- mpDoc->SetStartWithPresentation(nStartingSlide);
- }
-
bRet = SfxObjectShell::Load( rMedium );
if (bRet)
{
@@ -335,6 +328,25 @@ bool DrawDocShell::Load( SfxMedium& rMedium )
SetError(ERRCODE_ABORT);
}
+ if (SfxItemState::SET == rSet.GetItemState(SID_DOC_STARTPRESENTATION))
+ {
+ sal_uInt16 nStartingSlide = rSet.Get(SID_DOC_STARTPRESENTATION).GetValue();
+ if (nStartingSlide == 0)
+ {
+ OUString sStartPage = mpDoc->getPresentationSettings().maPresPage;
+ if (!sStartPage.isEmpty())
+ {
+ bool bIsMasterPage = false;
+ sal_uInt16 nPageNumb = mpDoc->GetPageByName(sStartPage, bIsMasterPage);
+ nStartingSlide = (nPageNumb + 1) / 2;
+ }
+ else
+ nStartingSlide = 1;
+ }
+ bStartPresentation = nStartingSlide;
+ mpDoc->SetStartWithPresentation(nStartingSlide);
+ }
+
// tell SFX to change viewshell when in preview mode
if( IsPreview() || bStartPresentation )
{
@@ -972,7 +984,9 @@ void DrawDocShell::OpenBookmark( const OUString& rBookmarkURL )
{
SfxStringItem aStrItem( SID_FILE_NAME, rBookmarkURL );
SfxStringItem aReferer( SID_REFERER, GetMedium()->GetName() );
- const SfxPoolItem* ppArgs[] = { &aStrItem, &aReferer, nullptr };
+ SfxUInt16Item aPresentation( SID_DOC_STARTPRESENTATION );
+ const SfxPoolItem* ppArgs[] = { &aStrItem, &aReferer, &aPresentation, nullptr };
+
if (SfxViewFrame* pFrame = mpViewShell ? mpViewShell->GetViewFrame() : SfxViewFrame::Current())
pFrame->GetBindings().Execute( SID_OPENHYPERLINK, ppArgs );
}