Kaydet (Commit) 5a410df4 authored tarafından Miklos Vajna's avatar Miklos Vajna

DOCX export: handle <w:autoHyphenation/>

Change-Id: Ie4bb2b3bf7d2df58c30a54ded68f7b932c2111ed
üst d93d09c5
......@@ -462,6 +462,11 @@ DECLARE_OOXMLEXPORT_TEST(testfdo78599,"fdo78599.docx")
return;
//docx file after RT is getting corrupted.
assertXPath ( pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink/w:r[6]/w:fldChar", "fldCharType", "end" );
// Check for automatic hyphenation
if (xmlDocPtr pSettingsXml = parseExport("word/settings.xml"))
// This failed as w:settings had no w:autoHyphenation child.
assertXPath(pSettingsXml, "/w:settings/w:autoHyphenation");
}
DECLARE_OOXMLEXPORT_TEST(testfdo78886, "fdo78886.docx")
......
......@@ -43,6 +43,7 @@
#include <IMark.hxx>
#include <IDocumentSettingAccess.hxx>
#include <IDocumentLayoutAccess.hxx>
#include <IDocumentStylePoolAccess.hxx>
#include <docsh.hxx>
#include <ndtxt.hxx>
#include <wrtww8.hxx>
......@@ -58,6 +59,7 @@
#include <editeng/editobj.hxx>
#include <editeng/outlobj.hxx>
#include <editeng/brushitem.hxx>
#include <editeng/hyphenzoneitem.hxx>
#include <docary.hxx>
#include <numrule.hxx>
......@@ -849,6 +851,17 @@ void DocxExport::WriteSettings()
pFS->singleElementNS( XML_w, XML_defaultTabStop, FSNS( XML_w, XML_val ),
OString::number( m_aSettings.defaultTabStop).getStr(), FSEND );
// Automatic hyphenation: it's a global setting in Word, it's a paragraph setting in Writer.
// Use the setting from the default style.
SwTxtFmtColl* pColl = pDoc->getIDocumentStylePoolAccess().GetTxtCollFromPool(RES_POOLCOLL_STANDARD, /*bRegardLanguage=*/false);
const SfxPoolItem* pItem;
if (pColl && SfxItemState::SET == pColl->GetItemState(RES_PARATR_HYPHENZONE, false, &pItem))
{
pFS->singleElementNS(XML_w, XML_autoHyphenation,
FSNS(XML_w, XML_val), OString::boolean(static_cast<const SvxHyphenZoneItem*>(pItem)->IsHyphen()),
FSEND);
}
// Even and Odd Headers
if( m_aSettings.evenAndOddHeaders )
pFS->singleElementNS( XML_w, XML_evenAndOddHeaders, FSEND );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment