cui/source/tabpages/paragrph.cxx                   |   30 +-
 cui/source/tabpages/tabstpge.cxx                   |    3 
 editeng/source/editeng/editdbg.cxx                 |    3 
 editeng/source/editeng/editdoc.cxx                 |    7 
 editeng/source/editeng/editview.cxx                |    2 
 editeng/source/editeng/impedit.hxx                 |    2 
 editeng/source/editeng/impedit2.cxx                |   25 ++
 editeng/source/editeng/impedit3.cxx                |   16 +
 editeng/source/editeng/impedit4.cxx                |    3 
 editeng/source/items/frmitems.cxx                  |  227 ++++++++++++++-------
 editeng/source/outliner/outliner.cxx               |    6 
 editeng/source/rtf/rtfitem.cxx                     |    2 
 filter/source/msfilter/svdfppt.cxx                 |    2 
 include/editeng/lrspitem.hxx                       |   48 +++-
 include/editeng/unoprnms.hxx                       |    2 
 include/editeng/unotext.hxx                        |    2 
 reportdesign/source/ui/report/ReportController.cxx |    6 
 sc/source/core/data/stlsheet.cxx                   |   11 -
 sc/source/ui/drawfunc/drtxtob.cxx                  |    4 
 sd/source/core/stlpool.cxx                         |    2 
 sd/source/core/stlsheet.cxx                        |    5 
 sd/source/filter/xml/sdtransform.cxx               |    4 
 sd/source/ui/func/fupage.cxx                       |    5 
 sd/source/ui/view/drtxtob1.cxx                     |    6 
 sd/source/ui/view/drviews3.cxx                     |   36 +--
 sd/source/ui/view/outlview.cxx                     |    2 
 svx/source/dialog/svxruler.cxx                     |    8 
 svx/source/sidebar/paragraph/ParaPropertyPanel.cxx |    7 
 svx/source/sidebar/paragraph/ParaSpacingWindow.cxx |    6 
 sw/source/core/attr/format.cxx                     |    2 
 sw/source/core/crsr/crstrvl.cxx                    |    2 
 sw/source/core/doc/DocumentStylePoolManager.cxx    |   21 +
 sw/source/core/doc/docfmt.cxx                      |    5 
 sw/source/core/doc/fmtcol.cxx                      |    3 
 sw/source/core/docnode/ndtbl.cxx                   |    3 
 sw/source/core/layout/fly.cxx                      |    1 
 sw/source/core/layout/frmtool.cxx                  |    2 
 sw/source/core/text/frmcrsr.cxx                    |    2 
 sw/source/core/text/frmpaint.cxx                   |    1 
 sw/source/core/text/itratr.cxx                     |    1 
 sw/source/core/text/porfld.cxx                     |    1 
 sw/source/core/tox/ToxTabStopTokenHandler.cxx      |    1 
 sw/source/core/txtnode/ndtxt.cxx                   |   21 -
 sw/source/core/txtnode/thints.cxx                  |    7 
 sw/source/filter/html/css1atr.cxx                  |    4 
 sw/source/filter/html/htmlctxt.cxx                 |    2 
 sw/source/filter/html/htmltab.cxx                  |    3 
 sw/source/filter/html/svxcss1.cxx                  |    3 
 sw/source/filter/html/swhtml.cxx                   |    4 
 sw/source/filter/ww8/docxattributeoutput.cxx       |    3 
 sw/source/filter/ww8/rtfattributeoutput.cxx        |    6 
 sw/source/filter/ww8/wrtw8nds.cxx                  |   12 -
 sw/source/filter/ww8/wrtw8sty.cxx                  |    6 
 sw/source/filter/ww8/ww8atr.cxx                    |    7 
 sw/source/filter/ww8/ww8graf.cxx                   |   13 -
 sw/source/filter/ww8/ww8par.cxx                    |   18 -
 sw/source/filter/ww8/ww8par3.cxx                   |    7 
 sw/source/filter/ww8/ww8par6.cxx                   |   17 -
 sw/source/filter/xml/xmlexpit.cxx                  |    9 
 sw/source/filter/xml/xmlimpit.cxx                  |    3 
 sw/source/ui/dialog/uiregionsw.cxx                 |    6 
 sw/source/uibase/app/applab.cxx                    |    2 
 sw/source/uibase/app/docstyle.cxx                  |   11 -
 sw/source/uibase/shells/drwtxtex.cxx               |    4 
 sw/source/uibase/shells/textsh1.cxx                |    3 
 sw/source/uibase/shells/txtattr.cxx                |    3 
 sw/source/uibase/sidebar/WrapPropertyPanel.cxx     |    2 
 sw/source/uibase/uiview/viewtab.cxx                |   14 -
 sw/source/uibase/wrtsh/delete.cxx                  |    4 
 vcl/qa/cppunit/pdfexport/data/tdf36709.fodt        |   95 ++++++--
 vcl/qa/cppunit/pdfexport/pdfexport2.cxx            |   24 ++
 71 files changed, 545 insertions(+), 295 deletions(-)

New commits:
commit 2cb039f570379213ffc9469a132f5b24f425b7be
Author:     Jonathan Clark <[email protected]>
AuthorDate: Fri Nov 8 01:12:48 2024 -0700
Commit:     Jonathan Clark <[email protected]>
CommitDate: Wed Nov 13 15:01:11 2024 +0100

    tdf#36709 editeng: Layout for font-relative first-line indent
    
    This change extends layout for font-relative paragraph first-line
    indentation into Edit Engine.
    
    Change-Id: I5906f493b91fbcb87ded165709fb132b33ce1906
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176487
    Tested-by: Jenkins
    Reviewed-by: Jonathan Clark <[email protected]>

diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx
index 2b262378a361..2889ea2cdf76 100644
--- a/cui/source/tabpages/paragrph.cxx
+++ b/cui/source/tabpages/paragrph.cxx
@@ -412,22 +412,21 @@ bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet* 
rOutSet )
             if (m_aFLineIndent.IsRelative())
             {
                 item.SetTextFirstLineOffset(
-                    rOldItem.GetTextFirstLineOffsetValue(), 
rOldItem.GetTextFirstLineOffsetUnit(),
+                    rOldItem.GetTextFirstLineOffset(),
                     
static_cast<sal_uInt16>(m_aFLineIndent.get_value(FieldUnit::NONE)));
             }
             else
             {
                 // tdf#36709: TODO: Handle font-relative units from GUI
                 item.SetTextFirstLineOffset(
-                    
static_cast<sal_uInt16>(m_aFLineIndent.GetCoreValue(eUnit)),
+                    SvxIndentValue::twips(m_aFLineIndent.GetCoreValue(eUnit)),
                     css::util::MeasureUnit::TWIP);
             }
         }
         else
         {
             // tdf#36709: TODO: Handle font-relative units from GUI
-            
item.SetTextFirstLineOffset(static_cast<sal_uInt16>(m_aFLineIndent.GetCoreValue(eUnit)),
-                                        css::util::MeasureUnit::TWIP);
+            
item.SetTextFirstLineOffset(SvxIndentValue::twips(m_aFLineIndent.GetCoreValue(eUnit)));
         }
         item.SetAutoFirst(m_xAutoCB->get_active());
         if (item.GetTextFirstLineOffsetValue() < 0)
@@ -474,19 +473,26 @@ bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet* 
rOutSet )
                 aMargin.SetRight(m_aRightIndent.GetCoreValue(eUnit));
 
             if ( m_aFLineIndent.IsRelative() )
-                aMargin.SetTextFirstLineOffset( 
rOldItem.GetTextFirstLineOffset(),
-                                             
static_cast<sal_uInt16>(m_aFLineIndent.get_value(FieldUnit::NONE)) );
+                aMargin.SetTextFirstLineOffset(
+                    rOldItem.GetTextFirstLineOffset(),
+                    
static_cast<sal_uInt16>(m_aFLineIndent.get_value(FieldUnit::NONE)));
             else
-                
aMargin.SetTextFirstLineOffset(static_cast<sal_uInt16>(m_aFLineIndent.GetCoreValue(eUnit)));
+            {
+                // tdf#36709: TODO: Handle font-relative units from GUI
+                aMargin.SetTextFirstLineOffset(
+                    SvxIndentValue::twips(m_aFLineIndent.GetCoreValue(eUnit)));
+            }
         }
         else
         {
             aMargin.SetTextLeft(m_aLeftIndent.GetCoreValue(eUnit));
             aMargin.SetRight(m_aRightIndent.GetCoreValue(eUnit));
-            
aMargin.SetTextFirstLineOffset(static_cast<sal_uInt16>(m_aFLineIndent.GetCoreValue(eUnit)));
+            // tdf#36709: TODO: Handle font-relative units from GUI
+            aMargin.SetTextFirstLineOffset(
+                SvxIndentValue::twips(m_aFLineIndent.GetCoreValue(eUnit)));
         }
         aMargin.SetAutoFirst(m_xAutoCB->get_active());
-        if ( aMargin.GetTextFirstLineOffset() < 0 )
+        if ( aMargin.GetTextFirstLineOffsetValue() < 0.0 )
             bNullTab = true;
 
         if ( !pOld || *static_cast<const SvxLRSpaceItem*>(pOld) != aMargin ||
@@ -733,7 +739,8 @@ void SvxStdParagraphTabPage::Reset( const SfxItemSet* rSet )
                 m_aFLineIndent.SetRelative(false);
                 m_aFLineIndent.set_min(-9999, FieldUnit::NONE);
                 m_aFLineIndent.SetFieldUnit(eFUnit);
-                
m_aFLineIndent.SetMetricValue(rOldItem.GetTextFirstLineOffset(), eUnit);
+                // tdf#36709: TODO: Populate GUI with font-relative unit
+                
m_aFLineIndent.SetMetricValue(rOldItem.GetTextFirstLineOffsetValue(), eUnit);
             }
             m_xAutoCB->set_active(rOldItem.IsAutoFirst());
         }
@@ -744,7 +751,8 @@ void SvxStdParagraphTabPage::Reset( const SfxItemSet* rSet )
 
             m_aLeftIndent.SetMetricValue(rSpace.GetTextLeft(), eUnit);
             m_aRightIndent.SetMetricValue(rSpace.GetRight(), eUnit);
-            m_aFLineIndent.SetMetricValue(rSpace.GetTextFirstLineOffset(), 
eUnit);
+            // tdf#36709: TODO: Populate GUI with font-relative units
+            
m_aFLineIndent.SetMetricValue(rSpace.GetTextFirstLineOffsetValue(), eUnit);
             m_xAutoCB->set_active(rSpace.IsAutoFirst());
         }
         AutoHdl_Impl(*m_xAutoCB);
diff --git a/cui/source/tabpages/tabstpge.cxx b/cui/source/tabpages/tabstpge.cxx
index 3b4ca844f095..34b0b631af3a 100644
--- a/cui/source/tabpages/tabstpge.cxx
+++ b/cui/source/tabpages/tabstpge.cxx
@@ -176,7 +176,8 @@ bool SvxTabulatorTabPage::FillItemSet(SfxItemSet* rSet)
         if (SfxItemState::SET != 
rSet->GetItemState(GetWhich(SID_ATTR_LRSPACE), true, &pLRSpace))
             pLRSpace = GetOldItem(*rSet, SID_ATTR_LRSPACE);
 
