cui/source/inc/paragrph.hxx                                 |    4 
 cui/source/tabpages/paragrph.cxx                            |   24 +
 cui/uiconfig/ui/paragalignpage.ui                           |   81 ++++
 editeng/source/items/paraitem.cxx                           |   16 
 include/editeng/adjustitem.hxx                              |   14 
 include/editeng/memberids.h                                 |    1 
 include/editeng/unotext.hxx                                 |    1 
 include/xmloff/xmltoken.hxx                                 |    1 
 offapi/com/sun/star/style/ParagraphProperties.idl           |    7 
 schema/libreoffice/OpenDocument-v1.4+libreoffice-schema.rng |   12 
 svx/sdi/svxitems.sdi                                        |    1 
 sw/inc/inspectorproperties.hrc                              |    1 
 sw/inc/unoprnms.hxx                                         |    1 
 sw/qa/extras/odfexport/data/tdf159923.fodt                  |  203 ++++++++++++
 sw/qa/extras/odfexport/data/tdf159923_stretched.fodt        |  203 ++++++++++++
 sw/qa/extras/odfexport/odfexport2.cxx                       |   12 
 sw/qa/uitest/styleInspector/styleInspector.py               |   23 -
 sw/qa/uitest/styleInspector/tdf137513.py                    |    2 
 sw/source/core/text/guess.cxx                               |    8 
 sw/source/core/text/portxt.cxx                              |    8 
 sw/source/core/unocore/unomapproperties.hxx                 |    2 
 sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx       |    1 
 xmloff/inc/xmlprop.hxx                                      |    1 
 xmloff/source/core/xmltoken.cxx                             |    1 
 xmloff/source/style/xmlexppr.cxx                            |    6 
 xmloff/source/text/txtprmap.cxx                             |    1 
 xmloff/source/token/tokens.txt                              |    1 
 27 files changed, 616 insertions(+), 20 deletions(-)

New commits:
commit 7d6696757dcdfa3cee481ac7795a91b2b47da363
Author:     László Németh <nem...@numbertext.org>
AuthorDate: Tue Apr 15 00:23:18 2025 +0200
Commit:     László Németh <nem...@numbertext.org>
CommitDate: Tue Apr 15 22:40:12 2025 +0200

    tdf#159923 sw cui offapi xmloff: add custom word spacing
    
    Add com::sun::star::text::ParaWordSpacing UNO
    and loext:word-spacing ODF extensions to set
    desired word spacing of a justified paragraph
    relative to the width of the space character,
    like DTP software do.
    
    Add Justification section and "Word spacing"
    spin box to the Text Align pane of paragraph settings.
    
    This extends not only the smart justify interoperability
    feature for custom shrinking (until 0%), but for custom
    expansion, too, until 1000%, like Adobe InDesign do.
    
    Note: this value hasn't been applied in the last
    paragraph line, yet.
    
    See also XSL-FO/CSS word-spacing and
    commit 7d08767b890e723cd502b1c61d250924f695eb98
    "tdf#130088 tdf#119908 smart justify: fix DOCX line count + compat opt."
    
    Change-Id: I06f771335135e4682a1d1abfc9a247dbe4bc6b66
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184187
    Reviewed-by: László Németh <nem...@numbertext.org>
    Tested-by: Jenkins

diff --git a/cui/source/inc/paragrph.hxx b/cui/source/inc/paragrph.hxx
index 5dab4d9e12cd..14916178d752 100644
--- a/cui/source/inc/paragrph.hxx
+++ b/cui/source/inc/paragrph.hxx
@@ -150,6 +150,10 @@ class SvxParaAlignTabPage : public SfxTabPage
 
     std::unique_ptr<svx::FrameDirectionListBox>  m_xTextDirectionLB;
 
+    /// word spacing
+    std::unique_ptr<weld::Label> m_xLabelWordSpacing;
+    std::unique_ptr<weld::MetricSpinButton> m_xWordSpacing;
+
     DECL_LINK(AlignHdl_Impl, weld::Toggleable&, void);
     DECL_LINK(LastLineHdl_Impl, weld::ComboBox&, void);
     DECL_LINK(TextDirectionHdl_Impl, weld::ComboBox&, void);
diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx
index b0465b425dd6..eefd2f9119c5 100644
--- a/cui/source/tabpages/paragrph.cxx
+++ b/cui/source/tabpages/paragrph.cxx
@@ -1279,6 +1279,8 @@ SvxParaAlignTabPage::SvxParaAlignTabPage(weld::Container* 
pPage, weld::DialogCon
     , m_xVertAlign(m_xBuilder->weld_label(u"labelFL_VERTALIGN"_ustr))
     , m_xVertAlignSdr(m_xBuilder->weld_label(u"labelST_VERTALIGN_SDR"_ustr))
     , m_xTextDirectionLB(new 
svx::FrameDirectionListBox(m_xBuilder->weld_combo_box(u"comboLB_TEXTDIRECTION"_ustr)))
+    , m_xLabelWordSpacing(m_xBuilder->weld_label(u"labelWordSpacing"_ustr))
+    , 
m_xWordSpacing(m_xBuilder->weld_metric_spin_button(u"spin_WORD_SPACING"_ustr, 
FieldUnit::PERCENT))
 {
     SetExchangeSupport();
 
@@ -1361,7 +1363,8 @@ bool SvxParaAlignTabPage::FillItemSet( SfxItemSet* 
rOutSet )
         eAdjust = SvxAdjust::Block;
         bAdj = m_xJustify->get_saved_state() == TRISTATE_FALSE ||
             m_xExpandCB->get_state_changed_from_saved() ||
-            m_xLastLineLB->get_value_changed_from_saved();
+            m_xLastLineLB->get_value_changed_from_saved() ||
+            m_xWordSpacing->get_value_changed_from_saved();
     }
 
     sal_uInt16 _nWhich = GetWhich( SID_ATTR_PARA_ADJUST );
@@ -1381,6 +1384,7 @@ bool SvxParaAlignTabPage::FillItemSet( SfxItemSet* 
rOutSet )
         aAdj.SetAdjust( eAdjust );
         aAdj.SetOneWord( eOneWord );
         aAdj.SetLastBlock( eLastBlock );
+        aAdj.SetPropWordSpacing( m_xWordSpacing->get_value(FieldUnit::PERCENT) 
);
         rOutSet->Put( aAdj );
         bModified = true;
     }
@@ -1454,6 +1458,18 @@ void SvxParaAlignTabPage::Reset( const SfxItemSet* rSet )
         }
         m_xExpandCB->set_sensitive(bEnable && nLBSelect == 2);
         m_xExpandCB->set_active(SvxAdjust::Block == rAdj.GetOneWord());
+
+        if (m_xJustify->get_active())
+        {
+            m_xLabelWordSpacing->set_sensitive(true);
+            m_xWordSpacing->set_sensitive(true);
+            m_xWordSpacing->set_value(rAdj.GetPropWordSpacing(), 
FieldUnit::PERCENT);
+        }
+        else
+        {
+            m_xLabelWordSpacing->set_sensitive(false);
+            m_xWordSpacing->set_sensitive(false);
+        }
     }
     else
     {
@@ -1461,6 +1477,8 @@ void SvxParaAlignTabPage::Reset( const SfxItemSet* rSet )
         m_xRight->set_active(false);
         m_xCenter->set_active(false);
         m_xJustify->set_active(false);
+        m_xLabelWordSpacing->set_sensitive(false);
+        m_xWordSpacing->set_sensitive(false);
     }
     m_xLastLineLB->set_active(nLBSelect);
 
@@ -1518,6 +1536,7 @@ void SvxParaAlignTabPage::Reset( const SfxItemSet* rSet )
     m_xJustify->save_state();
     m_xLastLineLB->save_value();
     m_xExpandCB->save_state();
+    m_xWordSpacing->save_value();
 
     UpdateExample_Impl();
 }
@@ -1533,6 +1552,7 @@ void SvxParaAlignTabPage::ChangesApplied()
     m_xJustify->save_state();
     m_xLastLineLB->save_value();
     m_xExpandCB->save_state();
+    m_xWordSpacing->save_value();
 }
 
 IMPL_LINK_NOARG(SvxParaAlignTabPage, AlignHdl_Impl, weld::Toggleable&, void)
@@ -1540,6 +1560,8 @@ IMPL_LINK_NOARG(SvxParaAlignTabPage, AlignHdl_Impl, 
weld::Toggleable&, void)
     bool bJustify = m_xJustify->get_active();
     m_xLastLineFT->set_sensitive(bJustify);
     m_xLastLineLB->set_sensitive(bJustify);
+    m_xLabelWordSpacing->set_sensitive(bJustify);
+    m_xWordSpacing->set_sensitive(bJustify);
     bool bLastLineIsBlock = m_xLastLineLB->get_active() == 2;
     m_xExpandCB->set_sensitive(bJustify && bLastLineIsBlock);
     //set last line listbox to entry position 0 if not enabled
diff --git a/cui/uiconfig/ui/paragalignpage.ui 
b/cui/uiconfig/ui/paragalignpage.ui
index 47f5865d2b6f..7fb8bbeb6321 100644
--- a/cui/uiconfig/ui/paragalignpage.ui
+++ b/cui/uiconfig/ui/paragalignpage.ui
@@ -2,6 +2,21 @@
 <!-- Generated with glade 3.40.0 -->
 <interface domain="cui">
   <requires lib="gtk+" version="3.20"/>
+  <object class="GtkAdjustment" id="adjustmentPercent">
+    <property name="upper">1000</property>
+    <property name="step-increment">1</property>
+    <property name="page-increment">10</property>
+  </object>
+  <object class="GtkAdjustment" id="adjustmentPercent2">
+    <property name="upper">1000</property>
+    <property name="step-increment">1</property>
+    <property name="page-increment">10</property>
+  </object>
+  <object class="GtkAdjustment" id="adjustmentPercent3">
+    <property name="upper">1000</property>
+    <property name="step-increment">1</property>
+    <property name="page-increment">10</property>
+  </object>
   <!-- n-columns=2 n-rows=1 -->
   <object class="GtkGrid" id="ParaAlignPage">
     <property name="visible">True</property>
@@ -392,6 +407,72 @@
             <property name="top-attach">2</property>
           </packing>
         </child>
+        <child>
+          <object class="GtkFrame" id="frameJUSTIFICATION">
+            <property name="visible">True</property>
+            <property name="can-focus">False</property>
+            <property name="label-xalign">0</property>
+            <property name="shadow-type">none</property>
+            <child>
+              <!-- n-columns=4 n-rows=2 -->
+              <object class="GtkGrid" id="gridJustification">
+                <property name="visible">True</property>
+                <property name="can-focus">False</property>
+                <property name="margin-start">12</property>
+                <property name="margin-top">6</property>
+                <property name="row-spacing">6</property>
+                <property name="column-spacing">12</property>
+                <child>
+                  <object class="GtkLabel" id="labelWordSpacing">
+                    <property name="visible">True</property>
+                    <property name="can-focus">False</property>
+                    <property name="label" translatable="yes" 
context="paragalignpage|labelWordSpacing">_Word spacing:</property>
+                    <property name="use-underline">True</property>
+                    <property name="xalign">0</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="left-attach">0</property>
+                    <property name="top-attach">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkSpinButton" id="spin_WORD_SPACING">
+                    <property name="visible">True</property>
+                    <property name="can-focus">True</property>
+                    <property name="activates-default">True</property>
+                    <property name="truncate-multiline">True</property>
+                    <property name="adjustment">adjustmentPercent2</property>
+                    <child internal-child="accessible">
+                      <object class="AtkObject" id="JUSTIFICATION-atkobject">
+                        <property name="AtkObject::accessible-description" 
translatable="yes" context="paralignpage|extended_tip|JUSTIFICATION">Adjusts 
the desired word spacing. Enter a number between 0% (no word spacing) and 250% 
(two and a half times the width of the space character).</property>
+                      </object>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="left-attach">1</property>
+                    <property name="top-attach">0</property>
+                  </packing>
+                </child>
+              </object>
+            </child>
+            <child type="label">
+              <object class="GtkLabel" id="labelFL_JUSTIFICATION">
+                <property name="visible">True</property>
+                <property name="can-focus">False</property>
+                <property name="label" translatable="yes" 
context="paragalignpage|labelFL_JUSTIFICATION">Justification</property>
+                <attributes>
+                  <attribute name="weight" value="bold"/>
+                </attributes>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="left-attach">0</property>
+            <property name="top-attach">3</property>
+          </packing>
+        </child>
       </object>
       <packing>
         <property name="left-attach">0</property>
diff --git a/editeng/source/items/paraitem.cxx 
b/editeng/source/items/paraitem.cxx
index dc209a85e3b2..382552b230c8 100644
--- a/editeng/source/items/paraitem.cxx
+++ b/editeng/source/items/paraitem.cxx
@@ -361,7 +361,8 @@ ItemInstanceManager* 
SvxAdjustItem::getItemInstanceManager() const
 
 SvxAdjustItem::SvxAdjustItem(const SvxAdjust eAdjst, const sal_uInt16 nId )
     : SfxEnumItemInterface( nId ),
-    bOneBlock( false ), bLastCenter( false ), bLastBlock( false )
+    bOneBlock( false ), bLastCenter( false ), bLastBlock( false ),
+    nPropWordSpacing(100)
 {
     SetAdjust( eAdjst );
 }
@@ -374,7 +375,8 @@ bool SvxAdjustItem::operator==( const SfxPoolItem& rAttr ) 
const
     return GetAdjust() == rItem.GetAdjust() &&
            bOneBlock == rItem.bOneBlock &&
            bLastCenter == rItem.bLastCenter &&
-           bLastBlock == rItem.bLastBlock;
+           bLastBlock == rItem.bLastBlock &&
+           nPropWordSpacing == rItem.nPropWordSpacing;
 }
 
 size_t SvxAdjustItem::hashCode() const
@@ -384,6 +386,7 @@ size_t SvxAdjustItem::hashCode() const
     o3tl::hash_combine(seed, bOneBlock);
     o3tl::hash_combine(seed, bLastCenter);
     o3tl::hash_combine(seed, bLastBlock);
+    o3tl::hash_combine(seed, nPropWordSpacing);
     return seed;
 }
 
@@ -394,6 +397,7 @@ bool SvxAdjustItem::QueryValue( uno::Any& rVal, sal_uInt8 
nMemberId ) const
     {
         case MID_PARA_ADJUST      : rVal <<= 
static_cast<sal_Int16>(GetAdjust()); break;
         case MID_LAST_LINE_ADJUST : rVal <<= 
static_cast<sal_Int16>(GetLastBlock()); break;
+        case MID_WORD_SPACING     : rVal <<= 
static_cast<sal_Int16>(GetPropWordSpacing()); break;
         case MID_EXPAND_SINGLE    :
         {
             rVal <<= bOneBlock;
@@ -427,6 +431,13 @@ bool SvxAdjustItem::PutValue( const uno::Any& rVal, 
sal_uInt8 nMemberId )
             }
         }
         break;
+        case MID_WORD_SPACING :
+        {
+            sal_Int16 nVal = -1;
+            rVal >>= nVal;
+            SetPropWordSpacing(nVal);
+        }
+        break;
         case MID_EXPAND_SINGLE :
             ASSERT_CHANGE_REFCOUNTED_ITEM;
             bOneBlock = Any2Bool(rVal);
@@ -452,6 +463,7 @@ bool SvxAdjustItem::GetPresentation
     {
         case SfxItemPresentation::Nameless:
         case SfxItemPresentation::Complete:
+            // TODO Word spacing
             rText = GetValueTextByPos( static_cast<sal_uInt16>(GetAdjust()) );
             return true;
         default: ;//prevent warning
diff --git a/include/editeng/adjustitem.hxx b/include/editeng/adjustitem.hxx
index 4e85d090d9c4..61d8836ae235 100644
--- a/include/editeng/adjustitem.hxx
+++ b/include/editeng/adjustitem.hxx
@@ -44,6 +44,9 @@ class EDITENG_DLLPUBLIC SvxAdjustItem final : public 
SfxEnumItemInterface
     bool    bLastCenter : 1;
     bool    bLastBlock : 1;
 
+    // desired word spacing in percent of the width of space character in 
justified text
+    sal_uInt16 nPropWordSpacing;
+
 protected:
     virtual ItemInstanceManager* getItemInstanceManager() const override;
 
@@ -146,6 +149,17 @@ public:
         bLastCenter = 0 != (nFlags & 0x0002);
         bLastBlock = 0 != (nFlags & 0x0004);
     }
+
+    sal_uInt16 GetPropWordSpacing() const
+    {
+        return nPropWordSpacing;
+    }
+
+    void SetPropWordSpacing( sal_uInt16 nVal )
+    {
+        nPropWordSpacing = nVal;
+    }
+
 };
 
 #endif
diff --git a/include/editeng/memberids.h b/include/editeng/memberids.h
index 1bb3d24912dc..9d6cd26c036c 100644
--- a/include/editeng/memberids.h
+++ b/include/editeng/memberids.h
@@ -69,6 +69,7 @@
 #define MID_PARA_ADJUST         0
 #define MID_LAST_LINE_ADJUST    1
 #define MID_EXPAND_SINGLE       2
+#define MID_WORD_SPACING        3
 
 //SvxFontItem
 // Don't use 0 as it used for the whole struct
diff --git a/include/editeng/unotext.hxx b/include/editeng/unotext.hxx
index 20ace0ae976b..1d63f76ce060 100644
--- a/include/editeng/unotext.hxx
+++ b/include/editeng/unotext.hxx
@@ -160,6 +160,7 @@ struct SfxItemPropertyMapEntry;
     { UNO_NAME_EDIT_PARA_IS_HANGING_PUNCTUATION,EE_PARA_HANGINGPUNCTUATION,  
cppu::UnoType<bool>::get(),                0 ,0 }, \
     { UNO_NAME_EDIT_PARA_IS_CHARACTER_DISTANCE, EE_PARA_ASIANCJKSPACING,   
cppu::UnoType<bool>::get(),                0 ,0 }, \
     { UNO_NAME_EDIT_PARA_IS_FORBIDDEN_RULES,    EE_PARA_FORBIDDENRULES,     
cppu::UnoType<bool>::get(),                0 ,0 },\
+    {u"ParaWordSpacing"_ustr,          EE_PARA_JUST,               
::cppu::UnoType<sal_Int16>::get(),            0, MID_WORD_SPACING }, \
     {u"WritingMode"_ustr,              EE_PARA_WRITINGDIR, 
::cppu::UnoType<sal_Int16>::get(),            0, 0 }
 
 class SvxFieldData;
diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index 1c36a3faf4a0..f37f1e4466d7 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -2200,6 +2200,7 @@ namespace xmloff::token {
         XML_WINDOW_FONT_COLOR,
         XML_WORD,
         XML_WORD_COUNT,
+        XML_WORD_SPACING,
         XML_WRAP,
         XML_WRAP_CONTOUR,
         XML_WRAP_CONTOUR_MODE,
diff --git a/offapi/com/sun/star/style/ParagraphProperties.idl 
b/offapi/com/sun/star/style/ParagraphProperties.idl
index 2db7752a0cd2..5d4fb7cbd648 100644
--- a/offapi/com/sun/star/style/ParagraphProperties.idl
+++ b/offapi/com/sun/star/style/ParagraphProperties.idl
@@ -510,6 +510,13 @@ published service ParagraphProperties
             @since LibreOffice 25.8
          */
         [optional, property] long ParaHyphenationZoneSpread;
+
+        /** specifies the desired word spacing as percentage value relative
+            to the width of the space character.
+
+            @since LibreOffice 25.8
+         */
+        [optional, property] long ParaWordSpacing;
 };
 
 
diff --git a/schema/libreoffice/OpenDocument-v1.4+libreoffice-schema.rng 
b/schema/libreoffice/OpenDocument-v1.4+libreoffice-schema.rng
index 5c201b4c95b7..19a8e6e8838a 100644
--- a/schema/libreoffice/OpenDocument-v1.4+libreoffice-schema.rng
+++ b/schema/libreoffice/OpenDocument-v1.4+libreoffice-schema.rng
@@ -3160,6 +3160,18 @@ 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.
     </rng:optional>
   </rng:define>
 
+  <!-- TODO no proposal -->
+  <rng:define name="style-paragraph-properties-attlist" combine="interleave">
+    <rng:optional>
+      <rng:attribute name="loext:word-spacing">
+        <rng:choice>
+          <rng:ref name="positiveLength"/>
+          <rng:ref name="percent"/>
+        </rng:choice>
+      </rng:attribute>
+    </rng:optional>
+  </rng:define>
+
   <!-- TODO no proposal -->
   <rng:define name="style-text-properties-attlist" combine="interleave">
     <rng:optional>
diff --git a/svx/sdi/svxitems.sdi b/svx/sdi/svxitems.sdi
index 0810b70e2fa2..d14ad2776988 100644
--- a/svx/sdi/svxitems.sdi
+++ b/svx/sdi/svxitems.sdi
@@ -57,6 +57,7 @@ struct SvxAdjustStruct
     SvxAdjust   ParagraphAdjustment MID_PARA_ADJUST;
     SvxAdjust   LastLineAdjustment  MID_LAST_LINE_ADJUST;
     BOOL        ExpandSingleWord    MID_EXPAND_SINGLE;
