svx/source/dialog/svxruler.cxx |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit bc36476a50687a31e2934a5b52502f2f24424ce1
Author:     Sarper Akdemir <sarper.akde...@collabora.com>
AuthorDate: Tue Feb 28 23:03:12 2023 +0300
Commit:     Sarper Akdemir <sarper.akde...@collabora.com>
CommitDate: Tue Mar 28 14:54:50 2023 +0000

    related tdf#102261: consider ParaTabStopDefaultDistance in SvxRuler
    
    If there's a paragraph scoped tab default distance defined,
    use that as the default tab distance in the SvxRuler instead
    of the document wide setting.
    
    Change-Id: I9b0e7d0db0b25aee08bd27948b2e462b4a4ee496
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148060
    Tested-by: Jenkins
    Reviewed-by: Sarper Akdemir <sarper.akde...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149513
    Tested-by: Sarper Akdemir <sarper.akde...@collabora.com>

diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx
index be53a0c91c58..671afa9f6737 100644
--- a/svx/source/dialog/svxruler.cxx
+++ b/svx/source/dialog/svxruler.cxx
@@ -1027,7 +1027,10 @@ void SvxRuler::UpdateTabs()
         const tools::Long lPosPixel = ConvertHPosPixel(lParaIndent) + lLastTab;
         const tools::Long lRightIndent = ConvertHPosPixel(nRightFrameMargin - 
mxParaItem->GetRight());
 
-        tools::Long nDefTabDist = ConvertHPosPixel(lDefTabDist);
+        tools::Long lCurrentDefTabDist = lDefTabDist;
+        if(mxTabStopItem->GetDefaultDistance())
+            lCurrentDefTabDist = mxTabStopItem->GetDefaultDistance();
+        tools::Long nDefTabDist = ConvertHPosPixel(lCurrentDefTabDist);
 
         const sal_uInt16 nDefTabBuf = lPosPixel > lRightIndent || lLastTab > 
lRightIndent
                     ? 0
@@ -1063,13 +1066,13 @@ void SvxRuler::UpdateTabs()
         }
 
         // Adjust to previous-to-first default tab stop
-        lLastTabOffsetLogic -= lLastTabOffsetLogic % lDefTabDist;
+        lLastTabOffsetLogic -= lLastTabOffsetLogic % lCurrentDefTabDist;
 
         // fill the rest with default Tabs
         for (j = 0; j < nDefTabBuf; ++j)
         {
             //simply add the default distance to the last position
-            lLastTabOffsetLogic += lDefTabDist;
+            lLastTabOffsetLogic += lCurrentDefTabDist;
             if (bRTL)
             {
                 mpTabs[nTabCount + TAB_GAP].nPos =

Reply via email to