core.git: Branch 'distro/collabora/co-23.05' - oox/source sd/qa sd/source xmloff/source

2023-12-19 Thread Balazs Varga (via logerrit)
 oox/source/ppt/presentationfragmenthandler.cxx |7 -
 oox/source/ppt/slidepersist.cxx|6 
 sd/qa/unit/data/pptx/tdf157740.pptx|binary
 sd/qa/unit/export-tests-ooxml1.cxx |   16 +-
 sd/qa/unit/export-tests-ooxml2.cxx |   12 -
 sd/source/core/drawdoc3.cxx|   38 -
 sd/source/filter/eppt/epptbase.hxx |2 
 sd/source/filter/eppt/epptooxml.hxx|2 
 sd/source/filter/eppt/pptx-epptooxml.cxx   |  160 ++---
 sd/source/ui/inc/unopage.hxx   |1 
 sd/source/ui/unoidl/unopage.cxx|   13 +-
 xmloff/source/draw/ximpbody.cxx|   19 ++
 12 files changed, 149 insertions(+), 127 deletions(-)

New commits:
commit 397da200a5250bc23df7692354ccb4910783f61e
Author: Balazs Varga 
AuthorDate: Sun Dec 3 23:41:01 2023 +0100
Commit: Henry Castro 
CommitDate: Tue Dec 19 22:47:04 2023 +0100

tdf#157740 FILESAVE PPTX: fix explosion of the number of master slides

- Export correctly the "supported" master slides with the actual slides 
names.
- Set SlideLayout property at ODF import as well for MasterSlides layout 
type.
- When we copy a slide with the master slide also copy the SlideLayout 
property
value as well.

Change-Id: Idb6b88ebe87a83818d8eb27a1fa087652a002c0c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160290
Tested-by: Jenkins
Reviewed-by: Henry Castro 
Reviewed-by: Balazs Varga 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160985
Tested-by: Jenkins CollaboraOffice 

diff --git a/oox/source/ppt/presentationfragmenthandler.cxx 
b/oox/source/ppt/presentationfragmenthandler.cxx
index 1586a8a26174..91824210e239 100644
--- a/oox/source/ppt/presentationfragmenthandler.cxx
+++ b/oox/source/ppt/presentationfragmenthandler.cxx
@@ -212,11 +212,11 @@ void PresentationFragmentHandler::importMasterSlide(const 
ReferencegetFragmentPathFromRelation(rEntry.second);
-
 if (!rEntry.second.maType.endsWith("relationships/slideLayout"))
 continue;
 
+aLayoutFragmentPath = 
xMasterRelations->getFragmentPathFromRelation(rEntry.second);
+
 sal_Int32 nIndex;
 if( rFilter.getMasterPages().empty() )
 {
@@ -271,6 +271,9 @@ void PresentationFragmentHandler::importMasterSlide(const 
ReferencecreateBackground( rFilter );
 pMasterPersistPtr->createXShapes( rFilter );
 
+uno::Reference< beans::XPropertySet > 
xSet(pMasterPersistPtr->getPage(), uno::UNO_QUERY_THROW);
+xSet->setPropertyValue("SlideLayout", 
Any(pMasterPersistPtr->getLayoutFromValueToken()));
+
 oox::drawingml::ThemePtr pTheme = pMasterPersistPtr->getTheme();
 if (pTheme)
 {
diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx
index 0f7479e8ede9..d31416e43f5b 100644
--- a/oox/source/ppt/slidepersist.cxx
+++ b/oox/source/ppt/slidepersist.cxx
@@ -105,6 +105,7 @@ sal_Int16 SlidePersist::getLayoutFromValueToken() const
 case XML_titleOnly: nLayout = 19; break;
 case XML_twoObj:
 case XML_twoColTx:  nLayout =  3; break;
+case XML_twoObjAndObj:
 case XML_twoObjAndTx:   nLayout = 15; break;
 case XML_twoObjOverTx:  nLayout = 16; break;
 case XML_tx:nLayout =  1; break;
@@ -112,19 +113,18 @@ sal_Int16 SlidePersist::getLayoutFromValueToken() const
 case XML_txAndClipArt:  nLayout =  6; break;
 case XML_txAndMedia:nLayout =  6; break;
 case XML_txAndObj:  nLayout = 10; break;
+case XML_objAndTwoObj:
 case XML_txAndTwoObj:   nLayout = 12; break;
 case XML_txOverObj: nLayout = 17; break;
 case XML_vertTitleAndTx:nLayout = 22; break;
 case XML_vertTitleAndTxOverChart: nLayout = 21; break;
 case XML_vertTx:nLayout = 23; break;
+case XML_objOnly:   nLayout = 32; break;
 
 case XML_twoTxTwoObj:
-case XML_twoObjAndObj:
 case XML_objTx:
 case XML_picTx:
 case XML_secHead:
-case XML_objOnly:
-case XML_objAndTwoObj:
 case XML_mediaAndTx:
 case XML_dgm:
 case XML_cust:
diff --git a/sd/qa/unit/data/pptx/tdf157740.pptx 
b/sd/qa/unit/data/pptx/tdf157740.pptx
new file mode 100644
index ..009e9eeb1da0
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf157740.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx 
b/sd/qa/unit/export-tests-ooxml1.cxx
index 30df5ba06789..e7726d27e29e 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -263,14 +263,14 @@ void SdOOXMLExportTest1::testTdf149128()
 save("Impress Office Open XML");
 
 xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml");
-assertXPath(pXmlDoc, 

core.git: Branch 'distro/collabora/co-23.05' - oox/source sd/qa sd/source

2023-12-11 Thread Henry Castro (via logerrit)
 oox/source/ppt/presentationfragmenthandler.cxx |7 -
 sd/qa/unit/export-tests-ooxml2.cxx |6 -
 sd/qa/unit/export-tests-ooxml3.cxx |4 
 sd/source/filter/eppt/epptooxml.hxx|4 
 sd/source/filter/eppt/pptx-epptooxml.cxx   |  128 +
 sd/source/ui/inc/unopage.hxx   |1 
 sd/source/ui/unoidl/unopage.cxx|   13 --
 7 files changed, 17 insertions(+), 146 deletions(-)

New commits:
commit 6c6ed62a98ee180236b60047f21c4584a323c931
Author: Henry Castro 
AuthorDate: Sun Dec 10 10:44:23 2023 -0400
Commit: Henry Castro 
CommitDate: Mon Dec 11 15:54:51 2023 +0100

tdf#158513: Revert "tdf#155512: sd: filter: eppt: add "SlideLayout"

This reverts commit c8d8d3bffec73e965ca3b9b30c4d74515e2d0d4e.

https://bugs.documentfoundation.org/show_bug.cgi?id=158513

1. Open example PPTX in Impress
2. Save from Impress.
3. Open just saved version in Impress again.
4. Observe how the background is gone.

Unit test adjustment:

SdOOXMLExportTest2::testAccentColor()
Now all slide masters are imported, so when saves and reload same
document, the reference theme has changed.

Change-Id: I9cdcb585b1143c2c76feea10fee71d6b83f698df
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160569
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Henry Castro 

diff --git a/oox/source/ppt/presentationfragmenthandler.cxx 
b/oox/source/ppt/presentationfragmenthandler.cxx
index 91824210e239..1586a8a26174 100644
--- a/oox/source/ppt/presentationfragmenthandler.cxx
+++ b/oox/source/ppt/presentationfragmenthandler.cxx
@@ -212,11 +212,11 @@ void PresentationFragmentHandler::importMasterSlide(const 
ReferencegetFragmentPathFromRelation(rEntry.second);
+
 if (!rEntry.second.maType.endsWith("relationships/slideLayout"))
 continue;
 
-aLayoutFragmentPath = 
xMasterRelations->getFragmentPathFromRelation(rEntry.second);
-
 sal_Int32 nIndex;
 if( rFilter.getMasterPages().empty() )
 {
@@ -271,9 +271,6 @@ void PresentationFragmentHandler::importMasterSlide(const 
ReferencecreateBackground( rFilter );
 pMasterPersistPtr->createXShapes( rFilter );
 
-uno::Reference< beans::XPropertySet > 
xSet(pMasterPersistPtr->getPage(), uno::UNO_QUERY_THROW);
-xSet->setPropertyValue("SlideLayout", 
Any(pMasterPersistPtr->getLayoutFromValueToken()));
-
 oox::drawingml::ThemePtr pTheme = pMasterPersistPtr->getTheme();
 if (pTheme)
 {
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index 47efaea2fe55..9d572a8ee10c 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -1462,7 +1462,7 @@ void SdOOXMLExportTest2::testTdf106867()
 
"/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/"
 
"p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:cmd/"
 "p:cBhvr/p:tgtEl/p:spTgt",
-"spid", "42");
+"spid", "455");
 }
 
 void SdOOXMLExportTest2::testTdf112280()
@@ -1841,7 +1841,7 @@ void SdOOXMLExportTest2::testAccentColor()
 xmlDocUniquePtr pXmlDocTheme1 = parseExport("ppt/theme/theme1.xml");
 assertXPath(pXmlDocTheme1, 
"/a:theme/a:themeElements/a:clrScheme/a:accent6/a:srgbClr", "val",
 "70ad47");
-xmlDocUniquePtr pXmlDocTheme2 = parseExport("ppt/theme/theme2.xml");
+xmlDocUniquePtr pXmlDocTheme2 = parseExport("ppt/theme/theme24.xml");
 assertXPath(pXmlDocTheme2, 
"/a:theme/a:themeElements/a:clrScheme/a:accent6/a:srgbClr", "val",
 "deb340");
 
@@ -1858,7 +1858,7 @@ void SdOOXMLExportTest2::testThemeColors()
 createSdImpressDoc("pptx/tdf84205.pptx");
 save("Impress Office Open XML");
 
-xmlDocUniquePtr pXmlDocTheme2 = parseExport("ppt/theme/theme1.xml");
+xmlDocUniquePtr pXmlDocTheme2 = parseExport("ppt/theme/theme2.xml");
 assertXPath(pXmlDocTheme2, 
"/a:theme/a:themeElements/a:clrScheme/a:dk2/a:srgbClr", "val",
 "44546a");
 assertXPath(pXmlDocTheme2, 
"/a:theme/a:themeElements/a:clrScheme/a:accent3/a:srgbClr", "val",
diff --git a/sd/qa/unit/export-tests-ooxml3.cxx 
b/sd/qa/unit/export-tests-ooxml3.cxx
index 0c9ab10203e0..dd0945bd4c40 100644
--- a/sd/qa/unit/export-tests-ooxml3.cxx
+++ b/sd/qa/unit/export-tests-ooxml3.cxx
@@ -288,6 +288,10 @@ void SdOOXMLExportTest3::testTdf114848()
 xmlDocUniquePtr pXmlDocTheme1 = parseExport("ppt/theme/theme1.xml");
 assertXPath(pXmlDocTheme1, 
"/a:theme/a:themeElements/a:clrScheme/a:dk2/a:srgbClr", "val",
 "1f497d");
+xmlDocUniquePtr pXmlDocTheme2 = parseExport("ppt/theme/theme2.xml");
+
+assertXPath(pXmlDocTheme2, 
"/a:theme/a:themeElements/a:clrScheme/a:dk2/a:srgbClr", "val",
+"1f497d");
 }
 
 void