[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - include/oox oox/source sd/qa

2023-10-05 Thread Henry Castro (via logerrit)
 include/oox/ppt/presentationfragmenthandler.hxx |4 
 oox/source/ppt/presentationfragmenthandler.cxx  |  121 +---
 sd/qa/unit/export-tests-ooxml2.cxx  |4 
 3 files changed, 71 insertions(+), 58 deletions(-)

New commits:
commit 1b871b635c7f368d46a0cff96c059a4d53b257d6
Author: Henry Castro 
AuthorDate: Thu Sep 28 15:01:43 2023 -0400
Commit: Henry Castro 
CommitDate: Thu Oct 5 12:59:42 2023 +0200

tdf#155512: oox: ppt: fix import master slides

Import all master slides according to
the relationship with slide layouts.

Adjust unit test values:

SdOOXMLExportTest2::testTdf106867
I do not know why those values change since
importing embedded video source code was not touched

SdOOXMLExportTest2::testAccentColor
The accent6 is a constant value.

Signed-off-by: Henry Castro 
Change-Id: Ic7c70d2c4ce30a7f2d2d1cf22604f1119a66f5f7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157387
Tested-by: Jenkins CollaboraOffice 
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 
(cherry picked from commit 08ed103d734ebf65202dc097c7bb0990573f8fd1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157532
Tested-by: Jenkins
(cherry picked from commit adcde78935fb8ca2b93322aa3a558d0b3ccdbfad)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157546

diff --git a/include/oox/ppt/presentationfragmenthandler.hxx 
b/include/oox/ppt/presentationfragmenthandler.hxx
index 4685ea2d8316..29204b282bdb 100644
--- a/include/oox/ppt/presentationfragmenthandler.hxx
+++ b/include/oox/ppt/presentationfragmenthandler.hxx
@@ -54,8 +54,8 @@ private:
 void importSlide(sal_uInt32 nSlide, bool bFirstSlide, bool bImportNotes);
 oox::ppt::SlidePersistPtr importMasterSlide(const 
::com::sun::star::uno::Reference<::com::sun::star::frame::XModel>& xModel,
 ::oox::ppt::PowerPointImport& 
rFilter,
-const OUString& 
rLayoutFragmentPath,
-const OUString& 
rMasterFragmentPath);
+std::u16string_view 
rLayoutFragmentPath,
+std::u16string_view 
rMasterFragmentPath);
 void saveThemeToGrabBag(const oox::drawingml::ThemePtr& pThemePtr, 
sal_Int32 nThemeIdx);
 void importCustomSlideShow(std::vector& rCustomShowList);
 static void importSlideNames(::oox::core::XmlFilterBase& rFilter, const 
std::vector& rSlidePersist);
diff --git a/oox/source/ppt/presentationfragmenthandler.cxx 
b/oox/source/ppt/presentationfragmenthandler.cxx
index 8dd0af1345df..09c39902a66a 100644
--- a/oox/source/ppt/presentationfragmenthandler.cxx
+++ b/oox/source/ppt/presentationfragmenthandler.cxx
@@ -217,75 +217,88 @@ void 
PresentationFragmentHandler::importCustomSlideShow(std::vector&
 
 SlidePersistPtr PresentationFragmentHandler::importMasterSlide(const 
Reference& xModel,

PowerPointImport& rFilter,
-   const OUString& 
rLayoutFragmentPath,
-   const OUString& 
rMasterFragmentPath)
+   
std::u16string_view rLayoutFragmentPath,
+   
std::u16string_view rMasterFragmentPath)
 {
-SlidePersistPtr pMasterPersistPtr;
+OUString aLayoutFragmentPath;
+OUString aMasterFragmentPath(rMasterFragmentPath);
+SlidePersistPtr pMasterPersistPtr, pMasterPtr;
 Reference< drawing::XDrawPage > xMasterPage;
 Reference< drawing::XMasterPagesSupplier > xMPS( xModel, 
uno::UNO_QUERY_THROW );
 Reference< drawing::XDrawPages > xMasterPages( xMPS->getMasterPages(), 
uno::UNO_SET_THROW );
+RelationsRef xMasterRelations = rFilter.importRelations( 
aMasterFragmentPath );
 
-sal_Int32 nIndex;
-if( rFilter.getMasterPages().empty() )
+for (const auto& rEntry : *xMasterRelations)
 {
-nIndex = 0;
-xMasterPages->getByIndex( nIndex ) >>= xMasterPage;
-}
-else
-{
-nIndex = xMasterPages->getCount();
-xMasterPage = xMasterPages->insertNewByIndex( nIndex );
-}
+aLayoutFragmentPath = 
xMasterRelations->getFragmentPathFromRelation(rEntry.second);
 
-pMasterPersistPtr = std::make_shared( rFilter, true, false, 
xMasterPage,
-
std::make_shared( Master, "com.sun.star.drawing.GroupShape" ), 
mpTextListStyle );
-pMasterPersistPtr->setLayoutPath( rLayoutFragmentPath );
-rFilter.getMasterPages().push_back( pMasterPersistPtr );
-rFilter.setActualSlidePersist( pMasterPersistPtr );
-FragmentHandlerRef xMasterFragmentHandler( new SlideFragmentHandler( 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - include/oox oox/source sd/qa sw/qa sw/source

2023-07-06 Thread Michael Stahl (via logerrit)
 include/oox/drawingml/shape.hxx|2 
 oox/source/core/xmlfilterbase.cxx  |1 
 oox/source/drawingml/connectorshapecontext.cxx |8 ++
 oox/source/drawingml/shape.cxx |4 +
 oox/source/drawingml/shapecontext.cxx  |8 ++
 oox/source/drawingml/shapegroupcontext.cxx |8 ++
 oox/source/export/shapes.cxx   |   73 +
 oox/source/ppt/pptshapegroupcontext.cxx|8 ++
 sd/qa/unit/data/pptx/tdf141058-1.pptx  |binary
 sd/qa/unit/export-tests.cxx|   86 +
 sw/qa/extras/globalfilter/globalfilter.cxx |   17 
 sw/source/filter/ww8/docxattributeoutput.cxx   |   15 
 sw/source/filter/ww8/docxsdrexport.cxx |   23 ++
 sw/source/filter/ww8/docxsdrexport.hxx |5 +
 14 files changed, 229 insertions(+), 29 deletions(-)

New commits:
commit 2f75278ff1f437228d39cc3f71d6fa98d58fc1c1
Author: Michael Stahl 
AuthorDate: Thu Jul 6 16:57:08 2023 +0200
Commit: Michael Stahl 
CommitDate: Thu Jul 6 22:14:34 2023 +0200

tdf#141058 oox,sw: OOXML import/export of decorative on shapes

Also add a test for PPTX (using the oox filters), and add a SdrObject to
the testTdf143311 for DOCX (using the writerfilter/docxsdrexport).

Change-Id: Iccee46c0d30316c33c0947b117e2604c96fa0182
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154137
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit e751d59264c369cfc342dab5f0759be12341d306)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154125

diff --git a/include/oox/drawingml/shape.hxx b/include/oox/drawingml/shape.hxx
index 72ce51ef6476..ccf477bef805 100644
--- a/include/oox/drawingml/shape.hxx
+++ b/include/oox/drawingml/shape.hxx
@@ -174,6 +174,7 @@ public:
 voidsetId( const OUString& rId ) { msId = rId; 
}
 const OUString& getId() const { return msId; }
 voidsetDescription( const OUString& rDescr ) { 
msDescription = rDescr; }
+voidsetDecorative(bool const isDecorative) { 
m_isDecorative = isDecorative; }
 voidsetHidden( bool bHidden ) { mbHidden = 
bHidden; }
 voidsetHiddenMasterShape( bool 
bHiddenMasterShape ) { mbHiddenMasterShape = bHiddenMasterShape; }
 voidsetLocked( bool bLocked ) { mbLocked = 
bLocked; }
@@ -356,6 +357,7 @@ protected:
 OUStringmsInternalName; // used by diagram; not 
displayed in UI
 OUStringmsId;
 OUStringmsDescription;
+boolm_isDecorative = false;
 sal_Int32   mnSubType;  // if this type is not zero, 
then the shape is a placeholder
 std::optional< sal_Int32 >  moSubTypeIndex;
 
diff --git a/oox/source/core/xmlfilterbase.cxx 
b/oox/source/core/xmlfilterbase.cxx
index c2911a756047..0c95980accd4 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -148,6 +148,7 @@ const Sequence< beans::Pair< OUString, sal_Int32 > >& 
NamespaceIds()
  NMSP_c15},
 
{"http://schemas.microsoft.com/office/spreadsheetml/2015/revision2;,
  NMSP_xr2},
+{"http://schemas.microsoft.com/office/drawing/2017/decorative;, 
NMSP_adec},
 };
 return SINGLETON;
 };