+    INT16       WordSpacing         MID_WORD_SPACING;
 };
 item SvxAdjustStruct SvxAdjustItem;
 
diff --git a/sw/inc/inspectorproperties.hrc b/sw/inc/inspectorproperties.hrc
index faecb2c06e64..970e724bb2c9 100644
--- a/sw/inc/inspectorproperties.hrc
+++ b/sw/inc/inspectorproperties.hrc
@@ -245,6 +245,7 @@
 #define RID_PARA_USER_DEFINED_ATTRIBUTES                    
NC_("RID_ATTRIBUTE_NAMES_MAP", "Para User Defined Attributes")
 #define RID_PARA_VERT_ALIGNMENT                             
NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Vertical Alignment")
 #define RID_PARA_WIDOWS                                     
NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Widows")
+#define RID_PARA_WORD_SPACING                               
NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Word Spacing")
 #define RID_REFERENCE_MARK                                  
NC_("RID_ATTRIBUTE_NAMES_MAP", "Reference Mark")
 #define RID_RIGHT_BORDER                                    
NC_("RID_ATTRIBUTE_NAMES_MAP", "Right Border")
 #define RID_RIGHT_BORDER_DISTANCE                           
NC_("RID_ATTRIBUTE_NAMES_MAP", "Right Border Distance")
diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx
index 1cbac3d0a733..a83ae8c90409 100644
--- a/sw/inc/unoprnms.hxx
+++ b/sw/inc/unoprnms.hxx
@@ -202,6 +202,7 @@ inline constexpr OUString UNO_NAME_PARA_ADJUST = 
u"ParaAdjust"_ustr;
 inline constexpr OUString UNO_NAME_PARA_REGISTER_MODE_ACTIVE = 
u"ParaRegisterModeActive"_ustr;
 inline constexpr OUString UNO_NAME_PARA_STYLE_NAME = u"ParaStyleName"_ustr;
 inline constexpr OUString UNO_NAME_PARA_LAST_LINE_ADJUST = 
u"ParaLastLineAdjust"_ustr;
+inline constexpr OUString UNO_NAME_PARA_WORD_SPACING = u"ParaWordSpacing"_ustr;
 inline constexpr OUString UNO_NAME_PARA_LINE_NUMBER_COUNT = 
u"ParaLineNumberCount"_ustr;
 inline constexpr OUString UNO_NAME_PARA_LINE_NUMBER_START_VALUE = 
u"ParaLineNumberStartValue"_ustr;
 inline constexpr OUString UNO_NAME_BACK_COLOR = u"BackColor"_ustr;
diff --git a/sw/qa/extras/odfexport/data/tdf159923.fodt 
b/sw/qa/extras/odfexport/data/tdf159923.fodt
new file mode 100644
index 000000000000..a3974cbab289
--- /dev/null
+++ b/sw/qa/extras/odfexport/data/tdf159923.fodt
@@ -0,0 +1,203 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<office:document xmlns:css3t="http://www.w3.org/TR/css3-text/"; 
xmlns:grddl="http://www.w3.org/2003/g/data-view#"; 
xmlns:xhtml="http://www.w3.org/1999/xhtml"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:xforms="http://www.w3.org/2002/xforms"; 
xmlns:dom="http://www.w3.org/2001/xml-events"; 
xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" 
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" 
xmlns:math="http://www.w3.org/1998/Math/MathML"; 
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" 
xmlns:ooo="http://openoffice.org/2004/office"; 
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" 
xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" 
xmlns:ooow="http://openoffice.org/2004/writer"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; 
xmlns:drawooo="http://openoffice.org/2010/draw"; 
xmlns:oooc="http://openoffice.org/2004/calc"; 
xmlns:dc="http://purl.org/dc/elements/1.1/"; xmlns:c
 alcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" 
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" 
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" 
xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" 
xmlns:tableooo="http://openoffice.org/2009/table"; 
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" 
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" 
xmlns:rpt="http://openoffice.org/2005/report"; 
xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0"
 xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" 
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" 
xmlns:officeooo="http://openoffice.org/2009/office"; 
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" 
xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" 
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" 
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:
 meta:1.0" 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"
 office:version="1.4" office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:settings>
