[Libreoffice-commits] core.git: sw/qa sw/source writerfilter/source

Samuel Mehrbrodt (via logerrit) logerrit at kemper.freedesktop.org
Thu Nov 21 13:46:54 UTC 2019


 sw/qa/extras/ooxmlexport/data/tdf121658.docx  |binary
 sw/qa/extras/ooxmlexport/ooxmlexport14.cxx    |    8 ++++++++
 sw/source/filter/ww8/docxexport.cxx           |    7 +++++++
 writerfilter/source/dmapper/DomainMapper.cxx  |    3 +++
 writerfilter/source/dmapper/SettingsTable.cxx |   12 ++++++++++++
 writerfilter/source/dmapper/SettingsTable.hxx |    1 +
 6 files changed, 31 insertions(+)

New commits:
commit 3185ce226447fb04c530af76f799fed86672f99c
Author:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
AuthorDate: Thu Nov 21 13:17:11 2019 +0100
Commit:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
CommitDate: Thu Nov 21 14:45:13 2019 +0100

    tdf#121658 Roundtrip w:doNotHyphenateCaps via InteropGrabBag
    
    Change-Id: I8a7efffb2866e46e978d09ca9fb5c9dec231e132
    Reviewed-on: https://gerrit.libreoffice.org/83384
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/sw/qa/extras/ooxmlexport/data/tdf121658.docx b/sw/qa/extras/ooxmlexport/data/tdf121658.docx
new file mode 100644
index 000000000000..fe42b5cde8e4
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf121658.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index 3bafcab32d6b..352b9418d0e7 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -129,6 +129,14 @@ DECLARE_OOXMLEXPORT_TEST(testTdf121661, "tdf121661.docx")
     assertXPath(pXmlSettings, "/w:settings/w:hyphenationZone", "val", "851");
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf121658, "tdf121658.docx")
+{
+    xmlDocPtr pXmlSettings = parseExport("word/settings.xml");
+    if (!pXmlSettings)
+        return;
+    assertXPath(pXmlSettings, "/w:settings/w:doNotHyphenateCaps");
+}
+
 DECLARE_OOXMLEXPORT_TEST(testTdf124367, "tdf124367.docx")
 {
     uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index 3e9c4bc5fd1b..2d04ac4986c0 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -1154,6 +1154,13 @@ void DocxExport::WriteSettings()
                     pFS->singleElementNS(XML_w, XML_hyphenationZone, FSNS(XML_w, XML_val),
                                          OString::number(nHyphenationZone));
             }
+            else if (rProp.Name == "NoHyphenateCaps")
+            {
+                bool bNoHyphenateCaps;
+                rProp.Value >>= bNoHyphenateCaps;
+                if (bNoHyphenateCaps)
+                    pFS->singleElementNS(XML_w, XML_doNotHyphenateCaps);
+            }
         }
     }
 
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 58a9654e9bfc..16d42193ac6a 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -232,6 +232,9 @@ DomainMapper::~DomainMapper()
         // Add the saved w:hypenationZone setting
         aProperties["HyphenationZone"] <<= m_pImpl->GetSettingsTable()->GetHypenationZone();
 
+        // Add the saved w:doNotHyphenateCaps setting
+        aProperties["NoHyphenateCaps"] <<= m_pImpl->GetSettingsTable()->GetNoHyphenateCaps();
+
         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 c71850b30d0c..05f655675e66 100644
--- a/writerfilter/source/dmapper/SettingsTable.cxx
+++ b/writerfilter/source/dmapper/SettingsTable.cxx
@@ -244,6 +244,7 @@ struct SettingsTable_Impl
     bool                m_bDoNotUseHTMLParagraphAutoSpacing;
     bool                m_bNoColumnBalance;
     bool                m_bAutoHyphenation;
+    bool                m_bNoHyphenateCaps;
     sal_Int16           m_nHyphenationZone;
     bool                m_bWidowControl;
     bool                m_bLongerSpaceSequence;
@@ -279,6 +280,7 @@ struct SettingsTable_Impl
     , m_bDoNotUseHTMLParagraphAutoSpacing(false)
     , m_bNoColumnBalance(false)
     , m_bAutoHyphenation(false)
+    , m_bNoHyphenateCaps(false)
     , m_nHyphenationZone(0)
     , m_bWidowControl(false)
     , m_bLongerSpaceSequence(false)
@@ -550,6 +552,9 @@ void SettingsTable::lcl_sprm(Sprm& rSprm)
     case NS_ooxml::LN_CT_Settings_autoHyphenation:
         m_pImpl->m_bAutoHyphenation = nIntValue;
         break;
+    case NS_ooxml::LN_CT_Settings_doNotHyphenateCaps:
+        m_pImpl->m_bNoHyphenateCaps = nIntValue;
+        break;
     case NS_ooxml::LN_CT_Settings_widowControl:
         m_pImpl->m_bWidowControl = nIntValue;
         break;
@@ -653,10 +658,17 @@ bool SettingsTable::GetProtectForm() const
 {
     return m_pImpl->m_bProtectForm;
 }
+
+bool SettingsTable::GetNoHyphenateCaps() const
+{
+    return m_pImpl->m_bNoHyphenateCaps;
+}
+
 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 8d717c7212b0..26c69d907b35 100644
--- a/writerfilter/source/dmapper/SettingsTable.hxx
+++ b/writerfilter/source/dmapper/SettingsTable.hxx
@@ -78,6 +78,7 @@ class SettingsTable : public LoggedProperties, public LoggedTable
     bool GetNoColumnBalance() const;
     bool GetProtectForm() const;
     bool GetLongerSpaceSequence() const;
+    bool GetNoHyphenateCaps() const;
     sal_Int16 GetHypenationZone() const;
 
     css::uno::Sequence<css::beans::PropertyValue> const & GetThemeFontLangProperties() const;


More information about the Libreoffice-commits mailing list