cui/source/inc/paragrph.hxx                     |    3 
 cui/source/tabpages/paragrph.cxx                |  230 +++++
 editeng/source/items/frmitems.cxx               |  953 ++++++++++++++++++++++++
 include/editeng/lrspitem.hxx                    |  256 ++++++
 sw/inc/format.hxx                               |    6 
 sw/inc/frmatr.hxx                               |   24 
 sw/inc/hintids.hxx                              |  185 ++--
 sw/inc/ndtxt.hxx                                |    7 
 sw/inc/swatrset.hxx                             |   12 
 sw/qa/extras/uiwriter/uiwriter2.cxx             |   12 
 sw/source/core/access/accpara.cxx               |    7 
 sw/source/core/attr/BorderCacheOwner.cxx        |    3 
 sw/source/core/bastyp/init.cxx                  |   12 
 sw/source/core/crsr/crstrvl.cxx                 |   13 
 sw/source/core/doc/DocumentStylePoolManager.cxx |  112 +-
 sw/source/core/doc/dbgoutsw.cxx                 |    6 
 sw/source/core/doc/docfmt.cxx                   |   14 
 sw/source/core/doc/docnum.cxx                   |   10 
 sw/source/core/doc/fmtcol.cxx                   |   90 +-
 sw/source/core/edit/autofmt.cxx                 |   38 
 sw/source/core/inc/frmtool.hxx                  |    4 
 sw/source/core/layout/fly.cxx                   |   11 
 sw/source/core/layout/frmtool.cxx               |   45 -
 sw/source/core/layout/wsfrm.cxx                 |    6 
 sw/source/core/text/EnhancedPDFExportHelper.cxx |    6 
 sw/source/core/text/frmcrsr.cxx                 |   10 
 sw/source/core/text/frmpaint.cxx                |   10 
 sw/source/core/text/itratr.cxx                  |   11 
 sw/source/core/text/itrcrsr.cxx                 |   13 
 sw/source/core/text/porfld.cxx                  |    2 
 sw/source/core/text/porrst.cxx                  |    4 
 sw/source/core/text/txtfrm.cxx                  |    2 
 sw/source/core/tox/ToxTabStopTokenHandler.cxx   |   18 
 sw/source/core/txtnode/ndtxt.cxx                |   37 
 sw/source/core/txtnode/thints.cxx               |    8 
 sw/source/core/unocore/unomapproperties.hxx     |   28 
 sw/source/core/unocore/unosrch.cxx              |   12 
 sw/source/filter/html/css1atr.cxx               |   70 +
 sw/source/filter/html/htmlatr.cxx               |   50 -
 sw/source/filter/html/htmlcss1.cxx              |   97 +-
 sw/source/filter/html/htmlctxt.cxx              |   62 +
 sw/source/filter/html/htmldrawreader.cxx        |   17 
 sw/source/filter/html/htmlflywriter.cxx         |    8 
 sw/source/filter/html/htmlform.cxx              |   17 
 sw/source/filter/html/htmlnumreader.cxx         |    4 
 sw/source/filter/html/htmlplug.cxx              |   17 
 sw/source/filter/html/svxcss1.cxx               |  105 --
 sw/source/filter/html/swhtml.cxx                |  125 ++-
 sw/source/filter/html/swhtml.hxx                |    4 
 sw/source/filter/html/wrthtml.cxx               |    2 
 sw/source/filter/ww8/attributeoutputbase.hxx    |    7 
 sw/source/filter/ww8/docxattributeoutput.cxx    |   94 +-
 sw/source/filter/ww8/docxattributeoutput.hxx    |    8 
 sw/source/filter/ww8/rtfattributeoutput.cxx     |   42 -
 sw/source/filter/ww8/rtfattributeoutput.hxx     |    7 
 sw/source/filter/ww8/wrtw8nds.cxx               |   47 -
 sw/source/filter/ww8/ww8atr.cxx                 |   81 +-
 sw/source/filter/ww8/ww8attributeoutput.hxx     |    7 
 sw/source/filter/ww8/ww8par.cxx                 |   90 +-
 sw/source/filter/ww8/ww8par.hxx                 |   11 
 sw/source/filter/ww8/ww8par2.cxx                |   10 
 sw/source/filter/ww8/ww8par3.cxx                |   73 +
 sw/source/filter/ww8/ww8par6.cxx                |   55 -
 sw/source/filter/xml/xmlexpit.cxx               |    5 
 sw/source/filter/xml/xmlimpit.cxx               |    8 
 sw/source/filter/xml/xmlitemm.cxx               |    1 
 sw/source/ui/envelp/envfmt.cxx                  |    5 
 sw/source/uibase/app/docstyle.cxx               |   21 
 sw/source/uibase/shells/textsh1.cxx             |   16 
 sw/source/uibase/shells/txtattr.cxx             |   13 
 sw/source/uibase/uiview/viewsrch.cxx            |    3 
 sw/source/uibase/uiview/viewtab.cxx             |   77 +
 sw/source/uibase/wrtsh/delete.cxx               |   22 
 73 files changed, 2814 insertions(+), 687 deletions(-)

New commits:
commit db115bec9254417ef7a3faf687478fe5424ab378
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Tue Feb 14 18:03:55 2023 +0100
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Fri Feb 24 07:32:23 2023 +0000

    tdf#78510 sw,cui: split SvxLRSpaceItem for SwTextNode, SwTextFormatColl
    
    Leave editengine and non-paragraph usages of SvxLRSpaceItem as-is for now.
    
    Add new items RES_MARGIN_LEFT etc., order them so that paragraphs can
    have 3 consecutive items RES_MARGIN_FIRSTLINE..RES_MARGIN_RIGHT and
    non-paragraphs also have 2-4 consecutive items
    RES_MARGIN_RIGHT..RES_MARGIN_LEFT (only the 3 paragraph ones are
    actually used now).
    
    The HTML import filter is particularly annoying because it parses CSS
    stuff into SfxItemSets without knowing where the items will be applied,
    so it can't know whether to create SvxLeftMarginItem or
    SvxTextLeftMarginItem... the split items are created in ParseCSS1_*
    functions and then converted later if necessary.
    
    WW8 import has some weird code as well, SwWW8ImplReader::Read_LR()
    creates 3 items and then something wants to set every item on its own
    so SwWW8FltControlStack::SetAttrInDoc() turned out rather weird.
    
    Convert the paragraph dialog to handle the split items (by mapping them
    to SID_ATTR_PARA_FIRSTLINESPACE/SID_ATTR_PARA_LEFTSPACE/
    SID_ATTR_PARA_RIGHTSPACE), but the SvxRuler looks a bit more confusing
    so convert in sw shells for now and leave that for later (also unclear if
    changing these slot items like SID_ATTR_PARA_LRSPACE breaks any ABIs?).
    
    Change-Id: I40431821868fd3e1cceba121b5539ff9ae6befbc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147024
    Tested-by: Michael Stahl <michael.st...@allotropia.de>
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/cui/source/inc/paragrph.hxx b/cui/source/inc/paragrph.hxx
index c44374776d79..c61e988d04f5 100644
--- a/cui/source/inc/paragrph.hxx
+++ b/cui/source/inc/paragrph.hxx
@@ -50,7 +50,8 @@ private:
 
     SvxParaPrevWindow m_aExampleWin;
 
-    // indention
+    // indentation
+    bool m_bSplitLRSpace = false; ///< which items to use?
     std::unique_ptr<SvxRelativeField> m_xLeftIndent;
 
     std::unique_ptr<SvxRelativeField> m_xRightIndent;
diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx
index ff6426b499aa..04a4ad8c82ea 100644
--- a/cui/source/tabpages/paragrph.cxx
+++ b/cui/source/tabpages/paragrph.cxx
@@ -54,6 +54,7 @@
 const WhichRangesContainer SvxStdParagraphTabPage::pStdRanges(
     svl::Items<
     SID_ATTR_PARA_LINESPACE, SID_ATTR_PARA_LINESPACE, // 10033
+    SID_ATTR_PARA_LEFTSPACE, SID_ATTR_PARA_FIRSTLINESPACE,
     SID_ATTR_LRSPACE, SID_ATTR_ULSPACE,              // 10048 - 10049
     SID_ATTR_PARA_REGISTER, SID_ATTR_PARA_REGISTER  // 10413
     >);
@@ -310,10 +311,126 @@ bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet* 
rOutSet )
     }
     bool bNullTab = false;
 
-    if ( m_xLeftIndent->get_value_changed_from_saved() ||
+    if (m_bSplitLRSpace && m_xLeftIndent->get_value_changed_from_saved())
+    {
+        nWhich = GetWhich(SID_ATTR_PARA_LEFTSPACE);
+        MapUnit const eUnit = pPool->GetMetric(nWhich);
+        SvxTextLeftMarginItem item(nWhich);
+        pOld = GetOldItem(*rOutSet, SID_ATTR_PARA_LEFTSPACE);
+
+        if (bRelativeMode)
+        {
+            assert(GetItemSet().GetParent());
+
+            const SvxTextLeftMarginItem & rOldItem(
+                static_cast<const 
SvxTextLeftMarginItem&>(GetItemSet().GetParent()->Get(nWhich)));
+
+            if (m_xLeftIndent->IsRelative())
+            {
+                item.SetTextLeft(rOldItem.GetTextLeft(),
+                    
static_cast<sal_uInt16>(m_xLeftIndent->get_value(FieldUnit::NONE)));
+            }
+            else
+            {
+                item.SetTextLeft(m_xLeftIndent->GetCoreValue(eUnit));
+            }
+        }
+        else
+        {
+            item.SetTextLeft(m_xLeftIndent->GetCoreValue(eUnit));
+        }
+        if (!pOld || *static_cast<const SvxTextLeftMarginItem*>(pOld) != item
+            || SfxItemState::DONTCARE == GetItemSet().GetItemState(nWhich))
+        {
+            rOutSet->Put(item);
+            bModified = true;
+        }
+    }
+
+    if (m_bSplitLRSpace && m_xRightIndent->get_value_changed_from_saved())
+    {
+        nWhich = GetWhich(SID_ATTR_PARA_RIGHTSPACE);
+        MapUnit const eUnit = pPool->GetMetric(nWhich);
+        SvxRightMarginItem item(nWhich);
+        pOld = GetOldItem(*rOutSet, SID_ATTR_PARA_RIGHTSPACE);
+
+        if (bRelativeMode)
+        {
+            assert(GetItemSet().GetParent());
+
+            const SvxRightMarginItem & rOldItem(
+                static_cast<const 
SvxRightMarginItem&>(GetItemSet().GetParent()->Get(nWhich)));
+
+            if (m_xRightIndent->IsRelative())
+            {
+                item.SetRight(rOldItem.GetRight(),
+                    
static_cast<sal_uInt16>(m_xRightIndent->get_value(FieldUnit::NONE)));
+            }
+            else
+            {
+                item.SetRight(m_xRightIndent->GetCoreValue(eUnit));
+            }
+        }
+        else
+        {
+            item.SetRight(m_xRightIndent->GetCoreValue(eUnit));
+        }
+        if (!pOld || *static_cast<const SvxRightMarginItem*>(pOld) != item
+            || SfxItemState::DONTCARE == GetItemSet().GetItemState(nWhich))
+        {
+            rOutSet->Put(item);
+            bModified = true;
+        }
+    }
+
+    if (m_bSplitLRSpace && (m_xFLineIndent->get_value_changed_from_saved()
+                            || m_xAutoCB->get_state_changed_from_saved()))
+    {
+        nWhich = GetWhich(SID_ATTR_PARA_FIRSTLINESPACE);
+        MapUnit const eUnit = pPool->GetMetric(nWhich);
+        SvxFirstLineIndentItem item(nWhich);
+        pOld = GetOldItem(*rOutSet, SID_ATTR_PARA_FIRSTLINESPACE);
+
+        if (bRelativeMode)
+        {
+            assert(GetItemSet().GetParent());
+
+            const SvxFirstLineIndentItem & rOldItem(
+                static_cast<const 
SvxFirstLineIndentItem&>(GetItemSet().GetParent()->Get(nWhich)));
+
+            if (m_xFLineIndent->IsRelative())
+            {
+                item.SetTextFirstLineOffset(rOldItem.GetTextFirstLineOffset(),
+                    
static_cast<sal_uInt16>(m_xFLineIndent->get_value(FieldUnit::NONE)));
+            }
+            else
+            {
+                
item.SetTextFirstLineOffset(static_cast<sal_uInt16>(m_xFLineIndent->GetCoreValue(eUnit)));
+            }
+        }
+        else
+        {
+            
item.SetTextFirstLineOffset(static_cast<sal_uInt16>(m_xFLineIndent->GetCoreValue(eUnit)));
+        }
+        item.SetAutoFirst(m_xAutoCB->get_active());
+        if (item.GetTextFirstLineOffset() < 0)
+        {
+            bNullTab = true;
+        }
+
+        if (!pOld || *static_cast<const SvxFirstLineIndentItem*>(pOld) != item
+            || SfxItemState::DONTCARE == GetItemSet().GetItemState(nWhich))
+        {
+            rOutSet->Put(item);
+            bModified = true;
+        }
+    }
+
+    if (!m_bSplitLRSpace &&
+        (m_xLeftIndent->get_value_changed_from_saved() ||
          m_xFLineIndent->get_value_changed_from_saved() ||
          m_xRightIndent->get_value_changed_from_saved() ||
-         m_xAutoCB->get_state_changed_from_saved() )
+         m_xAutoCB->get_state_changed_from_saved()))
     {
         nWhich = GetWhich( SID_ATTR_LRSPACE );
         MapUnit eUnit = pPool->GetMetric( nWhich );
@@ -436,10 +553,115 @@ void SvxStdParagraphTabPage::Reset( const SfxItemSet* 
rSet )
         SetFieldUnit(*m_xLineDistAtMetricBox, eFUnit);
     }
 
+    sal_uInt16 const nWhichFL(GetWhich(SID_ATTR_PARA_FIRSTLINESPACE));
+    m_bSplitLRSpace = (nWhichFL != SID_ATTR_PARA_FIRSTLINESPACE);
+    SfxItemState const eItemStateFL(rSet->GetItemState(nWhichFL));
+    sal_uInt16 const nWhichLM(GetWhich(SID_ATTR_PARA_LEFTSPACE));
+    SfxItemState const eItemStateLM(rSet->GetItemState(nWhichLM));
+    sal_uInt16 const nWhichRM(GetWhich(SID_ATTR_PARA_RIGHTSPACE));
+    SfxItemState const eItemStateRM(rSet->GetItemState(nWhichRM));
+
+    if (m_bSplitLRSpace && SfxItemState::DEFAULT <= eItemStateLM)
+    {
+        const SvxTextLeftMarginItem & rOldLeftMargin(
+            static_cast<const SvxTextLeftMarginItem &>(rSet->Get(nWhichLM)));
+
+        MapUnit const eUnit = pPool->GetMetric(nWhichLM);
+
+        if (bRelativeMode)
+        {
+            if (rOldLeftMargin.GetPropLeft() != 100)
+            {
+                m_xLeftIndent->SetRelative( true );
+                m_xLeftIndent->set_value(rOldLeftMargin.GetPropLeft(), 
FieldUnit::NONE);
+            }
+            else
+            {
+                m_xLeftIndent->SetRelative(false);
+                m_xLeftIndent->SetFieldUnit(eFUnit);
+                m_xLeftIndent->SetMetricValue(rOldLeftMargin.GetTextLeft(), 
eUnit);
+            }
+        }
+        else
+        {
+            m_xLeftIndent->SetMetricValue(rOldLeftMargin.GetTextLeft(), eUnit);
+        }
+    }
+    else if (m_bSplitLRSpace)
+    {
+        m_xLeftIndent->set_text(OUString());
+    }
+
+    if (m_bSplitLRSpace && SfxItemState::DEFAULT <= eItemStateRM)
+    {
+        const SvxRightMarginItem & rOldRightMargin(
+            static_cast<const SvxRightMarginItem &>(rSet->Get(nWhichRM)));
+
+        MapUnit const eUnit = pPool->GetMetric(nWhichRM);
+
+        if (bRelativeMode)
+        {
+            if (rOldRightMargin.GetPropRight() != 100)
+            {
+                m_xRightIndent->SetRelative( true );
+                m_xRightIndent->set_value(rOldRightMargin.GetPropRight(), 
FieldUnit::NONE);
+            }
+            else
+            {
+                m_xRightIndent->SetRelative(false);
+                m_xRightIndent->SetFieldUnit(eFUnit);
+                m_xRightIndent->SetMetricValue(rOldRightMargin.GetRight(), 
eUnit);
+            }
+        }
+        else
+        {
+            m_xRightIndent->SetMetricValue(rOldRightMargin.GetRight(), eUnit);
+        }
+    }
+    else if (m_bSplitLRSpace)
+    {
+        m_xRightIndent->set_text(OUString());
+    }
+
+    if (m_bSplitLRSpace && SfxItemState::DEFAULT <= eItemStateFL)
+    {
+        const SvxFirstLineIndentItem & rOldFirstLine(
+            static_cast<const SvxFirstLineIndentItem &>(rSet->Get(nWhichFL)));
+
+        MapUnit const eUnit = pPool->GetMetric(nWhichFL);
+
+        if (bRelativeMode)
+        {
+            if (rOldFirstLine.GetPropTextFirstLineOffset() != 100)
+            {
+                m_xFLineIndent->SetRelative(true);
+                
m_xFLineIndent->set_value(rOldFirstLine.GetPropTextFirstLineOffset(), 
FieldUnit::NONE);
+            }
+            else
+            {
+                m_xFLineIndent->SetRelative(false);
+                m_xFLineIndent->set_min(-9999, FieldUnit::NONE);
+                m_xFLineIndent->SetFieldUnit(eFUnit);
+                
m_xFLineIndent->SetMetricValue(rOldFirstLine.GetTextFirstLineOffset(), eUnit);
+            }
+            m_xAutoCB->set_active(rOldFirstLine.IsAutoFirst());
+        }
+        else
+        {
+            
m_xFLineIndent->SetMetricValue(rOldFirstLine.GetTextFirstLineOffset(), eUnit);
+            m_xAutoCB->set_active(rOldFirstLine.IsAutoFirst());
+        }
+        AutoHdl_Impl(*m_xAutoCB);
+    }
+    else if (m_bSplitLRSpace)
+    {
+        m_xFLineIndent->set_text(OUString());
+    }
+
     sal_uInt16 _nWhich = GetWhich( SID_ATTR_LRSPACE );
     SfxItemState eItemState = rSet->GetItemState( _nWhich );
 