+  <config:config-item-set config:name="ooo:view-settings">
+   <config:config-item config:name="ViewAreaTop" 
config:type="long">9343</config:config-item>
+   <config:config-item config:name="ViewAreaLeft" 
config:type="long">0</config:config-item>
+   <config:config-item config:name="ViewAreaWidth" 
config:type="long">22368</config:config-item>
+   <config:config-item config:name="ViewAreaHeight" 
config:type="long">12661</config:config-item>
+   <config:config-item config:name="ShowRedlineChanges" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="InBrowseMode" 
config:type="boolean">false</config:config-item>
+   <config:config-item-map-indexed config:name="Views">
+    <config:config-item-map-entry>
+     <config:config-item config:name="ViewId" 
config:type="string">view2</config:config-item>
+     <config:config-item config:name="ViewLeft" 
config:type="long">12674</config:config-item>
+     <config:config-item config:name="ViewTop" 
config:type="long">20331</config:config-item>
+     <config:config-item config:name="VisibleLeft" 
config:type="long">0</config:config-item>
+     <config:config-item config:name="VisibleTop" 
config:type="long">9343</config:config-item>
+     <config:config-item config:name="VisibleRight" 
config:type="long">22366</config:config-item>
+     <config:config-item config:name="VisibleBottom" 
config:type="long">22003</config:config-item>
+     <config:config-item config:name="ZoomType" 
config:type="short">0</config:config-item>
+     <config:config-item config:name="ViewLayoutColumns" 
config:type="short">0</config:config-item>
+     <config:config-item config:name="ViewLayoutBookMode" 
config:type="boolean">false</config:config-item>
+     <config:config-item config:name="ZoomFactor" 
config:type="short">172</config:config-item>
+     <config:config-item config:name="IsSelectedFrame" 
config:type="boolean">false</config:config-item>
+     <config:config-item config:name="KeepRatio" 
config:type="boolean">false</config:config-item>
+     <config:config-item config:name="AnchoredTextOverflowLegacy" 
config:type="boolean">true</config:config-item>
+     <config:config-item config:name="LegacySingleLineFontwork" 
config:type="boolean">true</config:config-item>
+     <config:config-item config:name="ConnectorUseSnapRect" 
config:type="boolean">false</config:config-item>
+     <config:config-item config:name="IgnoreBreakAfterMultilineField" 
config:type="boolean">false</config:config-item>
+    </config:config-item-map-entry>
+   </config:config-item-map-indexed>
+  </config:config-item-set>
+  <config:config-item-set config:name="ooo:configuration-settings">
+   <config:config-item config:name="PrintProspectRTL" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="PrintPageBackground" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="PrintDrawings" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="PrintFaxName" config:type="string"/>
+   <config:config-item config:name="PrintReversed" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="PrintAnnotationMode" 
config:type="short">0</config:config-item>
+   <config:config-item config:name="PrintHiddenText" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="PrintEmptyPages" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="BalanceSpacesAndIdeographicSpaces" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="MsWordCompGridMetrics" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="PaintHellOverHeaderFooter" 
config:type="boolean">false</config:config-item>
+   <config:config-item 
config:name="ApplyParagraphMarkFormatToEmptyLineAtEndOfParagraph" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="PrintGraphics" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="NoNumberingShowFollowBy" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="MinRowHeightInclBorder" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="HyphenateURLs" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="ImagePreferredDPI" 
config:type="int">0</config:config-item>
+   <config:config-item config:name="FootnoteInColumnToPageEnd" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="GutterAtTop" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="ContinuousEndnotes" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="MsWordUlTrailSpace" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="FrameAutowidthWithMorePara" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="SubtractFlysAnchoredAtFlys" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="SurroundTextWrapSmall" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="PrintControls" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="TreatSingleColumnBreakAsPageBreak" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="TabOverSpacing" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="AutoFirstLineIndentDisregardLineSpace" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="TabOverMargin" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="EmbedComplexScriptFonts" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="EmbedAsianScriptFonts" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="PrintTextPlaceholder" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="ApplyTextAttrToEmptyLineAtEndOfParagraph" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="EmbedSystemFonts" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="EmbedFonts" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="NoClippingWithWrapPolygon" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="DisableOffPagePositioning" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="BackgroundParaOverDrawings" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="TabOverflow" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="SmallCapsPercentage66" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="AllowPrintJobCancel" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="AddVerticalFrameOffsets" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="ProtectBookmarks" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="AddFrameOffsets" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="PrintBlackFonts" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="TableRowKeep" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="ApplyParagraphMarkFormatToNumbering" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="PrinterIndependentLayout" 
config:type="string">high-resolution</config:config-item>
+   <config:config-item config:name="JustifyLinesWithShrinking" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="RsidRoot" 
config:type="int">585804</config:config-item>
+   <config:config-item config:name="PrintProspect" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="CollapseEmptyCellPara" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="PrintPaperFromSetup" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="CurrentDatabaseCommand" 
config:type="string"/>
+   <config:config-item config:name="CurrentDatabaseDataSource" 
config:type="string"/>
+   <config:config-item config:name="SaveThumbnail" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="EmbeddedDatabaseName" 
config:type="string"/>
+   <config:config-item config:name="UnbreakableNumberings" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="SaveGlobalDocumentLinks" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="MsWordCompTrailingBlanks" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="PrintTables" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="PrintLeftPages" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="AddParaTableSpacing" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="PrinterPaperFromSetup" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="CurrentDatabaseCommandType" 
config:type="int">0</config:config-item>
+   <config:config-item config:name="ChartAutoUpdate" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="OutlineLevelYieldsNumbering" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="UseOldNumbering" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="AddParaSpacingToTableCells" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="FieldAutoUpdate" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="PropLineSpacingShrinksFirstLine" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="TabAtLeftIndentForParagraphsInList" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="PrintRightPages" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="DoNotCaptureDrawObjsOnPage" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="LoadReadonly" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="HeaderSpacingBelowLastPara" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="SaveVersionOnClose" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="UseFormerLineSpacing" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="PrinterName" config:type="string"/>
+   <config:config-item config:name="AddParaLineSpacingToTableCells" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="IsKernAsianPunctuation" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="DoNotJustifyLinesWithManualBreak" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="CharacterCompressionType" 
config:type="short">0</config:config-item>
+   <config:config-item config:name="IsLabelDocument" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="EmbedLatinScriptFonts" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="PrinterSetup" config:type="base64Binary"/>
+   <config:config-item config:name="UseVariableWidthNBSP" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="EmbedOnlyUsedFonts" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="ApplyUserData" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="AddParaTableSpacingAtStart" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="InvertBorderSpacing" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="ProtectFields" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="AddExternalLeading" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="LinkUpdateMode" 
config:type="short">1</config:config-item>
+   <config:config-item config:name="UseFormerObjectPositioning" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="UnxForceZeroExtLeading" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="UseFormerTextWrapping" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="ConsiderTextWrapOnObjPos" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="StylesNoDefault" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="IgnoreFirstLineIndentInNumbering" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="NoGapAfterNoteNumber" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="EmptyDbFieldHidesPara" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="DoNotResetParaAttrsForNumFont" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="IgnoreTabsAndBlanksForLineCalculation" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="ClippedPictures" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="MathBaselineAlignment" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="AlignTabStopPosition" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="IgnoreHiddenCharsForLineCalculation" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="ClipAsCharacterAnchoredWriterFlyFrames" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="DropCapPunctuation" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="UseOldPrinterMetrics" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="RedlineProtectionKey" 
config:type="base64Binary"/>
+   <config:config-item config:name="TabsRelativeToIndent" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="Rsid" 
config:type="int">693336</config:config-item>
+   <config:config-item config:name="UpdateFromTemplate" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="ProtectForm" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="MsWordCompMinLineHeightByFly" 
config:type="boolean">false</config:config-item>
+  </config:config-item-set>
+ </office:settings>
+ <office:scripts>
+  <office:script script:language="ooo:Basic">
+   <ooo:libraries xmlns:ooo="http://openoffice.org/2004/office"; 
xmlns:xlink="http://www.w3.org/1999/xlink"/>
+  </office:script>
+ </office:scripts>
+ <office:font-face-decls>
+  <style:font-face style:name="Arial" svg:font-family="Arial"/>
+  <style:font-face style:name="Arial Unicode MS" svg:font-family="&apos;Arial 
Unicode MS&apos;"/>
+  <style:font-face style:name="Arial Unicode MS1" svg:font-family="&apos;Arial 
Unicode MS&apos;" style:font-family-generic="system" 
style:font-pitch="variable"/>
+  <style:font-face style:name="Arial1" svg:font-family="Arial" 
style:font-family-generic="system" style:font-pitch="variable"/>
+ </office:font-face-decls>
+ <office:styles>
+  <style:default-style style:family="graphic">
+   <style:graphic-properties svg:stroke-color="#3465a4" 
draw:fill-color="#729fcf" fo:wrap-option="no-wrap" draw:shadow-offset-x="8.5pt" 
draw:shadow-offset-y="8.5pt" draw:start-line-spacing-horizontal="8.02pt" 
draw:start-line-spacing-vertical="8.02pt" 
draw:end-line-spacing-horizontal="8.02pt" 
draw:end-line-spacing-vertical="8.02pt" style:writing-mode="lr-tb" 
style:flow-with-text="false"/>
+   <style:paragraph-properties style:text-autospace="ideograph-alpha" 
style:line-break="strict" loext:tab-stop-distance="0pt" 
style:font-independent-line-spacing="false">
+    <style:tab-stops/>
+   </style:paragraph-properties>
+   <style:text-properties style:use-window-font-color="true" 
loext:opacity="0%" style:font-name="Calibri" fo:font-size="10pt" 
fo:language="en" fo:country="US" style:letter-kerning="false"/>
+  </style:default-style>
+  <style:default-style style:family="paragraph">
+   <style:paragraph-properties fo:hyphenation-ladder-count="no-limit" 
fo:hyphenation-keep="auto" loext:hyphenation-keep-type="column" 
loext:hyphenation-keep-line="false" style:text-autospace="ideograph-alpha" 
style:punctuation-wrap="hanging" style:line-break="strict" 
style:tab-stop-distance="36pt" style:writing-mode="page"/>
+   <style:text-properties style:use-window-font-color="true" 
loext:opacity="0%" style:font-name="Calibri" fo:font-size="10pt" 
fo:language="en" fo:country="US" style:letter-kerning="false"         
fo:hyphenate="false" fo:hyphenation-remain-char-count="2" 
fo:hyphenation-push-char-count="2" loext:hyphenation-no-caps="false" 
loext:hyphenation-no-last-word="false" 
loext:hyphenation-word-char-count="no-limit" loext:hyphenation-zone="no-limit"/>
+  </style:default-style>
+  <style:style style:name="Standard" style:family="paragraph" 
style:class="text">
+   <style:paragraph-properties fo:margin-top="0pt" fo:margin-bottom="0pt" 
style:contextual-spacing="false" fo:text-align="start" 
style:justify-single-word="false" fo:orphans="2" fo:widows="2" 
style:writing-mode="lr-tb"/>
+   <style:text-properties style:font-name="Arial" fo:font-family="Arial" 
fo:font-size="10pt" fo:language="en" fo:country="GB"/>
+  </style:style>
+ </office:styles>
+ <office:automatic-styles>
+  <style:style style:name="P1" style:family="paragraph" 
style:parent-style-name="Standard">
+   <style:paragraph-properties fo:text-align="justify" 
style:justify-single-word="false" loext:word-spacing="75%"/>
+  </style:style>
+  <style:page-layout style:name="pm1">
+   <style:page-layout-properties fo:page-width="419.56pt" 
fo:page-height="595.3pt" style:num-format="1" 
style:print-orientation="portrait" fo:margin-top="21.6pt" 
fo:margin-bottom="14.4pt" fo:margin-left="36pt" fo:margin-right="36pt" 
style:writing-mode="lr-tb" style:layout-grid-color="#c0c0c0" 
style:layout-grid-lines="31" style:layout-grid-base-height="18pt" 
style:layout-grid-ruby-height="0pt" style:layout-grid-mode="none" 
style:layout-grid-ruby-below="false" style:layout-grid-print="false" 
style:layout-grid-display="false" style:layout-grid-base-width="10.46pt" 
style:layout-grid-snap-to="true" style:footnote-max-height="0pt" 
loext:margin-gutter="0pt">
+    <style:footnote-sep style:width="0.51pt" 
style:distance-before-sep="2.86pt" style:distance-after-sep="2.86pt" 
style:line-style="solid" style:adjustment="left" style:rel-width="25%" 
style:color="#000000"/>
+   </style:page-layout-properties>
+  </style:page-layout>
+ </office:automatic-styles>
+ <office:master-styles>
+  <style:master-page style:name="Standard" style:page-layout-name="pm1" 
draw:style-name="dp1"/>
+ </office:master-styles>
+ <office:body>
+  <office:text>
+   <text:p text:style-name="P1">Integer sodales tincidunt tristique. Sed a 
metus posuere, adipiscing nunc et, viverra odio. Donec auctor molestie sem, sit 
amet tristique lectus hendrerit sed. Cras sodales nisl sed orci mattis iaculis. 
Nunc eget dolor accumsan, pharetra risus a, vestibulum mauris. Nunc vulputate 
lobortis mollis. Vivamus nec tellus faucibus, tempor magna nec, facilisis 
felis. Donec commodo enim a vehicula pellentesque. Nullam vehicula vestibulum 
est vel ultricies. Aliquam velit massa, laoreet vel leo nec, volutpat facilisis 
eros. Donec consequat arcu ut diam tempor luctus. Cum sociis natoque penatibus 
et magnis dis parturient montes, nascetur ridiculus mus. Praesent vitae lacus 
vel leo sodales pharetra a a nibh. Vestibulum ante ipsum primis in faucibus 
orci luctus et ultrices posuere cubilia Curae; Nam luctus tempus nibh, 
fringilla dictum augue consectetur eget. Curabitur at ante sit amet tortor 
pharetra molestie eu nec ante. Mauris tincidunt, nibh eu sollicitudin mol
 estie, dolor sapien congue tortor, a pulvinar sapien turpis sed ante. Donec 
nec est elementum, euismod nulla in, mollis nunc. Lorem ipsum dolor sit amet, 
consectetur adipiscing elit. Vestibulum consequat mi quis pretium semper. Proin 
luctus orci ac neque venenatis, quis commodo dolor posuere. Curabitur dignissim 
sapien quis cursus egestas. Donec blandit auctor arcu, nec pellentesque eros 
molestie eget. In consectetur aliquam hendrerit. Sed cursus mauris vitae ligula 
pellentesque, non pellentesque urna aliquet. Fusce placerat mauris enim, nec 
rutrum purus semper vel. Praesent tincidunt neque eu pellentesque pharetra. 
Fusce pellentesque est orci. Integer sodales.</text:p>
+   <text:p text:style-name="P1">Tincidunt tristique. Sed a metus posuere, 
adipiscing nunc et, viverra odio. Donec auctor molestie sem, sit amet tristique 
lectus hendrerit sed. Cras sodales nisl sed orci mattis iaculis. Nunc eget 
dolor accumsan, pharetra risus a, vestibulum mauris. Nunc vulputate lobortis 
mollis. Vivamus nec tellus faucibus, tempor magna nec, facilisis felis. Donec 
commodo enim a vehicula pellentesque. Nullam vehicula vestibulum est vel 
ultricies.</text:p>
+   <text:p text:style-name="P1">Lorem ipsum dolor sit amet, consectetur 
adipiscing elit. Vestibulum consequat mi quis pretium semper. Proin luctus orci 
ac neque venenatis, quis commodo dolor posuere. Curabitur dignissim sapien quis 
cursus egestas. Donec blandit auctor arcu, nec pellentesque eros molestie eget. 
In consectetur aliquam hendrerit. Sed cursus mauris vitae ligula pellentesque, 
non pellentesque urna aliquet. Fusce placerat mauris enim, nec rutrum purus 
semper vel. Praesent tincidunt neque eu pellentesque pharetra. Fusce 
pellentesque est orci.</text:p>
+   <text:p text:style-name="P1">Aliquam velit massa, laoreet vel leo nec, 
volutpat facilisis eros. Donec consequat arcu ut diam tempor luctus. Cum sociis 
natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. 
Praesent vitae lacus vel leo sodales pharetra a a nibh. Vestibulum ante ipsum 
primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nam luctus 
tempus nibh, fringilla dictum augue consectetur eget. Curabitur at ante sit 
amet tortor pharetra molestie eu nec ante. Mauris tincidunt, nibh eu 
sollicitudin molestie, dolor sapien congue tortor, a pulvinar sapien turpis sed 
ante. Donec nec est elementum, euismod nulla in, mollis nunc. Lorem ipsum dolor 
sit amet, consectetur adipiscing elit. Vestibulum consequat mi quis pretium 
semper. Proin luctus orci ac neque venenatis, quis commodo dolor posuere. 
Curabitur dignissim sapien quis cursus egestas. Donec blandit auctor arcu, nec 
pellentesque eros molestie eget. In consectetur aliquam hendrerit. Sed cursus m
 auris vitae ligula pellentesque, non pellentesque urna aliquet.</text:p>
