@@ -675,6 +675,16 @@ void DocxExport::InitStyles()
675675{
676676 m_pStyles.reset (new MSWordStyles ( *this , /* bListStyles =*/ true ));
677677
678+ // MACRO: M-1090 Fix docx export {
679+ const bool hasWebSettings
680+ = m_rFilter.hasRelWithType (m_pDocumentFS->getOutputStream (), u" http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings" _ustr);
681+
682+ const bool hasStylesWithEffects
683+ = m_rFilter.hasRelWithType (m_pDocumentFS->getOutputStream (), u" http://schemas.microsoft.com/office/2007/relationships/stylesWithEffects" _ustr);
684+
685+ m_rFilter.clearRelations (m_pDocumentFS->getOutputStream ());
686+
687+ // MACRO: M-1090 }
678688 // setup word/styles.xml and the relations + content type
679689 m_rFilter.addRelation ( m_pDocumentFS->getOutputStream (),
680690 oox::getRelationship (Relationship::STYLES),
@@ -694,6 +704,20 @@ void DocxExport::InitStyles()
694704 m_pAttrOutput->SetSerializer ( m_pDocumentFS );
695705
696706 pStylesFS->endDocument ();
707+
708+ // MACRO: M-1090 Fix docx export {
709+ if (hasStylesWithEffects)
710+ {
711+ m_rFilter.addRelation (m_pDocumentFS->getOutputStream (),
712+ oox::getRelationship (Relationship::STYLESWITHEFFECTS),
713+ u" stylesWithEffects.xml" );
714+ }
715+ if (hasWebSettings)
716+ {
717+ m_rFilter.addRelation (m_pDocumentFS->getOutputStream (),
718+ oox::getRelationship (Relationship::WEBSETTINGS), u" webSettings.xml" );
719+ }
720+ // MACRO: M-1090 }
697721}
698722
699723void DocxExport::WriteFootnotesEndnotes ()
@@ -1692,6 +1716,10 @@ void DocxExport::WriteCustomXml()
16921716
16931717 for (sal_Int32 j = 0 ; j < customXmlDomlist.getLength (); j++)
16941718 {
1719+ // MACRO: M-1090 Fix docx export {
1720+ m_rFilter.clearRelations (GetFilter ().openFragmentStream (
1721+ " customXml/item" + OUString::number (j + 1 ) + " .xml" , " application/xml" ));
1722+ // MACRO: M-1090 }
16951723 uno::Reference<xml::dom::XDocument> customXmlDom = customXmlDomlist[j];
16961724 uno::Reference<xml::dom::XDocument> customXmlDomProps = customXmlDomPropslist[j];
16971725 if (customXmlDom.is ())
0 commit comments