[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - sw/qa sw/source writerfilter/source
Samuel Mehrbrodt (via logerrit)
logerrit at kemper.freedesktop.org
Thu Nov 7 12:40:42 UTC 2019
sw/qa/extras/ooxmlexport/data/tdf121661.docx |binary
sw/qa/extras/ooxmlexport/ooxmlexport14.cxx | 8 ++++++++
sw/source/filter/ww8/docxexport.cxx | 8 ++++++++
writerfilter/source/dmapper/DomainMapper.cxx | 3 +++
writerfilter/source/dmapper/SettingsTable.cxx | 7 +++++++
writerfilter/source/dmapper/SettingsTable.hxx | 1 +
6 files changed, 27 insertions(+)
New commits:
commit fb67e254f777173095e25ed7570755aeeb5f43e0
Author: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
AuthorDate: Fri Nov 1 11:25:19 2019 +0100
Commit: Xisco FaulĂ <xiscofauli at libreoffice.org>
CommitDate: Thu Nov 7 13:40:04 2019 +0100
tdf#121661 Roundtrip w:hyphenationZone via InteropGrabBag
Change-Id: I097afb54ff31bd1c878231b51eac5af9f27d35e9
Reviewed-on: https://gerrit.libreoffice.org/81880
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
Signed-off-by: Xisco Fauli <xiscofauli at libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/82200
diff --git a/sw/qa/extras/ooxmlexport/data/tdf121661.docx b/sw/qa/extras/ooxmlexport/data/tdf121661.docx
new file mode 100644
index 000000000000..dfd2f291e339
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf121661.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index 27317edd1615..d6294544c68e 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -82,6 +82,14 @@ DECLARE_OOXMLIMPORT_TEST(testTdf125038c, "tdf125038c.docx")
CPPUNIT_ASSERT_EQUAL(OUString("email: test at test.test"), aActual);
}
+DECLARE_OOXMLEXPORT_TEST(testTdf121661, "tdf121661.docx")
+{
+ xmlDocPtr pXmlSettings = parseExport("word/settings.xml");
+ if (!pXmlSettings)
+ return;
+ assertXPath(pXmlSettings, "/w:settings/w:hyphenationZone", "val", "851");
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index 6d6dd78ad1c9..7babed3ebb44 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -1134,6 +1134,14 @@ void DocxExport::WriteSettings()
hasProtectionProperties = true;
}
}
+ else if (propList[i].Name == "HyphenationZone")
+ {
+ sal_Int16 nHyphenationZone;
+ propList[i].Value >>= nHyphenationZone;
+ if (nHyphenationZone > 0)
+ pFS->singleElementNS(XML_w, XML_hyphenationZone, FSNS(XML_w, XML_val),
+ OString::number(nHyphenationZone));
+ }
}
}
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 22625bcfac17..81193eaa658e 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -226,6 +226,9 @@ DomainMapper::~DomainMapper()
// Add the saved DocumentProtection settings
aProperties["DocumentProtection"] <<= m_pImpl->GetSettingsTable()->GetDocumentProtectionSettings();
+ // Add the saved w:hypenationZone setting
+ aProperties["HyphenationZone"] <<= m_pImpl->GetSettingsTable()->GetHypenationZone();
+
uno::Reference<beans::XPropertySet> xDocProps(m_pImpl->GetTextDocument(), uno::UNO_QUERY);
if (xDocProps.is())
{
diff --git a/writerfilter/source/dmapper/SettingsTable.cxx b/writerfilter/source/dmapper/SettingsTable.cxx
index 8be0c6c0f114..5e8fb240a1f6 100644
--- a/writerfilter/source/dmapper/SettingsTable.cxx
+++ b/writerfilter/source/dmapper/SettingsTable.cxx
@@ -248,6 +248,7 @@ struct SettingsTable_Impl
bool m_bDoNotUseHTMLParagraphAutoSpacing;
bool m_bNoColumnBalance;
bool m_bAutoHyphenation;
+ sal_Int16 m_nHyphenationZone;
bool m_bWidowControl;
bool m_bSplitPgBreakAndParaMark;
bool m_bMirrorMargin;
@@ -279,6 +280,7 @@ struct SettingsTable_Impl
, m_bDoNotUseHTMLParagraphAutoSpacing(false)
, m_bNoColumnBalance(false)
, m_bAutoHyphenation(false)
+ , m_nHyphenationZone(0)
, m_bWidowControl(false)
, m_bSplitPgBreakAndParaMark(false)
, m_bMirrorMargin(false)
@@ -446,6 +448,7 @@ void SettingsTable::lcl_sprm(Sprm& rSprm)
case NS_ooxml::LN_CT_Settings_rsids: // 92549; revision save Ids - probably not necessary
break;
case NS_ooxml::LN_CT_Settings_hyphenationZone: // 92508;
+ m_pImpl->m_nHyphenationZone = nIntValue;
break;
case NS_ooxml::LN_CT_Compat_useFELayout: // 92422;
// useFELayout (Do Not Bypass East Asian/Complex Script Layout Code - support of old versions of Word - ignored)
@@ -622,6 +625,10 @@ bool SettingsTable::GetProtectForm() const
{
return m_pImpl->m_bProtectForm;
}
+sal_Int16 SettingsTable::GetHypenationZone() const
+{
+ return m_pImpl->m_nHyphenationZone;
+}
uno::Sequence<beans::PropertyValue> const & SettingsTable::GetThemeFontLangProperties() const
{
return m_pImpl->m_pThemeFontLangProps;
diff --git a/writerfilter/source/dmapper/SettingsTable.hxx b/writerfilter/source/dmapper/SettingsTable.hxx
index 8e7136989b47..cd5bbaba2d02 100644
--- a/writerfilter/source/dmapper/SettingsTable.hxx
+++ b/writerfilter/source/dmapper/SettingsTable.hxx
@@ -77,6 +77,7 @@ class SettingsTable : public LoggedProperties, public LoggedTable
bool GetDoNotExpandShiftReturn() const;
bool GetNoColumnBalance() const;
bool GetProtectForm() const;
+ sal_Int16 GetHypenationZone() const;
css::uno::Sequence<css::beans::PropertyValue> const & GetThemeFontLangProperties() const;
More information about the Libreoffice-commits
mailing list