diff --git a/oox/source/drawingml/connectorshapecontext.cxx 
b/oox/source/drawingml/connectorshapecontext.cxx
index 8ea0bcca6965..018ca95c648d 100644
--- a/oox/source/drawingml/connectorshapecontext.cxx
+++ b/oox/source/drawingml/connectorshapecontext.cxx
@@ -69,6 +69,14 @@ ConnectorShapePropertiesContext::onCreateContext(sal_Int32 
aElementToken,
 {
 switch (getBaseToken(aElementToken))
 {
+case XML_extLst:
+case XML_ext:
+break;
+case XML_decorative:
+{
+mpConnectorShapePtr->setDecorative(rAttribs.getBool(XML_val, 
false));
+break;
+}
 case XML_cNvPr:
 mpConnectorShapePtr->setId(rAttribs.getStringDefaulted(XML_id));
 
mpConnectorShapePtr->setName(rAttribs.getStringDefaulted(XML_name));
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index b9aebab1b31d..3318198123e6 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -1144,6 +1144,10 @@ Reference< XShape > const & Shape::createAndInsert(
 {
 xSet->setPropertyValue( "Description", Any( msDescription ) );
 }
+if (m_isDecorative)
+{
+xSet->setPropertyValue("Decorative", Any(m_isDecorative));
+}
 if (aServiceName != "com.sun.star.text.TextFrame")
 rxShapes->add( mxShape );
 
diff --git a/oox/source/drawingml/shapecontext.cxx