+  </office:text>
+ </office:body>
+</office:document>
diff --git a/sw/qa/extras/odfexport/data/tdf159923_stretched.fodt 
b/sw/qa/extras/odfexport/data/tdf159923_stretched.fodt
new file mode 100644
index 000000000000..373213724499
--- /dev/null
+++ b/sw/qa/extras/odfexport/data/tdf159923_stretched.fodt
@@ -0,0 +1,203 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<office:document xmlns:css3t="http://www.w3.org/TR/css3-text/"; 
xmlns:grddl="http://www.w3.org/2003/g/data-view#"; 
xmlns:xhtml="http://www.w3.org/1999/xhtml"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:xforms="http://www.w3.org/2002/xforms"; 
xmlns:dom="http://www.w3.org/2001/xml-events"; 
xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" 
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" 
xmlns:math="http://www.w3.org/1998/Math/MathML"; 
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" 
xmlns:ooo="http://openoffice.org/2004/office"; 
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" 
xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" 
xmlns:ooow="http://openoffice.org/2004/writer"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; 
xmlns:drawooo="http://openoffice.org/2010/draw"; 
xmlns:oooc="http://openoffice.org/2004/calc"; 
xmlns:dc="http://purl.org/dc/elements/1.1/"; xmlns:c
 alcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" 
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" 
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" 
xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" 
xmlns:tableooo="http://openoffice.org/2009/table"; 
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" 
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" 
xmlns:rpt="http://openoffice.org/2005/report"; 
xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0"
 xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" 
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" 
xmlns:officeooo="http://openoffice.org/2009/office"; 
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" 
xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" 
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" 
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:
 meta:1.0" 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"
 office:version="1.4" office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:settings>
+  <config:config-item-set config:name="ooo:view-settings">
+   <config:config-item config:name="ViewAreaTop" 
config:type="long">9343</config:config-item>
+   <config:config-item config:name="ViewAreaLeft" 
config:type="long">0</config:config-item>
+   <config:config-item config:name="ViewAreaWidth" 
config:type="long">22368</config:config-item>
+   <config:config-item config:name="ViewAreaHeight" 
config:type="long">12661</config:config-item>
+   <config:config-item config:name="ShowRedlineChanges" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="InBrowseMode" 
config:type="boolean">false</config:config-item>
+   <config:config-item-map-indexed config:name="Views">
+    <config:config-item-map-entry>
+     <config:config-item config:name="ViewId" 
config:type="string">view2</config:config-item>
+     <config:config-item config:name="ViewLeft" 
config:type="long">12674</config:config-item>
+     <config:config-item config:name="ViewTop" 
config:type="long">20331</config:config-item>
+     <config:config-item config:name="VisibleLeft" 
config:type="long">0</config:config-item>
+     <config:config-item config:name="VisibleTop" 
config:type="long">9343</config:config-item>
+     <config:config-item config:name="VisibleRight" 
config:type="long">22366</config:config-item>
+     <config:config-item config:name="VisibleBottom" 
config:type="long">22003</config:config-item>
+     <config:config-item config:name="ZoomType" 
config:type="short">0</config:config-item>
+     <config:config-item config:name="ViewLayoutColumns" 
config:type="short">0</config:config-item>
+     <config:config-item config:name="ViewLayoutBookMode" 
config:type="boolean">false</config:config-item>
+     <config:config-item config:name="ZoomFactor" 
config:type="short">172</config:config-item>
+     <config:config-item config:name="IsSelectedFrame" 
config:type="boolean">false</config:config-item>
+     <config:config-item config:name="KeepRatio" 
config:type="boolean">false</config:config-item>
+     <config:config-item config:name="AnchoredTextOverflowLegacy" 
config:type="boolean">true</config:config-item>
+     <config:config-item config:name="LegacySingleLineFontwork" 
config:type="boolean">true</config:config-item>
+     <config:config-item config:name="ConnectorUseSnapRect" 
config:type="boolean">false</config:config-item>
+     <config:config-item config:name="IgnoreBreakAfterMultilineField" 
config:type="boolean">false</config:config-item>
+    </config:config-item-map-entry>
+   </config:config-item-map-indexed>
+  </config:config-item-set>
+  <config:config-item-set config:name="ooo:configuration-settings">
+   <config:config-item config:name="PrintProspectRTL" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="PrintPageBackground" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="PrintDrawings" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="PrintFaxName" config:type="string"/>
+   <config:config-item config:name="PrintReversed" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="PrintAnnotationMode" 
config:type="short">0</config:config-item>
+   <config:config-item config:name="PrintHiddenText" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="PrintEmptyPages" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="BalanceSpacesAndIdeographicSpaces" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="MsWordCompGridMetrics" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="PaintHellOverHeaderFooter" 
config:type="boolean">false</config:config-item>
+   <config:config-item 
config:name="ApplyParagraphMarkFormatToEmptyLineAtEndOfParagraph" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="PrintGraphics" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="NoNumberingShowFollowBy" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="MinRowHeightInclBorder" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="HyphenateURLs" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="ImagePreferredDPI" 
config:type="int">0</config:config-item>
+   <config:config-item config:name="FootnoteInColumnToPageEnd" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="GutterAtTop" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="ContinuousEndnotes" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="MsWordUlTrailSpace" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="FrameAutowidthWithMorePara" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="SubtractFlysAnchoredAtFlys" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="SurroundTextWrapSmall" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="PrintControls" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="TreatSingleColumnBreakAsPageBreak" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="TabOverSpacing" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="AutoFirstLineIndentDisregardLineSpace" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="TabOverMargin" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="EmbedComplexScriptFonts" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="EmbedAsianScriptFonts" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="PrintTextPlaceholder" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="ApplyTextAttrToEmptyLineAtEndOfParagraph" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="EmbedSystemFonts" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="EmbedFonts" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="NoClippingWithWrapPolygon" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="DisableOffPagePositioning" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="BackgroundParaOverDrawings" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="TabOverflow" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="SmallCapsPercentage66" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="AllowPrintJobCancel" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="AddVerticalFrameOffsets" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="ProtectBookmarks" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="AddFrameOffsets" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="PrintBlackFonts" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="TableRowKeep" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="ApplyParagraphMarkFormatToNumbering" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="PrinterIndependentLayout" 
config:type="string">high-resolution</config:config-item>
+   <config:config-item config:name="JustifyLinesWithShrinking" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="RsidRoot" 
config:type="int">585804</config:config-item>
+   <config:config-item config:name="PrintProspect" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="CollapseEmptyCellPara" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="PrintPaperFromSetup" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="CurrentDatabaseCommand" 
config:type="string"/>
+   <config:config-item config:name="CurrentDatabaseDataSource" 
config:type="string"/>
+   <config:config-item config:name="SaveThumbnail" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="EmbeddedDatabaseName" 
config:type="string"/>
+   <config:config-item config:name="UnbreakableNumberings" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="SaveGlobalDocumentLinks" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="MsWordCompTrailingBlanks" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="PrintTables" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="PrintLeftPages" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="AddParaTableSpacing" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="PrinterPaperFromSetup" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="CurrentDatabaseCommandType" 
config:type="int">0</config:config-item>
+   <config:config-item config:name="ChartAutoUpdate" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="OutlineLevelYieldsNumbering" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="UseOldNumbering" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="AddParaSpacingToTableCells" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="FieldAutoUpdate" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="PropLineSpacingShrinksFirstLine" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="TabAtLeftIndentForParagraphsInList" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="PrintRightPages" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="DoNotCaptureDrawObjsOnPage" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="LoadReadonly" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="HeaderSpacingBelowLastPara" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="SaveVersionOnClose" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="UseFormerLineSpacing" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="PrinterName" config:type="string"/>
+   <config:config-item config:name="AddParaLineSpacingToTableCells" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="IsKernAsianPunctuation" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="DoNotJustifyLinesWithManualBreak" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="CharacterCompressionType" 
config:type="short">0</config:config-item>
+   <config:config-item config:name="IsLabelDocument" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="EmbedLatinScriptFonts" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="PrinterSetup" config:type="base64Binary"/>
+   <config:config-item config:name="UseVariableWidthNBSP" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="EmbedOnlyUsedFonts" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="ApplyUserData" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="AddParaTableSpacingAtStart" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="InvertBorderSpacing" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="ProtectFields" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="AddExternalLeading" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="LinkUpdateMode" 
config:type="short">1</config:config-item>
+   <config:config-item config:name="UseFormerObjectPositioning" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="UnxForceZeroExtLeading" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="UseFormerTextWrapping" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="ConsiderTextWrapOnObjPos" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="StylesNoDefault" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="IgnoreFirstLineIndentInNumbering" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="NoGapAfterNoteNumber" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="EmptyDbFieldHidesPara" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="DoNotResetParaAttrsForNumFont" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="IgnoreTabsAndBlanksForLineCalculation" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="ClippedPictures" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="MathBaselineAlignment" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="AlignTabStopPosition" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="IgnoreHiddenCharsForLineCalculation" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="ClipAsCharacterAnchoredWriterFlyFrames" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="DropCapPunctuation" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="UseOldPrinterMetrics" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="RedlineProtectionKey" 
config:type="base64Binary"/>
+   <config:config-item config:name="TabsRelativeToIndent" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="Rsid" 
config:type="int">693336</config:config-item>
+   <config:config-item config:name="UpdateFromTemplate" 
config:type="boolean">true</config:config-item>
+   <config:config-item config:name="ProtectForm" 
config:type="boolean">false</config:config-item>
+   <config:config-item config:name="MsWordCompMinLineHeightByFly" 
config:type="boolean">false</config:config-item>
+  </config:config-item-set>
+ </office:settings>
+ <office:scripts>
+  <office:script script:language="ooo:Basic">
+   <ooo:libraries xmlns:ooo="http://openoffice.org/2004/office"; 
xmlns:xlink="http://www.w3.org/1999/xlink"/>
+  </office:script>
+ </office:scripts>
+ <office:font-face-decls>
+  <style:font-face style:name="Arial" svg:font-family="Arial"/>
+  <style:font-face style:name="Arial Unicode MS" svg:font-family="&apos;Arial 
Unicode MS&apos;"/>
+  <style:font-face style:name="Arial Unicode MS1" svg:font-family="&apos;Arial 
Unicode MS&apos;" style:font-family-generic="system" 
style:font-pitch="variable"/>
+  <style:font-face style:name="Arial1" svg:font-family="Arial" 
style:font-family-generic="system" style:font-pitch="variable"/>
+ </office:font-face-decls>
+ <office:styles>
+  <style:default-style style:family="graphic">
+   <style:graphic-properties svg:stroke-color="#3465a4" 
draw:fill-color="#729fcf" fo:wrap-option="no-wrap" draw:shadow-offset-x="8.5pt" 
draw:shadow-offset-y="8.5pt" draw:start-line-spacing-horizontal="8.02pt" 
draw:start-line-spacing-vertical="8.02pt" 
draw:end-line-spacing-horizontal="8.02pt" 
draw:end-line-spacing-vertical="8.02pt" style:writing-mode="lr-tb" 
style:flow-with-text="false"/>
+   <style:paragraph-properties style:text-autospace="ideograph-alpha" 
style:line-break="strict" loext:tab-stop-distance="0pt" 
style:font-independent-line-spacing="false">
+    <style:tab-stops/>
+   </style:paragraph-properties>
+   <style:text-properties style:use-window-font-color="true" 
loext:opacity="0%" style:font-name="Calibri" fo:font-size="10pt" 
fo:language="en" fo:country="US" style:letter-kerning="false"/>
+  </style:default-style>
+  <style:default-style style:family="paragraph">
+   <style:paragraph-properties fo:hyphenation-ladder-count="no-limit" 
fo:hyphenation-keep="auto" loext:hyphenation-keep-type="column" 
loext:hyphenation-keep-line="false" style:text-autospace="ideograph-alpha" 
style:punctuation-wrap="hanging" style:line-break="strict" 
style:tab-stop-distance="36pt" style:writing-mode="page"/>
+   <style:text-properties style:use-window-font-color="true" 
loext:opacity="0%" style:font-name="Calibri" fo:font-size="10pt" 
fo:language="en" fo:country="US" style:letter-kerning="false"         
fo:hyphenate="false" fo:hyphenation-remain-char-count="2" 
fo:hyphenation-push-char-count="2" loext:hyphenation-no-caps="false" 
loext:hyphenation-no-last-word="false" 
loext:hyphenation-word-char-count="no-limit" loext:hyphenation-zone="no-limit"/>
+  </style:default-style>
+  <style:style style:name="Standard" style:family="paragraph" 
style:class="text">
+   <style:paragraph-properties fo:margin-top="0pt" fo:margin-bottom="0pt" 
style:contextual-spacing="false" fo:text-align="start" 
style:justify-single-word="false" fo:orphans="2" fo:widows="2" 
style:writing-mode="lr-tb"/>
+   <style:text-properties style:font-name="Arial" fo:font-family="Arial" 
fo:font-size="10pt" fo:language="en" fo:country="GB"/>
+  </style:style>
+ </office:styles>
+ <office:automatic-styles>
+  <style:style style:name="P1" style:family="paragraph" 
style:parent-style-name="Standard">
+   <style:paragraph-properties fo:text-align="justify" 
style:justify-single-word="false" loext:word-spacing="750%"/>
+  </style:style>
+  <style:page-layout style:name="pm1">
+   <style:page-layout-properties fo:page-width="419.56pt" 
fo:page-height="595.3pt" style:num-format="1" 
style:print-orientation="portrait" fo:margin-top="21.6pt" 
fo:margin-bottom="14.4pt" fo:margin-left="36pt" fo:margin-right="36pt" 
style:writing-mode="lr-tb" style:layout-grid-color="#c0c0c0" 
style:layout-grid-lines="31" style:layout-grid-base-height="18pt" 
style:layout-grid-ruby-height="0pt" style:layout-grid-mode="none" 
style:layout-grid-ruby-below="false" style:layout-grid-print="false" 
style:layout-grid-display="false" style:layout-grid-base-width="10.46pt" 
style:layout-grid-snap-to="true" style:footnote-max-height="0pt" 
loext:margin-gutter="0pt">
+    <style:footnote-sep style:width="0.51pt" 
style:distance-before-sep="2.86pt" style:distance-after-sep="2.86pt" 
style:line-style="solid" style:adjustment="left" style:rel-width="25%" 
style:color="#000000"/>
+   </style:page-layout-properties>
+  </style:page-layout>
+ </office:automatic-styles>
+ <office:master-styles>
+  <style:master-page style:name="Standard" style:page-layout-name="pm1" 
draw:style-name="dp1"/>
+ </office:master-styles>
+ <office:body>
+  <office:text>
+   <text:p text:style-name="P1">Integer sodales tincidunt tristique. Sed a 
metus posuere, adipiscing nunc et, viverra odio. Donec auctor molestie sem, sit 
amet tristique lectus hendrerit sed. Cras sodales nisl sed orci mattis iaculis. 
Nunc eget dolor accumsan, pharetra risus a, vestibulum mauris. Nunc vulputate 
lobortis mollis. Vivamus nec tellus faucibus, tempor magna nec, facilisis 
felis. Donec commodo enim a vehicula pellentesque. Nullam vehicula vestibulum 
est vel ultricies. Aliquam velit massa, laoreet vel leo nec, volutpat facilisis 
eros. Donec consequat arcu ut diam tempor luctus. Cum sociis natoque penatibus 
et magnis dis parturient montes, nascetur ridiculus mus. Praesent vitae lacus 
vel leo sodales pharetra a a nibh. Vestibulum ante ipsum primis in faucibus 
orci luctus et ultrices posuere cubilia Curae; Nam luctus tempus nibh, 
fringilla dictum augue consectetur eget. Curabitur at ante sit amet tortor 
pharetra molestie eu nec ante. Mauris tincidunt, nibh eu sollicitudin mol
 estie, dolor sapien congue tortor, a pulvinar sapien turpis sed ante. Donec 