-    if ( eItemState >= SfxItemState::DEFAULT )
+    if (!m_bSplitLRSpace && SfxItemState::DEFAULT <= eItemState)
     {
         MapUnit eUnit = pPool->GetMetric( _nWhich );
 
@@ -498,7 +720,7 @@ void SvxStdParagraphTabPage::Reset( const SfxItemSet* rSet )
         }
         AutoHdl_Impl(*m_xAutoCB);
     }
-    else
+    else if (!m_bSplitLRSpace)
     {
         m_xLeftIndent->set_text(OUString());
         m_xRightIndent->set_text(OUString());
diff --git a/sw/inc/format.hxx b/sw/inc/format.hxx
index c5b599d36d31..9313b863dfbb 100644
--- a/sw/inc/format.hxx
+++ b/sw/inc/format.hxx
@@ -212,6 +212,12 @@ public:
     inline const SwFormatAnchor          &GetAnchor( bool = true ) const;
     inline const SwFormatCol                 &GetCol( bool = true ) const;
     inline const SvxPaperBinItem      &GetPaperBin( bool = true ) const;
+    inline const SvxLeftMarginItem &    GetLeftMargin(bool = true) const;
+    inline const SvxTextLeftMarginItem &GetTextLeftMargin(bool = true) const;
+    inline const SvxFirstLineIndentItem &GetFirstLineIndent(bool = true) const;
+    inline const SvxRightMarginItem &   GetRightMargin(bool = true) const;
+    inline const SvxGutterLeftMarginItem &GetGutterLeftMargin(bool = true) 
const;
+    inline const SvxGutterRightMarginItem &GetGutterRightMargin(bool = true) 
const;
     inline const SvxLRSpaceItem           &GetLRSpace( bool = true ) const;
     inline const SvxULSpaceItem           &GetULSpace( bool = true ) const;
     inline const SwFormatContent           &GetContent( bool = true ) const;
diff --git a/sw/inc/frmatr.hxx b/sw/inc/frmatr.hxx
index 51dda4f4a5d0..10dd955ceeb7 100644
--- a/sw/inc/frmatr.hxx
+++ b/sw/inc/frmatr.hxx
@@ -41,6 +41,18 @@
 // Implementation of FrameAttribute methods of SwAttrSet.
 inline const SvxPaperBinItem &SwAttrSet::GetPaperBin(bool bInP) const
     { return Get( RES_PAPER_BIN,bInP); }
+inline const SvxLeftMarginItem& SwAttrSet::GetLeftMargin(bool const bInP) const
+    { return Get(RES_MARGIN_LEFT, bInP); }
+inline const SvxTextLeftMarginItem& SwAttrSet::GetTextLeftMargin(bool const 
bInP) const
+    { return Get(RES_MARGIN_TEXTLEFT, bInP); }
+inline const SvxFirstLineIndentItem& SwAttrSet::GetFirstLineIndent(bool const 
bInP) const
+    { return Get(RES_MARGIN_FIRSTLINE, bInP); }
+inline const SvxRightMarginItem& SwAttrSet::GetRightMargin(bool const bInP) 
const
+    { return Get(RES_MARGIN_RIGHT, bInP); }
+inline const SvxGutterLeftMarginItem& SwAttrSet::GetGutterLeftMargin(bool 
const bInP) const
+    { return Get(RES_MARGIN_GUTTER, bInP); }
+inline const SvxGutterRightMarginItem& SwAttrSet::GetGutterRightMargin(bool 
const bInP) const
+    { return Get(RES_MARGIN_GUTTER_RIGHT, bInP); }
 inline const SvxLRSpaceItem &SwAttrSet::GetLRSpace(bool bInP) const
     { return Get( RES_LR_SPACE,bInP); }
 inline const SvxULSpaceItem &SwAttrSet::GetULSpace(bool bInP) const
@@ -71,6 +83,18 @@ inline const SdrTextVertAdjustItem 
&SwAttrSet::GetTextVertAdjust(bool bInP) cons
 // Implementation of FrameAttribute methods of SwFormat.
 inline const SvxPaperBinItem &SwFormat::GetPaperBin(bool bInP) const
     { return m_aSet.GetPaperBin(bInP); }
+inline const SvxLeftMarginItem& SwFormat::GetLeftMargin(bool bInP) const
+    { return m_aSet.GetLeftMargin(bInP); }
+inline const SvxTextLeftMarginItem& SwFormat::GetTextLeftMargin(bool const 
bInP) const
+    { return m_aSet.GetTextLeftMargin(bInP); }
+inline const SvxFirstLineIndentItem& SwFormat::GetFirstLineIndent(bool const 
bInP) const
+    { return m_aSet.GetFirstLineIndent(bInP); }
+inline const SvxRightMarginItem& SwFormat::GetRightMargin(bool const bInP) 
const
+    { return m_aSet.GetRightMargin(bInP); }
+inline const SvxGutterLeftMarginItem& SwFormat::GetGutterLeftMargin(bool const 
bInP) const
+    { return m_aSet.GetGutterLeftMargin(bInP); }
+inline const SvxGutterRightMarginItem& SwFormat::GetGutterRightMargin(bool 
const bInP) const
+    { return m_aSet.GetGutterRightMargin(bInP); }
 inline const SvxLRSpaceItem &SwFormat::GetLRSpace(bool bInP) const
     { return m_aSet.GetLRSpace(bInP); }
 inline const SvxULSpaceItem &SwFormat::GetULSpace(bool bInP) const
diff --git a/sw/inc/hintids.hxx b/sw/inc/hintids.hxx
index 05ee37676181..4be4a5182585 100644
--- a/sw/inc/hintids.hxx
+++ b/sw/inc/hintids.hxx
@@ -39,6 +39,12 @@ class SwMsgPoolItem;
 class SwPtrMsgPoolItem;
 class SfxBoolItem;
 class SvxColorItem;
+class SvxLeftMarginItem;
+class SvxTextLeftMarginItem;
+class SvxFirstLineIndentItem;
+class SvxRightMarginItem;
+class SvxGutterLeftMarginItem;
+class SvxGutterRightMarginItem;
 class SvxLRSpaceItem;
 class SdrTextVertAdjustItem;
 class SfxGrabBagItem;
@@ -326,108 +332,113 @@ constexpr sal_uInt16 
RES_FRMATR_BEGIN(RES_PARATR_LIST_END);
 constexpr TypedWhichId<SwFormatFillOrder> RES_FILL_ORDER(RES_FRMATR_BEGIN);
 constexpr TypedWhichId<SwFormatFrameSize> RES_FRM_SIZE(89);
 constexpr TypedWhichId<SvxPaperBinItem> RES_PAPER_BIN(90);
-constexpr TypedWhichId<SvxLRSpaceItem> RES_LR_SPACE(91);
-constexpr TypedWhichId<SvxULSpaceItem> RES_UL_SPACE(92);
-constexpr TypedWhichId<SwFormatPageDesc> RES_PAGEDESC(93);
-constexpr TypedWhichId<SvxFormatBreakItem> RES_BREAK(94);
-constexpr TypedWhichId<SwFormatContent> RES_CNTNT(95);
-constexpr TypedWhichId<SwFormatHeader> RES_HEADER(96);
-constexpr TypedWhichId<SwFormatFooter> RES_FOOTER(97);
-constexpr TypedWhichId<SvxPrintItem> RES_PRINT(98);
-constexpr TypedWhichId<SvxOpaqueItem> RES_OPAQUE(99);
-constexpr TypedWhichId<SvxProtectItem> RES_PROTECT(100);
-constexpr TypedWhichId<SwFormatSurround> RES_SURROUND(101);
-constexpr TypedWhichId<SwFormatVertOrient> RES_VERT_ORIENT(102);
-constexpr TypedWhichId<SwFormatHoriOrient> RES_HORI_ORIENT(103);
-constexpr TypedWhichId<SwFormatAnchor> RES_ANCHOR(104);
-constexpr TypedWhichId<SvxBrushItem> RES_BACKGROUND(105);
-constexpr TypedWhichId<SvxBoxItem> RES_BOX(106);
-constexpr TypedWhichId<SvxShadowItem> RES_SHADOW(107);
-constexpr TypedWhichId<SvxMacroItem> RES_FRMMACRO(108);
-constexpr TypedWhichId<SwFormatCol> RES_COL(109);
-constexpr TypedWhichId<SvxFormatKeepItem> RES_KEEP(110);
-constexpr TypedWhichId<SwFormatURL> RES_URL(111);
-constexpr TypedWhichId<SwFormatEditInReadonly> RES_EDIT_IN_READONLY(112);
-constexpr TypedWhichId<SwFormatLayoutSplit> RES_LAYOUT_SPLIT(113);
-constexpr TypedWhichId<SwFormatChain> RES_CHAIN(114);
-constexpr TypedWhichId<SwTextGridItem> RES_TEXTGRID(115);
-constexpr TypedWhichId<SwFormatLineNumber> RES_LINENUMBER(116);
-constexpr TypedWhichId<SwFormatFootnoteAtTextEnd> RES_FTN_AT_TXTEND(117);
-constexpr TypedWhichId<SwFormatEndAtTextEnd> RES_END_AT_TXTEND(118);
-constexpr TypedWhichId<SwFormatNoBalancedColumns> RES_COLUMNBALANCE(119);
-constexpr TypedWhichId<SvxFrameDirectionItem> RES_FRAMEDIR(120);
-constexpr TypedWhichId<SwHeaderAndFooterEatSpacingItem> 
RES_HEADER_FOOTER_EAT_SPACING(121);
-constexpr TypedWhichId<SwFormatRowSplit> RES_ROW_SPLIT(122);
-constexpr TypedWhichId<SwFormatFlySplit> RES_FLY_SPLIT(123);
-constexpr TypedWhichId<SwFormatFollowTextFlow> RES_FOLLOW_TEXT_FLOW(124);
-constexpr TypedWhichId<SfxBoolItem> RES_COLLAPSING_BORDERS(125);
-constexpr TypedWhichId<SwFormatWrapInfluenceOnObjPos> 
RES_WRAP_INFLUENCE_ON_OBJPOS(126);
-constexpr TypedWhichId<SwFormatAutoFormat> RES_AUTO_STYLE(127);
-constexpr TypedWhichId<SfxStringItem> RES_FRMATR_STYLE_NAME(128);
-constexpr TypedWhichId<SfxStringItem> RES_FRMATR_CONDITIONAL_STYLE_NAME(129);
-constexpr TypedWhichId<SfxGrabBagItem> RES_FRMATR_GRABBAG(130);
-constexpr TypedWhichId<SdrTextVertAdjustItem> RES_TEXT_VERT_ADJUST(131);
-constexpr TypedWhichId<SfxBoolItem> RES_BACKGROUND_FULL_SIZE(132);
-constexpr TypedWhichId<SfxBoolItem> RES_RTL_GUTTER(133);
-constexpr TypedWhichId<SfxBoolItem> RES_DECORATIVE(134);
-constexpr sal_uInt16 RES_FRMATR_END(135);
+constexpr TypedWhichId<SvxFirstLineIndentItem> RES_MARGIN_FIRSTLINE(91);
+constexpr TypedWhichId<SvxTextLeftMarginItem> RES_MARGIN_TEXTLEFT(92);
+constexpr TypedWhichId<SvxRightMarginItem> RES_MARGIN_RIGHT(93);
+constexpr TypedWhichId<SvxLeftMarginItem> RES_MARGIN_LEFT(94);
+constexpr TypedWhichId<SvxGutterLeftMarginItem> RES_MARGIN_GUTTER(95);
+constexpr TypedWhichId<SvxGutterRightMarginItem> RES_MARGIN_GUTTER_RIGHT(96);
+constexpr TypedWhichId<SvxLRSpaceItem> RES_LR_SPACE(97);
+constexpr TypedWhichId<SvxULSpaceItem> RES_UL_SPACE(98);
+constexpr TypedWhichId<SwFormatPageDesc> RES_PAGEDESC(99);
+constexpr TypedWhichId<SvxFormatBreakItem> RES_BREAK(100);
+constexpr TypedWhichId<SwFormatContent> RES_CNTNT(101);
+constexpr TypedWhichId<SwFormatHeader> RES_HEADER(102);
+constexpr TypedWhichId<SwFormatFooter> RES_FOOTER(103);
+constexpr TypedWhichId<SvxPrintItem> RES_PRINT(104);
+constexpr TypedWhichId<SvxOpaqueItem> RES_OPAQUE(105);
+constexpr TypedWhichId<SvxProtectItem> RES_PROTECT(106);
+constexpr TypedWhichId<SwFormatSurround> RES_SURROUND(107);
+constexpr TypedWhichId<SwFormatVertOrient> RES_VERT_ORIENT(108);
+constexpr TypedWhichId<SwFormatHoriOrient> RES_HORI_ORIENT(109);
+constexpr TypedWhichId<SwFormatAnchor> RES_ANCHOR(110);
+constexpr TypedWhichId<SvxBrushItem> RES_BACKGROUND(111);
+constexpr TypedWhichId<SvxBoxItem> RES_BOX(112);
+constexpr TypedWhichId<SvxShadowItem> RES_SHADOW(113);
+constexpr TypedWhichId<SvxMacroItem> RES_FRMMACRO(114);
+constexpr TypedWhichId<SwFormatCol> RES_COL(115);
+constexpr TypedWhichId<SvxFormatKeepItem> RES_KEEP(116);
+constexpr TypedWhichId<SwFormatURL> RES_URL(117);
+constexpr TypedWhichId<SwFormatEditInReadonly> RES_EDIT_IN_READONLY(118);
+constexpr TypedWhichId<SwFormatLayoutSplit> RES_LAYOUT_SPLIT(119);
+constexpr TypedWhichId<SwFormatChain> RES_CHAIN(120);
+constexpr TypedWhichId<SwTextGridItem> RES_TEXTGRID(121);
+constexpr TypedWhichId<SwFormatLineNumber> RES_LINENUMBER(122);
+constexpr TypedWhichId<SwFormatFootnoteAtTextEnd> RES_FTN_AT_TXTEND(123);
+constexpr TypedWhichId<SwFormatEndAtTextEnd> RES_END_AT_TXTEND(124);
+constexpr TypedWhichId<SwFormatNoBalancedColumns> RES_COLUMNBALANCE(125);
+constexpr TypedWhichId<SvxFrameDirectionItem> RES_FRAMEDIR(126);
+constexpr TypedWhichId<SwHeaderAndFooterEatSpacingItem> 
RES_HEADER_FOOTER_EAT_SPACING(127);
+constexpr TypedWhichId<SwFormatRowSplit> RES_ROW_SPLIT(128);
+constexpr TypedWhichId<SwFormatFlySplit> RES_FLY_SPLIT(129);
+constexpr TypedWhichId<SwFormatFollowTextFlow> RES_FOLLOW_TEXT_FLOW(130);
+constexpr TypedWhichId<SfxBoolItem> RES_COLLAPSING_BORDERS(131);
+constexpr TypedWhichId<SwFormatWrapInfluenceOnObjPos> 
RES_WRAP_INFLUENCE_ON_OBJPOS(132);
+constexpr TypedWhichId<SwFormatAutoFormat> RES_AUTO_STYLE(133);
+constexpr TypedWhichId<SfxStringItem> RES_FRMATR_STYLE_NAME(134);
+constexpr TypedWhichId<SfxStringItem> RES_FRMATR_CONDITIONAL_STYLE_NAME(135);
+constexpr TypedWhichId<SfxGrabBagItem> RES_FRMATR_GRABBAG(136);
+constexpr TypedWhichId<SdrTextVertAdjustItem> RES_TEXT_VERT_ADJUST(137);
+constexpr TypedWhichId<SfxBoolItem> RES_BACKGROUND_FULL_SIZE(138);
+constexpr TypedWhichId<SfxBoolItem> RES_RTL_GUTTER(139);
+constexpr TypedWhichId<SfxBoolItem> RES_DECORATIVE(140);
+constexpr sal_uInt16 RES_FRMATR_END(141);
 
 constexpr sal_uInt16 RES_GRFATR_BEGIN(RES_FRMATR_END);
 constexpr TypedWhichId<SwMirrorGrf> RES_GRFATR_MIRRORGRF(RES_GRFATR_BEGIN);
-constexpr TypedWhichId<SwCropGrf> RES_GRFATR_CROPGRF(136);
-
-constexpr TypedWhichId<SwRotationGrf> RES_GRFATR_ROTATION(137);
-constexpr TypedWhichId<SwLuminanceGrf> RES_GRFATR_LUMINANCE(138);
-constexpr TypedWhichId<SwContrastGrf> RES_GRFATR_CONTRAST(139);
-constexpr TypedWhichId<SwChannelRGrf> RES_GRFATR_CHANNELR(140);
-constexpr TypedWhichId<SwChannelGGrf> RES_GRFATR_CHANNELG(141);
-constexpr TypedWhichId<SwChannelBGrf> RES_GRFATR_CHANNELB(142);
-constexpr TypedWhichId<SwGammaGrf> RES_GRFATR_GAMMA(143);
-constexpr TypedWhichId<SwInvertGrf> RES_GRFATR_INVERT(144);
-constexpr TypedWhichId<SwTransparencyGrf> RES_GRFATR_TRANSPARENCY(145);
-constexpr TypedWhichId<SwDrawModeGrf> RES_GRFATR_DRAWMODE(146);
-
-constexpr TypedWhichId<SfxBoolItem> RES_GRFATR_DUMMY3(147);
-constexpr TypedWhichId<SfxBoolItem> RES_GRFATR_DUMMY4(148);
-constexpr TypedWhichId<SfxBoolItem> RES_GRFATR_DUMMY5(149);
-constexpr sal_uInt16 RES_GRFATR_END(150);
+constexpr TypedWhichId<SwCropGrf> RES_GRFATR_CROPGRF(142);
+
+constexpr TypedWhichId<SwRotationGrf> RES_GRFATR_ROTATION(143);
+constexpr TypedWhichId<SwLuminanceGrf> RES_GRFATR_LUMINANCE(144);
+constexpr TypedWhichId<SwContrastGrf> RES_GRFATR_CONTRAST(145);
+constexpr TypedWhichId<SwChannelRGrf> RES_GRFATR_CHANNELR(146);
+constexpr TypedWhichId<SwChannelGGrf> RES_GRFATR_CHANNELG(147);
+constexpr TypedWhichId<SwChannelBGrf> RES_GRFATR_CHANNELB(148);
+constexpr TypedWhichId<SwGammaGrf> RES_GRFATR_GAMMA(149);
+constexpr TypedWhichId<SwInvertGrf> RES_GRFATR_INVERT(150);
+constexpr TypedWhichId<SwTransparencyGrf> RES_GRFATR_TRANSPARENCY(151);
+constexpr TypedWhichId<SwDrawModeGrf> RES_GRFATR_DRAWMODE(152);
+
+constexpr TypedWhichId<SfxBoolItem> RES_GRFATR_DUMMY3(153);
+constexpr TypedWhichId<SfxBoolItem> RES_GRFATR_DUMMY4(154);
+constexpr TypedWhichId<SfxBoolItem> RES_GRFATR_DUMMY5(155);
+constexpr sal_uInt16 RES_GRFATR_END(156);
 
 constexpr sal_uInt16 RES_BOXATR_BEGIN(RES_GRFATR_END);
-constexpr TypedWhichId<SwTableBoxNumFormat> 
RES_BOXATR_FORMAT(RES_BOXATR_BEGIN); // 150
-constexpr TypedWhichId<SwTableBoxFormula> RES_BOXATR_FORMULA(151);
-constexpr TypedWhichId<SwTableBoxValue> RES_BOXATR_VALUE(152);
-constexpr sal_uInt16 RES_BOXATR_END(153);
+constexpr TypedWhichId<SwTableBoxNumFormat> 
RES_BOXATR_FORMAT(RES_BOXATR_BEGIN);
+constexpr TypedWhichId<SwTableBoxFormula> RES_BOXATR_FORMULA(157);
+constexpr TypedWhichId<SwTableBoxValue> RES_BOXATR_VALUE(158);
+constexpr sal_uInt16 RES_BOXATR_END(159);
 
 constexpr sal_uInt16 RES_UNKNOWNATR_BEGIN(RES_BOXATR_END);
-constexpr TypedWhichId<SvXMLAttrContainerItem>
-    RES_UNKNOWNATR_CONTAINER(RES_UNKNOWNATR_BEGIN); // 153
-constexpr sal_uInt16 RES_UNKNOWNATR_END(154);
+constexpr TypedWhichId<SvXMLAttrContainerItem> 
RES_UNKNOWNATR_CONTAINER(RES_UNKNOWNATR_BEGIN);
+constexpr sal_uInt16 RES_UNKNOWNATR_END(160);
 
 constexpr sal_uInt16 POOLATTR_END(RES_UNKNOWNATR_END);
 
 // Format IDs
 constexpr sal_uInt16 RES_FMT_BEGIN(RES_UNKNOWNATR_END);
-constexpr TypedWhichId<SwCharFormat> RES_CHRFMT(RES_FMT_BEGIN); // 154
-constexpr TypedWhichId<SwFrameFormat> RES_FRMFMT(155);
-constexpr TypedWhichId<SwFlyFrameFormat> RES_FLYFRMFMT(156);
-constexpr TypedWhichId<SwTextFormatColl> RES_TXTFMTCOLL(157);
-constexpr TypedWhichId<SwGrfFormatColl> RES_GRFFMTCOLL(158);
-constexpr TypedWhichId<SwDrawFrameFormat> RES_DRAWFRMFMT(159);
-constexpr TypedWhichId<SwConditionTextFormatColl> RES_CONDTXTFMTCOLL(160);
-constexpr sal_uInt16 RES_FMT_END(161);
+constexpr TypedWhichId<SwCharFormat> RES_CHRFMT(RES_FMT_BEGIN);
+constexpr TypedWhichId<SwFrameFormat> RES_FRMFMT(161);
+constexpr TypedWhichId<SwFlyFrameFormat> RES_FLYFRMFMT(162);
+constexpr TypedWhichId<SwTextFormatColl> RES_TXTFMTCOLL(163);
+constexpr TypedWhichId<SwGrfFormatColl> RES_GRFFMTCOLL(164);
+constexpr TypedWhichId<SwDrawFrameFormat> RES_DRAWFRMFMT(165);
+constexpr TypedWhichId<SwConditionTextFormatColl> RES_CONDTXTFMTCOLL(166);
+constexpr sal_uInt16 RES_FMT_END(167);
 
 // ID's for Messages in the Formats
 constexpr sal_uInt16 RES_FORMAT_MSG_BEGIN(RES_FMT_END);
-constexpr TypedWhichId<SwPtrMsgPoolItem> 
RES_OBJECTDYING(RES_FORMAT_MSG_BEGIN); // 161
-constexpr TypedWhichId<SwFormatChg> RES_FMT_CHG(162);
-constexpr TypedWhichId<SwAttrSetChg> RES_ATTRSET_CHG(163);
-constexpr TypedWhichId<SwUpdateAttr> RES_UPDATE_ATTR(167);
-constexpr TypedWhichId<SwPtrMsgPoolItem> RES_REFMARKFLD_UPDATE(168);
-constexpr TypedWhichId<SwDocPosUpdate> RES_DOCPOS_UPDATE(169);
-constexpr TypedWhichId<SwTableFormulaUpdate> RES_TABLEFML_UPDATE(170);
-constexpr TypedWhichId<SwMsgPoolItem> RES_UPDATEDDETBL(171);
-constexpr TypedWhichId<SwMsgPoolItem> RES_TBLHEADLINECHG(172);
-constexpr TypedWhichId<SwAutoFormatGetDocNode> RES_AUTOFMT_DOCNODE(173);
+constexpr TypedWhichId<SwPtrMsgPoolItem> 
RES_OBJECTDYING(RES_FORMAT_MSG_BEGIN); // 167
+constexpr TypedWhichId<SwFormatChg> RES_FMT_CHG(168);
+constexpr TypedWhichId<SwAttrSetChg> RES_ATTRSET_CHG(169);
+constexpr TypedWhichId<SwUpdateAttr> RES_UPDATE_ATTR(170);
+constexpr TypedWhichId<SwPtrMsgPoolItem> RES_REFMARKFLD_UPDATE(171);
+constexpr TypedWhichId<SwDocPosUpdate> RES_DOCPOS_UPDATE(172);
+constexpr TypedWhichId<SwTableFormulaUpdate> RES_TABLEFML_UPDATE(173);
+constexpr TypedWhichId<SwMsgPoolItem> RES_UPDATEDDETBL(174);
+constexpr TypedWhichId<SwMsgPoolItem> RES_TBLHEADLINECHG(175);
+constexpr TypedWhichId<SwAutoFormatGetDocNode> RES_AUTOFMT_DOCNODE(176);
 constexpr TypedWhichId<SwMsgPoolItem> RES_HIDDENPARA_PRINT(178);
 constexpr TypedWhichId<SwVirtPageNumInfo> RES_VIRTPAGENUM_INFO(180);
 constexpr TypedWhichId<SwPtrMsgPoolItem> RES_REMOVE_UNO_OBJECT(181);
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index f28f2faf1e02..0ea123233d69 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -41,7 +41,8 @@
 class SfxHint;
 class SwNumRule;
 class SwNodeNum;
-class SvxLRSpaceItem;
+class SvxFirstLineIndentItem;
+class SvxTextLeftMarginItem;
 class SwXParagraph;
 
 namespace utl {
@@ -535,7 +536,9 @@ public:
 
     SwTwips GetAdditionalIndentForStartingNewList() const;
 
-    void ClearLRSpaceItemDueToListLevelIndents( 
std::shared_ptr<SvxLRSpaceItem>& o_rLRSpaceItem ) const;
+    void ClearLRSpaceItemDueToListLevelIndents(
+        std::unique_ptr<SvxFirstLineIndentItem>& o_rFirstLineItem,
+        std::unique_ptr<SvxTextLeftMarginItem>& o_rTextLeftMarginItem) const;
 
     /** return left margin for tab stop position calculation
 
diff --git a/sw/inc/swatrset.hxx b/sw/inc/swatrset.hxx
index 6fd2662186d8..96a7cc833e55 100644
--- a/sw/inc/swatrset.hxx
+++ b/sw/inc/swatrset.hxx
@@ -56,6 +56,12 @@ class SvxCharHiddenItem;
 class SwFormatFillOrder;
 class SwFormatFrameSize;
 class SvxPaperBinItem;
+class SvxLeftMarginItem;
+class SvxTextLeftMarginItem;
+class SvxFirstLineIndentItem;
+class SvxRightMarginItem;
+class SvxGutterLeftMarginItem;
+class SvxGutterRightMarginItem;
 class SvxLRSpaceItem;
 class SvxULSpaceItem;
 class SwFormatContent;
@@ -239,6 +245,12 @@ public:
     inline const SwFormatFillOrder       &GetFillOrder( bool = true ) const;
     inline const SwFormatFrameSize             &GetFrameSize( bool = true ) 
const;
     inline const SvxPaperBinItem      &GetPaperBin( bool = true ) const;
+    inline const SvxLeftMarginItem &    GetLeftMargin(bool = true) const;
+    inline const SvxTextLeftMarginItem &GetTextLeftMargin(bool = true) const;
+    inline const SvxFirstLineIndentItem &GetFirstLineIndent(bool = true) const;
+    inline const SvxRightMarginItem &   GetRightMargin(bool = true) const;
+    inline const SvxGutterLeftMarginItem &GetGutterLeftMargin(bool = true) 
const;
+    inline const SvxGutterRightMarginItem &GetGutterRightMargin(bool = true) 
const;
     inline const SvxLRSpaceItem           &GetLRSpace( bool = true ) const;
     inline const SvxULSpaceItem           &GetULSpace( bool = true ) const;
     inline const SwFormatContent           &GetContent( bool = true ) const;
diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx 
b/sw/qa/extras/uiwriter/uiwriter2.cxx
index 84a7502191d0..c3f20d2f1390 100644
--- a/sw/qa/extras/uiwriter/uiwriter2.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter2.cxx
@@ -31,6 +31,7 @@
 #include <fmtfsize.hxx>
 #include <comphelper/scopeguard.hxx>
 #include <editeng/acorrcfg.hxx>
+#include <editeng/lrspitem.hxx>
 #include <swacorr.hxx>
 #include <redline.hxx>
 #include <frameformats.hxx>
@@ -151,9 +152,12 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf101534)
     // Go to the second paragraph, assert that we have margins as direct
     // formatting.
     pWrtShell->Down(/*bSelect=*/false);
-    SfxItemSet aSet(pWrtShell->GetAttrPool(), svl::Items<RES_LR_SPACE, 
RES_LR_SPACE>);
+    SfxItemSet aSet(pWrtShell->GetAttrPool(),
+                    svl::Items<RES_MARGIN_FIRSTLINE, RES_MARGIN_TEXTLEFT>);
     pWrtShell->GetCurAttr(aSet);
-    CPPUNIT_ASSERT(aSet.HasItem(RES_LR_SPACE));
+    CPPUNIT_ASSERT(!aSet.HasItem(RES_MARGIN_FIRSTLINE));
+    CPPUNIT_ASSERT(aSet.HasItem(RES_MARGIN_TEXTLEFT));
+    CPPUNIT_ASSERT_EQUAL(::tools::Long(0), 
aSet.GetItem(RES_MARGIN_TEXTLEFT)->GetTextLeft());
 
     // Make sure that direct formatting is preserved during paste.
     pWrtShell->EndPara(/*bSelect=*/false);
@@ -162,7 +166,9 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf101534)
     aSet.ClearItem();
     pWrtShell->GetCurAttr(aSet);
     // This failed, direct formatting was lost.
