sd/source/core/drawdoc2.cxx | 4 ++++ sd/source/filter/eppt/eppt.cxx | 10 +++++++++- sd/source/filter/eppt/epptbase.hxx | 2 ++ sd/source/filter/eppt/pptx-epptbase.cxx | 9 +++++++++ sd/source/filter/eppt/pptx-epptooxml.cxx | 6 +++++- 5 files changed, 29 insertions(+), 2 deletions(-)
New commits: commit 94f9ae36d340dfab5a6852fe7a1e1e3e4b63728d Author: Mohit Marathe <[email protected]> AuthorDate: Tue Dec 2 18:52:16 2025 +0530 Commit: Mohit Marathe <[email protected]> CommitDate: Tue Jan 13 09:03:33 2026 +0100 sd: exclude canvas page from slideshow Signed-off-by: Mohit Marathe <[email protected]> Change-Id: I052e12b08946c26bc129e8bcda4e1ca3c8a8e681 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194926 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Michael Stahl <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196810 Tested-by: Jenkins diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx index d5c5998b7d14..150d87e63bdb 100644 --- a/sd/source/core/drawdoc2.cxx +++ b/sd/source/core/drawdoc2.cxx @@ -1505,6 +1505,7 @@ void SdDrawDocument::ImportCanvasPage() SdPage* pPage = GetSdPage(0, PageKind::Standard); bool bIsCanvasPageValid = ValidateCanvasPage(pPage); pPage->SetCanvasPage(); + pPage->SetExcluded(true); mpCanvasPage = pPage; // re-populate the previews grid if not valid if (!bIsCanvasPageValid) @@ -1611,6 +1612,9 @@ sal_uInt16 SdDrawDocument::GetOrInsertCanvasPage() if (!pCanvasPage) return 0xffff; + // exclude from slideshow + pCanvasPage->SetExcluded(true); + // move the canvas page to the top sal_uInt16 nCanvasPageNum = 2 * nCanvasPageIndex + 1; MovePage(nCanvasPageNum, 1); // Canvas page commit 0a6c2925e4e0e402449fed67b5c9943ce445a303 Author: Mohit Marathe <[email protected]> AuthorDate: Fri Nov 28 21:17:23 2025 +0530 Commit: Mohit Marathe <[email protected]> CommitDate: Tue Jan 13 09:03:19 2026 +0100 sd: do not export canvas page to pptx Signed-off-by: Mohit Marathe <[email protected]> Change-Id: I82c078bda9bb2b7cb6ac634d4296031beeb59f71 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194880 Reviewed-by: Michael Stahl <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196809 Tested-by: Jenkins diff --git a/sd/source/filter/eppt/eppt.cxx b/sd/source/filter/eppt/eppt.cxx index 6c88c2b4f499..8f4123c38791 100644 --- a/sd/source/filter/eppt/eppt.cxx +++ b/sd/source/filter/eppt/eppt.cxx @@ -101,7 +101,7 @@ void PPTWriter::exportPPTPre( const std::vector< css::beans::PropertyValue >& rM if ( mXStatusIndicator.is() ) { mbStatusIndicator = true; - mnStatMaxValue = ( mnPages + mnMasterPages ) * 5; + mnStatMaxValue = ( mnPages + mnMasterPages - (2 * static_cast<int>(mbHasCanvasPage)) ) * 5; mXStatusIndicator->start( u"PowerPoint Export"_ustr, mnStatMaxValue + ( mnStatMaxValue >> 3 ) ); } @@ -707,6 +707,8 @@ bool PPTWriter::ImplCreateDocument() for ( i = 0; i < mnPages; i++ ) { + if (mbHasCanvasPage && i == 0) + continue; mpPptEscherEx->AddAtom( 20, EPP_SlidePersistAtom ); mpPptEscherEx->InsertPersistOffset( EPP_MAINSLIDE_PERSIST_KEY | i, mpStrm->Tell() ); mpStrm->WriteUInt32( 0 ) // psrReference - logical reference to the slide persist object ( EPP_MAINSLIDE_PERSIST_KEY ) @@ -732,6 +734,8 @@ bool PPTWriter::ImplCreateDocument() mpPptEscherEx->OpenContainer( EPP_SlideListWithText, 2 ); // animation information for the notes for( i = 0; i < mnPages; i++ ) { + if (mbHasCanvasPage && i == 0) + continue; mpPptEscherEx->AddAtom( 20, EPP_SlidePersistAtom ); mpPptEscherEx->InsertPersistOffset( EPP_MAINNOTES_PERSIST_KEY | i, mpStrm->Tell() ); mpStrm->WriteUInt32( 0 ) @@ -1313,6 +1317,8 @@ void PPTWriter::ImplWriteAtomEnding() // write slide persists -> we have to write a valid value into EPP_SlidePersistAtome too for ( i = 0; i < mnPages; i++ ) { + if (mbHasCanvasPage && i == 0) + continue; nOfs = mpPptEscherEx->PtGetOffsetByID( EPP_Persist_Slide | i ); if ( nOfs ) { @@ -1323,6 +1329,8 @@ void PPTWriter::ImplWriteAtomEnding() // write Notes persists for ( i = 0; i < mnPages; i++ ) { + if (mbHasCanvasPage && i == 0) + continue; nOfs = mpPptEscherEx->PtGetOffsetByID( EPP_Persist_Notes | i ); if ( nOfs ) { diff --git a/sd/source/filter/eppt/epptbase.hxx b/sd/source/filter/eppt/epptbase.hxx index 87d5d386e6cb..560676aa04ab 100644 --- a/sd/source/filter/eppt/epptbase.hxx +++ b/sd/source/filter/eppt/epptbase.hxx @@ -341,6 +341,8 @@ protected: bool mbIsBackgroundDark; sal_Int32 mnAngle; + bool mbHasCanvasPage; + sal_uInt32 mnPages; ///< number of Slides ( w/o master pages & notes & handout ) sal_uInt32 mnMasterPages; diff --git a/sd/source/filter/eppt/pptx-epptbase.cxx b/sd/source/filter/eppt/pptx-epptbase.cxx index 642394419882..5d3d88972870 100644 --- a/sd/source/filter/eppt/pptx-epptbase.cxx +++ b/sd/source/filter/eppt/pptx-epptbase.cxx @@ -204,6 +204,8 @@ void PPTWriterBase::exportPPT( const std::vector< css::beans::PropertyValue >& r for ( i = 0; i < mnPages; i++ ) { + if (mbHasCanvasPage && i == 0) + continue; SAL_INFO("sd.eppt", "call ImplCreateSlide( " << i << " )"); if ( !CreateSlide( i ) ) return; @@ -211,6 +213,8 @@ void PPTWriterBase::exportPPT( const std::vector< css::beans::PropertyValue >& r for ( i = 0; i < mnPages; i++ ) { + if (mbHasCanvasPage && i == 0) + continue; if ( !CreateNotes( i ) ) return; } @@ -234,6 +238,11 @@ bool PPTWriterBase::InitSOIface() if ( !GetPageByIndex( 0, NORMAL ) ) break; + SdDrawDocument* pDoc = mXModel->GetDoc(); + if (pDoc && pDoc->HasCanvasPage()) + mbHasCanvasPage = true; + else + mbHasCanvasPage = false; return true; } return false; diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx index 695c433b6650..24541dddd18b 100644 --- a/sd/source/filter/eppt/pptx-epptooxml.cxx +++ b/sd/source/filter/eppt/pptx-epptooxml.cxx @@ -1708,7 +1708,9 @@ void PowerPointExport::ImplWriteSlide(sal_uInt32 nPageNum, sal_uInt32 nMasterNum SAL_INFO("sd.eppt", "write slide: " << nPageNum << " ----------------"); // slides list - if (nPageNum == 0) + if (!mbHasCanvasPage && nPageNum == 0) + mPresentationFS->startElementNS(XML_p, XML_sldIdLst); + else if (mbHasCanvasPage && nPageNum == 1) mPresentationFS->startElementNS(XML_p, XML_sldIdLst); // add explicit relation of presentation to this slide @@ -2709,6 +2711,8 @@ bool PowerPointExport::ImplCreateDocument() for (sal_uInt32 i = 0; i < mnPages; i++) { + if (mbHasCanvasPage && i == 0) + continue; if (!GetPageByIndex(i, NOTICE)) return false;
