[Libreoffice-commits] core.git: sd/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Fri Sep 11 10:39:38 UTC 2020


 sd/source/filter/eppt/eppt.cxx          |    2 ++
 sd/source/filter/eppt/pptx-epptbase.cxx |    6 ++----
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit b7756fdde63b1eef85ef13772fc3578e345d34dc
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Sep 11 10:04:45 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Sep 11 12:38:54 2020 +0200

    crashtesting: failed on export of tdf118002-1.potx to pptx
    
    because the bg isn't set a master isn't exported, so
    the endelement XML_sldMasterIdLst isn't exported and
    the document is broken
    
    so don't exit early if the propertyset isn't found and always call
    ImplWriteSlideMaster
    
    Modify the ppt variant PPTWriter::ImplWriteSlideMaster to do nothing on an
    empty propertyset allowing PowerPointExport:ImplWriteSlideMaster to
    output its XML_sldMasterIdLst on the last master
    
    Change-Id: I512ee10b3b3c80b6566827d708b737c6c502c3b5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102451
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sd/source/filter/eppt/eppt.cxx b/sd/source/filter/eppt/eppt.cxx
index 26f0dae9f234..5c1f9da7d7af 100644
--- a/sd/source/filter/eppt/eppt.cxx
+++ b/sd/source/filter/eppt/eppt.cxx
@@ -361,6 +361,8 @@ void PPTWriter::ImplWriteSlide( sal_uInt32 nPageNum, sal_uInt32 nMasterNum, sal_
 
 void PPTWriter::ImplWriteSlideMaster( sal_uInt32 nPageNum, Reference< XPropertySet > const & aXBackgroundPropSet )
 {
+    if (!aXBackgroundPropSet)
+        return;
     mpPptEscherEx->PtReplaceOrInsert( EPP_Persist_MainMaster | nPageNum, mpStrm->Tell() );
     mpPptEscherEx->OpenContainer( EPP_MainMaster );
     mpPptEscherEx->AddAtom( 24, EPP_SlideAtom, 2 );
diff --git a/sd/source/filter/eppt/pptx-epptbase.cxx b/sd/source/filter/eppt/pptx-epptbase.cxx
index 0f9975e7ce67..38015a654e09 100644
--- a/sd/source/filter/eppt/pptx-epptbase.cxx
+++ b/sd/source/filter/eppt/pptx-epptbase.cxx
@@ -388,11 +388,9 @@ bool PPTWriterBase::CreateSlideMaster( sal_uInt32 nPageNum )
         return false;
     SetCurrentStyleSheet( nPageNum );
 
-    if ( !ImplGetPropertyValue( mXPagePropSet, "Background" ) )                // load background shape
-        return false;
     css::uno::Reference< css::beans::XPropertySet > aXBackgroundPropSet;
-    if ( !( mAny >>= aXBackgroundPropSet ) )
-        return false;
+    if (ImplGetPropertyValue(mXPagePropSet, "Background"))                // load background shape
+        mAny >>= aXBackgroundPropSet;
 
     ImplWriteSlideMaster( nPageNum, aXBackgroundPropSet );
 


More information about the Libreoffice-commits mailing list