diff options
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 3 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 7 |
2 files changed, 8 insertions, 2 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 6cd31bc80310..2d47c8cbcc7f 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -341,6 +341,9 @@ DECLARE_OOXMLEXPORT_TEST(testTable, "table.odt") int nInsideV = getXPathPosition(pXmlDoc, "/w:document/w:body/w:tbl/w:tblPr/w:tblBorders", "insideV"); CPPUNIT_ASSERT(nEnd < nInsideH); CPPUNIT_ASSERT(nInsideH < nInsideV); + + // Make sure we write qFormat for well-known style names. + assertXPath(parseExport("word/styles.xml"), "//w:style[@w:styleId='Normal']/w:qFormat", 1); } DECLARE_OOXMLEXPORT_TEST(testTablePosition, "table-position.docx") diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index e382c1b4a0e6..30c059665dce 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -5055,7 +5055,7 @@ oox::drawingml::DrawingML& DocxAttributeOutput::GetDrawingML() } void DocxAttributeOutput::StartStyle( const OUString& rName, StyleType eType, - sal_uInt16 nBase, sal_uInt16 nNext, sal_uInt16 /*nWwId*/, sal_uInt16 nId, bool bAutoUpdate ) + sal_uInt16 nBase, sal_uInt16 nNext, sal_uInt16 nWwId, sal_uInt16 nId, bool bAutoUpdate ) { bool bQFormat = false, bUnhideWhenUsed = false, bSemiHidden = false, bLocked = false, bDefault = false, bCustomStyle = false; OUString aLink, aRsid, aUiPriority; @@ -5147,7 +5147,10 @@ void DocxAttributeOutput::StartStyle( const OUString& rName, StyleType eType, m_pSerializer->singleElementNS(XML_w, XML_semiHidden, FSEND); if (bUnhideWhenUsed) m_pSerializer->singleElementNS(XML_w, XML_unhideWhenUsed, FSEND); - if (bQFormat) + + // If the style has a dedicated STI number, then chances are high that Word + // will have qFormat enabled for it, so let's do the same. + if (bQFormat || nWwId != ww::stiUser) m_pSerializer->singleElementNS(XML_w, XML_qFormat, FSEND); if (bLocked) m_pSerializer->singleElementNS(XML_w, XML_locked, FSEND); |