-    CPPUNIT_ASSERT(aSet.HasItem(RES_LR_SPACE));
+    CPPUNIT_ASSERT(!aSet.HasItem(RES_MARGIN_FIRSTLINE));
+    CPPUNIT_ASSERT(aSet.HasItem(RES_MARGIN_TEXTLEFT));
+    CPPUNIT_ASSERT_EQUAL(::tools::Long(0), 
aSet.GetItem(RES_MARGIN_TEXTLEFT)->GetTextLeft());
 }
 
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testRedlineMoveInsertInDelete)
diff --git a/sw/source/core/access/accpara.cxx 
b/sw/source/core/access/accpara.cxx
index 67b12571f412..70eec47e51a2 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -1751,7 +1751,8 @@ void 
SwAccessibleParagraph::_getSupplementalAttributesImpl(
                 RES_PARATR_TABSTOP, RES_PARATR_TABSTOP,
                 RES_PARATR_NUMRULE, RES_PARATR_NUMRULE,
                 RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END - 1,
-                RES_LR_SPACE, RES_UL_SPACE>
+                RES_MARGIN_FIRSTLINE, RES_MARGIN_RIGHT,
+                RES_UL_SPACE, RES_UL_SPACE>
         aSet( const_cast<SwAttrPool&>(pTextNode->GetDoc().GetAttrPool()) );
 
     if ( pTextNode->HasBullet() || pTextNode->HasNumber() )
@@ -1759,7 +1760,9 @@ void 
SwAccessibleParagraph::_getSupplementalAttributesImpl(
         aSet.Put( pTextNode->GetAttr(RES_PARATR_LIST_LEVEL) );
     }
     aSet.Put( pTextNode->SwContentNode::GetAttr(RES_UL_SPACE) );
-    aSet.Put( pTextNode->SwContentNode::GetAttr(RES_LR_SPACE) );
+    aSet.Put( pTextNode->SwContentNode::GetAttr(RES_MARGIN_FIRSTLINE) );
+    aSet.Put( pTextNode->SwContentNode::GetAttr(RES_MARGIN_TEXTLEFT) );
+    aSet.Put( pTextNode->SwContentNode::GetAttr(RES_MARGIN_RIGHT) );
     aSet.Put( pTextNode->SwContentNode::GetAttr(RES_PARATR_ADJUST) );
 
     tAccParaPropValMap aSupplementalAttrSeq;
diff --git a/sw/source/core/attr/BorderCacheOwner.cxx 
b/sw/source/core/attr/BorderCacheOwner.cxx
index af13686c5afd..dd71b694931f 100644
--- a/sw/source/core/attr/BorderCacheOwner.cxx
+++ b/sw/source/core/attr/BorderCacheOwner.cxx
@@ -29,6 +29,9 @@ void BorderCacheOwner::InvalidateInSwCache(const sal_uInt16 
nWhich)
         case RES_FMT_CHG:
         case RES_ATTRSET_CHG:
         case RES_UL_SPACE:
+        case RES_MARGIN_FIRSTLINE:
+        case RES_MARGIN_TEXTLEFT:
+        case RES_MARGIN_RIGHT:
         case RES_LR_SPACE:
         case RES_BOX:
         case RES_SHADOW:
diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx
index feadd5c9298d..52e452bb4aa0 100644
--- a/sw/source/core/bastyp/init.cxx
+++ b/sw/source/core/bastyp/init.cxx
@@ -357,6 +357,12 @@ SfxItemInfo aSlotTab[] =
     { 0, true },                           // RES_FILL_ORDER
     { 0, true },                           // RES_FRM_SIZE
     { SID_ATTR_PAGE_PAPERBIN, true },      // RES_PAPER_BIN
+    { SID_ATTR_PARA_FIRSTLINESPACE, true }, // RES_MARGIN_FIRSTLINE
+    { SID_ATTR_PARA_LEFTSPACE, true },      // RES_MARGIN_TEXTLEFT
+    { SID_ATTR_PARA_RIGHTSPACE, true },     // RES_MARGIN_RIGHT
+    { 0, true },                            // RES_MARGIN_LEFT
+    { 0, true },                            // RES_MARGIN_GUTTER
+    { 0, true },                            // RES_MARGIN_GUTTER_RIGHT
     { SID_ATTR_LRSPACE, true },            // RES_LR_SPACE
     { SID_ATTR_ULSPACE, true },            // RES_UL_SPACE
     { 0, false },                               // RES_PAGEDESC
@@ -562,6 +568,12 @@ void InitCore()
     aAttrTab[ RES_FILL_ORDER- POOLATTR_BEGIN ] =            new 
SwFormatFillOrder;
     aAttrTab[ RES_FRM_SIZE- POOLATTR_BEGIN ] =              new 
SwFormatFrameSize;
     aAttrTab[ RES_PAPER_BIN- POOLATTR_BEGIN ] =             new 
SvxPaperBinItem( RES_PAPER_BIN );
+    aAttrTab[ RES_MARGIN_FIRSTLINE - POOLATTR_BEGIN ] =     new 
SvxFirstLineIndentItem(RES_MARGIN_FIRSTLINE);
+    aAttrTab[ RES_MARGIN_TEXTLEFT - POOLATTR_BEGIN ] =      new 
SvxTextLeftMarginItem(RES_MARGIN_TEXTLEFT);
+    aAttrTab[ RES_MARGIN_RIGHT - POOLATTR_BEGIN ] =         new 
SvxRightMarginItem(RES_MARGIN_RIGHT);
+    aAttrTab[ RES_MARGIN_LEFT - POOLATTR_BEGIN ] =          new 
SvxLeftMarginItem(RES_MARGIN_LEFT);
+    aAttrTab[ RES_MARGIN_GUTTER - POOLATTR_BEGIN ] =        new 
SvxGutterLeftMarginItem(RES_MARGIN_GUTTER);
+    aAttrTab[ RES_MARGIN_GUTTER_RIGHT - POOLATTR_BEGIN ] =  new 
SvxGutterRightMarginItem(RES_MARGIN_GUTTER_RIGHT);
     aAttrTab[ RES_LR_SPACE- POOLATTR_BEGIN ] =              new 
SvxLRSpaceItem( RES_LR_SPACE );
     aAttrTab[ RES_UL_SPACE- POOLATTR_BEGIN ] =              new 
SvxULSpaceItem( RES_UL_SPACE );
     aAttrTab[ RES_PAGEDESC- POOLATTR_BEGIN ] =              new 
SwFormatPageDesc;
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 966127cece62..c5c0c741f5dd 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -2374,13 +2374,16 @@ bool SwCursorShell::SetShadowCursorPos( const Point& 
rPt, SwFillMode eFillMode )
     case SwFillMode::Indent:
         if( nullptr != (pCNd = aPos.GetNode().GetContentNode() ))
         {
+            assert(pCNd->IsTextNode()); // ???
             SfxItemSetFixed<
                     RES_PARATR_ADJUST, RES_PARATR_ADJUST,
-                    RES_LR_SPACE, RES_LR_SPACE>  aSet( GetDoc()->GetAttrPool() 
);
-            SvxLRSpaceItem aLR(pCNd->GetAttr(RES_LR_SPACE));
-            aLR.SetTextLeft( aFPos.nTabCnt );
-            aLR.SetTextFirstLineOffset( 0 );
-            aSet.Put( aLR );
+                    RES_MARGIN_FIRSTLINE, RES_MARGIN_TEXTLEFT> 
aSet(GetDoc()->GetAttrPool());
+            SvxFirstLineIndentItem 
firstLine(pCNd->GetAttr(RES_MARGIN_FIRSTLINE));
+            SvxTextLeftMarginItem 
leftMargin(pCNd->GetAttr(RES_MARGIN_TEXTLEFT));
+            firstLine.SetTextFirstLineOffset(0);
+            leftMargin.SetTextLeft(aFPos.nTabCnt);
+            aSet.Put(firstLine);
+            aSet.Put(leftMargin);
 
             const SvxAdjustItem& rAdj = pCNd->GetAttr(RES_PARATR_ADJUST);
             if( SvxAdjust::Left != rAdj.GetAdjust() )
diff --git a/sw/source/core/doc/DocumentStylePoolManager.cxx 
b/sw/source/core/doc/DocumentStylePoolManager.cxx
index 9877dc785ccb..ad0c00ff42c0 100644
--- a/sw/source/core/doc/DocumentStylePoolManager.cxx
+++ b/sw/source/core/doc/DocumentStylePoolManager.cxx
@@ -210,11 +210,13 @@ namespace
                                     SvxNumberFormat::LABEL_WIDTH_AND_POSITION 
&&
                         ( rNFormat.GetAbsLSpace() || 
rNFormat.GetFirstLineOffset() ) )
                 {
-                    SvxLRSpaceItem aLR( pColl->GetFormatAttr( RES_LR_SPACE ) );
-                    aLR.SetTextFirstLineOffsetValue( 
rNFormat.GetFirstLineOffset() );
+                    SvxFirstLineIndentItem 
firstLine(pColl->GetFormatAttr(RES_MARGIN_FIRSTLINE));
+                    SvxTextLeftMarginItem 
leftMargin(pColl->GetFormatAttr(RES_MARGIN_TEXTLEFT));
+                    
firstLine.SetTextFirstLineOffsetValue(rNFormat.GetFirstLineOffset());
                         //TODO: overflow
-                    aLR.SetTextLeft( rNFormat.GetAbsLSpace() );
-                    pColl->SetFormatAttr( aLR );
+                    leftMargin.SetTextLeft(rNFormat.GetAbsLSpace());
+                    pColl->SetFormatAttr(firstLine);
+                    pColl->SetFormatAttr(leftMargin);
                 }
 
                 // All paragraph styles, which are assigned to a level of the
@@ -229,11 +231,11 @@ namespace
     void lcl_SetRegister( SwDoc& rDoc, SfxItemSet& rSet, sal_uInt16 nFact,
                             bool bHeader, bool bTab )
     {
-        SvxLRSpaceItem aLR( RES_LR_SPACE );
         sal_uInt16 nLeft = o3tl::convert(5 * nFact, o3tl::Length::mm, 
o3tl::Length::twip);
-        aLR.SetTextLeft( nLeft );
-
-        rSet.Put( aLR );
+        SvxFirstLineIndentItem const firstLine(0, RES_MARGIN_FIRSTLINE);
+        SvxTextLeftMarginItem const leftMargin(nLeft, RES_MARGIN_TEXTLEFT);
+        rSet.Put(firstLine);
+        rSet.Put(leftMargin);
         if( bHeader )
         {
             SetAllScriptItem( rSet, SvxWeightItem( WEIGHT_BOLD, 
RES_CHRATR_WEIGHT ) );
@@ -255,14 +257,13 @@ namespace
                             sal_uInt16 nNxt, SwTwips nEZ, SwTwips nLeft,
                             SwTwips nUpper, SwTwips nLower )
     {
-
-        SvxLRSpaceItem aLR( RES_LR_SPACE );
+        SvxFirstLineIndentItem const firstLine(sal_uInt16(nEZ), 
RES_MARGIN_FIRSTLINE);
+        SvxTextLeftMarginItem const leftMargin(sal_uInt16(nLeft), 
RES_MARGIN_TEXTLEFT);
+        rSet.Put(firstLine);
+        rSet.Put(leftMargin);
         SvxULSpaceItem aUL( RES_UL_SPACE );
-        aLR.SetTextFirstLineOffset( sal_uInt16(nEZ) );
-        aLR.SetTextLeft( sal_uInt16(nLeft) );
         aUL.SetUpper( sal_uInt16(nUpper) );
         aUL.SetLower( sal_uInt16(nLower) );
-        rSet.Put( aLR );
         rSet.Put( aUL );
 
         if( pColl )
@@ -706,49 +707,58 @@ SwTextFormatColl* 
DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
             break;
         case RES_POOLCOLL_TEXT_IDENT:           // Text body indentation
             {
-                SvxLRSpaceItem aLR( RES_LR_SPACE );
-                aLR.SetTextFirstLineOffset(o3tl::convert(5, o3tl::Length::mm, 
o3tl::Length::twip));
-                aSet.Put( aLR );
+                auto const first(o3tl::convert(5, o3tl::Length::mm, 
o3tl::Length::twip));
+                SvxFirstLineIndentItem const firstLine(first, 
RES_MARGIN_FIRSTLINE);
+                SvxTextLeftMarginItem const leftMargin(0, RES_MARGIN_TEXTLEFT);
+                aSet.Put(firstLine);
+                aSet.Put(leftMargin);
             }
             break;
         case RES_POOLCOLL_TEXT_NEGIDENT:        // Text body neg. indentation
             {
-                SvxLRSpaceItem aLR( RES_LR_SPACE );
-                aLR.SetTextFirstLineOffset(-o3tl::convert(5, o3tl::Length::mm, 
o3tl::Length::twip));
-                aLR.SetTextLeft(o3tl::convert(1, o3tl::Length::cm, 
o3tl::Length::twip));
+                auto const first(-o3tl::convert(5, o3tl::Length::mm, 
o3tl::Length::twip));
+                auto const left(o3tl::convert(1, o3tl::Length::cm, 
o3tl::Length::twip));
+                SvxFirstLineIndentItem const firstLine(first, 
RES_MARGIN_FIRSTLINE);
+                SvxTextLeftMarginItem const leftMargin(left, 
RES_MARGIN_TEXTLEFT);
+                aSet.Put(firstLine);
+                aSet.Put(leftMargin);
+
                 SvxTabStopItem aTStops(RES_PARATR_TABSTOP);
                 aTStops.Insert( SvxTabStop( 0 ));
-
-                aSet.Put( aLR );
                 aSet.Put( aTStops );
             }
             break;
         case RES_POOLCOLL_TEXT_MOVE:            // Text body move
             {
-                SvxLRSpaceItem aLR( RES_LR_SPACE );
-                aLR.SetTextLeft(o3tl::convert(5, o3tl::Length::mm, 
o3tl::Length::twip));
-                aSet.Put( aLR );
+                auto const left(o3tl::convert(5, o3tl::Length::mm, 
o3tl::Length::twip));
+                SvxFirstLineIndentItem const firstLine(0, 
RES_MARGIN_FIRSTLINE);
+                SvxTextLeftMarginItem const leftMargin(left, 
RES_MARGIN_TEXTLEFT);
+                aSet.Put(firstLine);
+                aSet.Put(leftMargin);
             }
             break;
 
         case RES_POOLCOLL_CONFRONTATION:    // Text body confrontation
             {
-                SvxLRSpaceItem aLR( RES_LR_SPACE );
-                aLR.SetTextFirstLineOffset(
-                    -o3tl::convert(45, o3tl::Length::mm, o3tl::Length::twip));
-                aLR.SetTextLeft(o3tl::convert(5, o3tl::Length::cm, 
o3tl::Length::twip));
+                auto const first(-o3tl::convert(45, o3tl::Length::mm, 
o3tl::Length::twip));
+                auto const left(o3tl::convert(5, o3tl::Length::cm, 
o3tl::Length::twip));
+                SvxFirstLineIndentItem const firstLine(first, 
RES_MARGIN_FIRSTLINE);
+                SvxTextLeftMarginItem const leftMargin(left, 
RES_MARGIN_TEXTLEFT);
+                aSet.Put(firstLine);
+                aSet.Put(leftMargin);
+
                 SvxTabStopItem aTStops( RES_PARATR_TABSTOP );
                 aTStops.Insert( SvxTabStop( 0 ));
-
-                aSet.Put( aLR );
                 aSet.Put( aTStops );
             }
             break;
         case RES_POOLCOLL_MARGINAL:         // Text body marginal
             {
-                SvxLRSpaceItem aLR( RES_LR_SPACE );
-                aLR.SetTextLeft(o3tl::convert(4, o3tl::Length::cm, 
o3tl::Length::twip));
-                aSet.Put( aLR );
+                auto const left(o3tl::convert(4, o3tl::Length::cm, 
o3tl::Length::twip));
+                SvxFirstLineIndentItem const firstLine(0, 
RES_MARGIN_FIRSTLINE);
+                SvxTextLeftMarginItem const leftMargin(left, 
RES_MARGIN_TEXTLEFT);
+                aSet.Put(firstLine);
+                aSet.Put(leftMargin);
             }
             break;
 
@@ -938,11 +948,14 @@ SwTextFormatColl* 
DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
         case RES_POOLCOLL_FOOTNOTE:             // paragraph style Footnote
         case RES_POOLCOLL_ENDNOTE:              // paragraph style Endnote
             {
-                SvxLRSpaceItem aLR( RES_LR_SPACE );
-                aLR.SetTextFirstLineOffset(-o3tl::convert(6, o3tl::Length::mm, 
o3tl::Length::twip));
-                aLR.SetTextLeft(o3tl::convert(6, o3tl::Length::mm, 
o3tl::Length::twip));
+                auto const first(-o3tl::convert(6, o3tl::Length::mm, 
o3tl::Length::twip));
+                auto const left(o3tl::convert(6, o3tl::Length::mm, 
o3tl::Length::twip));
+                SvxFirstLineIndentItem const firstLine(first, 
RES_MARGIN_FIRSTLINE);
+                SvxTextLeftMarginItem const leftMargin(left, 
RES_MARGIN_TEXTLEFT);
+                aSet.Put(firstLine);
+                aSet.Put(leftMargin);
+
                 SetAllScriptItem( aSet, SvxFontHeightItem( PT_10, 100, 
RES_CHRATR_FONTSIZE ) );
-                aSet.Put( aLR );
                 SwFormatLineNumber aLN;
                 aLN.SetCountLines( false );
                 aSet.Put( aLN );
@@ -1344,10 +1357,15 @@ SwTextFormatColl* 
DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
 
         case RES_POOLCOLL_HTML_BLOCKQUOTE:
             {
-                SvxLRSpaceItem aLR( RES_LR_SPACE );
-                aLR.SetLeft(o3tl::convert(1, o3tl::Length::cm, 
o3tl::Length::twip));
-                aLR.SetRight(o3tl::convert(1, o3tl::Length::cm, 
o3tl::Length::twip));
-                aSet.Put( aLR );
+                auto const left(o3tl::convert(1, o3tl::Length::cm, 
o3tl::Length::twip));
+                auto const right(o3tl::convert(1, o3tl::Length::cm, 
o3tl::Length::twip));
+                SvxFirstLineIndentItem const firstLine(0, 
RES_MARGIN_FIRSTLINE);
+                SvxTextLeftMarginItem const leftMargin(left, 
RES_MARGIN_TEXTLEFT);
+                SvxRightMarginItem const rightMargin(right, RES_MARGIN_RIGHT);
+                aSet.Put(firstLine);
+                aSet.Put(leftMargin);
+                aSet.Put(rightMargin);
+
                 std::unique_ptr<SvxULSpaceItem> 
aUL(pNewColl->GetULSpace().Clone());
                 aUL->SetLower( HTML_PARSPACE );
                 aSet.Put(std::move(aUL));
@@ -1395,22 +1413,20 @@ SwTextFormatColl* 
DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
 
         case RES_POOLCOLL_HTML_DD:
             {
-                std::unique_ptr<SvxLRSpaceItem> 
aLR(pNewColl->GetLRSpace().Clone());
                 // We indent by 1 cm. The IDs are always 2 away from each 
other!
-                aLR->SetLeft(o3tl::convert(1, o3tl::Length::cm, 
o3tl::Length::twip));
-                aSet.Put(std::move(aLR));
+                auto const left(o3tl::convert(1, o3tl::Length::cm, 
o3tl::Length::twip));
+                SvxTextLeftMarginItem const leftMargin(left, 
RES_MARGIN_TEXTLEFT);
+                aSet.Put(leftMargin);
             }
             break;
         case RES_POOLCOLL_HTML_DT:
             {
-                std::unique_ptr<SvxLRSpaceItem> aLR;
                 {
                     pNewColl->SetNextTextFormatColl( *GetTextCollFromPool( 
RES_POOLCOLL_HTML_DD ));
-                    aLR.reset(pNewColl->GetLRSpace().Clone());
                 }
                 // We indent by 0 cm. The IDs are always 2 away from each 
other!
-                aLR->SetLeft( 0 );
-                aSet.Put( std::move(aLR) );
+                SvxTextLeftMarginItem const leftMargin(0, RES_MARGIN_TEXTLEFT);
+                aSet.Put(leftMargin);
             }
             break;
         }
diff --git a/sw/source/core/doc/dbgoutsw.cxx b/sw/source/core/doc/dbgoutsw.cxx
index 184390720407..20f8e6ecae9f 100644
--- a/sw/source/core/doc/dbgoutsw.cxx
+++ b/sw/source/core/doc/dbgoutsw.cxx
@@ -162,6 +162,12 @@ static std::map<sal_uInt16,OUString> & GetItemWhichMap()
         { RES_FILL_ORDER , "FILL_ORDER" },
         { RES_FRM_SIZE , "FRM_SIZE" },
         { RES_PAPER_BIN , "PAPER_BIN" },
+        { RES_MARGIN_FIRSTLINE, "FIRSTLINE" },
+        { RES_MARGIN_TEXTLEFT, "TEXTLEFT" },
+        { RES_MARGIN_RIGHT, "RIGHT" },
+        { RES_MARGIN_LEFT, "LEFT" },
+        { RES_MARGIN_GUTTER, "GUTTER" },
+        { RES_MARGIN_GUTTER_RIGHT, "GUTTER_RIGHT" },
         { RES_LR_SPACE , "LR_SPACE" },
         { RES_UL_SPACE , "UL_SPACE" },
         { RES_PAGEDESC , "PAGEDESC" },
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 03e8d8d2ee0c..e990919ed719 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -1649,7 +1649,8 @@ void SwDoc::MoveLeftMargin(const SwPaM& rPam, bool 
bRight, bool bModulus,
         if( pTNd )
         {
             pTNd = sw::GetParaPropsNode(*pLayout, aIdx.GetNode());
-            SvxLRSpaceItem aLS(pTNd->SwContentNode::GetAttr(RES_LR_SPACE));
+            SvxFirstLineIndentItem 
firstLine(pTNd->SwContentNode::GetAttr(RES_MARGIN_FIRSTLINE));
+            SvxTextLeftMarginItem 
leftMargin(pTNd->SwContentNode::GetAttr(RES_MARGIN_TEXTLEFT));
 
             // #i93873# See also lcl_MergeListLevelIndentAsLRSpaceItem in 
thints.cxx
             if ( pTNd->AreListLevelIndentsApplicable() )
@@ -1663,14 +1664,14 @@ void SwDoc::MoveLeftMargin(const SwPaM& rPam, bool 
bRight, bool bModulus,
                         const SwNumFormat& rFormat = 
pRule->Get(o3tl::narrowing<sal_uInt16>(nListLevel));
                         if ( rFormat.GetPositionAndSpaceMode() == 
SvxNumberFormat::LABEL_ALIGNMENT )
                         {
-                            aLS.SetTextLeft( rFormat.GetIndentAt() );
-                            aLS.SetTextFirstLineOffset( 
static_cast<short>(rFormat.GetFirstLineIndent()) );
+                            leftMargin.SetTextLeft(rFormat.GetIndentAt());
+                            
firstLine.SetTextFirstLineOffset(static_cast<short>(rFormat.GetFirstLineIndent()));
                         }
                     }
                 }
             }
 
-            tools::Long nNext = aLS.GetTextLeft();
+            tools::Long nNext = leftMargin.GetTextLeft();
             if( bModulus )
                 nNext = ( nNext / nDefDist ) * nDefDist;
 
@@ -1680,10 +1681,11 @@ void SwDoc::MoveLeftMargin(const SwPaM& rPam, bool 
bRight, bool bModulus,
                 if(nNext >0) // fdo#75936 set limit for decreasing indent
                     nNext -= nDefDist;
 
-            aLS.SetTextLeft( nNext );
+            leftMargin.SetTextLeft( nNext );
 
             SwRegHistory aRegH( pTNd, *pTNd, pHistory );
-            pTNd->SetAttr( aLS );
+            pTNd->SetAttr(firstLine);
+            pTNd->SetAttr(leftMargin);
             aIdx = *sw::GetFirstAndLastNode(*pLayout, aIdx.GetNode()).second;
         }
         ++aIdx;
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx
index b4d32ea25b61..fc51f148e3c3 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -59,10 +59,10 @@
 #include <wrtsh.hxx>
 
 namespace {
-    void lcl_ResetIndentAttrs(SwDoc *pDoc, const SwPaM &rPam, sal_uInt16 
marker,
+    void lcl_ResetIndentAttrs(SwDoc *pDoc, const SwPaM &rPam,
+            const o3tl::sorted_vector<sal_uInt16> aResetAttrsArray,
             SwRootFrame const*const pLayout)
     {
-        const o3tl::sorted_vector<sal_uInt16> aResetAttrsArray{ marker };
         // #i114929#
         // On a selection setup a corresponding Point-and-Mark in order to get
         // the indentation attribute reset on all paragraphs touched by the 
selection
@@ -978,7 +978,8 @@ OUString SwDoc::SetNumRule( const SwPaM& rPam,
     if ( bResetIndentAttrs
          && pNewOrChangedNumRule->Get( 0 ).GetPositionAndSpaceMode() == 
SvxNumberFormat::LABEL_ALIGNMENT )
     {
-        ::lcl_ResetIndentAttrs(this, aPam, RES_LR_SPACE, pLayout);
+        const o3tl::sorted_vector<sal_uInt16> attrs{ RES_MARGIN_FIRSTLINE, 
RES_MARGIN_TEXTLEFT, RES_MARGIN_RIGHT };
+        ::lcl_ResetIndentAttrs(this, aPam, attrs, pLayout);
     }
 
     if (GetIDocumentUndoRedo().DoesUndo())
@@ -996,7 +997,8 @@ void SwDoc::SetCounted(const SwPaM & rPam, bool bCounted,
 {
     if ( bCounted )
     {
-        ::lcl_ResetIndentAttrs(this, rPam, RES_PARATR_LIST_ISCOUNTED, pLayout);
+        const o3tl::sorted_vector<sal_uInt16> attrs{ RES_PARATR_LIST_ISCOUNTED 
};
+        ::lcl_ResetIndentAttrs(this, rPam, attrs, pLayout);
     }
     else
     {
diff --git a/sw/source/core/doc/fmtcol.cxx b/sw/source/core/doc/fmtcol.cxx
index 0a53339b0460..95cd8754fb44 100644
--- a/sw/source/core/doc/fmtcol.cxx
+++ b/sw/source/core/doc/fmtcol.cxx
@@ -137,7 +137,9 @@ void SwTextFormatColl::SwClientNotify(const SwModify& 
rModify, const SfxHint& rH
     }
     bool bNewParent( false ); // #i66431# - adjust type of <bNewParent>
     const SvxULSpaceItem *pNewULSpace = nullptr, *pOldULSpace = nullptr;
-    const SvxLRSpaceItem *pNewLRSpace = nullptr, *pOldLRSpace = nullptr;
+    const SvxFirstLineIndentItem *pNewFirstLineIndent = nullptr;
+    const SvxTextLeftMarginItem *pNewTextLeftMargin = nullptr;
+    const SvxRightMarginItem *pNewRightMargin = nullptr;
     const SvxFontHeightItem* aFontSizeArr[3] = {nullptr,nullptr,nullptr};
     // #i70223#
     const bool 
bAssignedToListLevelOfOutlineStyle(IsAssignedToListLevelOfOutlineStyle());
@@ -152,7 +154,9 @@ void SwTextFormatColl::SwClientNotify(const SwModify& 
rModify, const SfxHint& rH
         // Only recalculate if we're not the sender!
         pNewChgSet = &pNew->StaticWhichCast(RES_ATTRSET_CHG);
         pOldChgSet = &pOld->StaticWhichCast(RES_ATTRSET_CHG);
-        pNewLRSpace = pNewChgSet->GetChgSet()->GetItemIfSet( RES_LR_SPACE, 
false );
+        pNewFirstLineIndent = 
pNewChgSet->GetChgSet()->GetItemIfSet(RES_MARGIN_FIRSTLINE, false);
+        pNewTextLeftMargin = 
pNewChgSet->GetChgSet()->GetItemIfSet(RES_MARGIN_TEXTLEFT, false);
+        pNewRightMargin = 
pNewChgSet->GetChgSet()->GetItemIfSet(RES_MARGIN_RIGHT, false);
         pNewULSpace = pNewChgSet->GetChgSet()->GetItemIfSet( RES_UL_SPACE, 
false );
         aFontSizeArr[0] = pNewChgSet->GetChgSet()->GetItemIfSet( 
RES_CHRATR_FONTSIZE, false );
         aFontSizeArr[1] = pNewChgSet->GetChgSet()->GetItemIfSet( 
RES_CHRATR_CJK_FONTSIZE, false );
@@ -171,7 +175,9 @@ void SwTextFormatColl::SwClientNotify(const SwModify& 
rModify, const SfxHint& rH
         if( GetAttrSet().GetParent() )
         {
             const SfxItemSet* pParent = GetAttrSet().GetParent();
-            pNewLRSpace = &pParent->Get( RES_LR_SPACE );
+            pNewFirstLineIndent = &pParent->Get(RES_MARGIN_FIRSTLINE);
+            pNewTextLeftMargin = &pParent->Get(RES_MARGIN_TEXTLEFT);
+            pNewRightMargin = &pParent->Get(RES_MARGIN_RIGHT);
             pNewULSpace = &pParent->Get( RES_UL_SPACE );
             aFontSizeArr[0] = &pParent->Get( RES_CHRATR_FONTSIZE );
             aFontSizeArr[1] = &pParent->Get( RES_CHRATR_CJK_FONTSIZE );
@@ -181,8 +187,14 @@ void SwTextFormatColl::SwClientNotify(const SwModify& 
rModify, const SfxHint& rH
         }
         break;
 
-    case RES_LR_SPACE:
-        pNewLRSpace = &pNew->StaticWhichCast(RES_LR_SPACE);
+    case RES_MARGIN_FIRSTLINE:
+        pNewFirstLineIndent = &pNew->StaticWhichCast(RES_MARGIN_FIRSTLINE);
+        break;
+    case RES_MARGIN_TEXTLEFT:
+        pNewTextLeftMargin = &pNew->StaticWhichCast(RES_MARGIN_TEXTLEFT);
+        break;
+    case RES_MARGIN_RIGHT:
+        pNewRightMargin = &pNew->StaticWhichCast(RES_MARGIN_RIGHT);
         break;
     case RES_UL_SPACE:
         pNewULSpace = &pNew->StaticWhichCast(RES_UL_SPACE);
@@ -217,34 +229,72 @@ void SwTextFormatColl::SwClientNotify(const SwModify& 
rModify, const SfxHint& rH
     bool bContinue = true;
 
     // Check against the own attributes
-    if( pNewLRSpace && (pOldLRSpace = GetItemIfSet( RES_LR_SPACE, false)) )
+    const SvxFirstLineIndentItem 
*pOldFirstLineIndent(GetItemIfSet(RES_MARGIN_FIRSTLINE, false));
+    if (pNewFirstLineIndent && pOldFirstLineIndent)
+    {
+        if (pOldFirstLineIndent != pNewFirstLineIndent) // Avoid recursion 
(SetAttr!)
+        {
+            bool bChg = false;
+            SvxFirstLineIndentItem aNew(*pOldFirstLineIndent);
+            // We had a relative value -> recalculate
+            if( 100 != aNew.GetPropTextFirstLineOffset() )
+            {
+                short nTmp = aNew.GetTextFirstLineOffset();    // keep so that 
we can compare
+                
aNew.SetTextFirstLineOffset(pNewFirstLineIndent->GetTextFirstLineOffset(),
+                                            aNew.GetPropTextFirstLineOffset() 
);
+                bChg |= nTmp != aNew.GetTextFirstLineOffset();
+            }
+            if( bChg )
+            {
+                SetFormatAttr( aNew );
+                bContinue = nullptr != pOldChgSet || bNewParent;
+            }
+            // We set it to absolute -> do not propagate it further, unless
+            // we set it!
+            else if( pNewChgSet )
+                bContinue = pNewChgSet->GetTheChgdSet() == &GetAttrSet();
+        }
+    }
+    const SvxTextLeftMarginItem 
*pOldTextLeftMargin(GetItemIfSet(RES_MARGIN_TEXTLEFT, false));
+    if (pNewTextLeftMargin && pOldTextLeftMargin)
     {
-        if( pOldLRSpace != pNewLRSpace )    // Avoid recursion (SetAttr!)
+        if (pOldTextLeftMargin != pNewTextLeftMargin) // Avoid recursion 
(SetAttr!)
         {
             bool bChg = false;
-            SvxLRSpaceItem aNew( *pOldLRSpace );
+            SvxTextLeftMarginItem aNew(*pOldTextLeftMargin);
             // We had a relative value -> recalculate
             if( 100 != aNew.GetPropLeft() )
             {
-                tools::Long nTmp = aNew.GetLeft();     // keep so that we can 
compare
-                aNew.SetLeft( pNewLRSpace->GetLeft(), aNew.GetPropLeft() );
-                bChg |= nTmp != aNew.GetLeft();
+                // note: changing from Left to TextLeft - looked wrong with 
Left
+                tools::Long nTmp = aNew.GetTextLeft(); // keep so that we can 
compare
+                aNew.SetTextLeft(pNewTextLeftMargin->GetTextLeft(), 
aNew.GetPropLeft());
+                bChg |= nTmp != aNew.GetTextLeft();
+            }
+            if( bChg )
+            {
+                SetFormatAttr( aNew );
+                bContinue = nullptr != pOldChgSet || bNewParent;
             }
+            // We set it to absolute -> do not propagate it further, unless
+            // we set it!
+            else if( pNewChgSet )
+                bContinue = pNewChgSet->GetTheChgdSet() == &GetAttrSet();
+        }
+    }
+    const SvxRightMarginItem *pOldRightMargin(GetItemIfSet(RES_MARGIN_RIGHT, 
false));
+    if (pNewRightMargin && pOldRightMargin)
+    {
+        if (pOldRightMargin != pNewRightMargin) // Avoid recursion (SetAttr!)
+        {
+            bool bChg = false;
+            SvxRightMarginItem aNew(*pOldRightMargin);
             // We had a relative value -> recalculate
             if( 100 != aNew.GetPropRight() )
             {
                 tools::Long nTmp = aNew.GetRight();    // keep so that we can 
compare
-                aNew.SetRight( pNewLRSpace->GetRight(), aNew.GetPropRight() );
+                aNew.SetRight(pNewRightMargin->GetRight(), 
aNew.GetPropRight());
                 bChg |= nTmp != aNew.GetRight();
             }
-            // We had a relative value -> recalculate
-            if( 100 != aNew.GetPropTextFirstLineOffset() )
-            {
-                short nTmp = aNew.GetTextFirstLineOffset();    // keep so that 
we can compare
-                aNew.SetTextFirstLineOffset( 
pNewLRSpace->GetTextFirstLineOffset(),
-                                            aNew.GetPropTextFirstLineOffset() 
);
-                bChg |= nTmp != aNew.GetTextFirstLineOffset();
-            }
             if( bChg )
             {
                 SetFormatAttr( aNew );
diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index a4c6e02dbc30..0f5d4cd307e9 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -1479,7 +1479,7 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 
nDigitLevel )
 
         SwTextFrameInfo aInfo( m_pCurTextFrame );
         nLeftTextPos = aInfo.GetCharPos(nPos);
-        nLeftTextPos -= 
m_pCurTextFrame->GetTextNodeForParaProps()->GetSwAttrSet().GetLRSpace().GetLeft();
+        nLeftTextPos -= 
m_pCurTextFrame->GetTextNodeForParaProps()->GetSwAttrSet().GetTextLeftMargin().GetLeft(m_pCurTextFrame->GetTextNodeForParaProps()->GetSwAttrSet().GetFirstLineIndent());
     }
 
     if( m_bMoreLines )
@@ -2414,16 +2414,19 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, 
SvxSwAutoFormatFlags aFlags,
                     break;
                 }
 
-                // check for hard spaces or LRSpaces set by the template
+                // check for left margin set by the style
                 if( IsPoolUserFormat( nPoolId ) ||
                     RES_POOLCOLL_STANDARD == nPoolId )
                 {
-                    short nSz;
-                    SvxLRSpaceItem const * pLRSpace = 
m_pCurTextFrame->GetTextNodeForParaProps()->GetSwAttrSet().
-                        GetItemIfSet( RES_LR_SPACE );
-                    if (pLRSpace &&
-                        ( 0 != (nSz = pLRSpace->GetTextFirstLineOffset()) ||
-                            0 != pLRSpace->GetTextLeft() ) )
+                    SvxFirstLineIndentItem const*const pFirstLineIndent(
+                        m_pCurTextFrame->GetTextNodeForParaProps()
+                            
->GetSwAttrSet().GetItemIfSet(RES_MARGIN_FIRSTLINE));
+                    SvxTextLeftMarginItem const*const pTextLeftMargin(
+                        m_pCurTextFrame->GetTextNodeForParaProps()
+                            
->GetSwAttrSet().GetItemIfSet(RES_MARGIN_TEXTLEFT));
+                    short nSz(pFirstLineIndent ? 
pFirstLineIndent->GetTextFirstLineOffset() : 0);
+                    if (0 != nSz ||
+                        (pTextLeftMargin && 0 != 
pTextLeftMargin->GetTextLeft()))
                     {
                         // exception: numbering/enumeration can have an 
indentation
                         if (IsEnumericChar(*m_pCurTextFrame))
@@ -2446,7 +2449,7 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, 
SvxSwAutoFormatFlags aFlags,
                                 BuildIndent();
                             else if( 0 > nSz )      // negative 1st line 
indentation
                                 BuildNegIndent( aFInfo.GetLineStart() );
-                            else if( pLRSpace->GetTextLeft() )   // is 
indentation
+                            else if (pTextLeftMargin && 
pTextLeftMargin->GetTextLeft() != 0)   // is indentation
                                 BuildTextIndent();
                         }
                         eStat = READ_NEXT_PARA;
@@ -2651,13 +2654,16 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, 
SvxSwAutoFormatFlags aFlags,
                 // handle hard attributes
                 if (m_pCurTextFrame->GetTextNodeForParaProps()->HasSwAttrSet())
                 {
-                    short nSz;
-                    SvxLRSpaceItem const * pLRSpace;
+                    SvxFirstLineIndentItem const*const pFirstLineIndent(
+                        m_pCurTextFrame->GetTextNodeForParaProps()
+                            
->GetSwAttrSet().GetItemIfSet(RES_MARGIN_FIRSTLINE, false));
+                    SvxTextLeftMarginItem const*const pTextLeftMargin(
+                        m_pCurTextFrame->GetTextNodeForParaProps()
+                            ->GetSwAttrSet().GetItemIfSet(RES_MARGIN_TEXTLEFT, 
false));
+                    short nSz(pFirstLineIndent ? 
pFirstLineIndent->GetTextFirstLineOffset() : 0);
                     if( bReplaceStyles &&
-                        (pLRSpace = 
m_pCurTextFrame->GetTextNodeForParaProps()->GetSwAttrSet().
-                            GetItemIfSet( RES_LR_SPACE, false )) &&
-                        ( 0 != (nSz = pLRSpace->GetTextFirstLineOffset()) ||
-                            0 != pLRSpace->GetTextLeft() ) )
+                        (0 != nSz ||
+                            (pTextLeftMargin && 0 != 
pTextLeftMargin->GetTextLeft())))
                     {
                         // then use one of our templates
                         if( 0 < nSz )           // positive 1st line 
indentation
@@ -2666,7 +2672,7 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, 
SvxSwAutoFormatFlags aFlags,
                         {
                             BuildNegIndent( aFInfo.GetLineStart() );
                         }
-                        else if( pLRSpace->GetTextLeft() )   // is indentation
+                        else if (pTextLeftMargin && 
pTextLeftMargin->GetTextLeft()) // is indentation
                             BuildTextIndent();
                         else
                             BuildText();
diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx
index 0aaa4d2c05c3..ca3c787e3954 100644
--- a/sw/source/core/inc/frmtool.hxx
+++ b/sw/source/core/inc/frmtool.hxx
@@ -309,7 +309,9 @@ class SwBorderAttrs final : public SwCacheObj
 {
     const SwAttrSet      &m_rAttrSet;
     const SvxULSpaceItem &m_rUL;
-    // #i96772#
+    std::unique_ptr<SvxFirstLineIndentItem> m_pFirstLineIndent;
+    std::unique_ptr<SvxTextLeftMarginItem> m_pTextLeftMargin;
+    std::unique_ptr<SvxRightMarginItem> m_pRightMargin;
     std::shared_ptr<SvxLRSpaceItem> m_xLR;
     const SvxBoxItem     &m_rBox;
     const SvxShadowItem  &m_rShadow;
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index 91c0f0549680..398452d603be 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -2650,10 +2650,15 @@ static SwTwips lcl_CalcAutoWidth( const SwLayoutFrame& 
rFrame )
         if ( pFrame->IsTextFrame() )
         {
             nMin = const_cast<SwTextFrame*>(static_cast<const 
SwTextFrame*>(pFrame))->CalcFitToContent();
-            const SvxLRSpaceItem &rSpace =
-                static_cast<const 
SwTextFrame*>(pFrame)->GetTextNodeForParaProps()->GetSwAttrSet().GetLRSpace();
+            auto const& rParaSet(static_cast<const 
SwTextFrame*>(pFrame)->GetTextNodeForParaProps()->GetSwAttrSet());
+            SvxFirstLineIndentItem const& 
rFirstLine(rParaSet.GetFirstLineIndent());
+            SvxTextLeftMarginItem const& 
rLeftMargin(rParaSet.GetTextLeftMargin());
+            SvxRightMarginItem const& rRightMargin(rParaSet.GetRightMargin());
             if (!static_cast<const SwTextFrame*>(pFrame)->IsLocked())
-                nMin += rSpace.GetRight() + rSpace.GetTextLeft() + 
rSpace.GetTextFirstLineOffset();
+            {
+                nMin += rRightMargin.GetRight() + rLeftMargin.GetTextLeft()
+                        + rFirstLine.GetTextFirstLineOffset();
+            }
         }
         else if ( pFrame->IsTabFrame() )
         {
diff --git a/sw/source/core/layout/frmtool.cxx 
b/sw/source/core/layout/frmtool.cxx
index e47c68283e33..bcdb49c292eb 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -2234,9 +2234,6 @@ SwBorderAttrs::SwBorderAttrs(const sw::BorderCacheOwner* 
pOwner, const SwFrame*
                         : static_cast<const 
SwNoTextFrame*>(pConstructor)->GetNode()->GetSwAttrSet()
                     : static_cast<const 
SwLayoutFrame*>(pConstructor)->GetFormat()->GetAttrSet())
     , m_rUL(m_rAttrSet.GetULSpace())
-    // #i96772#
-    // LRSpaceItem is copied due to the possibility that it is adjusted - see 
below
-    , m_xLR(m_rAttrSet.GetLRSpace().Clone())
     , m_rBox(m_rAttrSet.GetBox())
     , m_rShadow(m_rAttrSet.GetShadow())
     , m_aFrameSize(m_rAttrSet.GetFrameSize().GetSize())
@@ -2257,15 +2254,24 @@ SwBorderAttrs::SwBorderAttrs(const 
sw::BorderCacheOwner* pOwner, const SwFrame*
     const SwTextFrame* pTextFrame = pConstructor->DynCastTextFrame();
     if ( pTextFrame )
     {
-        
pTextFrame->GetTextNodeForParaProps()->ClearLRSpaceItemDueToListLevelIndents( 
m_xLR );
+        m_pFirstLineIndent.reset(m_rAttrSet.GetFirstLineIndent().Clone());
+        m_pTextLeftMargin.reset(m_rAttrSet.GetTextLeftMargin().Clone());
+        m_pRightMargin.reset(m_rAttrSet.GetRightMargin().Clone());
+        
pTextFrame->GetTextNodeForParaProps()->ClearLRSpaceItemDueToListLevelIndents(m_pFirstLineIndent,
 m_pTextLeftMargin);
+        assert(m_pFirstLineIndent);
+        assert(m_pTextLeftMargin);
     }
-    else if ( pConstructor->IsNoTextFrame() )
+    else
     {
-        m_xLR = std::make_shared<SvxLRSpaceItem>(RES_LR_SPACE);
+        // LRSpaceItem is copied due to the possibility that it is adjusted
+        m_xLR.reset(m_rAttrSet.GetLRSpace().Clone());
+        if (pConstructor->IsNoTextFrame())
+        {
+            m_xLR = std::make_shared<SvxLRSpaceItem>(RES_LR_SPACE);
+        }
+        assert(m_xLR);
     }
 
-    assert(m_xLR && "always exists");
-
     // Caution: The USHORTs for the cached values are not initialized by 
intention!
 
     // everything needs to be calculated at least once:
@@ -2298,7 +2304,7 @@ void SwBorderAttrs::CalcTop_()
 
     bool bGutterAtTop = m_rAttrSet.GetDoc()->getIDocumentSettingAccess().get(
         DocumentSettingId::GUTTER_AT_TOP);
-    if (bGutterAtTop)
+    if (bGutterAtTop && m_xLR)
     {
         // Decrease the print area: the top space is the sum of top and gutter 
margins.
         m_nTop += m_xLR->GetGutterMargin();
@@ -2327,8 +2333,17 @@ tools::Long SwBorderAttrs::CalcRight( const SwFrame* 
pCaller ) const
 
     }
     // for paragraphs, "left" is "before text" and "right" is "after text"
-    if ( pCaller->IsTextFrame() && pCaller->IsRightToLeft() )
-        nRight += m_xLR->GetLeft();
+    if (pCaller->IsTextFrame())
+    {
+        if (pCaller->IsRightToLeft())
+        {
+            nRight += m_pTextLeftMargin->GetLeft(*m_pFirstLineIndent);
+        }
+        else
+        {
+            nRight += m_pRightMargin->GetRight();
+        }
+    }
     else
         nRight += m_xLR->GetRight();
 
@@ -2391,7 +2406,7 @@ tools::Long SwBorderAttrs::CalcLeft( const SwFrame 
*pCaller ) const
 
     // for paragraphs, "left" is "before text" and "right" is "after text"
     if ( pCaller->IsTextFrame() && pCaller->IsRightToLeft() )
-        nLeft += m_xLR->GetRight();
+        nLeft += m_pRightMargin->GetRight();
     else
     {
         bool bIgnoreMargin = false;
@@ -2407,8 +2422,12 @@ tools::Long SwBorderAttrs::CalcLeft( const SwFrame 
*pCaller ) const
                 else if (pTextFrame->FindPrev() && 
pTextFrame->FindPrev()->IsTextFrame() && lcl_hasTabFrame(static_cast<const 
SwTextFrame*>(pTextFrame->FindPrev())))
                     bIgnoreMargin = true;
             }
+            if (!bIgnoreMargin)
+            {
+                nLeft += m_pTextLeftMargin->GetLeft(*m_pFirstLineIndent);
+            }
         }
-        if (!bIgnoreMargin)
+        else
             nLeft += m_xLR->GetLeft();
     }
 
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index 5a31c3c0a2d5..7484db742c7c 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -541,6 +541,9 @@ void SwFrame::UpdateAttrFrame( const SfxPoolItem *pOld, 
const SfxPoolItem *pNew,
         case RES_SHADOW:
             Prepare( PrepareHint::FixSizeChanged );
             [[fallthrough]];
+        case RES_MARGIN_FIRSTLINE:
+        case RES_MARGIN_TEXTLEFT:
+        case RES_MARGIN_RIGHT:
         case RES_LR_SPACE:
         case RES_UL_SPACE:
         case RES_RTL_GUTTER:
@@ -2490,6 +2493,9 @@ void SwContentFrame::UpdateAttr_( const SfxPoolItem* 
pOld, const SfxPoolItem* pN
                 rInvFlags |= SwContentFrameInvFlags::SetNextCompletePaint;
                 [[fallthrough]];
             }
+        case RES_MARGIN_FIRSTLINE:
+        case RES_MARGIN_TEXTLEFT:
+        case RES_MARGIN_RIGHT:
         case RES_LR_SPACE:
         case RES_BOX:
         case RES_SHADOW:
diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx 
b/sw/source/core/text/EnhancedPDFExportHelper.cxx
index 9e7a01c60a7f..053b67990eda 100644
--- a/sw/source/core/text/EnhancedPDFExportHelper.cxx
+++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx
@@ -661,9 +661,9 @@ void SwTaggedPDFHelper::SetAttributes( 
vcl::PDFWriter::StructElement eType )
         if ( bTextIndent )
         {
             OSL_ENSURE( pFrame->IsTextFrame(), "Frame type <-> tag attribute 
mismatch" );
-            const SvxLRSpaceItem &rSpace =
-                static_cast<const 
SwTextFrame*>(pFrame)->GetTextNodeForParaProps()->GetSwAttrSet().GetLRSpace();
-            nVal =  rSpace.GetTextFirstLineOffset();
+            const SvxFirstLineIndentItem& rFirstLine(
+                static_cast<const 
SwTextFrame*>(pFrame)->GetTextNodeForParaProps()->GetSwAttrSet().GetFirstLineIndent());
+            nVal = rFirstLine.GetTextFirstLineOffset();
             if ( 0 != nVal )
                 mpPDFExtOutDevData->SetStructureAttributeNumerical( 
vcl::PDFWriter::TextIndent, nVal );
         }
diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx
index 0891a38321e7..d7f7a2cab99e 100644
--- a/sw/source/core/text/frmcrsr.cxx
+++ b/sw/source/core/text/frmcrsr.cxx
@@ -1431,16 +1431,18 @@ void SwTextFrame::FillCursorPos( SwFillData& rFill ) 
const
         else
         {
             const SvxTabStopItem &rRuler = pSet->GetTabStops();
-            const SvxLRSpaceItem &rLRSpace = pSet->GetLRSpace();
+            const SvxFirstLineIndentItem& 
rFirstLine(pSet->GetFirstLineIndent());
+            const SvxTextLeftMarginItem& 
rTextLeftMargin(pSet->GetTextLeftMargin());
+            const SvxRightMarginItem& rRightMargin(pSet->GetRightMargin());
 
             SwRect &rRect = rFill.Fill().aCursor;
             rRect.Top( rFill.Bottom() + (nDiff+1) * nDist - nLineHeight );
             if( nFirst && nDiff > -1 )
                 rRect.Top( rRect.Top() + nFirst );
             rRect.Height( nLineHeight );
-            SwTwips nLeft = rFill.Left() + rLRSpace.GetLeft() +
+            SwTwips nLeft = rFill.Left() + rTextLeftMargin.GetLeft(rFirstLine) 
+
                             GetTextNodeForParaProps()->GetLeftMarginWithNum();
-            SwTwips nRight = rFill.Right() - rLRSpace.GetRight();
+            SwTwips nRight = rFill.Right() - rRightMargin.GetRight();
             SwTwips nCenter = ( nLeft + nRight ) / 2;
             rRect.Left( nLeft );
             if( SwFillMode::Margin == rFill.Mode() )
@@ -1510,7 +1512,7 @@ void SwTextFrame::FillCursorPos( SwFillData& rFill ) const
                 }
                 else if( rFill.X() > nLeft )
                 {
-                    SwTwips nTextLeft = rFill.Left() + rLRSpace.GetTextLeft() +
+                    SwTwips nTextLeft = rFill.Left() + 
rTextLeftMargin.GetTextLeft() +
                         GetTextNodeForParaProps()->GetLeftMarginWithNum(true);
                     rFill.nLineWidth += rFill.bFirstLine ? nLeft : nTextLeft;
                     SwTwips nLeftTab;
diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx
index 461c8094c0ac..2af086d9fd69 100644
--- a/sw/source/core/text/frmpaint.cxx
+++ b/sw/source/core/text/frmpaint.cxx
@@ -570,11 +570,13 @@ bool SwTextFrame::PaintEmpty( const SwRect &rRect, bool 
bCheck ) const
                 pFnt->ChgPhysFnt( pSh, *pSh->GetOut() );
                 Point aPos = getFrameArea().Pos() + getFramePrintArea().Pos();
 
-                const SvxLRSpaceItem &rSpace =
-                    GetTextNodeForParaProps()->GetSwAttrSet().GetLRSpace();
+                const SvxFirstLineIndentItem& rFirstLine(
+                    
GetTextNodeForParaProps()->GetSwAttrSet().GetFirstLineIndent());
 
-                if ( rSpace.GetTextFirstLineOffset() > 0 )
-                    aPos.AdjustX(rSpace.GetTextFirstLineOffset() );
+                if (0 < rFirstLine.GetTextFirstLineOffset())
+                {
+                    aPos.AdjustX(rFirstLine.GetTextFirstLineOffset());
+                }
 
                 std::unique_ptr<SwSaveClip, o3tl::default_delete<SwSaveClip>> 
xClip;
                 if( IsUndersized() )
diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx
index 613a2aa44265..bc46758eb590 100644
--- a/sw/source/core/text/itratr.cxx
+++ b/sw/source/core/text/itratr.cxx
@@ -1026,8 +1026,9 @@ void SwTextNode::GetMinMaxSize( SwNodeOffset nIndex, 
sal_uLong& rMin, sal_uLong
     rMax = 0;
     rAbsMin = 0;
 
-    const SvxLRSpaceItem &rSpace = GetSwAttrSet().GetLRSpace();
-    tools::Long nLROffset = rSpace.GetTextLeft() + GetLeftMarginWithNum( true 
);
+    SvxTextLeftMarginItem const& 
rTextLeftMargin(GetSwAttrSet().GetTextLeftMargin());
+    SvxRightMarginItem const& rRightMargin(GetSwAttrSet().GetRightMargin());
+    tools::Long nLROffset = rTextLeftMargin.GetTextLeft() + 
GetLeftMarginWithNum( true );
     short nFLOffs;
     // For enumerations a negative first line indentation is probably filled 
already
     if( !GetFirstLineOfsWithNum( nFLOffs ) || nFLOffs > nLROffset )
@@ -1037,7 +1038,7 @@ void SwTextNode::GetMinMaxSize( SwNodeOffset nIndex, 
sal_uLong& rMin, sal_uLong
     aNodeArgs.m_nMinWidth = 0;
     aNodeArgs.m_nMaxWidth = 0;
     aNodeArgs.m_nLeftRest = nLROffset;
-    aNodeArgs.m_nRightRest = rSpace.GetRight();
+    aNodeArgs.m_nRightRest = rRightMargin.GetRight();
     aNodeArgs.m_nLeftDiff = 0;
     aNodeArgs.m_nRightDiff = 0;
     if( nIndex )
@@ -1057,7 +1058,7 @@ void SwTextNode::GetMinMaxSize( SwNodeOffset nIndex, 
sal_uLong& rMin, sal_uLong
         aNodeArgs.m_nMaxWidth -= aNodeArgs.m_nLeftRest;
 
     if (aNodeArgs.m_nRightRest < 0)
-        aNodeArgs.Minimum(rSpace.GetRight() - aNodeArgs.m_nRightRest);
+        aNodeArgs.Minimum(rRightMargin.GetRight() - aNodeArgs.m_nRightRest);
     aNodeArgs.m_nRightRest -= aNodeArgs.m_nRightDiff;
     if (aNodeArgs.m_nRightRest < 0)
         aNodeArgs.m_nMaxWidth -= aNodeArgs.m_nRightRest;
@@ -1230,7 +1231,7 @@ void SwTextNode::GetMinMaxSize( SwNodeOffset nIndex, 
sal_uLong& rMin, sal_uLong
     if (static_cast<tools::Long>(rMax) < aArg.m_nRowWidth)
         rMax = aArg.m_nRowWidth;
 
-    nLROffset += rSpace.GetRight();
+    nLROffset += rRightMargin.GetRight();
 
     rAbsMin += nLROffset;
     rAbsMin += nAdd;
diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index 47befa14d008..7158aa9f0d8f 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -161,7 +161,8 @@ void SwTextMargin::CtorInitTextMargin( SwTextFrame 
*pNewFrame, SwTextSizeInfo *p
     GetInfo().SetFont( GetFnt() );
     const SwTextNode *const pNode = m_pFrame->GetTextNodeForParaProps();
 
-    const SvxLRSpaceItem &rSpace = pNode->GetSwAttrSet().GetLRSpace();
+    SvxFirstLineIndentItem const& 
rFirstLine(pNode->GetSwAttrSet().GetFirstLineIndent());
+    SvxTextLeftMarginItem const& 
rTextLeftMargin(pNode->GetSwAttrSet().GetTextLeftMargin());
     // #i95907#
     // #i111284#
     const SwTextNode *pTextNode = m_pFrame->GetTextNodeForParaProps();
@@ -193,7 +194,7 @@ void SwTextMargin::CtorInitTextMargin( SwTextFrame 
*pNewFrame, SwTextSizeInfo *p
                 // rSpace.GetLeft() + rSpace.GetTextLeft();
                 ( bListLevelIndentsApplicableAndLabelAlignmentActive
                   ? 0
-                  : ( rSpace.GetLeft() - rSpace.GetTextLeft() ) );
+                  : (rTextLeftMargin.GetLeft(rFirstLine) - 
rTextLeftMargin.GetTextLeft()));
     }
     else
     {
@@ -211,12 +212,12 @@ void SwTextMargin::CtorInitTextMargin( SwTextFrame 
*pNewFrame, SwTextSizeInfo *p
                     // #i111284#
                     ( bListLevelIndentsApplicableAndLabelAlignmentActive
                       ? 0
-                      : ( rSpace.GetLeft() - rSpace.GetTextLeft() ) );
+                      : (rTextLeftMargin.GetLeft(rFirstLine) - 
rTextLeftMargin.GetTextLeft()));
         }
         else
         {
             mnLeft = m_pFrame->getFrameArea().Left() +
-                    std::max( tools::Long( rSpace.GetTextLeft() + nLMWithNum ),
+                std::max(tools::Long(rTextLeftMargin.GetTextLeft() + 
nLMWithNum),
                          m_pFrame->getFramePrintArea().Left() );
         }
     }
@@ -242,7 +243,7 @@ void SwTextMargin::CtorInitTextMargin( SwTextFrame 
*pNewFrame, SwTextSizeInfo *p
         short nFLOfst = 0;
         tools::Long nFirstLineOfs = 0;
         if( !pNode->GetFirstLineOfsWithNum( nFLOfst ) &&
-            rSpace.IsAutoFirst() )
+            rFirstLine.IsAutoFirst())
         {
             nFirstLineOfs = GetFnt()->GetSize( GetFnt()->GetActual() 
).Height();
             LanguageType const aLang = m_pFrame->GetLangOfChar(
@@ -325,7 +326,7 @@ void SwTextMargin::CtorInitTextMargin( SwTextFrame 
*pNewFrame, SwTextSizeInfo *p
         else
         {
               mnFirst = m_pFrame->getFrameArea().Left() +
-                     std::max( rSpace.GetTextLeft() + nLMWithNum+ 
nFirstLineOfs,
+                 std::max(rTextLeftMargin.GetTextLeft() + nLMWithNum + 
nFirstLineOfs,
                           m_pFrame->getFramePrintArea().Left() );
         }
 
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx
index 795caed47d92..dbe62d49e6bb 100644
--- a/sw/source/core/text/porfld.cxx
+++ b/sw/source/core/text/porfld.cxx
@@ -575,7 +575,7 @@ bool SwNumberPortion::Format( SwTextFormatInfo &rInf )
             {
                 nDiff = rInf.Left()
                     + rInf.GetTextFrame()->GetTextNodeForParaProps()->
-                    GetSwAttrSet().GetLRSpace().GetTextFirstLineOffset()
+                        
GetSwAttrSet().GetFirstLineIndent().GetTextFirstLineOffset()
                     - rInf.First()
                     + rInf.ForcedLeftMargin();
             }
diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx
index 90f4d763578d..73bd05aa96da 100644
--- a/sw/source/core/text/porrst.cxx
+++ b/sw/source/core/text/porrst.cxx
@@ -427,8 +427,10 @@ bool SwTextFrame::FormatEmpty()
     const SvxLineSpacingItem &rSpacing = aSet.GetLineSpacing();
     if( !bCollapse && ( SvxLineSpaceRule::Min == rSpacing.GetLineSpaceRule() ||
         SvxLineSpaceRule::Fix == rSpacing.GetLineSpaceRule() ||
-        aSet.GetLRSpace().IsAutoFirst() ) )
+        aSet.GetFirstLineIndent().IsAutoFirst()))
+    {
         return false;
+    }
 
     SwTextFly aTextFly( this );
     SwRect aRect;
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index 7ac2a5183114..bd772efc74f9 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -1756,7 +1756,7 @@ void SwTextFrame::CalcLineSpace()
         return;
 
     if( GetDrawObjs() ||
-        GetTextNodeForParaProps()->GetSwAttrSet().GetLRSpace().IsAutoFirst())
+        
GetTextNodeForParaProps()->GetSwAttrSet().GetFirstLineIndent().IsAutoFirst())
     {
         Init();
         return;
diff --git a/sw/source/core/tox/ToxTabStopTokenHandler.cxx 
b/sw/source/core/tox/ToxTabStopTokenHandler.cxx
index a89e9ad276eb..b3943d6e5393 100644
--- a/sw/source/core/tox/ToxTabStopTokenHandler.cxx
+++ b/sw/source/core/tox/ToxTabStopTokenHandler.cxx
@@ -50,11 +50,12 @@ DefaultToxTabStopTokenHandler::HandleTabStopToken(
 
     // check whether a tab adjustment has been specified.
     if (SvxTabAdjust::End > aToken.eTabAlign) {
-        const SvxLRSpaceItem& rLR = 
targetNode.SwContentNode::GetAttr(RES_LR_SPACE);
-
+        SvxTextLeftMarginItem const& rTextLeftMargin(
+            targetNode.SwContentNode::GetAttr(RES_MARGIN_TEXTLEFT));
         tools::Long nTabPosition = aToken.nTabStopPosition;
-        if (!mTabPositionIsRelativeToParagraphIndent && rLR.GetTextLeft()) {
-            nTabPosition -= rLR.GetTextLeft();
+        if (!mTabPositionIsRelativeToParagraphIndent && 
rTextLeftMargin.GetTextLeft() != 0)
+        {
+            nTabPosition -= rTextLeftMargin.GetTextLeft();
         }
         result.tabStop = SvxTabStop(nTabPosition, aToken.eTabAlign, 
cDfltDecimalChar, aToken.cTabFillChar);
         return result;
@@ -73,9 +74,12 @@ DefaultToxTabStopTokenHandler::HandleTabStopToken(
     //#i24363# tab stops relative to indent
     if (mTabStopReferencePolicy == TABSTOPS_RELATIVE_TO_INDENT) {
         // left margin of paragraph style
-        const SvxLRSpaceItem& rLRSpace = 
targetNode.GetTextColl()->GetLRSpace();
-        nRightMargin -= rLRSpace.GetLeft();
-        nRightMargin -= rLRSpace.GetTextFirstLineOffset();
+        SvxFirstLineIndentItem const& rFirstLine(
+            targetNode.GetTextColl()->GetFirstLineIndent());
+        SvxTextLeftMarginItem const& rTextLeftMargin(
+            targetNode.GetTextColl()->GetTextLeftMargin());
+        nRightMargin -= rTextLeftMargin.GetLeft(rFirstLine);
+        nRightMargin -= rFirstLine.GetTextFirstLineOffset();
     }
 
     result.tabStop = SvxTabStop(nRightMargin, SvxTabAdjust::Right, 
cDfltDecimalChar, aToken.cTabFillChar);
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index ba7ab2b1f54f..ed2065f02c70 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -2976,7 +2976,7 @@ void SwTextNode::NumRuleChgd()
     // in the list tree reflected in the layout.
     // Important note:
     {
-        SvxLRSpaceItem& rLR = 
const_cast<SvxLRSpaceItem&>(GetSwAttrSet().GetLRSpace());
+        SvxTextLeftMarginItem & rLR = 
const_cast<SvxTextLeftMarginItem&>(GetSwAttrSet().GetTextLeftMargin());
         CallSwClientNotify(sw::LegacyModifyHint(&rLR, &rLR));
     }
 
@@ -3294,7 +3294,10 @@ tools::Long SwTextNode::GetLeftMarginWithNum( bool 
bTextLeft ) const
             }
 
             if( pRule->IsAbsSpaces() )
-                nRet = nRet - GetSwAttrSet().GetLRSpace().GetLeft();
+            {
+                SvxFirstLineIndentItem const& 
rFirst(GetSwAttrSet().GetFirstLineIndent());
+                nRet = nRet - 
GetSwAttrSet().GetTextLeftMargin().GetLeft(rFirst);
+            }
         }
         else if ( rFormat.GetPositionAndSpaceMode() == 
SvxNumberFormat::LABEL_ALIGNMENT )
         {
@@ -3333,7 +3336,7 @@ bool SwTextNode::GetFirstLineOfsWithNum( short& rFLOffset 
) const
 
                 if 
(!getIDocumentSettingAccess()->get(DocumentSettingId::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING))
                 {
-                    SvxLRSpaceItem aItem = GetSwAttrSet().GetLRSpace();
+                    SvxFirstLineIndentItem const 
aItem(GetSwAttrSet().GetFirstLineIndent());
                     rFLOffset = rFLOffset + aItem.GetTextFirstLineOffset();
                 }
             }
@@ -3345,7 +3348,7 @@ bool SwTextNode::GetFirstLineOfsWithNum( short& rFLOffset 
) const
                 }
                 else if 
(!getIDocumentSettingAccess()->get(DocumentSettingId::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING))
                 {
-                    SvxLRSpaceItem aItem = GetSwAttrSet().GetLRSpace();
+                    SvxFirstLineIndentItem const 
aItem(GetSwAttrSet().GetFirstLineIndent());
                     rFLOffset = aItem.GetTextFirstLineOffset();
                 }
             }
@@ -3354,7 +3357,7 @@ bool SwTextNode::GetFirstLineOfsWithNum( short& rFLOffset 
) const
         return true;
     }
 
-    rFLOffset = GetSwAttrSet().GetLRSpace().GetTextFirstLineOffset();
+    rFLOffset = GetSwAttrSet().GetFirstLineIndent().GetTextFirstLineOffset();
     return false;
 }
 
@@ -3368,12 +3371,13 @@ SwTwips 
SwTextNode::GetAdditionalIndentForStartingNewList() const
         const SwNumFormat& rFormat = 
pRule->Get(lcl_BoundListLevel(GetActualListLevel()));
         if ( rFormat.GetPositionAndSpaceMode() == 
SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
         {
-            nAdditionalIndent = GetSwAttrSet().GetLRSpace().GetLeft();
+            SvxFirstLineIndentItem const& 
rFirst(GetSwAttrSet().GetFirstLineIndent());
+            nAdditionalIndent = 
GetSwAttrSet().GetTextLeftMargin().GetLeft(rFirst);
 
             if 
(getIDocumentSettingAccess()->get(DocumentSettingId::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING))
             {
                 nAdditionalIndent = nAdditionalIndent -
-                                    
GetSwAttrSet().GetLRSpace().GetTextFirstLineOffset();
+                    
GetSwAttrSet().GetFirstLineIndent().GetTextFirstLineOffset();
             }
         }
         else if ( rFormat.GetPositionAndSpaceMode() == 
SvxNumberFormat::LABEL_ALIGNMENT )
@@ -3384,25 +3388,29 @@ SwTwips 
SwTextNode::GetAdditionalIndentForStartingNewList() const
             }
             else
             {
-                nAdditionalIndent = GetSwAttrSet().GetLRSpace().GetLeft();
+                SvxFirstLineIndentItem const& 
rFirst(GetSwAttrSet().GetFirstLineIndent());
+                nAdditionalIndent = 
GetSwAttrSet().GetTextLeftMargin().GetLeft(rFirst);
                 if 
(getIDocumentSettingAccess()->get(DocumentSettingId::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING))
                 {
                     nAdditionalIndent = nAdditionalIndent -
-                                        
GetSwAttrSet().GetLRSpace().GetTextFirstLineOffset();
+                        
GetSwAttrSet().GetFirstLineIndent().GetTextFirstLineOffset();
                 }
             }
         }
     }
     else
     {
-        nAdditionalIndent = GetSwAttrSet().GetLRSpace().GetLeft();
+        SvxFirstLineIndentItem const& 
rFirst(GetSwAttrSet().GetFirstLineIndent());
+        nAdditionalIndent = GetSwAttrSet().GetTextLeftMargin().GetLeft(rFirst);
     }
 
     return nAdditionalIndent;
 }
 
 // #i96772#
-void SwTextNode::ClearLRSpaceItemDueToListLevelIndents( 
std::shared_ptr<SvxLRSpaceItem>& o_rLRSpaceItem ) const
+void SwTextNode::ClearLRSpaceItemDueToListLevelIndents(
+        std::unique_ptr<SvxFirstLineIndentItem>& o_rFirstLineItem,
+        std::unique_ptr<SvxTextLeftMarginItem>& o_rTextLeftMarginItem) const
 {
     if ( AreListLevelIndentsApplicable() )
     {
@@ -3412,7 +3420,8 @@ void SwTextNode::ClearLRSpaceItemDueToListLevelIndents( 
std::shared_ptr<SvxLRSpa
             const SwNumFormat& rFormat = 
pRule->Get(lcl_BoundListLevel(GetActualListLevel()));
             if ( rFormat.GetPositionAndSpaceMode() == 
SvxNumberFormat::LABEL_ALIGNMENT )
             {
-                o_rLRSpaceItem = 
std::make_shared<SvxLRSpaceItem>(RES_LR_SPACE);
+                o_rFirstLineItem = 
std::make_unique<SvxFirstLineIndentItem>(RES_MARGIN_FIRSTLINE);
+                o_rTextLeftMarginItem = 
std::make_unique<SvxTextLeftMarginItem>(RES_MARGIN_TEXTLEFT);
             }
         }
     }
@@ -3439,7 +3448,7 @@ tools::Long SwTextNode::GetLeftMarginForTabCalculation() 
const
     }
     if ( !bLeftMarginForTabCalcSetToListLevelIndent )
     {
-        nLeftMarginForTabCalc = GetSwAttrSet().GetLRSpace().GetTextLeft();
+        nLeftMarginForTabCalc = 
GetSwAttrSet().GetTextLeftMargin().GetTextLeft();
     }
 
     return nLeftMarginForTabCalc;
@@ -4690,7 +4699,7 @@ bool SwTextNode::GetListTabStopPosition( tools::Long& 
nListTabStopPosition ) con
                 }
                 else if 
(!getIDocumentSettingAccess()->get(DocumentSettingId::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING))
                 {
-                    SvxLRSpaceItem aItem = GetSwAttrSet().GetLRSpace();
+                    SvxTextLeftMarginItem const 
aItem(GetSwAttrSet().GetTextLeftMargin());
                     nListTabStopPosition -= aItem.GetTextLeft();
                 }
             }
diff --git a/sw/source/core/txtnode/thints.cxx 
b/sw/source/core/txtnode/thints.cxx
index 59a931a406de..c31afa4abead 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -2121,10 +2121,10 @@ static void lcl_MergeListLevelIndentAsLRSpaceItem( 
const SwTextNode& rTextNode,
         const SwNumFormat& rFormat = 
pRule->Get(o3tl::narrowing<sal_uInt16>(rTextNode.GetActualListLevel()));
         if ( rFormat.GetPositionAndSpaceMode() == 
SvxNumberFormat::LABEL_ALIGNMENT )
         {
-            SvxLRSpaceItem aLR( RES_LR_SPACE );
-            aLR.SetTextLeft( rFormat.GetIndentAt() );
-            aLR.SetTextFirstLineOffset( 
static_cast<short>(rFormat.GetFirstLineIndent()) );
-            rSet.Put( aLR );
+            SvxTextLeftMarginItem const leftMargin(rFormat.GetIndentAt(), 
RES_MARGIN_TEXTLEFT);
+            SvxFirstLineIndentItem const 
firstLine(static_cast<short>(rFormat.GetFirstLineIndent()), 
RES_MARGIN_FIRSTLINE);
+            rSet.Put(firstLine);
+            rSet.Put(leftMargin);
         }
     }
 }
diff --git a/sw/source/core/unocore/unomapproperties.hxx 
b/sw/source/core/unocore/unomapproperties.hxx
index d849c4fcb36c..77cd36a1bb51 100644
--- a/sw/source/core/unocore/unomapproperties.hxx
+++ b/sw/source/core/unocore/unomapproperties.hxx
@@ -147,10 +147,10 @@
         { UNO_NAME_PARA_GRAPHIC,                        RES_BACKGROUND,        
        cppu::UnoType<css::graphic::XGraphic>::get(),      
PropertyAttribute::MAYBEVOID, MID_GRAPHIC                        }, \
         { UNO_NAME_PARA_GRAPHIC_FILTER,                 RES_BACKGROUND,        
        cppu::UnoType<OUString>::get(),      PropertyAttribute::MAYBEVOID, 
MID_GRAPHIC_FILTER                     }, \
         { UNO_NAME_PARA_GRAPHIC_LOCATION,               RES_BACKGROUND,        
        cppu::UnoType<css::style::GraphicLocation>::get(),    
PropertyAttribute::MAYBEVOID, MID_GRAPHIC_POSITION                   }, \
-        { UNO_NAME_PARA_LEFT_MARGIN,                    RES_LR_SPACE,          
        cppu::UnoType<sal_Int32>::get(),         PropertyAttribute::MAYBEVOID, 
MID_TXT_LMARGIN        | CONVERT_TWIPS }, \
-        { UNO_NAME_PARA_RIGHT_MARGIN,                   RES_LR_SPACE,          
        cppu::UnoType<sal_Int32>::get(),         PropertyAttribute::MAYBEVOID, 
MID_R_MARGIN           | CONVERT_TWIPS }, \
-        { UNO_NAME_PARA_IS_AUTO_FIRST_LINE_INDENT,      RES_LR_SPACE,          
        cppu::UnoType<bool>::get(),       PropertyAttribute::MAYBEVOID, 
MID_FIRST_AUTO                         }, \
-        { UNO_NAME_PARA_FIRST_LINE_INDENT,              RES_LR_SPACE,          
        cppu::UnoType<sal_Int32>::get(),         PropertyAttribute::MAYBEVOID, 
MID_FIRST_LINE_INDENT  | CONVERT_TWIPS }, \
+        { UNO_NAME_PARA_LEFT_MARGIN,                    RES_MARGIN_TEXTLEFT,   
        cppu::UnoType<sal_Int32>::get(),     PropertyAttribute::MAYBEVOID, 
MID_TXT_LMARGIN        | CONVERT_TWIPS }, \
+        { UNO_NAME_PARA_RIGHT_MARGIN,                   RES_MARGIN_RIGHT,      
        cppu::UnoType<sal_Int32>::get(),     PropertyAttribute::MAYBEVOID, 
MID_R_MARGIN           | CONVERT_TWIPS }, \
+        { UNO_NAME_PARA_IS_AUTO_FIRST_LINE_INDENT,      RES_MARGIN_FIRSTLINE,  
        cppu::UnoType<bool>::get(),          PropertyAttribute::MAYBEVOID, 
MID_FIRST_AUTO                         }, \
+        { UNO_NAME_PARA_FIRST_LINE_INDENT,              RES_MARGIN_FIRSTLINE,  
        cppu::UnoType<sal_Int32>::get(),     PropertyAttribute::MAYBEVOID, 
MID_FIRST_LINE_INDENT  | CONVERT_TWIPS }, \
         STANDARD_FONT_PROPERTIES \
         CJK_FONT_PROPERTIES \
         CTL_FONT_PROPERTIES \
@@ -392,13 +392,13 @@
                     { UNO_NAME_CHAR_OVERLINE, RES_CHRATR_OVERLINE ,  
cppu::UnoType<sal_Int16>::get(),      PROPERTY_NONE, MID_TL_STYLE},\
                     { UNO_NAME_CHAR_OVERLINE_COLOR, RES_CHRATR_OVERLINE ,  
cppu::UnoType<sal_Int32>::get(),            PROPERTY_NONE, MID_TL_COLOR},\
                     { UNO_NAME_CHAR_OVERLINE_HAS_COLOR, RES_CHRATR_OVERLINE ,  
cppu::UnoType<bool>::get(),              PROPERTY_NONE, MID_TL_HASCOLOR},\
-                    { UNO_NAME_PARA_LEFT_MARGIN, RES_LR_SPACE,            
cppu::UnoType<sal_Int32>::get(), PROPERTY_NONE, MID_TXT_LMARGIN|CONVERT_TWIPS},\
-                    { UNO_NAME_PARA_RIGHT_MARGIN, RES_LR_SPACE,           
cppu::UnoType<sal_Int32>::get(), PROPERTY_NONE, MID_R_MARGIN|CONVERT_TWIPS},\
-                    { UNO_NAME_PARA_LEFT_MARGIN_RELATIVE, RES_LR_SPACE,        
  cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE,        MID_L_REL_MARGIN},\
-                    { UNO_NAME_PARA_RIGHT_MARGIN_RELATIVE, RES_LR_SPACE,       
  cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE,        MID_R_REL_MARGIN},\
-                    { UNO_NAME_PARA_IS_AUTO_FIRST_LINE_INDENT, RES_LR_SPACE,   
       cppu::UnoType<bool>::get(),      PROPERTY_NONE, MID_FIRST_AUTO},\
-                    { UNO_NAME_PARA_FIRST_LINE_INDENT, RES_LR_SPACE,           
cppu::UnoType<sal_Int32>::get(), PROPERTY_NONE, 
MID_FIRST_LINE_INDENT|CONVERT_TWIPS},\
-                    { UNO_NAME_PARA_FIRST_LINE_INDENT_RELATIVE, RES_LR_SPACE,  
       cppu::UnoType<sal_Int32>::get(), PROPERTY_NONE, 
MID_FIRST_LINE_REL_INDENT|CONVERT_TWIPS},\
+                    { UNO_NAME_PARA_LEFT_MARGIN, RES_MARGIN_TEXTLEFT, 
cppu::UnoType<sal_Int32>::get(), PROPERTY_NONE, MID_TXT_LMARGIN|CONVERT_TWIPS},\
+                    { UNO_NAME_PARA_RIGHT_MARGIN, RES_MARGIN_RIGHT, 
cppu::UnoType<sal_Int32>::get(), PROPERTY_NONE, MID_R_MARGIN|CONVERT_TWIPS},\
+                    { UNO_NAME_PARA_LEFT_MARGIN_RELATIVE, RES_MARGIN_TEXTLEFT, 
cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE,        MID_L_REL_MARGIN},\
+                    { UNO_NAME_PARA_RIGHT_MARGIN_RELATIVE, RES_MARGIN_RIGHT, 
cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE,        MID_R_REL_MARGIN},\
+                    { UNO_NAME_PARA_IS_AUTO_FIRST_LINE_INDENT, 
RES_MARGIN_FIRSTLINE, cppu::UnoType<bool>::get(),      PROPERTY_NONE, 
MID_FIRST_AUTO},\
+                    { UNO_NAME_PARA_FIRST_LINE_INDENT, RES_MARGIN_FIRSTLINE, 
cppu::UnoType<sal_Int32>::get(), PROPERTY_NONE, 
MID_FIRST_LINE_INDENT|CONVERT_TWIPS},\
+                    { UNO_NAME_PARA_FIRST_LINE_INDENT_RELATIVE, 
RES_MARGIN_FIRSTLINE, cppu::UnoType<sal_Int32>::get(), PROPERTY_NONE, 
MID_FIRST_LINE_REL_INDENT|CONVERT_TWIPS},\
                     { UNO_NAME_CHAR_KERNING, RES_CHRATR_KERNING    ,  
cppu::UnoType<sal_Int16>::get()  ,         PROPERTY_NONE,  CONVERT_TWIPS},\
                     { UNO_NAME_CHAR_NO_HYPHENATION, RES_CHRATR_NOHYPHEN   ,   
cppu::UnoType<bool>::get()  ,       PROPERTY_NONE,     0},\
                     { UNO_NAME_CHAR_SHADOWED, RES_CHRATR_SHADOWED  ,  
cppu::UnoType<bool>::get()  ,       PROPERTY_NONE, 0},\
@@ -505,10 +505,10 @@
                     { UNO_NAME_NUMBERING_RULES, 
RES_PARATR_NUMRULE,cppu::UnoType<sal_Int16>::get(), 
PropertyAttribute::MAYBEVOID, CONVERT_TWIPS},    \
                     { UNO_NAME_PARA_ADJUST, RES_PARATR_ADJUST,      
cppu::UnoType<sal_Int16>::get(),         PropertyAttribute::MAYBEVOID, 
MID_PARA_ADJUST}, \
                     { UNO_NAME_PARA_BOTTOM_MARGIN, RES_UL_SPACE,          
cppu::UnoType<sal_Int32>::get(),           PropertyAttribute::MAYBEVOID, 
MID_LO_MARGIN|CONVERT_TWIPS}, \
-                    { UNO_NAME_PARA_FIRST_LINE_INDENT, RES_LR_SPACE,           
cppu::UnoType<sal_Int32>::get(),      PropertyAttribute::MAYBEVOID, 
MID_FIRST_LINE_INDENT|CONVERT_TWIPS}, \

... etc. - the rest is truncated

Reply via email to