nec est elementum, euismod nulla in, mollis nunc. Lorem ipsum dolor sit amet, 
consectetur adipiscing elit. Vestibulum consequat mi quis pretium semper. Proin 
luctus orci ac neque venenatis, quis commodo dolor posuere. Curabitur dignissim 
sapien quis cursus egestas. Donec blandit auctor arcu, nec pellentesque eros 
molestie eget. In consectetur aliquam hendrerit. Sed cursus mauris vitae ligula 
pellentesque, non pellentesque urna aliquet. Fusce placerat mauris enim, nec 
rutrum purus semper vel. Praesent tincidunt neque eu pellentesque pharetra. 
Fusce pellentesque est orci. Integer sodales.</text:p>
+   <text:p text:style-name="P1">Tincidunt tristique. Sed a metus posuere, 
adipiscing nunc et, viverra odio. Donec auctor molestie sem, sit amet tristique 
lectus hendrerit sed. Cras sodales nisl sed orci mattis iaculis. Nunc eget 
dolor accumsan, pharetra risus a, vestibulum mauris. Nunc vulputate lobortis 
mollis. Vivamus nec tellus faucibus, tempor magna nec, facilisis felis. Donec 
commodo enim a vehicula pellentesque. Nullam vehicula vestibulum est vel 
ultricies.</text:p>
+   <text:p text:style-name="P1">Lorem ipsum dolor sit amet, consectetur 
adipiscing elit. Vestibulum consequat mi quis pretium semper. Proin luctus orci 
ac neque venenatis, quis commodo dolor posuere. Curabitur dignissim sapien quis 
cursus egestas. Donec blandit auctor arcu, nec pellentesque eros molestie eget. 
In consectetur aliquam hendrerit. Sed cursus mauris vitae ligula pellentesque, 
non pellentesque urna aliquet. Fusce placerat mauris enim, nec rutrum purus 
semper vel. Praesent tincidunt neque eu pellentesque pharetra. Fusce 
pellentesque est orci.</text:p>
+   <text:p text:style-name="P1">Aliquam velit massa, laoreet vel leo nec, 
volutpat facilisis eros. Donec consequat arcu ut diam tempor luctus. Cum sociis 
natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. 
Praesent vitae lacus vel leo sodales pharetra a a nibh. Vestibulum ante ipsum 
primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nam luctus 
tempus nibh, fringilla dictum augue consectetur eget. Curabitur at ante sit 
amet tortor pharetra molestie eu nec ante. Mauris tincidunt, nibh eu 
sollicitudin molestie, dolor sapien congue tortor, a pulvinar sapien turpis sed 
ante. Donec nec est elementum, euismod nulla in, mollis nunc. Lorem ipsum dolor 
sit amet, consectetur adipiscing elit. Vestibulum consequat mi quis pretium 
semper. Proin luctus orci ac neque venenatis, quis commodo dolor posuere. 
Curabitur dignissim sapien quis cursus egestas. Donec blandit auctor arcu, nec 
pellentesque eros molestie eget. In consectetur aliquam hendrerit. Sed cursus m
 auris vitae ligula pellentesque, non pellentesque urna aliquet.</text:p>
+  </office:text>
+ </office:body>
+</office:document>
diff --git a/sw/qa/extras/odfexport/odfexport2.cxx 
b/sw/qa/extras/odfexport/odfexport2.cxx
index 1d7eddd8a226..7eeb22a8e3dc 100644
--- a/sw/qa/extras/odfexport/odfexport2.cxx
+++ b/sw/qa/extras/odfexport/odfexport2.cxx
@@ -555,6 +555,18 @@ CPPUNIT_TEST_FIXTURE(Test, tdf163575)
     loadAndReload("tdf163575.docx");
 }
 