-        if (pLRSpace && static_cast<const 
SvxLRSpaceItem*>(pLRSpace)->GetTextFirstLineOffset() < 0)
+        if (pLRSpace
+            && static_cast<const 
SvxLRSpaceItem*>(pLRSpace)->GetTextFirstLineOffsetValue() < 0.0)
         {
             SvxTabStop aNull(0, SvxTabAdjust::Default);
             aNewTabs->Insert(aNull);
diff --git a/editeng/source/editeng/editdbg.cxx 
b/editeng/source/editeng/editdbg.cxx
index 39c7de5b2ffa..0ff602376509 100644
--- a/editeng/source/editeng/editdbg.cxx
+++ b/editeng/source/editeng/editdbg.cxx
@@ -69,7 +69,8 @@ struct DebOutBuffer
     }
     void append(std::string_view descr, const SvxLRSpaceItem& rItem)
     {
-        str.append(OString::Concat(descr) + "FI=" + 
OString::number(rItem.GetTextFirstLineOffset())
+        str.append(OString::Concat(descr)
+                   + "FI=" + 
OString::number(rItem.ResolveTextFirstLineOffset({}))
                    + ", LI=" + OString::number(rItem.GetTextLeft())
                    + ", RI=" + OString::number(rItem.GetRight()));
     }
diff --git a/editeng/source/editeng/editdoc.cxx 
b/editeng/source/editeng/editdoc.cxx
index 541d652bf8f1..fdc52e57a7fc 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -574,7 +574,12 @@ void ConvertItem( std::unique_ptr<SfxPoolItem>& rPoolItem, 
MapUnit eSourceUnit,
         {
             assert(dynamic_cast<const SvxLRSpaceItem *>(rPoolItem.get()) != 
nullptr);
             SvxLRSpaceItem& rItem = static_cast<SvxLRSpaceItem&>(*rPoolItem);
-            rItem.SetTextFirstLineOffset( sal::static_int_cast< short >( 
OutputDevice::LogicToLogic( rItem.GetTextFirstLineOffset(), eSourceUnit, 
eDestUnit ) ) );
+            if (rItem.GetTextFirstLineOffsetUnit() == 
css::util::MeasureUnit::TWIP)
+            {
+                rItem.SetTextFirstLineOffset(
+                    
SvxIndentValue::twips(sal::static_int_cast<short>(OutputDevice::LogicToLogic(
+                        rItem.ResolveTextFirstLineOffset({}), eSourceUnit, 
eDestUnit))));
+            }
             rItem.SetTextLeft( OutputDevice::LogicToLogic( 
rItem.GetTextLeft(), eSourceUnit, eDestUnit ) );
             rItem.SetRight( OutputDevice::LogicToLogic( rItem.GetRight(), 
eSourceUnit, eDestUnit ) );
         }
diff --git a/editeng/source/editeng/editview.cxx 
b/editeng/source/editeng/editview.cxx
index 2ab10fda7e6f..7176e3961985 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -570,7 +570,7 @@ void EditView::HideCursor(bool bDeactivate)
 
 bool EditView::IsCursorVisible() const { return 
getImpl().GetCursor()->IsVisible(); }
 
-Pair EditView::Scroll( tools::Long ndX, tools::Long ndY, ScrollRangeCheck 
nRangeCheck )
+::Pair EditView::Scroll( tools::Long ndX, tools::Long ndY, ScrollRangeCheck 
nRangeCheck )
 {
     return getImpl().Scroll( ndX, ndY, nRangeCheck );
 }
diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index d4b7ce6109af..aa2846126c23 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -67,6 +67,7 @@ class OutlinerSearchable;
 
 class SvxSearchItem;
 class SvxLRSpaceItem;
+struct SvxFontUnitMetrics;
 class TextRanger;
 class SvKeyValueIterator;
 class SvxForbiddenCharactersTable;
@@ -1270,6 +1271,7 @@ public:
     SvxAdjust               GetJustification( sal_Int32 nPara ) const;
     SvxCellJustifyMethod    GetJustifyMethod( sal_Int32 nPara ) const;
     SvxCellVerJustify       GetVerJustification( sal_Int32 nPara ) const;
+    SvxFontUnitMetrics GetFontUnitMetrics(ContentNode* pNode);
 
     void setScalingParameters(ScalingParameters const& rScalingParameters);
 
diff --git a/editeng/source/editeng/impedit2.cxx 
b/editeng/source/editeng/impedit2.cxx
index c638fa147ffd..cd5d25cfd90e 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -2130,6 +2130,21 @@ SvxCellVerJustify ImpEditEngine::GetVerJustification( 
sal_Int32 nPara ) const
     return static_cast<SvxCellVerJustify>(rItem.GetEnumValue());
 }
 
+SvxFontUnitMetrics ImpEditEngine::GetFontUnitMetrics(ContentNode* pNode)
+{
+    SvxFont aTmpFont{ pNode->GetCharAttribs().GetDefFont() };
+    SeekCursor(pNode, /*index*/ 1, aTmpFont);
+    aTmpFont.SetPhysFont(*GetRefDevice());
+
+    // tdf#36709: Metrics conversion should use em and ic values from the 
bound fonts.
+    // Unfortunately, this currently poses a problem due to font substitution: 
tests
+    // abort when a missing font is set on a device.
+    // In the interim, use height for all metrics. This is technically not 
correct, but
+    // should be close enough for common fonts.
+    auto dTextLineHeight = 
static_cast<double>(aTmpFont.GetPhysTxtSize(GetRefDevice()).Height());
+    return SvxFontUnitMetrics{ /*em*/ dTextLineHeight, /*ic*/ dTextLineHeight 
};
+}
+
 //  Text changes
 void ImpEditEngine::ImpRemoveChars( const EditPaM& rPaM, sal_Int32 nChars )
 {
@@ -3452,6 +3467,7 @@ sal_uInt32 ImpEditEngine::CalcParaWidth( sal_Int32 nPara, 
bool bIgnoreExtraSpace
         const SvxLRSpaceItem& rLRItem = GetLRSpaceItem( pPortion->GetNode() );
         sal_Int32 nSpaceBeforeAndMinLabelWidth = 
GetSpaceBeforeAndMinLabelWidth( pPortion->GetNode() );
 
+        auto stMetrics = GetFontUnitMetrics(pPortion->GetNode());
 
         // On the lines of the paragraph ...
 
@@ -3467,7 +3483,7 @@ sal_uInt32 ImpEditEngine::CalcParaWidth( sal_Int32 nPara, 
bool bIgnoreExtraSpace
             tools::Long nCurWidth = scaleXSpacingValue(rLRItem.GetTextLeft() + 
nSpaceBeforeAndMinLabelWidth);
             if ( nLine == 0 )
             {
-                tools::Long nFI = 
scaleXSpacingValue(rLRItem.GetTextFirstLineOffset());
+                tools::Long nFI = 
scaleXSpacingValue(rLRItem.ResolveTextFirstLineOffset(stMetrics));
                 nCurWidth -= nFI;
                 if ( pPortion->GetBulletX() > nCurWidth )
                 {
@@ -3770,6 +3786,9 @@ Point ImpEditEngine::GetDocPosTopLeft( sal_Int32 
nParagraph )
 {
     const ParaPortion* pPPortion = maParaPortionList.SafeGetObject(nParagraph);
     DBG_ASSERT( pPPortion, "Paragraph not found: GetWindowPosTopLeft" );
+
+    auto stMetrics = GetFontUnitMetrics(pPPortion->GetNode());
+
     Point aPoint;
     if ( pPPortion )
     {
@@ -3789,8 +3808,8 @@ Point ImpEditEngine::GetDocPosTopLeft( sal_Int32 
nParagraph )
             sal_Int32 nSpaceBefore = 0;
             GetSpaceBeforeAndMinLabelWidth(pPPortion->GetNode(), 
&nSpaceBefore);
             short nX = static_cast<short>(rLRItem.GetTextLeft()
-                            + rLRItem.GetTextFirstLineOffset()
-                            + nSpaceBefore);
+                                          + 
rLRItem.ResolveTextFirstLineOffset(stMetrics)
+                                          + nSpaceBefore);
 
             aPoint.setX(scaleXSpacingValue(nX));
         }
diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index f74d7664d305..049cb1527008 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -815,7 +815,8 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, 
sal_uInt32 nStartPosY )
         tools::Long nStartXNextLine = nStartX;
         if ( nIndex == 0 )
         {
-            tools::Long nFI = 
scaleXSpacingValue(rLRItem.GetTextFirstLineOffset());
+            auto stMetrics = GetFontUnitMetrics(pNode);
+            tools::Long nFI = 
scaleXSpacingValue(rLRItem.ResolveTextFirstLineOffset(stMetrics));
             nStartX += nFI;
 
             if (!nLine && rParaPortion.GetBulletX() > nStartX)
@@ -1791,17 +1792,22 @@ void 
ImpEditEngine::CreateAndInsertEmptyLine(ParaPortion& rParaPortion)
     pTmpLine->SetEnd(rParaPortion.GetNode()->Len());
     rParaPortion.GetLines().Append(std::unique_ptr<EditLine>(pTmpLine));
 
+    auto stMetrics = GetFontUnitMetrics(rParaPortion.GetNode());
+
     bool bLineBreak = rParaPortion.GetNode()->Len() > 0;
     sal_Int32 nSpaceBefore = 0;
     sal_Int32 nSpaceBeforeAndMinLabelWidth = 
GetSpaceBeforeAndMinLabelWidth(rParaPortion.GetNode(), &nSpaceBefore);
     const SvxLRSpaceItem& rLRItem = GetLRSpaceItem(rParaPortion.GetNode());
     const SvxLineSpacingItem& rLSItem = 
rParaPortion.GetNode()->GetContentAttribs().GetItem( EE_PARA_SBL );
-    tools::Long nStartX = scaleXSpacingValue(rLRItem.GetTextLeft() + 
rLRItem.GetTextFirstLineOffset() + nSpaceBefore);
+    tools::Long nStartX = scaleXSpacingValue(
+        rLRItem.GetTextLeft() + rLRItem.ResolveTextFirstLineOffset(stMetrics) 
+ nSpaceBefore);
 
     tools::Rectangle aBulletArea { Point(), Point() };
     if ( bLineBreak )
     {
-        nStartX = scaleXSpacingValue(rLRItem.GetTextLeft() + 
rLRItem.GetTextFirstLineOffset() + nSpaceBeforeAndMinLabelWidth);
+        nStartX = scaleXSpacingValue(rLRItem.GetTextLeft()
+                                     + 
rLRItem.ResolveTextFirstLineOffset(stMetrics)
+                                     + nSpaceBeforeAndMinLabelWidth);
     }
     else
     {
@@ -1812,7 +1818,9 @@ void ImpEditEngine::CreateAndInsertEmptyLine(ParaPortion& 
rParaPortion)
             rParaPortion.SetBulletX( 0 ); // If Bullet set incorrectly.
         if (rParaPortion.GetBulletX() > nStartX)
         {
-            nStartX = scaleXSpacingValue(rLRItem.GetTextLeft() + 
rLRItem.GetTextFirstLineOffset() + nSpaceBeforeAndMinLabelWidth);
+            nStartX = scaleXSpacingValue(rLRItem.GetTextLeft()
+                                         + 
rLRItem.ResolveTextFirstLineOffset(stMetrics)
+                                         + nSpaceBeforeAndMinLabelWidth);
             if (rParaPortion.GetBulletX() > nStartX)
                 nStartX = rParaPortion.GetBulletX();
         }
diff --git a/editeng/source/editeng/impedit4.cxx 
b/editeng/source/editeng/impedit4.cxx
index 05cf8c28a13d..cc45b717f5d5 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -770,7 +770,8 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& 
rItem, SvStream& rOutput,
         case EE_PARA_LRSPACE:
         {
             rOutput.WriteOString( OOO_STRING_SVTOOLS_RTF_FI );
-            sal_Int32 nTxtFirst = static_cast<const 
SvxLRSpaceItem&>(rItem).GetTextFirstLineOffset();
+            sal_Int32 nTxtFirst
+                = static_cast<const 
SvxLRSpaceItem&>(rItem).ResolveTextFirstLineOffset({});
             nTxtFirst = LogicToTwips( nTxtFirst );
             rOutput.WriteNumberAsString( nTxtFirst );
             rOutput.WriteOString( OOO_STRING_SVTOOLS_RTF_LI );
diff --git a/editeng/source/items/frmitems.cxx 
b/editeng/source/items/frmitems.cxx
index 3f11d48057ac..930fdd70f2e2 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -291,7 +291,6 @@ bool SvxSizeItem::HasMetrics() const
 
 SvxLRSpaceItem::SvxLRSpaceItem(const sal_uInt16 nId)
     : SfxPoolItem(nId, SfxItemType::SvxLRSpaceItemType)
-    , nFirstLineOffset(0)
     , nLeftMargin(0)
     , nRightMargin(0)
     , m_nGutterMargin(0)
@@ -305,23 +304,21 @@ SvxLRSpaceItem::SvxLRSpaceItem(const sal_uInt16 nId)
 {
 }
 
-
-SvxLRSpaceItem::SvxLRSpaceItem( const tools::Long nLeft, const tools::Long 
nRight,
-                                const short nOfset,
-                                const sal_uInt16 nId )
+SvxLRSpaceItem::SvxLRSpaceItem(const tools::Long nLeft, const tools::Long 
nRight,
+                               SvxIndentValue stOffset, const sal_uInt16 nId)
     : SfxPoolItem(nId, SfxItemType::SvxLRSpaceItemType)
-    , nFirstLineOffset(nOfset)
     , nLeftMargin(nLeft)
     , nRightMargin(nRight)
     , m_nGutterMargin(0)
-    , m_nRightGutterMargin(0),
-    nPropFirstLineOffset( 100 ),
-    nPropLeftMargin( 100 ),
-    nPropRightMargin( 100 ),
-    bAutoFirst      ( false ),
-    bExplicitZeroMarginValRight(false),
-    bExplicitZeroMarginValLeft(false)
+    , m_nRightGutterMargin(0)
+    , nPropFirstLineOffset(100)
+    , nPropLeftMargin(100)
+    , nPropRightMargin(100)
+    , bAutoFirst(false)
+    , bExplicitZeroMarginValRight(false)
+    , bExplicitZeroMarginValLeft(false)
 {
+    SetTextFirstLineOffset(stOffset);
 }
 
 
@@ -341,7 +338,10 @@ bool SvxLRSpaceItem::QueryValue( uno::Any& rVal, sal_uInt8 
nMemberId ) const
             aLRSpace.Right = static_cast<sal_Int32>(bConvert ? 
convertTwipToMm100(nRightMargin) : nRightMargin);
             aLRSpace.ScaleLeft = static_cast<sal_Int16>(nPropLeftMargin);
             aLRSpace.ScaleRight = static_cast<sal_Int16>(nPropRightMargin);
-            aLRSpace.FirstLine = static_cast<sal_Int32>(bConvert ? 
convertTwipToMm100(nFirstLineOffset) : nFirstLineOffset);
+
+            auto nFirstLineOffsetTwips = ResolveTextFirstLineOffset({});
+            aLRSpace.FirstLine = static_cast<sal_Int32>(bConvert ? 
convertTwipToMm100(nFirstLineOffsetTwips) : nFirstLineOffsetTwips);
+
             aLRSpace.ScaleFirstLine = 
static_cast<sal_Int16>(nPropFirstLineOffset);
             aLRSpace.AutoFirstLine = IsAutoFirst();
             rVal <<= aLRSpace;
@@ -365,13 +365,39 @@ bool SvxLRSpaceItem::QueryValue( uno::Any& rVal, 
sal_uInt8 nMemberId ) const
         break;
 
         case MID_FIRST_LINE_INDENT:
-            rVal <<= static_cast<sal_Int32>(bConvert ? 
convertTwipToMm100(nFirstLineOffset) : nFirstLineOffset);
-            break;
+            // MID_FIRST_LINE_INDENT only supports statically-convertible 
measures.
+            // In practice, these are always stored here in twips.
+            if (m_nFirstLineUnit == css::util::MeasureUnit::TWIP)
+            {
+                auto nConvOffset
+                    = (bConvert ? convertTwipToMm100(m_dFirstLineOffset) : 
m_dFirstLineOffset);
+                rVal <<= static_cast<sal_Int32>(std::llround(nConvOffset));
+            }
+            else
+            {
+                bRet = false;
+            }
+        break;
 
         case MID_FIRST_LINE_REL_INDENT:
             rVal <<= static_cast<sal_Int16>(nPropFirstLineOffset);
             break;
 
+        case MID_FIRST_LINE_UNIT_INDENT:
+            // MID_FIRST_LINE_UNIT_INDENT is used for any values that must be 
serialized
+            // as a unit-value pair. In practice, this will be limited to 
font-relative
+            // units (e.g. em, ic), and all other units will be pre-converted 
to twips.
+            if (m_nFirstLineUnit != css::util::MeasureUnit::TWIP)
+            {
+                rVal
+                    <<= css::beans::Pair<double, sal_Int16>{ 
m_dFirstLineOffset, m_nFirstLineUnit };
+            }
+            else
+            {
+                bRet = false;
+            }
+        break;
+
         case MID_FIRST_AUTO:
             rVal <<= IsAutoFirst();
             break;
@@ -395,8 +421,8 @@ bool SvxLRSpaceItem::PutValue( const uno::Any& rVal, 
sal_uInt8 nMemberId )
     bool bConvert = 0 != (nMemberId&CONVERT_TWIPS);
     nMemberId &= ~CONVERT_TWIPS;
     sal_Int32 nVal = 0;
-    if( nMemberId != 0 && nMemberId != MID_FIRST_AUTO &&
-            nMemberId != MID_L_REL_MARGIN && nMemberId != MID_R_REL_MARGIN)
+    if (nMemberId != 0 && nMemberId != MID_FIRST_AUTO && nMemberId != 
MID_L_REL_MARGIN
+        && nMemberId != MID_R_REL_MARGIN && nMemberId != 
MID_FIRST_LINE_UNIT_INDENT)
         if(!(rVal >>= nVal))
             return false;
 
@@ -413,7 +439,9 @@ bool SvxLRSpaceItem::PutValue( const uno::Any& rVal, 
sal_uInt8 nMemberId )
             SetRight(bConvert ? o3tl::toTwips(aLRSpace.Right, 
o3tl::Length::mm100) : aLRSpace.Right);
             nPropLeftMargin = aLRSpace.ScaleLeft;
             nPropRightMargin = aLRSpace.ScaleRight;
-            SetTextFirstLineOffset(bConvert ? 
o3tl::toTwips(aLRSpace.FirstLine, o3tl::Length::mm100) : aLRSpace.FirstLine);
+            SetTextFirstLineOffset(SvxIndentValue::twips(
+                bConvert ? o3tl::toTwips(aLRSpace.FirstLine, 
o3tl::Length::mm100)
+                         : aLRSpace.FirstLine));
             SetPropTextFirstLineOffset ( aLRSpace.ScaleFirstLine );
             SetAutoFirst( aLRSpace.AutoFirstLine );
             break;
@@ -445,13 +473,26 @@ bool SvxLRSpaceItem::PutValue( const uno::Any& rVal, 
sal_uInt8 nMemberId )
         }
         break;
         case MID_FIRST_LINE_INDENT     :
-            SetTextFirstLineOffset(bConvert ? o3tl::toTwips(nVal, 
o3tl::Length::mm100) : nVal);
+            SetTextFirstLineOffset(
+                SvxIndentValue::twips(bConvert ? o3tl::toTwips(nVal, 
o3tl::Length::mm100) : nVal));
             break;
 
         case MID_FIRST_LINE_REL_INDENT:
             SetPropTextFirstLineOffset ( nVal );
             break;
 
+        case MID_FIRST_LINE_UNIT_INDENT:
+        {
+            css::beans::Pair<double, sal_Int16> stVal;
+            if (!(rVal >>= stVal))
+            {
+                return false;
+            }
+
+            SetTextFirstLineOffset(SvxIndentValue{ stVal.First, stVal.Second 
});
+            break;
+        }
+
         case MID_FIRST_AUTO:
             SetAutoFirst( Any2Bool(rVal) );
             break;
@@ -476,7 +517,8 @@ void SvxLeftMarginItem::SetLeft(const tools::Long nL, const 
sal_uInt16 nProp)
 void SvxLRSpaceItem::SetLeft(const tools::Long nL, const sal_uInt16 nProp)
 {
     nLeftMargin = (nL * nProp) / 100;
-    SAL_WARN_IF(nFirstLineOffset != 0, "editeng", "probably call SetTextLeft 
instead? looks inconsistent otherwise");
+    SAL_WARN_IF(m_dFirstLineOffset != 0.0, "editeng",
+                "probably call SetTextLeft instead? looks inconsistent 
otherwise");
     nPropLeftMargin = nProp;
 }
 
@@ -497,18 +539,26 @@ void SvxLRSpaceItem::SetRight(const tools::Long nR, const 
sal_uInt16 nProp)
     nPropRightMargin = nProp;
 }
 
-void SvxLRSpaceItem::SetTextFirstLineOffset(const short nF, const sal_uInt16 
nProp)
+void SvxLRSpaceItem::SetTextFirstLineOffset(SvxIndentValue stValue, sal_uInt16 
nProp)
 {
     // note: left margin contains any negative first line offset - preserve it!
-    if (nFirstLineOffset < 0)
+    if (m_dFirstLineOffset < 0.0)
     {
-        nLeftMargin -= nFirstLineOffset;
+        nLeftMargin -= ResolveTextFirstLineOffset({});
     }
-    nFirstLineOffset = short((tools::Long(nF) * nProp ) / 100);
+
+    m_dFirstLineOffset = stValue.m_dValue;
+    m_nFirstLineUnit = stValue.m_nUnit;
     nPropFirstLineOffset = nProp;
-    if (nFirstLineOffset < 0)
+
+    if (nProp != 100)
+    {
+        m_dFirstLineOffset = (stValue.m_dValue * static_cast<double>(nProp)) / 
100.0;
+    }
+
+    if (m_dFirstLineOffset < 0.0)
     {
-        nLeftMargin += nFirstLineOffset;
+        nLeftMargin += ResolveTextFirstLineOffset({});
     }
 }
 
@@ -542,12 +592,47 @@ void SvxLRSpaceItem::SetTextLeft(const tools::Long nL, 
const sal_uInt16 nProp)
     auto const nTxtLeft = (nL * nProp) / 100;
     nPropLeftMargin = nProp;
     // note: left margin contains any negative first line offset
-    if ( 0 > nFirstLineOffset )
-        nLeftMargin = nTxtLeft + nFirstLineOffset;
+    if (0.0 > m_dFirstLineOffset)
+        nLeftMargin = nTxtLeft + ResolveTextFirstLineOffset({});
     else
         nLeftMargin = nTxtLeft;
 }
 
+SvxIndentValue SvxLRSpaceItem::GetTextFirstLineOffset() const
+{
+    return { m_dFirstLineOffset, m_nFirstLineUnit };
+}
+
+double SvxLRSpaceItem::GetTextFirstLineOffsetValue() const { return 
m_dFirstLineOffset; }
+
+sal_Int16 SvxLRSpaceItem::GetTextFirstLineOffsetUnit() const { return 
m_nFirstLineUnit; }
+
+double SvxLRSpaceItem::ResolveTextFirstLineOffsetDouble(const 
SvxFontUnitMetrics& rMetrics) const
+{
+    if (m_nFirstLineUnit == css::util::MeasureUnit::TWIP)
+        return m_dFirstLineOffset;
+
+    SAL_WARN_IF(!rMetrics.m_bInitialized, "editeng", "font-relative 
indentation lost");
+
+    switch (m_nFirstLineUnit)
+    {
+        case css::util::MeasureUnit::FONT_EM:
+            return m_dFirstLineOffset * rMetrics.m_dEmTwips;
+
+        case css::util::MeasureUnit::FONT_CJK_ADVANCE:
+            return m_dFirstLineOffset * rMetrics.m_dIcTwips;
+
+        default:
+            SAL_WARN("editeng", "unhandled type conversion");
+            return 0.0;
+    }
+}
+
+sal_Int32 SvxLRSpaceItem::ResolveTextFirstLineOffset(const SvxFontUnitMetrics& 
rMetrics) const
+{
+    return 
static_cast<sal_Int32>(std::llround(ResolveTextFirstLineOffsetDouble(rMetrics)));
+}
+
 tools::Long SvxTextLeftMarginItem::GetTextLeft() const
 {
     return m_nTextLeftMargin;
@@ -569,9 +654,7 @@ tools::Long SvxTextLeftMarginItem::GetLeft(const 
SvxFirstLineIndentItem& rFirstL
 tools::Long SvxLRSpaceItem::GetTextLeft() const
 {
     // remove any negative first line offset from left margin to get text-left
-    return (nFirstLineOffset < 0)
-        ? nLeftMargin - nFirstLineOffset
-        : nLeftMargin;
+    return (m_dFirstLineOffset < 0) ? nLeftMargin - 
ResolveTextFirstLineOffset({}) : nLeftMargin;
 }
 
 SvxLeftMarginItem::SvxLeftMarginItem(const sal_uInt16 nId)
@@ -935,11 +1018,10 @@ SvxFirstLineIndentItem::SvxFirstLineIndentItem(const 
sal_uInt16 nId)
 {
 }
 
-SvxFirstLineIndentItem::SvxFirstLineIndentItem(double dValue, sal_uInt16 nUnit,
-                                               const sal_uInt16 nId)
+SvxFirstLineIndentItem::SvxFirstLineIndentItem(SvxIndentValue stValue, const 
sal_uInt16 nId)
     : SvxFirstLineIndentItem(nId)
 {
-    SetTextFirstLineOffset(dValue, nUnit);
+    SetTextFirstLineOffset(stValue);
 }
 
 bool SvxFirstLineIndentItem::IsAutoFirst() const { return m_bAutoFirst; }
@@ -961,20 +1043,24 @@ sal_uInt16 
SvxFirstLineIndentItem::GetPropTextFirstLineOffset() const
     return m_nPropFirstLineOffset;
 }
 
-void SvxFirstLineIndentItem::SetTextFirstLineOffset(double dValue, sal_Int16 
nUnit,
-                                                    sal_uInt16 nProp)
+void SvxFirstLineIndentItem::SetTextFirstLineOffset(SvxIndentValue stValue, 
sal_uInt16 nProp)
 {
     ASSERT_CHANGE_REFCOUNTED_ITEM;
-    m_dFirstLineOffset = dValue;
-    m_nUnit = nUnit;
+    m_dFirstLineOffset = stValue.m_dValue;
+    m_nUnit = stValue.m_nUnit;
     m_nPropFirstLineOffset = nProp;
 
     if (nProp != 100)
     {
-        m_dFirstLineOffset = (dValue * static_cast<double>(nProp)) / 100.0;
+        m_dFirstLineOffset = (stValue.m_dValue * static_cast<double>(nProp)) / 
100.0;
     }
 }
 
+SvxIndentValue SvxFirstLineIndentItem::GetTextFirstLineOffset() const
+{
+    return { m_dFirstLineOffset, m_nUnit };
+}
+
 double SvxFirstLineIndentItem::GetTextFirstLineOffsetValue() const { return 
m_dFirstLineOffset; }
 
 sal_Int16 SvxFirstLineIndentItem::GetTextFirstLineOffsetUnit() const { return 
m_nUnit; }
@@ -1098,9 +1184,7 @@ bool SvxFirstLineIndentItem::PutValue(const uno::Any& 
rVal, sal_uInt8 nMemberId)
                 return false;
             }
 
-            m_dFirstLineOffset = stVal.First;
-            m_nUnit = stVal.Second;
-            m_nPropFirstLineOffset = 100;
+            SetTextFirstLineOffset(SvxIndentValue{ stVal.First, stVal.Second 
});
             break;
         }
         case MID_FIRST_AUTO:
@@ -1669,18 +1753,15 @@ bool SvxLRSpaceItem::operator==( const SfxPoolItem& 
rAttr ) const
 
     const SvxLRSpaceItem& rOther = static_cast<const SvxLRSpaceItem&>(rAttr);
 
-    return (
-        nFirstLineOffset == rOther.GetTextFirstLineOffset() &&
-        m_nGutterMargin == rOther.GetGutterMargin() &&
-        m_nRightGutterMargin == rOther.GetRightGutterMargin() &&
-        nLeftMargin == rOther.GetLeft()  &&
-        nRightMargin == rOther.GetRight() &&
-        nPropFirstLineOffset == rOther.GetPropTextFirstLineOffset() &&
-        nPropLeftMargin == rOther.GetPropLeft()  &&
-        nPropRightMargin == rOther.GetPropRight() &&
-        bAutoFirst == rOther.IsAutoFirst() &&
-        bExplicitZeroMarginValRight == rOther.IsExplicitZeroMarginValRight() &&
-        bExplicitZeroMarginValLeft == rOther.IsExplicitZeroMarginValLeft() );
+    return std::tie(m_dFirstLineOffset, m_nFirstLineUnit, m_nGutterMargin, 
m_nRightGutterMargin,
+                    nLeftMargin, nRightMargin, nPropFirstLineOffset, 
nPropLeftMargin,
+                    nPropRightMargin, bAutoFirst, bExplicitZeroMarginValRight,
+                    bExplicitZeroMarginValLeft)
+           == std::tie(rOther.m_dFirstLineOffset, rOther.m_nFirstLineUnit, 
rOther.m_nGutterMargin,
+                       rOther.m_nRightGutterMargin, rOther.nLeftMargin, 
rOther.nRightMargin,
+                       rOther.nPropFirstLineOffset, rOther.nPropLeftMargin, 
rOther.nPropRightMargin,
+                       rOther.bAutoFirst, rOther.bExplicitZeroMarginValRight,
+                       rOther.bExplicitZeroMarginValLeft);
 }
 
 SvxLRSpaceItem* SvxLRSpaceItem::Clone( SfxItemPool* ) const
@@ -1714,9 +1795,15 @@ bool SvxLRSpaceItem::GetPresentation
                 rText += unicode::formatPercent(nPropFirstLineOffset,
                     Application::GetSettings().GetUILanguageTag());
             }
+            else if (m_nFirstLineUnit != css::util::MeasureUnit::TWIP)
+            {
+                OUStringBuffer stBuf;
+                sax::Converter::convertMeasureUnit(stBuf, m_dFirstLineOffset, 
m_nFirstLineUnit);
+                rText += stBuf.makeStringAndClear();
+            }
             else
-                rText += GetMetricText( 
static_cast<tools::Long>(nFirstLineOffset),
-                                        eCoreUnit, ePresUnit, &rIntl );
+                rText += 
GetMetricText(static_cast<tools::Long>(m_dFirstLineOffset), eCoreUnit,
+                                       ePresUnit, &rIntl);
             rText += cpDelim;
             if ( 100 != nRightMargin )
             {
@@ -1740,17 +1827,23 @@ bool SvxLRSpaceItem::GetPresentation
                         " " + EditResId(GetMetricId(ePresUnit));
             }
             rText += cpDelim;
-            if ( 100 != nPropFirstLineOffset || nFirstLineOffset )
+            if (100 != nPropFirstLineOffset || m_dFirstLineOffset != 0.0)
             {
                 rText += EditResId(RID_SVXITEMS_LRSPACE_FLINE);
                 if ( 100 != nPropFirstLineOffset )
                     rText += unicode::formatPercent(nPropFirstLineOffset,
                                 Application::GetSettings().GetUILanguageTag());
+                else if (m_nFirstLineUnit != css::util::MeasureUnit::TWIP)
+                {
+                    OUStringBuffer stBuf;
+                    sax::Converter::convertMeasureUnit(stBuf, 
m_dFirstLineOffset, m_nFirstLineUnit);
+                    rText += stBuf.makeStringAndClear();
+                }
                 else
                 {
-                    rText += GetMetricText( 
static_cast<tools::Long>(nFirstLineOffset),
-                                            eCoreUnit, ePresUnit, &rIntl ) +
-                            " " + EditResId(GetMetricId(ePresUnit));
+                    rText += 
GetMetricText(static_cast<tools::Long>(m_dFirstLineOffset), eCoreUnit,
+                                           ePresUnit, &rIntl)
+                             + " " + EditResId(GetMetricId(ePresUnit));
                 }
                 rText += cpDelim;
             }
@@ -1774,7 +1867,8 @@ bool SvxLRSpaceItem::GetPresentation
 
 void SvxLRSpaceItem::ScaleMetrics( tools::Long nMult, tools::Long nDiv )
 {
-    nFirstLineOffset = static_cast<short>(BigInt::Scale( nFirstLineOffset, 
nMult, nDiv ));
+    m_dFirstLineOffset
+        = (m_dFirstLineOffset * static_cast<double>(nMult)) / 
static_cast<double>(nDiv);
     nLeftMargin = BigInt::Scale( nLeftMargin, nMult, nDiv );
     nRightMargin = BigInt::Scale( nRightMargin, nMult, nDiv );
 }
@@ -1790,7 +1884,10 @@ void SvxLRSpaceItem::dumpAsXml(xmlTextWriterPtr pWriter) 
const
 {
     (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SvxLRSpaceItem"));
     (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), 
BAD_CAST(OString::number(Which()).getStr()));
-    (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nFirstLineOffset"), 
BAD_CAST(OString::number(nFirstLineOffset).getStr()));
+    (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("m_dFirstLineOffset"),
+                                      
BAD_CAST(OString::number(m_dFirstLineOffset).getStr()));
+    (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("m_nFirstLineUnit"),
+                                      
BAD_CAST(OString::number(m_nFirstLineUnit).getStr()));
     (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nLeftMargin"), 
BAD_CAST(OString::number(nLeftMargin).getStr()));
     (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nRightMargin"), 
BAD_CAST(OString::number(nRightMargin).getStr()));
     (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("m_nGutterMargin"),
@@ -1821,8 +1918,8 @@ boost::property_tree::ptree SvxLRSpaceItem::dumpAsJSON() 
const
     OUString sRight = GetMetricText(GetRight(),
                         MapUnit::MapTwip, eTargetUnit, nullptr);
 
-    OUString sFirstline = GetMetricText(GetTextFirstLineOffset(),
-                        MapUnit::MapTwip, eTargetUnit, nullptr);
+    OUString sFirstline
+        = GetMetricText(ResolveTextFirstLineOffset({}), MapUnit::MapTwip, 
eTargetUnit, nullptr);
 
     aState.put("left", sLeft);
     aState.put("right", sRight);
diff --git a/editeng/source/outliner/outliner.cxx 
b/editeng/source/outliner/outliner.cxx
index 1a5ad1e0cbdd..171c296beaa1 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -1492,9 +1492,11 @@ tools::Rectangle Outliner::ImpCalcBulletArea( sal_Int32 
nPara, bool bAdjust, boo
         const auto nSpaceBefore = pFmt->GetAbsLSpace() + 
pFmt->GetFirstLineOffset();
 
         const SvxLRSpaceItem& rLR = pEditEngine->GetParaAttrib( nPara, 
bOutlineMode ? EE_PARA_OUTLLRSPACE : EE_PARA_LRSPACE );
-        aTopLeft.setX( rLR.GetTextLeft() + rLR.GetTextFirstLineOffset() + 
nSpaceBefore );
+        aTopLeft.setX(rLR.GetTextLeft() + rLR.ResolveTextFirstLineOffset({}) + 
nSpaceBefore);
 
-        tools::Long nBulletWidth = std::max( 
static_cast<tools::Long>(-rLR.GetTextFirstLineOffset()), 
static_cast<tools::Long>((-pFmt->GetFirstLineOffset()) + 
pFmt->GetCharTextDistance()) );
+        tools::Long nBulletWidth = std::max(
+            static_cast<tools::Long>(-rLR.ResolveTextFirstLineOffset({})),
+            static_cast<tools::Long>((-pFmt->GetFirstLineOffset()) + 
pFmt->GetCharTextDistance()));
         if ( nBulletWidth < aBulletSize.Width() )   // The Bullet creates its 
space
             nBulletWidth = aBulletSize.Width();
 
diff --git a/editeng/source/rtf/rtfitem.cxx b/editeng/source/rtf/rtfitem.cxx
index a5cfd41efae9..129e43ebc33c 100644
--- a/editeng/source/rtf/rtfitem.cxx
+++ b/editeng/source/rtf/rtfitem.cxx
@@ -325,7 +325,7 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet )
                             CalcValue();
                         nSz = sal_uInt16(nTokenValue);
                     }
-                    aLR.SetTextFirstLineOffset( nSz );
+                    aLR.SetTextFirstLineOffset(SvxIndentValue::twips(nSz));
                     pSet->Put( aLR );
                 }
                 break;
diff --git a/filter/source/msfilter/svdfppt.cxx 
b/filter/source/msfilter/svdfppt.cxx
index 141f4fed9a20..c85d32b1ae64 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -6189,7 +6189,7 @@ void PPTParagraphObj::ApplyTo( SfxItemSet& rSet,  
std::optional< sal_Int16 >& rS
     {
         auto const nAbsLSpace = convertMasterUnitToMm100(_nTextOfs);
         auto const nFirstLineOffset = nAbsLSpace - 
convertMasterUnitToMm100(_nBulletOfs);
-        aLRSpaceItem.SetTextFirstLineOffsetValue( -nFirstLineOffset );
+        
aLRSpaceItem.SetTextFirstLineOffset(SvxIndentValue::twips(-nFirstLineOffset));
         aLRSpaceItem.SetTextLeft( nAbsLSpace );
     }
     rSet.Put( aLRSpaceItem );
diff --git a/include/editeng/lrspitem.hxx b/include/editeng/lrspitem.hxx
index e4f0e8a3dbf7..c47f9a8f29cf 100644
--- a/include/editeng/lrspitem.hxx
+++ b/include/editeng/lrspitem.hxx
@@ -63,6 +63,24 @@ struct SvxFontUnitMetrics
     }
 };
 
+/// helper struct for passing indentation along with units
+struct SvxIndentValue
+{
+    double m_dValue;
+    sal_Int16 m_nUnit;
+
+    SvxIndentValue() = delete;
+    SvxIndentValue(double dValue, sal_Int16 nUnit)
+        : m_dValue(dValue)
+        , m_nUnit(nUnit)
+    {
+    }
+
+    static SvxIndentValue twips(double dValue) { return { dValue, 
css::util::MeasureUnit::TWIP }; }
+
+    static SvxIndentValue zero() { return twips(0.0); }
+};
+
 /// GetLeft() - for everything that's not applied to a paragraph
 class EDITENG_DLLPUBLIC SvxLeftMarginItem final : public SfxPoolItem
 {
@@ -166,14 +184,15 @@ public:
     void SetPropTextFirstLineOffset(sal_uInt16 nProp);
     sal_uInt16 GetPropTextFirstLineOffset() const;
 
-    void SetTextFirstLineOffset(double dValue, sal_Int16 nUnit, sal_uInt16 
nProp = 100);
+    void SetTextFirstLineOffset(SvxIndentValue stValue, sal_uInt16 nProp = 
100);
+    SvxIndentValue GetTextFirstLineOffset() const;
     double GetTextFirstLineOffsetValue() const;
     sal_Int16 GetTextFirstLineOffsetUnit() const;
     double ResolveTextFirstLineOffsetDouble(const SvxFontUnitMetrics& 
rMetrics) const;
     sal_Int32 ResolveTextFirstLineOffset(const SvxFontUnitMetrics& rMetrics) 
const;
 
     explicit SvxFirstLineIndentItem(const sal_uInt16 nId);
-    SvxFirstLineIndentItem(double dValue, sal_uInt16 nUnit, const sal_uInt16 
nId);
+    SvxFirstLineIndentItem(SvxIndentValue stValue, const sal_uInt16 nId);
     SvxFirstLineIndentItem(SvxFirstLineIndentItem const &) = default; // 
SfxPoolItem copy function dichotomy
 
     // "pure virtual Methods" from SfxPoolItem
@@ -306,7 +325,8 @@ public:
 class EDITENG_DLLPUBLIC SvxLRSpaceItem final : public SfxPoolItem
 {
     /// First-line indent always relative to GetTextLeft()
-    short   nFirstLineOffset;
+    double m_dFirstLineOffset = 0.0;
+    sal_Int16 m_nFirstLineUnit = css::util::MeasureUnit::TWIP;
     tools::Long    nLeftMargin;        // nLeft or the negative first-line 
indent
     tools::Long    nRightMargin;       // The unproblematic right edge
     /// The amount of extra space added to the left margin.
@@ -324,9 +344,8 @@ public:
     static SfxPoolItem* CreateDefault();
 
     explicit SvxLRSpaceItem( const sal_uInt16 nId  );
-    SvxLRSpaceItem( const tools::Long nLeft, const tools::Long nRight,
-                    const short nOfset /*= 0*/,
-                    const sal_uInt16 nId  );
+    SvxLRSpaceItem(const tools::Long nLeft, const tools::Long nRight, 
SvxIndentValue stValue,
+                   const sal_uInt16 nId);
     SvxLRSpaceItem(SvxLRSpaceItem const &) = default; // SfxPoolItem copy 
function dichotomy
 
     // "pure virtual Methods" from SfxPoolItem
@@ -351,7 +370,11 @@ public:
     // Query/direct setting of the absolute values
     tools::Long GetLeft()  const { return nLeftMargin; }
     tools::Long GetRight() const { return nRightMargin;}
-    void SetLeftValue( const tools::Long nL ) { assert(nFirstLineOffset == 0); 
nLeftMargin = nL; }
+    void SetLeftValue(const tools::Long nL)
+    {
+        assert(m_dFirstLineOffset == 0.0);
+        nLeftMargin = nL;
+    }
     void SetRightValue( const tools::Long nR ) { nRightMargin = nR; }
     bool IsAutoFirst()  const { return bAutoFirst; }
     void SetAutoFirst( const bool bNew ) { bAutoFirst = bNew; }
@@ -367,14 +390,17 @@ public:
     void SetTextLeft(const tools::Long nL, const sal_uInt16 nProp = 100);
     tools::Long GetTextLeft() const;
 
-    void SetTextFirstLineOffset(const short nF, const sal_uInt16 nProp = 100);
-    short  GetTextFirstLineOffset() const { return nFirstLineOffset; }
+    void SetTextFirstLineOffset(SvxIndentValue stValue, sal_uInt16 nProp = 
100);
+    SvxIndentValue GetTextFirstLineOffset() const;
+    double GetTextFirstLineOffsetValue() const;
+    sal_Int16 GetTextFirstLineOffsetUnit() const;
+    double ResolveTextFirstLineOffsetDouble(const SvxFontUnitMetrics& 
rMetrics) const;
+    sal_Int32 ResolveTextFirstLineOffset(const SvxFontUnitMetrics& rMetrics) 
const;
+
     void SetPropTextFirstLineOffset( const sal_uInt16 nProp )
                     { nPropFirstLineOffset = nProp; }
     sal_uInt16 GetPropTextFirstLineOffset() const
                     { return nPropFirstLineOffset; }
-    void SetTextFirstLineOffsetValue( const short nValue )
-                    { nFirstLineOffset = nValue; }
     void SetGutterMargin(const tools::Long nGutterMargin) { m_nGutterMargin = 
nGutterMargin; }
     tools::Long GetGutterMargin() const { return m_nGutterMargin; }
     void SetRightGutterMargin(const tools::Long nRightGutterMargin) { 
m_nRightGutterMargin = nRightGutterMargin; }
diff --git a/include/editeng/unoprnms.hxx b/include/editeng/unoprnms.hxx
index 947cfb0d1ca3..0ba35cbee24a 100644
--- a/include/editeng/unoprnms.hxx
+++ b/include/editeng/unoprnms.hxx
@@ -305,6 +305,8 @@ inline constexpr OUString 
UNO_NAME_EDIT_PARA_IS_HANGING_PUNCTUATION = u"ParaIsHa
 inline constexpr OUString UNO_NAME_EDIT_PARA_IS_CHARACTER_DISTANCE = 
u"ParaIsCharacterDistance"_ustr;
 inline constexpr OUString UNO_NAME_EDIT_PARA_IS_FORBIDDEN_RULES = 
u"ParaIsForbiddenRules"_ustr;
 inline constexpr OUString UNO_NAME_EDIT_PARA_FIRST_LINE_INDENT = 
u"ParaFirstLineIndent"_ustr;
+inline constexpr OUString UNO_NAME_EDIT_PARA_FIRST_LINE_INDENT_UNIT
+    = u"ParaFirstLineIndentUnit"_ustr;
 
 inline constexpr OUString UNO_NAME_EDIT_CHAR_HEIGHT = u"CharHeight"_ustr;
 inline constexpr OUString UNO_NAME_EDIT_CHAR_FONTNAME = u"CharFontName"_ustr;
diff --git a/include/editeng/unotext.hxx b/include/editeng/unotext.hxx
index 9cb53b5b3063..b5cecccbf625 100644
--- a/include/editeng/unotext.hxx
+++ b/include/editeng/unotext.hxx
@@ -29,6 +29,7 @@
 #include <com/sun/star/text/XTextCursor.hpp>
 #include <com/sun/star/lang/XTypeProvider.hpp>
 #include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/beans/Pair.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/beans/XPropertyState.hpp>
 #include <com/sun/star/beans/XMultiPropertySet.hpp>
@@ -153,6 +154,7 @@ struct SfxItemPropertyMapEntry;
     { UNO_NAME_EDIT_PARA_TABSTOP_DEFAULT_DISTANCE, EE_PARA_TABS, 
::cppu::UnoType<sal_Int32>::get(), 0, MID_TABSTOP_DEFAULT_DISTANCE }, \
     { UNO_NAME_EDIT_PARA_TMARGIN,      EE_PARA_ULSPACE,            
::cppu::UnoType<sal_Int32>::get(),            0, MID_UP_MARGIN, 
PropertyMoreFlags::METRIC_ITEM },\
     { UNO_NAME_EDIT_PARA_FIRST_LINE_INDENT,     EE_PARA_LRSPACE,   
::cppu::UnoType<sal_Int32>::get(),            0, MID_FIRST_LINE_INDENT, 
PropertyMoreFlags::METRIC_ITEM}, \
+    { UNO_NAME_EDIT_PARA_FIRST_LINE_INDENT_UNIT, EE_PARA_LRSPACE, 
::cppu::UnoType<css::beans::Pair<double, sal_Int16>>::get(), 0, 
MID_FIRST_LINE_UNIT_INDENT }, \
     { UNO_NAME_EDIT_PARA_IS_HANGING_PUNCTUATION,EE_PARA_HANGINGPUNCTUATION,  
cppu::UnoType<bool>::get(),                0 ,0 }, \
     { UNO_NAME_EDIT_PARA_IS_CHARACTER_DISTANCE, EE_PARA_ASIANCJKSPACING,   
cppu::UnoType<bool>::get(),                0 ,0 }, \
     { UNO_NAME_EDIT_PARA_IS_FORBIDDEN_RULES,    EE_PARA_FORBIDDENRULES,     
cppu::UnoType<bool>::get(),                0 ,0 },\
diff --git a/reportdesign/source/ui/report/ReportController.cxx 
b/reportdesign/source/ui/report/ReportController.cxx
index 83e354df6ead..41914a33ca7a 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -2415,8 +2415,10 @@ void OReportController::openPageDialog(const 
uno::Reference<report::XSection>& _
         {
             aDescriptor.Put(SvxSizeItem(RPTUI_ID_SIZE,
                                         
VCLUnoHelper::ConvertToVCLSize(getStyleProperty<awt::Size>(m_xReportDefinition,PROPERTY_PAPERSIZE))));
-            
aDescriptor.Put(SvxLRSpaceItem(getStyleProperty<sal_Int32>(m_xReportDefinition,PROPERTY_LEFTMARGIN)
-                                            
,getStyleProperty<sal_Int32>(m_xReportDefinition,PROPERTY_RIGHTMARGIN),0,RPTUI_ID_LRSPACE));
+            aDescriptor.Put(SvxLRSpaceItem(
+                getStyleProperty<sal_Int32>(m_xReportDefinition, 
PROPERTY_LEFTMARGIN),
+                getStyleProperty<sal_Int32>(m_xReportDefinition, 
PROPERTY_RIGHTMARGIN),
+                SvxIndentValue::zero(), RPTUI_ID_LRSPACE));
             
aDescriptor.Put(SvxULSpaceItem(static_cast<sal_uInt16>(getStyleProperty<sal_Int32>(m_xReportDefinition,PROPERTY_TOPMARGIN))
                                             
,static_cast<sal_uInt16>(getStyleProperty<sal_Int32>(m_xReportDefinition,PROPERTY_BOTTOMMARGIN)),RPTUI_ID_ULSPACE));
             
aDescriptor.Put(SfxUInt16Item(SID_ATTR_METRIC,static_cast<sal_uInt16>(eUserMetric)));
diff --git a/sc/source/core/data/stlsheet.cxx b/sc/source/core/data/stlsheet.cxx
index 4f9ebcb5527d..eafe3f48a264 100644
--- a/sc/source/core/data/stlsheet.cxx
+++ b/sc/source/core/data/stlsheet.cxx
@@ -175,10 +175,10 @@ SfxItemSet& ScStyleSheet::GetItemSet()
                                                       HFDIST_CM,// nLow
                                                       ATTR_ULSPACE );
 
-                        SvxLRSpaceItem  aLRSpaceItem( TWO_CM,   // nLeft
-                                                      TWO_CM,   // nRight
-                                                      0,        // 
nFirstLineOffset
-                                                      ATTR_LRSPACE );
+                        SvxLRSpaceItem aLRSpaceItem(TWO_CM, // nLeft
+                                                    TWO_CM, // nRight
+                                                    SvxIndentValue::zero(), // 
nFirstLineOffset
+                                                    ATTR_LRSPACE);
                         SvxULSpaceItem  aULSpaceItem( TWO_CM,   // nUp
                                                       TWO_CM,   // nLow
                                                       ATTR_ULSPACE );
@@ -193,7 +193,8 @@ SfxItemSet& ScStyleSheet::GetItemSet()
                         rHFSet.Put( aBoxInfoItem );
                         rHFSet.Put( aHFSizeItem );
                         rHFSet.Put( aHFDistItem );
-                        rHFSet.Put( SvxLRSpaceItem(0, 0, 0, ATTR_LRSPACE) ); 
// Set border to Null
+                        rHFSet.Put(SvxLRSpaceItem(0, 0, SvxIndentValue::zero(),
+                                                  ATTR_LRSPACE)); // Set 
border to Null
 
                         aHFSetItem.SetWhich(ATTR_PAGE_HEADERSET);
                         pSet->Put( aHFSetItem );
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx 
b/sc/source/ui/drawfunc/drtxtob.cxx
index 48f0c0df135d..cc2b3e561488 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -970,8 +970,8 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq )
             pArgs->Get( nId ));
         SfxItemSetFixed<EE_PARA_LRSPACE, EE_PARA_LRSPACE> aAttr( GetPool() );
         nId = EE_PARA_LRSPACE;
-        SvxLRSpaceItem aLRSpaceItem( rItem.GetLeft(),
-            rItem.GetRight(), rItem.GetTextFirstLineOffset(), nId );
+        SvxLRSpaceItem aLRSpaceItem(rItem.GetLeft(), rItem.GetRight(),
+                                    rItem.GetTextFirstLineOffset(), nId);
         aAttr.Put( aLRSpaceItem );
         pView->SetAttributes( aAttr );
     }
diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx
index 9823c031c251..7af9b22146d3 100644
--- a/sd/source/core/stlpool.cxx
+++ b/sd/source/core/stlpool.cxx
@@ -439,7 +439,7 @@ void 
SdStyleSheetPool::CreateLayoutStyleSheets(std::u16string_view rLayoutName,
         rNotesSet.Put( SvxCharReliefItem(FontRelief::NONE, EE_CHAR_RELIEF) );
         rNotesSet.Put( SvxColorItem( COL_AUTO, EE_CHAR_COLOR ) );
         rNotesSet.Put( SvxColorItem( COL_AUTO, EE_CHAR_BKGCOLOR ) );
-        rNotesSet.Put( SvxLRSpaceItem( 0, 0, -600, EE_PARA_LRSPACE  ) );
+        rNotesSet.Put(SvxLRSpaceItem(0, 0, SvxIndentValue::twips(-600.0), 
EE_PARA_LRSPACE));
         // #i16874# enable kerning by default but only for new documents
         rNotesSet.Put( SvxAutoKernItem( true, EE_CHAR_PAIRKERNING ) );
 
diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx
index 0389adbb145f..9c402c8956e5 100644
--- a/sd/source/core/stlsheet.cxx
+++ b/sd/source/core/stlsheet.cxx
@@ -582,8 +582,9 @@ void SdStyleSheet::AdjustToFontHeight(SfxItemSet& rSet, 
bool bOnlyMissingItems)
         double fIndentFraction = double(rLRItem.GetTextLeft()) / nOldHeight;
         SvxLRSpaceItem aNewLRItem(rLRItem);
         aNewLRItem.SetTextLeft(fIndentFraction * nNewHeight);
-        double fFirstIndentFraction = double(rLRItem.GetTextFirstLineOffset()) 
/ nOldHeight;
-        
aNewLRItem.SetTextFirstLineOffset(static_cast<short>(fFirstIndentFraction * 
nNewHeight));
+        double fFirstIndentFraction = rLRItem.GetTextFirstLineOffsetValue() / 
nOldHeight;
+        aNewLRItem.SetTextFirstLineOffset(SvxIndentValue{ fFirstIndentFraction 
* nNewHeight,
+                                                          
rLRItem.GetTextFirstLineOffsetUnit() });
         rSet.Put(aNewLRItem);
     }
 
diff --git a/sd/source/filter/xml/sdtransform.cxx 
b/sd/source/filter/xml/sdtransform.cxx
index 418f65470315..d11327c76fbb 100644
--- a/sd/source/filter/xml/sdtransform.cxx
+++ b/sd/source/filter/xml/sdtransform.cxx
@@ -294,10 +294,10 @@ bool SdTransformOOo2xDocument::transformItemSet( 
SfxItemSet& rSet, bool bNumberi
     if (pItem)
     {
         SvxLRSpaceItem aItem(*pItem);
-        if( (aItem.GetLeft() != 0) || (aItem.GetTextFirstLineOffset() != 0) )
+        if ((aItem.GetLeft() != 0) || (aItem.GetTextFirstLineOffsetValue() != 
0.0))
         {
             aItem.SetLeftValue( 0 );
-            aItem.SetTextFirstLineOffset( 0 );
+            aItem.SetTextFirstLineOffset(SvxIndentValue::zero());
             rSet.Put( aItem );
             bRet = true;
         }
diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx
index a90861d1a7a8..9170f72622b2 100644
--- a/sd/source/ui/func/fupage.cxx
+++ b/sd/source/ui/func/fupage.cxx
@@ -244,7 +244,10 @@ void FuPage::ExecuteAsyncDialog(weld::Window* pParent, 
const SfxRequest& rReq)
     SvxPaperBinItem aPaperBinItem( SID_ATTR_PAGE_PAPERBIN, 
static_cast<sal_uInt8>(mpPage->GetPaperBin()) );
     aNewAttr->Put( aPaperBinItem );
 
-    SvxLRSpaceItem aLRSpaceItem( 
static_cast<sal_uInt16>(mpPage->GetLeftBorder()), 
static_cast<sal_uInt16>(mpPage->GetRightBorder()), 0, 
mpDoc->GetPool().GetWhichIDFromSlotID(SID_ATTR_LRSPACE));
+    SvxLRSpaceItem 
aLRSpaceItem(static_cast<sal_uInt16>(mpPage->GetLeftBorder()),
+                                
static_cast<sal_uInt16>(mpPage->GetRightBorder()),
+                                SvxIndentValue::zero(),
+                                
mpDoc->GetPool().GetWhichIDFromSlotID(SID_ATTR_LRSPACE));
     aNewAttr->Put( aLRSpaceItem );
 
     SvxULSpaceItem aULSpaceItem( 
static_cast<sal_uInt16>(mpPage->GetUpperBorder()), 
static_cast<sal_uInt16>(mpPage->GetLowerBorder()), 
mpDoc->GetPool().GetWhichIDFromSlotID(SID_ATTR_ULSPACE));
diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx
index eed3b9662676..b90bff224518 100644
--- a/sd/source/ui/view/drtxtob1.cxx
+++ b/sd/source/ui/view/drtxtob1.cxx
@@ -347,14 +347,14 @@ void TextObjectBar::ExecuteImpl(ViewShell* mpViewShell, 
::sd::View* mpView, SfxR
 
             SvxLRSpaceItem aNewMargin( EE_PARA_LRSPACE );
 
-            ::tools::Long nIndentDist = aParaMargin.GetTextFirstLineOffset();
+            auto nIndentDist = aParaMargin.ResolveTextFirstLineOffset({});
 
-            if (nIndentDist == 0)
+            if (nIndentDist == 0.0)
                 nIndentDist = nIndentDefaultDist;
 
             aNewMargin.SetTextLeft(aParaMargin.GetTextLeft() + nIndentDist);
             aNewMargin.SetRight(aParaMargin.GetRight());
-            aNewMargin.SetTextFirstLineOffset(nIndentDist * -1);
+            
aNewMargin.SetTextFirstLineOffset(SvxIndentValue::twips(nIndentDist * -1));
 
             aLRSpaceSet.Put( aNewMargin );
             mpView->SetAttributes( aLRSpaceSet );
diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx
index 4ec6b61390d8..63add2a2aca8 100644
--- a/sd/source/ui/view/drviews3.cxx
+++ b/sd/source/ui/view/drviews3.cxx
@@ -815,9 +815,8 @@ void  DrawViewShell::ExecRuler(SfxRequest& rReq)
                 mpDrawView->GetAttributes( aEditAttr );
 
                 nId = EE_PARA_LRSPACE;
-                SvxLRSpaceItem aLRSpaceItem( rItem.GetLeft(),
-                        rItem.GetRight(),
-                        rItem.GetTextFirstLineOffset(), nId );
+                SvxLRSpaceItem aLRSpaceItem(rItem.GetLeft(), rItem.GetRight(),
+                                            rItem.GetTextFirstLineOffset(), 
nId);
 
                 const sal_Int16 nOutlineLevel = aEditAttr.Get( 
EE_PARA_OUTLLEVEL ).GetValue();
                 const SvxLRSpaceItem& rOrigLRSpaceItem = aEditAttr.Get( 
EE_PARA_LRSPACE );
@@ -843,21 +842,19 @@ void  DrawViewShell::ExecRuler(SfxRequest& rReq)
 
                     // negative first line indent goes to the number
                     // format, positive to the lrSpace item
-                    if( rItem.GetTextFirstLineOffset() < 0 )
+                    if (rItem.GetTextFirstLineOffsetValue() < 0.0)
                     {
-                        aFormat.SetFirstLineOffset(
-                            rItem.GetTextFirstLineOffset()
-                            - rOrigLRSpaceItem.GetTextFirstLineOffset()
-                            + aFormat.GetCharTextDistance());
-                        aLRSpaceItem.SetTextFirstLineOffset(0);
+                        
aFormat.SetFirstLineOffset(rItem.ResolveTextFirstLineOffset({})
+                                                   - 
rOrigLRSpaceItem.ResolveTextFirstLineOffset({})
+                                                   + 
aFormat.GetCharTextDistance());
+                        
aLRSpaceItem.SetTextFirstLineOffset(SvxIndentValue::zero());
                     }
                     else
                     {
                         aFormat.SetFirstLineOffset(0);
-                        aLRSpaceItem.SetTextFirstLineOffset(
-                            rItem.GetTextFirstLineOffset()
-                            - aFormat.GetFirstLineOffset() //TODO: overflow
-                            + aFormat.GetCharTextDistance());
+                        
aLRSpaceItem.SetTextFirstLineOffset(SvxIndentValue::twips(
+                            rItem.ResolveTextFirstLineOffset({}) - 
aFormat.GetFirstLineOffset()
+                            + aFormat.GetCharTextDistance()));
                     }
 
                     if( rFormat != aFormat )
@@ -945,9 +942,9 @@ void  DrawViewShell::GetRulerState(SfxItemSet& rSet)
                     rSet.Put( rItem );
 
                     const SvxLRSpaceItem& rLRSpaceItem = aEditAttr.Get( 
EE_PARA_LRSPACE );
-                    SvxLRSpaceItem aLRSpaceItem( rLRSpaceItem.GetLeft(),
-                            rLRSpaceItem.GetRight(),
-                            rLRSpaceItem.GetTextFirstLineOffset(), 
SID_ATTR_PARA_LRSPACE );
+                    SvxLRSpaceItem aLRSpaceItem(rLRSpaceItem.GetLeft(), 
rLRSpaceItem.GetRight(),
+                                                
rLRSpaceItem.GetTextFirstLineOffset(),
+                                                SID_ATTR_PARA_LRSPACE);
 
                     const sal_Int16 nOutlineLevel = aEditAttr.Get( 
EE_PARA_OUTLLEVEL ).GetValue();
                     const SvxNumBulletItem& rNumBulletItem = aEditAttr.Get( 
EE_PARA_NUMBULLET );
@@ -956,10 +953,9 @@ void  DrawViewShell::GetRulerState(SfxItemSet& rSet)
                     {
                         const SvxNumberFormat& rFormat = 
rNumBulletItem.GetNumRule().GetLevel(nOutlineLevel);
                         aLRSpaceItem.SetTextLeft(rFormat.GetAbsLSpace() + 
rLRSpaceItem.GetTextLeft());
-                        aLRSpaceItem.SetTextFirstLineOffset(
-                            rLRSpaceItem.GetTextFirstLineOffset() + 
rFormat.GetFirstLineOffset()
-                                //TODO: overflow
-                            - rFormat.GetCharTextDistance());
+                        
aLRSpaceItem.SetTextFirstLineOffset(SvxIndentValue::twips(
+                            rLRSpaceItem.ResolveTextFirstLineOffset({})
+                            + rFormat.GetFirstLineOffset() - 
rFormat.GetCharTextDistance()));
                     }
 
                     rSet.Put( aLRSpaceItem );
diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx
index 33d8f78ba3c5..0fa6402f1a04 100644
--- a/sd/source/ui/view/outlview.cxx
+++ b/sd/source/ui/view/outlview.cxx
@@ -78,7 +78,7 @@ OutlineView::OutlineView( DrawDocShell& rDocSh, vcl::Window* 
pWindow, OutlineVie
 , mnPagesProcessed(0)
 , mbFirstPaint(true)
 , maDocColor( COL_WHITE )
-, maLRSpaceItem(2000, 0, 0, EE_PARA_OUTLLRSPACE)
+, maLRSpaceItem(2000, 0, SvxIndentValue::zero(), EE_PARA_OUTLLRSPACE)
 {
     bool bInitOutliner = false;
 
diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx
index 3f447bf9a1af..6bbf1b1a9ddd 100644
--- a/svx/source/dialog/svxruler.cxx
+++ b/svx/source/dialog/svxruler.cxx
@@ -567,7 +567,7 @@ void SvxRuler::MouseMove( const MouseEvent& rMEvt )
             if (nIndex == INDENT_LEFT_MARGIN)
                 nIndentValue = mxParaItem->GetTextLeft();
             else if (nIndex == INDENT_FIRST_LINE)
-                nIndentValue = mxParaItem->GetTextFirstLineOffset();
+                nIndentValue = mxParaItem->ResolveTextFirstLineOffset({});
             else if (nIndex == INDENT_RIGHT_MARGIN)
                 nIndentValue = mxParaItem->GetRight();
 
@@ -846,13 +846,13 @@ void SvxRuler::UpdatePara()
         if(bRTLText)
         {
             leftMargin    = nRightFrameMargin - mxParaItem->GetTextLeft() + 
lAppNullOffset;
-            leftFirstLine = leftMargin - mxParaItem->GetTextFirstLineOffset();
+            leftFirstLine = leftMargin - 
mxParaItem->ResolveTextFirstLineOffset({});
             rightMargin   = nLeftFrameMargin + mxParaItem->GetRight() + 
lAppNullOffset;
         }
         else
         {
             leftMargin    = nLeftFrameMargin + mxParaItem->GetTextLeft() + 
lAppNullOffset;
-            leftFirstLine = leftMargin + mxParaItem->GetTextFirstLineOffset();
+            leftFirstLine = leftMargin + 
mxParaItem->ResolveTextFirstLineOffset({});
             rightMargin   = nRightFrameMargin - mxParaItem->GetRight() + 
lAppNullOffset;
         }
 
@@ -2194,7 +2194,7 @@ void SvxRuler::ApplyIndents()
         nNewRight           = RoundToCurrentMapMode(nNewRight);
     }
 
-    
mxParaItem->SetTextFirstLineOffset(sal::static_int_cast<short>(nNewFirstLineOffset));
+    
mxParaItem->SetTextFirstLineOffset(SvxIndentValue::twips(nNewFirstLineOffset));
     mxParaItem->SetTextLeft(nNewTxtLeft);
     mxParaItem->SetRight(nNewRight);
 
diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx 
b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
index 269946d8f852..2fd5647d8666 100644
--- a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
+++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
@@ -221,7 +221,9 @@ IMPL_LINK_NOARG( ParaPropertyPanel, ModifyIndentHdl_Impl, 
weld::MetricSpinButton
     SvxLRSpaceItem aMargin( SID_ATTR_PARA_LRSPACE );
     aMargin.SetTextLeft(mxLeftIndent->GetCoreValue(m_eLRSpaceUnit));
     aMargin.SetRight(mxRightIndent->GetCoreValue(m_eLRSpaceUnit));
-    
aMargin.SetTextFirstLineOffset(static_cast<short>(mxFLineIndent->GetCoreValue(m_eLRSpaceUnit)));
+    // tdf#36709: TODO: Handle font-relative units from GUI
+    aMargin.SetTextFirstLineOffset(
+        SvxIndentValue::twips(mxFLineIndent->GetCoreValue(m_eLRSpaceUnit)));
 
     GetBindings()->GetDispatcher()->ExecuteList(
         SID_ATTR_PARA_LRSPACE, SfxCallMode::RECORD, { &aMargin });
@@ -401,7 +403,8 @@ void ParaPropertyPanel::StateChangedIndentImpl( 
SfxItemState eState, const SfxPo
         tools::Long aTxtRight = pSpace->GetRight();
         aTxtRight = OutputDevice::LogicToLogic(aTxtRight, m_eLRSpaceUnit, 
MapUnit::MapTwip);
 
-        tools::Long aTxtFirstLineOfst = pSpace->GetTextFirstLineOffset();
+        // tdf#36709: TODO: Handle font-relative units
+        tools::Long aTxtFirstLineOfst = pSpace->ResolveTextFirstLineOffset({});
         aTxtFirstLineOfst = OutputDevice::LogicToLogic( aTxtFirstLineOfst, 
m_eLRSpaceUnit, MapUnit::MapTwip );
 
         tools::Long nVal = o3tl::convert(maTxtLeft, o3tl::Length::twip, 
o3tl::Length::mm100);
diff --git a/svx/source/sidebar/paragraph/ParaSpacingWindow.cxx 
b/svx/source/sidebar/paragraph/ParaSpacingWindow.cxx
index 8952f91a0f5f..933a2f5f06ab 100644
--- a/svx/source/sidebar/paragraph/ParaSpacingWindow.cxx
+++ b/svx/source/sidebar/paragraph/ParaSpacingWindow.cxx
@@ -215,7 +215,8 @@ void ParaLRSpacingWindow::SetValue(SfxItemState eState, 
const SfxPoolItem* pStat
         const SvxLRSpaceItem* pSpace = static_cast<const 
SvxLRSpaceItem*>(pState);
         tools::Long aTxtLeft = pSpace->GetTextLeft();
         tools::Long aTxtRight = pSpace->GetRight();
-        tools::Long aTxtFirstLineOfst = pSpace->GetTextFirstLineOffset();
+        // tdf#36709: TODO: Handle font-relative units
+        tools::Long aTxtFirstLineOfst = pSpace->ResolveTextFirstLineOffset({});
 
         aTxtLeft = m_xBeforeSpacing->normalize(aTxtLeft);
 
@@ -294,7 +295,8 @@ IMPL_LINK_NOARG(ParaLRSpacingWindow, ModifySpacingHdl, 
weld::MetricSpinButton&,
         SvxLRSpaceItem aMargin(SID_ATTR_PARA_LRSPACE);
         aMargin.SetTextLeft(m_xBeforeSpacing->GetCoreValue(m_eUnit));
         aMargin.SetRight(m_xAfterSpacing->GetCoreValue(m_eUnit));
-        aMargin.SetTextFirstLineOffset(m_xFLSpacing->GetCoreValue(m_eUnit));
+        // tdf#36709: TODO: Handle font-relative units from GUI
+        
aMargin.SetTextFirstLineOffset(SvxIndentValue::twips(m_xFLSpacing->GetCoreValue(m_eUnit)));
 
         pDisp->ExecuteList(SID_ATTR_PARA_LRSPACE, SfxCallMode::RECORD, 
{&aMargin});
     }
diff --git a/sw/source/core/attr/format.cxx b/sw/source/core/attr/format.cxx
index 68ec83a6178d..eacf0e8129f0 100644
--- a/sw/source/core/attr/format.cxx
+++ b/sw/source/core/attr/format.cxx
@@ -674,7 +674,7 @@ void SwFormat::DelDiffs( const SfxItemSet& rSet )
 void SwFormat::SetPageFormatToDefault()
 {
     const sal_Int32 nSize = o3tl::convert(2, o3tl::Length::cm, 
o3tl::Length::twip);
-    SetFormatAttr(SvxLRSpaceItem(nSize, nSize, 0, RES_LR_SPACE));
+    SetFormatAttr(SvxLRSpaceItem(nSize, nSize, SvxIndentValue::zero(), 
RES_LR_SPACE));
     SetFormatAttr(SvxULSpaceItem(nSize, nSize, RES_UL_SPACE));
 }
 
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index e187159bc7d3..fc7aac7814d4 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -2438,7 +2438,7 @@ bool SwCursorShell::SetShadowCursorPos( const Point& rPt, 
SwFillMode eFillMode )
                     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.0, 
css::util::MeasureUnit::TWIP);
+            firstLine.SetTextFirstLineOffset(SvxIndentValue::zero());
             leftMargin.SetTextLeft(aFPos.nTabCnt);
             aSet.Put(firstLine);
             aSet.Put(leftMargin);
diff --git a/sw/source/core/doc/DocumentStylePoolManager.cxx 
b/sw/source/core/doc/DocumentStylePoolManager.cxx
index 7df2dc58ebfd..665f8094232e 100644
--- a/sw/source/core/doc/DocumentStylePoolManager.cxx
+++ b/sw/source/core/doc/DocumentStylePoolManager.cxx
@@ -212,8 +212,9 @@ namespace
                 {
                     SvxFirstLineIndentItem 
firstLine(pColl->GetFormatAttr(RES_MARGIN_FIRSTLINE));
                     SvxTextLeftMarginItem 
leftMargin(pColl->GetFormatAttr(RES_MARGIN_TEXTLEFT));
-                    
firstLine.SetTextFirstLineOffset(rNFormat.GetFirstLineOffset(),
-                                                     
rNFormat.GetFirstLineOffsetUnit());
+                    firstLine.SetTextFirstLineOffset(
+                        SvxIndentValue{ 
static_cast<double>(rNFormat.GetFirstLineOffset()),
+                                        rNFormat.GetFirstLineOffsetUnit() });
                     leftMargin.SetTextLeft(rNFormat.GetAbsLSpace());
                     pColl->SetFormatAttr(firstLine);
                     pColl->SetFormatAttr(leftMargin);
@@ -257,7 +258,7 @@ namespace
                             sal_uInt16 nNxt, SwTwips nEZ, SwTwips nLeft,
                             SwTwips nUpper, SwTwips nLower )
     {
-        SvxFirstLineIndentItem firstLine(nEZ, css::util::MeasureUnit::TWIP, 
RES_MARGIN_FIRSTLINE);
+        SvxFirstLineIndentItem firstLine(SvxIndentValue::twips(nEZ), 
RES_MARGIN_FIRSTLINE);
 
         SvxTextLeftMarginItem const leftMargin(sal_uInt16(nLeft), 
RES_MARGIN_TEXTLEFT);
         rSet.Put(firstLine);
@@ -711,7 +712,7 @@ SwTextFormatColl* 
DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
         case RES_POOLCOLL_TEXT_IDENT:           // Text body indentation
             {
                 auto const first(o3tl::convert(5, o3tl::Length::mm, 
o3tl::Length::twip));
-                SvxFirstLineIndentItem const firstLine(first, 
css::util::MeasureUnit::TWIP,
+                SvxFirstLineIndentItem const 
firstLine(SvxIndentValue::twips(first),
                                                        RES_MARGIN_FIRSTLINE);
                 SvxTextLeftMarginItem const leftMargin(0, RES_MARGIN_TEXTLEFT);
                 aSet.Put(firstLine);
@@ -722,7 +723,7 @@ SwTextFormatColl* 
DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
             {
                 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, 
css::util::MeasureUnit::TWIP,
+                SvxFirstLineIndentItem const 
firstLine(SvxIndentValue::twips(first),
                                                        RES_MARGIN_FIRSTLINE);
                 SvxTextLeftMarginItem const leftMargin(left, 
RES_MARGIN_TEXTLEFT);
                 aSet.Put(firstLine);
@@ -747,7 +748,7 @@ SwTextFormatColl* 
DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
             {
                 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, 
css::util::MeasureUnit::TWIP,
+                SvxFirstLineIndentItem const 
firstLine(SvxIndentValue::twips(first),
                                                        RES_MARGIN_FIRSTLINE);
                 SvxTextLeftMarginItem const leftMargin(left, 
RES_MARGIN_TEXTLEFT);
                 aSet.Put(firstLine);
@@ -956,7 +957,7 @@ SwTextFormatColl* 
DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
             {
                 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, 
css::util::MeasureUnit::TWIP,
+                SvxFirstLineIndentItem const 
firstLine(SvxIndentValue::twips(first),
                                                        RES_MARGIN_FIRSTLINE);
                 SvxTextLeftMarginItem const leftMargin(left, 
RES_MARGIN_TEXTLEFT);
                 aSet.Put(firstLine);
@@ -1683,7 +1684,7 @@ SwFormat* DocumentStylePoolManager::GetFormatFromPool( 
sal_uInt16 nId )
                 aBox.SetLine( &aLine, SvxBoxItemLine::RIGHT );
                 aBox.SetAllDistances( 85 );
                 aSet.Put( aBox );
-                aSet.Put( SvxLRSpaceItem( 114, 114, 0, RES_LR_SPACE ) );
+                aSet.Put(SvxLRSpaceItem(114, 114, SvxIndentValue::zero(), 
RES_LR_SPACE));
                 aSet.Put( SvxULSpaceItem( 114, 114, RES_UL_SPACE ) );
             }
 
@@ -1705,7 +1706,7 @@ SwFormat* DocumentStylePoolManager::GetFormatFromPool( 
sal_uInt16 nId )
         {
             aSet.Put( SwFormatAnchor( RndStdIds::FLY_AS_CHAR ) );
             aSet.Put( SwFormatVertOrient( 0, 
text::VertOrientation::CHAR_CENTER, text::RelOrientation::FRAME ) );
-            aSet.Put( SvxLRSpaceItem( 0, 0, 0, RES_LR_SPACE ) );
+            aSet.Put(SvxLRSpaceItem(0, 0, SvxIndentValue::zero(), 
RES_LR_SPACE));
 
             if ( RES_POOLFRM_INLINE_HEADING == nId )
             {
@@ -1746,7 +1747,7 @@ SwFormat* DocumentStylePoolManager::GetFormatFromPool( 
sal_uInt16 nId )
         {
             aSet.Put( SwFormatAnchor( RndStdIds::FLY_AS_CHAR ) );
             aSet.Put( SwFormatVertOrient( 0, text::VertOrientation::TOP, 
text::RelOrientation::FRAME ) );
-            aSet.Put( SvxLRSpaceItem( 114, 114, 0, RES_LR_SPACE ) );
+            aSet.Put(SvxLRSpaceItem(114, 114, SvxIndentValue::zero(), 
RES_LR_SPACE));
 
             SvxProtectItem aProtect( RES_PROTECT );
             aProtect.SetSizeProtect( true );
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index adec26e403c4..c9a0dfd62c05 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -1706,8 +1706,9 @@ void SwDoc::MoveLeftMargin(const SwPaM& rPam, bool 
bRight, bool bModulus,
                             }
                             if (indents & ::sw::ListLevelIndents::FirstLine)
                             {
-                                
firstLine.SetTextFirstLineOffset(rFormat.GetFirstLineIndent(),
-                                                                 
rFormat.GetFirstLineIndentUnit());
+                                
firstLine.SetTextFirstLineOffset(SvxIndentValue{
+                                    
static_cast<double>(rFormat.GetFirstLineIndent()),
+                                    rFormat.GetFirstLineIndentUnit() });
                             }
                         }
                     }
diff --git a/sw/source/core/doc/fmtcol.cxx b/sw/source/core/doc/fmtcol.cxx
index a7d47a8681fe..353048fcb7c8 100644
--- a/sw/source/core/doc/fmtcol.cxx
+++ b/sw/source/core/doc/fmtcol.cxx
@@ -252,8 +252,7 @@ void SwTextFormatColl::SwClientNotify(const SwModify& 
rModify, const SfxHint& rH
             if (100 != pOldFirstLineIndent->GetPropTextFirstLineOffset())
             {
                 const double dOld = 
pOldFirstLineIndent->GetTextFirstLineOffsetValue();
-                
aNew.SetTextFirstLineOffset(pNewFirstLineIndent->GetTextFirstLineOffsetValue(),
-                                            
pNewFirstLineIndent->GetTextFirstLineOffsetUnit(),
+                
aNew.SetTextFirstLineOffset(pNewFirstLineIndent->GetTextFirstLineOffset(),
                                             
pOldFirstLineIndent->GetPropTextFirstLineOffset());
                 bChg = dOld != aNew.GetTextFirstLineOffsetValue();
             }
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 15cd4b39fbe1..e6005663e99a 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -431,7 +431,8 @@ const SwTable* SwDoc::InsertTable( const 
SwInsertTableOptions& rInsTableOpts,
         {
             sal_uInt16 nFrameWidth = nLastPos;
             nLastPos = (*pColArr)[ pColArr->size()-2 ];
-            pTableFormat->SetFormatAttr( SvxLRSpaceItem( nSttPos, nFrameWidth 
- nLastPos, 0, RES_LR_SPACE ) );
+            pTableFormat->SetFormatAttr(SvxLRSpaceItem(nSttPos, nFrameWidth - 
nLastPos,
+                                                       SvxIndentValue::zero(), 
RES_LR_SPACE));
         }
         nWidth = nLastPos - nSttPos;
     }
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index 9a91f98d75a1..42e7af795e73 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -3021,7 +3021,6 @@ static SwTwips lcl_CalcAutoWidth( const SwLayoutFrame& 
rFrame )
             SvxRightMarginItem const& rRightMargin(rParaSet.GetRightMargin());
             if (!static_cast<const SwTextFrame*>(pFrame)->IsLocked())
             {
-                // tdf#36709: TODO: Handle font-relative first-line indent
                 nMin += rRightMargin.GetRight() + rLeftMargin.GetTextLeft()
                         + rFirstLine.ResolveTextFirstLineOffset({});
             }
diff --git a/sw/source/core/layout/frmtool.cxx 
b/sw/source/core/layout/frmtool.cxx
index 1cf9fac80564..14cac86e962a 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -2353,7 +2353,6 @@ tools::Long SwBorderAttrs::CalcRight( const SwFrame* 
pCaller ) const
     {
         if (pCaller->IsRightToLeft())
         {
-            // tdf#36709: TODO: Handle font-relative units
             nRight += m_pTextLeftMargin->GetLeft(*m_pFirstLineIndent, 
/*metrics*/ {});
         }
         else
@@ -2409,7 +2408,6 @@ tools::Long SwBorderAttrs::CalcLeft( const SwFrame 
*pCaller ) const
     {
         if (pCaller->IsTextFrame())
         {
-            // tdf#36709: TODO: Handle font-relative units
             nLeft += m_pTextLeftMargin->GetLeft(*m_pFirstLineIndent, 
/*metrics*/ {});
         }
         else
diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx
index 0c845b0150a7..7961e14a58ff 100644
--- a/sw/source/core/text/frmcrsr.cxx
+++ b/sw/source/core/text/frmcrsr.cxx
@@ -216,7 +216,6 @@ bool SwTextFrame::GetCharRect( SwRect& rOrig, const 
SwPosition &rPos,
         Point aPnt1 = pFrame->getFrameArea().Pos() + 
pFrame->getFramePrintArea().Pos();
         SwTextNode const*const pTextNd(GetTextNodeForParaProps());
         short nFirstOffset;
-        // tdf#36709: TODO: Handle font-relative units
         pTextNd->GetFirstLineOfsWithNum(nFirstOffset, {});
 
         Point aPnt2;
@@ -1484,7 +1483,6 @@ void SwTextFrame::FillCursorPos( SwFillData& rFill ) const
                 rRect.Top( rRect.Top() + nFirst );
             rRect.Height( nLineHeight );
 
-            // tdf#36709: TODO: Handle font-relative units
             SwTwips nLeft = rFill.Left() + rTextLeftMargin.GetLeft(rFirstLine, 
/*metrics*/ {})
                             + 
GetTextNodeForParaProps()->GetLeftMarginWithNum();
             SwTwips nRight = rFill.Right() - rRightMargin.GetRight();
diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx
index c39ea7b7395f..b23741335cb0 100644
--- a/sw/source/core/text/frmpaint.cxx
+++ b/sw/source/core/text/frmpaint.cxx
@@ -575,7 +575,6 @@ bool SwTextFrame::PaintEmpty( const SwRect &rRect, bool 
bCheck ) const
                 const SvxFirstLineIndentItem& rFirstLine(
                     
GetTextNodeForParaProps()->GetSwAttrSet().GetFirstLineIndent());
 
-                // tdf#36709: TODO: Handle font-relative first-line indentation
                 if (0.0 < rFirstLine.GetTextFirstLineOffsetValue())
                 {
                     aPos.AdjustX(rFirstLine.ResolveTextFirstLineOffset({}));
diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx
index c7d03b80b9f9..f93b7274e257 100644
--- a/sw/source/core/text/itratr.cxx
+++ b/sw/source/core/text/itratr.cxx
@@ -1085,7 +1085,6 @@ void SwTextNode::GetMinMaxSize( SwNodeOffset nIndex, 
sal_uLong& rMin, sal_uLong
     tools::Long nLROffset = rTextLeftMargin.GetTextLeft() + 
GetLeftMarginWithNum( true );
     short nFLOffs;
     // For enumerations a negative first line indentation is probably filled 
already
-    // tdf#36709: TODO: Handle font-relative units
     if (!GetFirstLineOfsWithNum(nFLOffs, {}) || nFLOffs > nLROffset)
         nLROffset = nFLOffs;
 
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx
index 36cbdbce162d..3330129be981 100644
--- a/sw/source/core/text/porfld.cxx
+++ b/sw/source/core/text/porfld.cxx
@@ -604,7 +604,6 @@ bool SwNumberPortion::Format( SwTextFormatInfo &rInf )
                 (IsFootnoteNumPortion() &&
                  
rInf.GetTextFrame()->GetDoc().getIDocumentSettingAccess().get(DocumentSettingId::NO_GAP_AFTER_NOTE_NUMBER)))
             {
-                // tdf#36709: TODO: Handle font-relative first line indentation
                 nDiff = rInf.Left()
                         + rInf.GetTextFrame()
                               ->GetTextNodeForParaProps()
diff --git a/sw/source/core/tox/ToxTabStopTokenHandler.cxx 
b/sw/source/core/tox/ToxTabStopTokenHandler.cxx
index 3ebedfec05a3..45020252f592 100644
--- a/sw/source/core/tox/ToxTabStopTokenHandler.cxx
+++ b/sw/source/core/tox/ToxTabStopTokenHandler.cxx
@@ -115,7 +115,6 @@ auto DefaultToxTabStopTokenHandler::CalcEndStop(SwTextNode 
const& rNode,
         SvxTextLeftMarginItem const& rTextLeftMargin(
             rNode.GetTextColl()->GetTextLeftMargin());
 
-        // tdf#36709: TODO: Handle font-relative units
         nRightMargin -= rTextLeftMargin.GetLeft(rFirstLine, /*metrics*/ {});
         nRightMargin -= rFirstLine.ResolveTextFirstLineOffset(/*metrics*/ {});
     }
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index edb760a33ba9..38b034c7c24d 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -3311,7 +3311,6 @@ tools::Long SwTextNode::GetLeftMarginWithNum( bool 
bTextLeft ) const
             if( pRule->IsAbsSpaces() )
             {
                 SvxFirstLineIndentItem const& 
rFirst(GetSwAttrSet().GetFirstLineIndent());
-                // tdf#36709: TODO: Handle font-relative units
                 nRet = nRet - 
GetSwAttrSet().GetTextLeftMargin().GetLeft(rFirst, /*metrics*/ {});
             }
         }
@@ -3325,7 +3324,6 @@ tools::Long SwTextNode::GetLeftMarginWithNum( bool 
bTextLeft ) const
             // list/paragraph items. (this is rather inelegant)
             SvxFirstLineIndentItem 
firstLine(GetSwAttrSet().GetFirstLineIndent());
             SvxTextLeftMarginItem 
leftMargin(GetSwAttrSet().GetTextLeftMargin());
-            // tdf#36709: TODO: Handle font-relative units
             nRet = bTextLeft ? -leftMargin.GetTextLeft()
                              : -leftMargin.GetLeft(firstLine, /*metrics*/ {});
             if (indents & ::sw::ListLevelIndents::LeftMargin)
@@ -3334,10 +3332,10 @@ tools::Long SwTextNode::GetLeftMarginWithNum( bool 
bTextLeft ) const
             }
             if (indents & ::sw::ListLevelIndents::FirstLine)
             {
-                firstLine.SetTextFirstLineOffset(rFormat.GetFirstLineIndent(),
-                                                 
rFormat.GetFirstLineIndentUnit());
+                firstLine.SetTextFirstLineOffset(
+                    SvxIndentValue{ 
static_cast<double>(rFormat.GetFirstLineIndent()),
+                                    rFormat.GetFirstLineIndentUnit() });
             }
-            // tdf#36709: TODO: Handle font-relative units
             nRet += bTextLeft ? leftMargin.GetTextLeft()
                               : leftMargin.GetLeft(firstLine, /*metrics*/ {});
         }
@@ -3402,12 +3400,10 @@ SwTwips 
SwTextNode::GetAdditionalIndentForStartingNewList() const
         {
             SvxFirstLineIndentItem const& 
rFirst(GetSwAttrSet().GetFirstLineIndent());
 
-            // tdf#36709: TODO: Handle font-relative indentation
             nAdditionalIndent = 
GetSwAttrSet().GetTextLeftMargin().GetLeft(rFirst, /*metrics*/ {});
 
             if 
(getIDocumentSettingAccess()->get(DocumentSettingId::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING))
             {
-                // tdf#36709: TODO: Handle font-relative indentation
                 nAdditionalIndent
                     = nAdditionalIndent
                       - 
GetSwAttrSet().GetFirstLineIndent().ResolveTextFirstLineOffset({});
@@ -3420,21 +3416,21 @@ SwTwips 
SwTextNode::GetAdditionalIndentForStartingNewList() const
             // other use of it.
             ::sw::ListLevelIndents const 
indents(AreListLevelIndentsApplicable());
             SvxFirstLineIndentItem const aFirst(
-                    indents & ::sw::ListLevelIndents::FirstLine
-                    ? SvxFirstLineIndentItem(rFormat.GetFirstLineIndent(),
-                                             rFormat.GetFirstLineIndentUnit(), 
RES_MARGIN_FIRSTLINE)
+                indents & ::sw::ListLevelIndents::FirstLine
+                    ? SvxFirstLineIndentItem(
+                          SvxIndentValue{ 
static_cast<double>(rFormat.GetFirstLineIndent()),
+                                          rFormat.GetFirstLineIndentUnit() },
+                          RES_MARGIN_FIRSTLINE)
                     : GetSwAttrSet().GetFirstLineIndent());
             SvxTextLeftMarginItem const aLeft(
                     indents & ::sw::ListLevelIndents::LeftMargin
                     ? SvxTextLeftMarginItem(rFormat.GetIndentAt(), 
RES_MARGIN_TEXTLEFT)
                     : GetSwAttrSet().GetTextLeftMargin());
-            // tdf#36709: TODO: Handle font-relative indentation
             nAdditionalIndent = aLeft.GetLeft(aFirst, /*metrics*/ {});
             if (!(indents & ::sw::ListLevelIndents::FirstLine))
             {
                 if 
(getIDocumentSettingAccess()->get(DocumentSettingId::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING))
                 {
-                    // tdf#36709: TODO: Handle font-relative first line 
indentation
                     nAdditionalIndent = nAdditionalIndent - 
aFirst.ResolveTextFirstLineOffset({});
                 }
             }
@@ -3442,7 +3438,6 @@ SwTwips 
SwTextNode::GetAdditionalIndentForStartingNewList() const
     }
     else
     {
-        // tdf#36709: TODO: Handle font-relative first line indentation
         SvxFirstLineIndentItem const& 
rFirst(GetSwAttrSet().GetFirstLineIndent());
         nAdditionalIndent = GetSwAttrSet().GetTextLeftMargin().GetLeft(rFirst, 
/*metrics*/ {});
     }
diff --git a/sw/source/core/txtnode/thints.cxx 
b/sw/source/core/txtnode/thints.cxx
index 4dab2b5ee23d..a2dffac99636 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -2135,9 +2135,10 @@ static void lcl_MergeListLevelIndentAsLRSpaceItem( const 
SwTextNode& rTextNode,
         {
             if (indents & ::sw::ListLevelIndents::FirstLine)
             {
-                SvxFirstLineIndentItem const 
firstLine(rFormat.GetFirstLineIndent(),
-                                                       
rFormat.GetFirstLineIndentUnit(),
-                                                       RES_MARGIN_FIRSTLINE);
+                SvxFirstLineIndentItem const firstLine(
+                    SvxIndentValue{ 
static_cast<double>(rFormat.GetFirstLineIndent()),
+                                    rFormat.GetFirstLineIndentUnit() },
+                    RES_MARGIN_FIRSTLINE);
                 rSet.Put(firstLine);
             }
             if (indents & ::sw::ListLevelIndents::LeftMargin)
diff --git a/sw/source/filter/html/css1atr.cxx 
b/sw/source/filter/html/css1atr.cxx
index de2c160f3330..90c505eba8bd 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -2867,8 +2867,8 @@ static SwHTMLWriter& OutCSS1_SvxLRSpace( SwHTMLWriter& 
rWrt, const SfxPoolItem&
     }
 
     // The LineIndent of the first line might contain the room for numbering
-    tools::Long nFirstLineIndent = 
static_cast<tools::Long>(rLRItem.GetTextFirstLineOffset()) -
-        rWrt.m_nFirstLineIndent;
+    tools::Long nFirstLineIndent = 
static_cast<tools::Long>(rLRItem.ResolveTextFirstLineOffset({}))
+                                   - rWrt.m_nFirstLineIndent;
     if( rWrt.m_nDfltFirstLineIndent != nFirstLineIndent )
     {
         rWrt.OutCSS1_UnitProperty( sCSS1_P_text_indent,
diff --git a/sw/source/filter/html/htmlctxt.cxx 
b/sw/source/filter/html/htmlctxt.cxx
index bb0a1d58c734..4035a4dde407 100644
--- a/sw/source/filter/html/htmlctxt.cxx
+++ b/sw/source/filter/html/htmlctxt.cxx
@@ -644,7 +644,7 @@ void SwHTMLParser::InsertAttrs( SfxItemSet &rItemSet,
                 pContext->SetMargins( nLeft, nRight, nIndent );
 
                 // Set the attribute on the current paragraph
-                SvxFirstLineIndentItem firstLine(nIndent, 
css::util::MeasureUnit::TWIP,
+                SvxFirstLineIndentItem 
firstLine(SvxIndentValue::twips(nIndent),
                                                  RES_MARGIN_FIRSTLINE);
                 NewAttr(m_xAttrTab, &m_xAttrTab->pFirstLineIndent, firstLine);
                 EndAttr(m_xAttrTab->pFirstLineIndent, false);
diff --git a/sw/source/filter/html/htmltab.cxx 
b/sw/source/filter/html/htmltab.cxx
index 92ca567aeeb0..23ec0f9b6d7b 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -3459,7 +3459,8 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, 
bool bReadOptions,
 
                     sal_uInt16 nSpace = pCurTable->GetHSpace();
                     if( nSpace )
-                        aFrameSet.Put( SvxLRSpaceItem(nSpace, nSpace, 0, 
RES_LR_SPACE) );
+                        aFrameSet.Put(
+                            SvxLRSpaceItem(nSpace, nSpace, 
SvxIndentValue::zero(), RES_LR_SPACE));
                     nSpace = pCurTable->GetVSpace();
                     if( nSpace )
                         aFrameSet.Put( SvxULSpaceItem(nSpace,nSpace, 
RES_UL_SPACE) );
diff --git a/sw/source/filter/html/svxcss1.cxx 
b/sw/source/filter/html/svxcss1.cxx
index 8350dff92c7d..b1dc184d722f 100644
--- a/sw/source/filter/html/svxcss1.cxx
+++ b/sw/source/filter/html/svxcss1.cxx
@@ -1987,8 +1987,7 @@ static void ParseCSS1_text_indent( const CSS1Expression 
*pExpr,
     if( !bSet )
         return;
 
-    SvxFirstLineIndentItem const firstLine(nIndent, 
css::util::MeasureUnit::TWIP,
-                                           RES_MARGIN_FIRSTLINE);
+    SvxFirstLineIndentItem const firstLine(SvxIndentValue::twips(nIndent), 
RES_MARGIN_FIRSTLINE);
     rItemSet.Put(firstLine);
     rPropInfo.m_bTextIndent = true;
 }
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index 5f8236f97217..b1a85351a5af 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -4846,7 +4846,7 @@ void SwHTMLParser::SetTextCollAttrs( HTMLAttrContext 
*pContext )
         SvxFirstLineIndentItem firstLine(rFirstLine);
         SvxTextLeftMarginItem leftMargin(rTextLeftMargin);
         SvxRightMarginItem rightMargin(rRightMargin);
-        firstLine.SetTextFirstLineOffset(nFirstLineIndent, 
css::util::MeasureUnit::TWIP);
+        
firstLine.SetTextFirstLineOffset(SvxIndentValue::twips(nFirstLineIndent));
         leftMargin.SetTextLeft(nLeftMargin);
         rightMargin.SetRight(nRightMargin);
         if( pItemSet )
@@ -5081,7 +5081,7 @@ void SwHTMLParser::InsertSpacer()
                 GetMarginsFromContextWithNumberBullet( nLeft, nRight, nIndent 
);
                 nIndent = nIndent + static_cast<short>(nSize);
 
-                SvxFirstLineIndentItem const firstLine(nIndent, 
css::util::MeasureUnit::TWIP,
+                SvxFirstLineIndentItem const 
firstLine(SvxIndentValue::twips(nIndent),
                                                        RES_MARGIN_FIRSTLINE);
                 SvxTextLeftMarginItem const leftMargin(nLeft, 
RES_MARGIN_TEXTLEFT);
                 SvxRightMarginItem const rightMargin(nRight, RES_MARGIN_RIGHT);
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index c36fc02f633a..294651fbeb22 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -9397,7 +9397,8 @@ void DocxAttributeOutput::FormatLRSpace( const 
SvxLRSpaceItem& rLRSpace )
         {
             pLRSpaceAttrList->add( FSNS(XML_w, (bEcma ? XML_right : XML_end)), 
OString::number(pLRSpace->GetRight()) );
         }
-        sal_Int32 const nFirstLineAdjustment = 
pLRSpace->GetTextFirstLineOffset();
+        // tdf#83844: TODO: export FONT_CJK_ADVANCE first line indent as 
HangingChars/FirstLineChars
+        sal_Int32 const nFirstLineAdjustment = 
pLRSpace->ResolveTextFirstLineOffset({});
         if (nFirstLineAdjustment > 0)
             pLRSpaceAttrList->add( FSNS( XML_w, XML_firstLine ), 
OString::number( nFirstLineAdjustment ) );
         else
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx 
b/sw/source/filter/ww8/rtfattributeoutput.cxx
index bea6f6940c6e..7ddde4e78101 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -3254,8 +3254,8 @@ void RtfAttributeOutput::ParaNumRule_Impl(const 
SwTextNode* pTextNd, sal_Int32 n
     SvxTextLeftMarginItem leftMargin(rNdSet.Get(RES_MARGIN_TEXTLEFT));
     leftMargin.SetTextLeft(leftMargin.GetTextLeft() + pFormat->GetIndentAt());
 
-    firstLine.SetTextFirstLineOffset(pFormat->GetFirstLineOffset(),
-                                     pFormat->GetFirstLineOffsetUnit());
+    firstLine.SetTextFirstLineOffset(SvxIndentValue{
+        static_cast<double>(pFormat->GetFirstLineOffset()), 
pFormat->GetFirstLineOffsetUnit() });
 
     sal_uInt16 nStyle = m_rExport.GetId(pFormat->GetCharFormat());
     OString* pString = m_rExport.GetStyle(nStyle);
@@ -3459,7 +3459,7 @@ void RtfAttributeOutput::FormatLRSpace(const 
SvxLRSpaceItem& rLRSpace)
             m_aStyles.append(OOO_STRING_SVTOOLS_RTF_RIN);
             m_aStyles.append(static_cast<sal_Int32>(rLRSpace.GetRight()));
             m_aStyles.append(OOO_STRING_SVTOOLS_RTF_FI);
-            
m_aStyles.append(static_cast<sal_Int32>(rLRSpace.GetTextFirstLineOffset()));
+            m_aStyles.append(rLRSpace.ResolveTextFirstLineOffset({}));
         }
     }
     else if (m_rExport.GetRTFFlySyntax())
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx 
b/sw/source/filter/ww8/wrtw8nds.cxx
index 5f113a231ea0..463646a1cfee 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -3062,17 +3062,15 @@ void MSWordExportBase::OutputTextNode( SwTextNode& 
rNode )
                     {
                         if (bParaRTL)
                         {
-                            firstLine.SetTextFirstLineOffset(
+                            
firstLine.SetTextFirstLineOffset(SvxIndentValue::twips(
                                 firstLine.ResolveTextFirstLineOffset({}) + 
pFormat->GetAbsLSpace()
-                                    - pFormat->GetFirstLineOffset(),
-                                css::util::MeasureUnit::TWIP);
+                                - pFormat->GetFirstLineOffset()));
                         }
                         else
                         {
                             firstLine.SetTextFirstLineOffset(
-                                firstLine.ResolveTextFirstLineOffset({})
-                                    + GetWordFirstLineOffset(*pFormat),
-                                css::util::MeasureUnit::TWIP);
+                                
SvxIndentValue::twips(firstLine.ResolveTextFirstLineOffset({})
+                                                      + 
GetWordFirstLineOffset(*pFormat)));
                         }
                     }
 
@@ -3205,7 +3203,7 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode )
                 // (first line indent is ignored)
                 if (!bParaRTL)
                 {
-                    firstLine.SetTextFirstLineOffset(0.0, 
css::util::MeasureUnit::TWIP);
+                    firstLine.SetTextFirstLineOffset(SvxIndentValue::zero());
                 }
 
                 // put back the new item
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx 
b/sw/source/filter/ww8/wrtw8sty.cxx
index d36541a0a891..39f195bc3d6e 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -1729,9 +1729,9 @@ void MSWordExportBase::SectionProperties( const 
WW8_SepInfo& rSepInfo, WW8_PdAtt
             const SvxLRSpaceItem &rPageLR =
                 pPdFormat->GetFormatAttr( RES_LR_SPACE );
 
-            SvxLRSpaceItem aResultLR( rPageLR.GetLeft() +
-                    rSectionLR.GetLeft(), rPageLR.GetRight() +
-                    rSectionLR.GetRight(), 0, RES_LR_SPACE );
+            SvxLRSpaceItem aResultLR(rPageLR.GetLeft() + rSectionLR.GetLeft(),
+                                     rPageLR.GetRight() + 
rSectionLR.GetRight(),
+                                     SvxIndentValue::zero(), RES_LR_SPACE);
             //i120133: The Section width should consider section indent value.
             if (rSectionLR.GetLeft()+rSectionLR.GetRight()!=0)
             {
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 50b35698c620..37915ccf7b66 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -927,8 +927,8 @@ void MSWordExportBase::OutputFormat( const SwFormat& 
rFormat, bool bPapFormat, b
                     SvxTextLeftMarginItem 
leftMargin(aSet.Get(RES_MARGIN_TEXTLEFT));
 
                     leftMargin.SetTextLeft(leftMargin.GetTextLeft() + 
rNFormat.GetAbsLSpace());
-                    
firstLine.SetTextFirstLineOffset(GetWordFirstLineOffset(rNFormat),
-                                                     
css::util::MeasureUnit::TWIP);
+                    firstLine.SetTextFirstLineOffset(
+                        
SvxIndentValue::twips(GetWordFirstLineOffset(rNFormat)));
 
                     aSet.Put(firstLine);
                     aSet.Put(leftMargin);
@@ -4427,8 +4427,9 @@ void WW8AttributeOutput::FormatLRSpace( const 
SvxLRSpaceItem& rLR )
         m_rWW8Export.InsUInt16( o3tl::narrowing<sal_uInt16>(rLR.GetRight()) );
 
         // sprmPDxaLeft1
+        // tdf#80596: TODO export sprmPDxcLeft1 for first line indents in ICs
         m_rWW8Export.InsUInt16( 0x8460 );        //asian version ?
-        m_rWW8Export.InsUInt16( rLR.GetTextFirstLineOffset() );
+        m_rWW8Export.InsUInt16(rLR.ResolveTextFirstLineOffset({}));
     }
 }
 
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index d3e8cd0bc20e..466e5d66e365 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -525,8 +525,8 @@ void SwWW8ImplReader::InsertTxbxStyAttrs(SfxItemSet& rS, 
sal_uInt16 nColl, ManTy
                        && "unnecessary when EditEng learns about the separate 
pieces");
 
                 SvxLRSpaceItem aLR(rS.Get(EE_PARA_LRSPACE));
-                aLR.SetTextFirstLineOffset(
-                    
pStyInf->m_pFormat->GetFirstLineIndent().ResolveTextFirstLineOffset({}));
+                const auto& rFirstLine = 
pStyInf->m_pFormat->GetFirstLineIndent();
+                
aLR.SetTextFirstLineOffset(rFirstLine.GetTextFirstLineOffset());
                 
aLR.SetTextLeft(pStyInf->m_pFormat->GetTextLeftMargin().GetTextLeft());
                 aLR.SetRight(pStyInf->m_pFormat->GetRightMargin().GetRight());
                 rS.Put(aLR);
@@ -771,9 +771,9 @@ void SwWW8ImplReader::InsertAttrsAsDrawingAttrs(WW8_CP 
nStartCp, WW8_CP nEndCp,
                             SvxLRSpaceItem aLR(pS->Get(EE_PARA_LRSPACE));
                             if (nWhich == RES_MARGIN_FIRSTLINE)
                             {
-                                aLR.SetTextFirstLineOffset(
-                                    static_cast<const 
SvxFirstLineIndentItem*>(pItem)
-                                        ->ResolveTextFirstLineOffset({}));
+                                const auto* pFirstLine
+                                    = static_cast<const 
SvxFirstLineIndentItem*>(pItem);
+                                
aLR.SetTextFirstLineOffset(pFirstLine->GetTextFirstLineOffset());
                             }
                             else if (nWhich == RES_MARGIN_TEXTLEFT)
                             {
@@ -2052,7 +2052,8 @@ void SwWW8ImplReader::MapWrapIntoFlyFormat(const 
SvxMSDffImportRec& rRecord,
     if (rRecord.nDxWrapDistLeft || rRecord.nDxWrapDistRight)
     {
         SvxLRSpaceItem aLR(writer_cast<sal_uInt16>(rRecord.nDxWrapDistLeft),
-                           writer_cast<sal_uInt16>(rRecord.nDxWrapDistRight), 
0, RES_LR_SPACE);
+                           writer_cast<sal_uInt16>(rRecord.nDxWrapDistRight),
+                           SvxIndentValue::zero(), RES_LR_SPACE);
         AdjustLRWrapForWordMargins(rRecord, aLR);
         rFlyFormat.SetFormatAttr(aLR);
     }
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 397d1b9c7ae9..e3fb612e75de 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1249,15 +1249,16 @@ void SyncIndentWithList( SvxFirstLineIndentItem & 
rFirstLine,
         tools::Long nWantedFirstLinePos;
         tools::Long nExtraListIndent = lcl_GetTrueMargin(rFirstLine, 
rLeftMargin, rFormat, nWantedFirstLinePos);
         rLeftMargin.SetTextLeft(nWantedFirstLinePos - nExtraListIndent);
-        rFirstLine.SetTextFirstLineOffset(0.0, css::util::MeasureUnit::TWIP);
+        rFirstLine.SetTextFirstLineOffset(SvxIndentValue::zero());
     }
     else if ( rFormat.GetPositionAndSpaceMode() == 
SvxNumberFormat::LABEL_ALIGNMENT )
     {
         if ( !bFirstLineOfstSet && bLeftIndentSet &&
              rFormat.GetFirstLineIndent() != 0 )
         {
-            rFirstLine.SetTextFirstLineOffset(rFormat.GetFirstLineIndent(),
-                                              
rFormat.GetFirstLineIndentUnit());
+            rFirstLine.SetTextFirstLineOffset(
+                SvxIndentValue{ 
static_cast<double>(rFormat.GetFirstLineIndent()),
+                                rFormat.GetFirstLineIndentUnit() });
         }
         else if ( bFirstLineOfstSet && !bLeftIndentSet &&
                   rFormat.GetIndentAt() != 0 )
@@ -1268,8 +1269,9 @@ void SyncIndentWithList( SvxFirstLineIndentItem & 
rFirstLine,
         {
             if ( rFormat.GetFirstLineIndent() != 0 )
             {
-                rFirstLine.SetTextFirstLineOffset(rFormat.GetFirstLineIndent(),
-                                                  
rFormat.GetFirstLineIndentUnit());
+                rFirstLine.SetTextFirstLineOffset(
+                    SvxIndentValue{ 
static_cast<double>(rFormat.GetFirstLineIndent()),
+                                    rFormat.GetFirstLineIndentUnit() });
             }
             if ( rFormat.GetIndentAt() != 0 )
             {
@@ -1358,8 +1360,7 @@ void SwWW8FltControlStack::SetAttrInDoc(const SwPosition& 
rTmpPos,
                     {
                         SvxFirstLineIndentItem const 
firstLineEntry(*static_cast<SvxFirstLineIndentItem*>(rEntry.m_pAttr.get()));
-e 
... etc. - the rest is truncated

Reply via email to