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

Samuel Mehrbrodt (via logerrit) logerrit at kemper.freedesktop.org
Wed Nov 6 08:33:05 UTC 2019


 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 +
 4 files changed, 19 insertions(+)

New commits:
commit c58b39b77dcafcf63872e7dc4270c7258072b193
Author:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
AuthorDate: Fri Nov 1 11:25:19 2019 +0100
Commit:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
CommitDate: Wed Nov 6 09:31:43 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>

diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index 0185e98b5f0a..c6226fd130ab 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -1146,6 +1146,14 @@ void DocxExport::WriteSettings()
                     hasProtectionProperties = true;
                 }
             }
+            else if (rProp.Name == "HyphenationZone")
+            {
+                sal_Int16 nHyphenationZone;
+                rProp.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 23fd1683b8ef..c44dcefb0abd 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -229,6 +229,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 004ee6431d22..a861ac7a9ff7 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;
+    sal_Int16           m_nHyphenationZone;
     bool                m_bWidowControl;
     bool                m_bSplitPgBreakAndParaMark;
     bool                m_bMirrorMargin;
@@ -277,6 +278,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)
@@ -465,6 +467,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)
@@ -641,6 +644,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 2b4a49085e20..631ab5d92634 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