+DECLARE_ODFEXPORT_TEST(testTdf159923, "tdf159923.fodt")
+{
+    // This was 2: missing custom shrinking by word-spacing = "75%"
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
+}
+
+DECLARE_ODFEXPORT_TEST(testTdf159923_stretched, "tdf159923_stretched.fodt")
+{
+    // This was 2: missing custom stretching by word-spacing = "750%"
+    CPPUNIT_ASSERT_EQUAL(3, getPages());
+}
+
 CPPUNIT_TEST_FIXTURE(Test, tdf145871)
 {
     loadAndReload("tdf145871.odt");
diff --git a/sw/qa/uitest/styleInspector/styleInspector.py 
b/sw/qa/uitest/styleInspector/styleInspector.py
index b29f42407f75..5e3a5ea7c91a 100644
--- a/sw/qa/uitest/styleInspector/styleInspector.py
+++ b/sw/qa/uitest/styleInspector/styleInspector.py
@@ -26,7 +26,7 @@ class styleNavigator(UITestCase):
             # The cursor is on text without formatting and default style
             self.assertEqual(1, len(xListBox.getChild('0').getChildren()))
             self.assertEqual("Default Paragraph Style  ", 
get_state_as_dict(xListBox.getChild('0').getChild('0'))['Text'])
-            self.assertEqual(148, 
len(xListBox.getChild('0').getChild('0').getChildren()))
+            self.assertEqual(149, 
len(xListBox.getChild('0').getChild('0').getChildren()))
             self.assertEqual(0, len(xListBox.getChild('1').getChildren()))
             self.assertEqual(0, len(xListBox.getChild('2').getChildren()))
             self.assertEqual(0, len(xListBox.getChild('3').getChildren()))
@@ -36,7 +36,7 @@ class styleNavigator(UITestCase):
             # The cursor is on text with direct formatting
             self.assertEqual(1, len(xListBox.getChild('0').getChildren()))
             self.assertEqual("Default Paragraph Style  ", 
get_state_as_dict(xListBox.getChild('0').getChild('0'))['Text'])
-            self.assertEqual(148, 
len(xListBox.getChild('0').getChild('0').getChildren()))
+            self.assertEqual(149, 
len(xListBox.getChild('0').getChild('0').getChildren()))
             self.assertEqual(0, len(xListBox.getChild('1').getChildren()))
             self.assertEqual(0, len(xListBox.getChild('2').getChildren()))
 
@@ -54,7 +54,7 @@ class styleNavigator(UITestCase):
             # The cursor is on text with paragraph direct formatting
             self.assertEqual(1, len(xListBox.getChild('0').getChildren()))
             self.assertEqual("Default Paragraph Style  ", 
get_state_as_dict(xListBox.getChild('0').getChild('0'))['Text'])
-            self.assertEqual(148, 
len(xListBox.getChild('0').getChild('0').getChildren()))
+            self.assertEqual(149, 
len(xListBox.getChild('0').getChild('0').getChildren()))
 
             xParDirFormatting = xListBox.getChild('1')
             self.assertEqual(7, len(xParDirFormatting.getChildren()))
@@ -75,13 +75,13 @@ class styleNavigator(UITestCase):
             xParStyle = xListBox.getChild('0')
             self.assertEqual(3, len(xParStyle.getChildren()))
             self.assertEqual("Default Paragraph Style  ", 
get_state_as_dict(xParStyle.getChild('0'))['Text'])
-            self.assertEqual(148, len(xParStyle.getChild('0').getChildren()))
+            self.assertEqual(149, len(xParStyle.getChild('0').getChildren()))
             self.assertEqual("Heading  ", 
get_state_as_dict(xParStyle.getChild('1'))['Text'])
             self.assertEqual(28, len(xParStyle.getChild('1').getChildren()))
 
             xTitleStyle = xParStyle.getChild('2')
             self.assertEqual("Title    ", 
get_state_as_dict(xTitleStyle)['Text'])
-            self.assertEqual(16, len(xTitleStyle.getChildren()))
+            self.assertEqual(17, len(xTitleStyle.getChildren()))
             self.assertEqual("Char Difference Height   0", 
get_state_as_dict(xTitleStyle.getChild('0'))['Text'])
             self.assertEqual("Char Difference Height Asian     0", 
get_state_as_dict(xTitleStyle.getChild('1'))['Text'])
             self.assertEqual("Char Difference Height Complex   0", 
get_state_as_dict(xTitleStyle.getChild('2'))['Text'])
@@ -98,6 +98,7 @@ class styleNavigator(UITestCase):
             self.assertEqual("Para Adjust      3", 
get_state_as_dict(xTitleStyle.getChild('13'))['Text'])
             self.assertEqual("Para Expand Single Word  False", 
get_state_as_dict(xTitleStyle.getChild('14'))['Text'])
             self.assertEqual("Para Last Line Adjust    0", 
get_state_as_dict(xTitleStyle.getChild('15'))['Text'])
+            self.assertEqual("Para Word Spacing        100", 
get_state_as_dict(xTitleStyle.getChild('16'))['Text'])
 
             self.assertEqual(0, len(xListBox.getChild('1').getChildren()))
             self.assertEqual(0, len(xListBox.getChild('2').getChildren()))
@@ -109,7 +110,7 @@ class styleNavigator(UITestCase):
             xParStyle = xListBox.getChild('0')
             self.assertEqual(3, len(xParStyle.getChildren()))
             self.assertEqual("Default Paragraph Style  ", 
get_state_as_dict(xParStyle.getChild('0'))['Text'])
-            self.assertEqual(148, len(xParStyle.getChild('0').getChildren()))
+            self.assertEqual(149, len(xParStyle.getChild('0').getChildren()))
             self.assertEqual("Body Text        ", 
get_state_as_dict(xParStyle.getChild('1'))['Text'])
             self.assertEqual(6, len(xParStyle.getChild('1').getChildren()))
 
@@ -144,7 +145,7 @@ class styleNavigator(UITestCase):
             # The cursor is on text without metadata
             self.assertEqual(1, len(xListBox.getChild('0').getChildren()))
             self.assertEqual("Default Paragraph Style  ", 
get_state_as_dict(xListBox.getChild('0').getChild('0'))['Text'])
-            self.assertEqual(148, 
len(xListBox.getChild('0').getChild('0').getChildren()))
+            self.assertEqual(149, 
len(xListBox.getChild('0').getChild('0').getChildren()))
             self.assertEqual(0, len(xListBox.getChild('1').getChildren()))
             self.assertEqual(0, len(xListBox.getChild('2').getChildren()))
             self.assertEqual(0, len(xListBox.getChild('3').getChildren()))
@@ -154,7 +155,7 @@ class styleNavigator(UITestCase):
             # The cursor is on text with paragraph metadata showed under 
direct paragraph formatting
             self.assertEqual(1, len(xListBox.getChild('0').getChildren()))
             self.assertEqual("Default Paragraph Style  ", 
get_state_as_dict(xListBox.getChild('0').getChild('0'))['Text'])
-            self.assertEqual(148, 
len(xListBox.getChild('0').getChild('0').getChildren()))
+            self.assertEqual(149, 
len(xListBox.getChild('0').getChild('0').getChildren()))
 
             xParDirFormatting = xListBox.getChild('1')
             self.assertEqual(1, len(xParDirFormatting.getChildren()))
@@ -207,7 +208,7 @@ class styleNavigator(UITestCase):
             # The cursor is on text without metadata
             self.assertEqual(1, len(xListBox.getChild('0').getChildren()))
             self.assertEqual("Default Paragraph Style  ", 
get_state_as_dict(xListBox.getChild('0').getChild('0'))['Text'])
-            self.assertEqual(148, 
len(xListBox.getChild('0').getChild('0').getChildren()))
+            self.assertEqual(149, 
len(xListBox.getChild('0').getChild('0').getChildren()))
             self.assertEqual(0, len(xListBox.getChild('1').getChildren()))
             self.assertEqual(0, len(xListBox.getChild('2').getChildren()))
             self.assertEqual(0, len(xListBox.getChild('3').getChildren()))
@@ -217,7 +218,7 @@ class styleNavigator(UITestCase):
             # The cursor is on text with paragraph metadata showed under 
direct paragraph formatting
             self.assertEqual(1, len(xListBox.getChild('1').getChildren()))
             self.assertEqual("Default Paragraph Style  ", 
get_state_as_dict(xListBox.getChild('1').getChild('0'))['Text'])
-            self.assertEqual(148, 
len(xListBox.getChild('1').getChild('0').getChildren()))
+            self.assertEqual(149, 
len(xListBox.getChild('1').getChild('0').getChildren()))
 
             # Outer bookmark
             xBookmarkFormatting = xListBox.getChild('0')
@@ -264,7 +265,7 @@ class styleNavigator(UITestCase):
             # The cursor is on text without metadata
             self.assertEqual(1, len(xListBox.getChild('0').getChildren()))
             self.assertEqual("Default Paragraph Style  ", 
get_state_as_dict(xListBox.getChild('0').getChild('0'))['Text'])
-            self.assertEqual(148, 
len(xListBox.getChild('0').getChild('0').getChildren()))
+            self.assertEqual(149, 
len(xListBox.getChild('0').getChild('0').getChildren()))
             self.assertEqual(0, len(xListBox.getChild('1').getChildren()))
             self.assertEqual(0, len(xListBox.getChild('2').getChildren()))
 
diff --git a/sw/qa/uitest/styleInspector/tdf137513.py 
b/sw/qa/uitest/styleInspector/tdf137513.py
index e5da641bbc03..c27646779743 100644
--- a/sw/qa/uitest/styleInspector/tdf137513.py
+++ b/sw/qa/uitest/styleInspector/tdf137513.py
@@ -35,7 +35,7 @@ class tdf137513(UITestCase):
             self.assertEqual(2, len(xListBox.getChild('0').getChildren()))
             self.assertEqual("Default Paragraph Style  ", 
get_state_as_dict(xListBox.getChild('0').getChild('0'))['Text'])
             self.assertEqual("Table Contents   ", 
get_state_as_dict(xListBox.getChild('0').getChild('1'))['Text'])
-            self.assertEqual(148, 
len(xListBox.getChild('0').getChild('0').getChildren()))
+            self.assertEqual(149, 
len(xListBox.getChild('0').getChild('0').getChildren()))
 
             xTableContent = xListBox.getChild('0').getChild('1')
             self.assertEqual(5, len(xTableContent.getChildren()))
diff --git a/sw/source/core/text/guess.cxx b/sw/source/core/text/guess.cxx
index 55e109136e78..3f90b3f13db6 100644
--- a/sw/source/core/text/guess.cxx
+++ b/sw/source/core/text/guess.cxx
@@ -181,14 +181,18 @@ bool SwTextGuess::Guess( const SwTextPortion& rPor, 
SwTextFormatInfo &rInf,
     SwTwips nLineWidth = rInf.GetLineWidth();
     TextFrameIndex nMaxLen = TextFrameIndex(rInf.GetText().getLength()) - 
rInf.GetIdx();
 
-    const SvxAdjust aAdjust = 
rInf.GetTextFrame()->GetTextNodeForParaProps()->GetSwAttrSet().GetAdjust().GetAdjust();
+    auto aAdjustItem = 
rInf.GetTextFrame()->GetTextNodeForParaProps()->GetSwAttrSet().GetAdjust();
+    const SvxAdjust aAdjust = aAdjustItem.GetAdjust();
 
     // allow up to 20% shrinking of the spaces
     if ( nSpacesInLine )
     {
         static constexpr OUStringLiteral STR_BLANK = u" ";
         sal_Int16 nSpaceWidth = rInf.GetTextSize(STR_BLANK).Width();
-        SwTwips nExtraSpace = nSpacesInLine * (nSpaceWidth/0.8 - nSpaceWidth);
+        float fWordSpacingOptimum = aAdjustItem.GetPropWordSpacing() == 100
+                ? 0.75 // MSO interoperability value
+                : aAdjustItem.GetPropWordSpacing() / 100.0;
+        SwTwips nExtraSpace = nSpacesInLine * nSpaceWidth * (1.0 - 
fWordSpacingOptimum);
         nLineWidth += nExtraSpace;
         rInf.SetExtraSpace(nExtraSpace);
     }
diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index 1d90ab335352..2fa74bb87b2d 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -363,11 +363,13 @@ bool SwTextPortion::Format_( SwTextFormatInfo &rInf )
 
     // tdf#158776 for the last full text portion, call Guess() again to allow 
more text in the
     // adjusted line by shrinking spaces using the know space count from the 
first Guess() call
-    const SvxAdjust aAdjust = 
rInf.GetTextFrame()->GetTextNodeForParaProps()->GetSwAttrSet().GetAdjust().GetAdjust();
+    auto aAdjustItem = 
rInf.GetTextFrame()->GetTextNodeForParaProps()->GetSwAttrSet().GetAdjust();
+    const SvxAdjust aAdjust = aAdjustItem.GetAdjust();
     if ( bFull && aAdjust == SvxAdjust::Block &&
          pGuess->BreakPos() != TextFrameIndex(COMPLETE_STRING) &&
-         rInf.GetTextFrame()->GetDoc().getIDocumentSettingAccess().get(
-                    DocumentSettingId::JUSTIFY_LINES_WITH_SHRINKING) &&
+         ( rInf.GetTextFrame()->GetDoc().getIDocumentSettingAccess().get(
+                    DocumentSettingId::JUSTIFY_LINES_WITH_SHRINKING) ||
+           aAdjustItem.GetPropWordSpacing() != 100 ) &&
          // tdf#164499 no shrinking in tabulated line
          ( !rInf.GetLast() || !rInf.GetLast()->InTabGrp() ) &&
          // tdf#158436 avoid shrinking at underflow, e.g. no-break space after 
a
diff --git a/sw/source/core/unocore/unomapproperties.hxx 
b/sw/source/core/unocore/unomapproperties.hxx
index f93b8e99b09a..61e8163dbcba 100644
--- a/sw/source/core/unocore/unomapproperties.hxx
+++ b/sw/source/core/unocore/unomapproperties.hxx
@@ -184,6 +184,7 @@
         { UNO_NAME_PARA_ADJUST,                         RES_PARATR_ADJUST,     
        cppu::UnoType<sal_Int16>::get(),         PropertyAttribute::MAYBEVOID, 
MID_PARA_ADJUST                        }, \
         { UNO_NAME_PARA_EXPAND_SINGLE_WORD,             RES_PARATR_ADJUST,     
        cppu::UnoType<bool>::get(),       PropertyAttribute::MAYBEVOID, 
MID_EXPAND_SINGLE                      }, \
         { UNO_NAME_PARA_LAST_LINE_ADJUST,               RES_PARATR_ADJUST,     
        cppu::UnoType<sal_Int16>::get(),         PropertyAttribute::MAYBEVOID, 
MID_LAST_LINE_ADJUST                   }, \
+        { UNO_NAME_PARA_WORD_SPACING,                   RES_PARATR_ADJUST,     
        cppu::UnoType<sal_Int16>::get(),         PropertyAttribute::MAYBEVOID, 
MID_WORD_SPACING                       }, \
         { UNO_NAME_PARA_LINE_NUMBER_COUNT,              RES_LINENUMBER,        
        cppu::UnoType<bool>::get(),       PropertyAttribute::MAYBEVOID, 
MID_LINENUMBER_COUNT                   }, \
         { UNO_NAME_PARA_LINE_NUMBER_START_VALUE,        RES_LINENUMBER,        
        cppu::UnoType<sal_Int32>::get(),         PropertyAttribute::MAYBEVOID, 
MID_LINENUMBER_STARTVALUE              }, \
         { UNO_NAME_PARA_LINE_SPACING,                   
RES_PARATR_LINESPACING,        cppu::UnoType<css::style::LineSpacing>::get(),   
  PropertyAttribute::MAYBEVOID, CONVERT_TWIPS                          }, \
@@ -447,6 +448,7 @@
                     { UNO_NAME_PARA_ORPHANS, RES_PARATR_ORPHANS,      
cppu::UnoType<sal_Int8>::get(),PropertyAttribute::MAYBEVOID,     0},\
                     { UNO_NAME_PARA_EXPAND_SINGLE_WORD, RES_PARATR_ADJUST,     
 cppu::UnoType<bool>::get()  ,         PROPERTY_NONE, MID_EXPAND_SINGLE   },\
                     { UNO_NAME_PARA_LAST_LINE_ADJUST, RES_PARATR_ADJUST,      
cppu::UnoType<sal_Int16>::get(),       PROPERTY_NONE, MID_LAST_LINE_ADJUST},\
+                    { UNO_NAME_PARA_WORD_SPACING, RES_PARATR_ADJUST,          
cppu::UnoType<sal_Int16>::get(),       PROPERTY_NONE, MID_WORD_SPACING    },\
                     { UNO_NAME_PARA_LINE_NUMBER_COUNT, RES_LINENUMBER,        
cppu::UnoType<bool>::get(),         PROPERTY_NONE ,MID_LINENUMBER_COUNT     },\
                     { UNO_NAME_PARA_LINE_NUMBER_START_VALUE, RES_LINENUMBER,   
   cppu::UnoType<sal_Int32>::get(),           PROPERTY_NONE 
,MID_LINENUMBER_STARTVALUE},\
                     { UNO_NAME_PARA_LINE_SPACING, RES_PARATR_LINESPACING, 
cppu::UnoType<css::style::LineSpacing>::get(),PROPERTY_NONE,     
CONVERT_TWIPS},\
diff --git a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx 
b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
index 91279617b120..10f861246381 100644
--- a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
+++ b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
@@ -309,6 +309,7 @@ static OUString PropertyNametoRID(const OUString& rName)
         { "ParaUserDefinedAttributes", RID_PARA_USER_DEFINED_ATTRIBUTES },
         { "ParaVertAlignment", RID_PARA_VERT_ALIGNMENT },
         { "ParaWidows", RID_PARA_WIDOWS },
+        { "ParaWordSpacing", RID_PARA_WORD_SPACING },
         { "ReferenceMark", RID_REFERENCE_MARK },
         { "RightBorder", RID_RIGHT_BORDER },
         { "RightBorderDistance", RID_RIGHT_BORDER_DISTANCE },
diff --git a/xmloff/inc/xmlprop.hxx b/xmloff/inc/xmlprop.hxx
index fe47eaf60ece..3224dc5653f5 100644
--- a/xmloff/inc/xmlprop.hxx
+++ b/xmloff/inc/xmlprop.hxx
@@ -523,6 +523,7 @@ inline constexpr OUString PROP_ParaLineNumberCount = 
u"ParaLineNumberCount"_ustr
 inline constexpr OUString PROP_ParaLineNumberStartValue = 
u"ParaLineNumberStartValue"_ustr;
 inline constexpr OUString PROP_ParaLineSpacing = u"ParaLineSpacing"_ustr;
 inline constexpr OUString PROP_ParaOrphans = u"ParaOrphans"_ustr;
+inline constexpr OUString PROP_ParaWordSpacing = u"ParaWordSpacing"_ustr;
 inline constexpr OUString PROP_ParaRegisterModeActive = 
u"ParaRegisterModeActive"_ustr;
 inline constexpr OUString PROP_ParaRightMargin = u"ParaRightMargin"_ustr;
 inline constexpr OUString PROP_ParaRightMarginRelative = 
u"ParaRightMarginRelative"_ustr;
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index 16db497dcb1c..686865a3bc9c 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -2213,6 +2213,7 @@ namespace xmloff::token {
         TOKEN( "window-font-color",               XML_WINDOW_FONT_COLOR ),
         TOKEN( "word",                            XML_WORD ),
         TOKEN( "word-count",                      XML_WORD_COUNT ),
+        TOKEN( "word-spacing",                    XML_WORD_SPACING ),
         TOKEN( "wrap",                            XML_WRAP ),
         TOKEN( "wrap-contour",                    XML_WRAP_CONTOUR ),
         TOKEN( "wrap-contour-mode",               XML_WRAP_CONTOUR_MODE ),
diff --git a/xmloff/source/style/xmlexppr.cxx b/xmloff/source/style/xmlexppr.cxx
index 22b94995d683..543cd7381474 100644
--- a/xmloff/source/style/xmlexppr.cxx
+++ b/xmloff/source/style/xmlexppr.cxx
@@ -947,6 +947,12 @@ sal_Int8 CheckExtendedNamespace(std::u16string_view 
sXMLAttributeName, std::u16s
         || IsXMLToken(sXMLAttributeName, XML_HYPHENATION_ZONE_PAGE)
         || IsXMLToken(sXMLAttributeName, XML_HYPHENATION_ZONE_SPREAD))
         return IsXMLToken(sValue, XML_NO_LIMIT) ? -1 : 1;
+    else if (IsXMLToken(sXMLAttributeName, XML_WORD_SPACING))
+    {
+        static constexpr OUString s100PercentCompare( u"100%"_ustr );
+        size_t nBegin = sValue.find( s100PercentCompare );
+        return nBegin != std::u16string_view::npos ? -1 : 1;
+    }
     return 0;
 }
 }
diff --git a/xmloff/source/text/txtprmap.cxx b/xmloff/source/text/txtprmap.cxx
index f6b1a672326f..d04a037bb18d 100644
--- a/xmloff/source/text/txtprmap.cxx
+++ b/xmloff/source/text/txtprmap.cxx
@@ -482,6 +482,7 @@ XMLPropertyMapEntry constexpr aXMLParaPropMap[] =
     MAP_EXT( PROP_ParaFirstLineIndentUnit, XML_NAMESPACE_LO_EXT, 
XML_TEXT_INDENT, 
XML_TYPE_PROP_PARAGRAPH|XML_TYPE_UNIT_MEASURE|MID_FLAG_MULTI_PROPERTY, 0 ),
     MAP_EXT_I( PROP_ParaFirstLineIndent, XML_NAMESPACE_LO_EXT, 
XML_TEXT_INDENT, 
XML_TYPE_PROP_PARAGRAPH|XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, 
CTF_PARAFIRSTLINE ),
     MAP_EXT_I( PROP_ParaFirstLineIndentRelative, XML_NAMESPACE_LO_EXT, 
XML_TEXT_INDENT, XML_TYPE_PROP_PARAGRAPH|XML_TYPE_PERCENT, 
CTF_PARAFIRSTLINE_REL ),
+    MAP_EXT( PROP_ParaWordSpacing, XML_NAMESPACE_LO_EXT, XML_WORD_SPACING, 
XML_TYPE_PROP_PARAGRAPH|XML_TYPE_PERCENT16, 0 ),
 
     M_END()
 };
diff --git a/xmloff/source/token/tokens.txt b/xmloff/source/token/tokens.txt
index 4765c948f775..ad37fe87e600 100644
--- a/xmloff/source/token/tokens.txt
+++ b/xmloff/source/token/tokens.txt
@@ -2113,6 +2113,7 @@ width
 window-font-color
 word
 word-count
+word-spacing
 wrap
 wrap-contour
 wrap-contour-mode

Reply via email to