summaryrefslogtreecommitdiff
path: root/sd/source
diff options
context:
space:
mode:
authorTibor Nagy <tibor.nagy.extern@allotropia.de>2024-09-10 12:04:13 +0200
committerThorsten Behrens <thorsten.behrens@allotropia.de>2024-09-11 00:03:13 +0200
commit34411f4e5fd04f16cdd1a443b3bce35c0ed71fda (patch)
tree19481133e3b9c113f7fd084de2a3ea5e0d168526 /sd/source
parent5d2297f35201a14543b6fe551cb8a238d6742f23 (diff)
tdf#76981 sd: opening linked presentation in slideshow mode (part2) cib_contract49c-24.2.6.2.M1
If an MSO presentation(pptx,ppt) 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: Ia9df1e4daa55dc697285a3778102a850e2f6098c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173130 Tested-by: Jenkins Reviewed-by: Nagy Tibor <tibor.nagy.extern@allotropia.de> (cherry picked from commit a781e5ad356ad0fb86eb8210a2c570fdd276ceac) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173103 Tested-by: allotropia jenkins <jenkins@allotropia.de> Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Diffstat (limited to 'sd/source')
-rw-r--r--sd/source/ui/docshell/docshel4.cxx38
1 files changed, 31 insertions, 7 deletions
diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx
index 6e995937215d..63722ba11c68 100644
--- a/sd/source/ui/docshell/docshel4.cxx
+++ b/sd/source/ui/docshell/docshel4.cxx
@@ -433,10 +433,22 @@ 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 );
+ 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;
+ }
+ mpDoc->SetStartWithPresentation(nStartingSlide);
// tell SFX to change viewshell when in preview mode
if( IsPreview() )
@@ -465,11 +477,23 @@ 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 );
+ 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);
}
if( aFilterName == pFilterPowerPoint97