summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-08-13 12:54:18 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-08-13 13:12:54 +0200
commit1cb2573cd3a7082e68aae03779f9bc08d9d13d8c (patch)
tree2663d49e4661bf790318417a64068a97acffbd39
parent947edda9871881161d2b59d7b041156a03cd47fd (diff)
DOCX export: write qFormat for style names having an STI number
Change-Id: I1f1bf0cf14bbd7b6253489f27753bdb2ec81fe35
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx3
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx7
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);