summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2022-02-15 14:26:35 +0200
committerJustin Luth <jluth@mail.com>2022-02-24 07:36:57 +0100
commite87f9b4fa158b917bb38fc00513bae7f94024e58 (patch)
tree3b497b99bdba64c9f602981086426b78d810458c /svx
parentdc4c55c51d52340c84e21da92d61d3488a253cd3 (diff)
tdf#95882 svxruler: restore adjustment for borders
This restores the clause removed from LO 3.6's commit 47a77d7dbc427e51421e2df8d59695834cb74980 Ruler: disable snapping, tooltips [Because that removal left behind dead code, which was later cleared out, of course this patch restores that as well. commit 8303e7ed668fbcbd0ba75bd9dd259f03073ffd46 Author: Noel Grandin on Fri Jun 14 10:41:11 2019 +0200 ] Basic borders on the paragraph itself do not affect where LO ends the tabstop, and thus the removal of that clause was partially justified. But the table/frame/page/headers definitely need to be adjusted in order for the tabstops to show in the correct position. RightFrameMargin needed this as well, especially now that RTL is supported by the ruler since LO 3.6, although the Left/Right functions are very different. [Frames never worked because the aCoreSet wasn't accepting RES_BOX items. Interesting error considering all of the other sections of code created a new CoreSet.] Change-Id: Ic24839dbbd730e66d8b0d588bfbd73bc7cb260bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130125 Tested-by: Justin Luth <jluth@mail.com> Reviewed-by: Justin Luth <jluth@mail.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/rlrcitem.cxx2
-rw-r--r--svx/source/dialog/svxruler.cxx13
2 files changed, 13 insertions, 2 deletions
diff --git a/svx/source/dialog/rlrcitem.cxx b/svx/source/dialog/rlrcitem.cxx
index 873663b27e30..a73cd00bdac5 100644
--- a/svx/source/dialog/rlrcitem.cxx
+++ b/svx/source/dialog/rlrcitem.cxx
@@ -131,7 +131,7 @@ void SvxRulerItem::StateChangedAtToolBoxControl( sal_uInt16 nSID, SfxItemState e
{
const SvxLRSpaceItem *pItem = dynamic_cast<const SvxLRSpaceItem*>( pState );
SAL_WARN_IF(pState != nullptr && pItem == nullptr, "svx.dialog", "SvxLRSpaceItem expected");
- rRuler.UpdateParaBorder();
+ rRuler.UpdateBorder(pItem);
}
break;
case SID_RULER_TEXT_RIGHT_TO_LEFT :
diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx
index 6e960a18433d..d676c3c1208f 100644
--- a/svx/source/dialog/svxruler.cxx
+++ b/svx/source/dialog/svxruler.cxx
@@ -881,11 +881,16 @@ void SvxRuler::UpdatePara(const SvxLRSpaceItem *pItem) // new value of paragraph
}
}
-void SvxRuler::UpdateParaBorder()
+void SvxRuler::UpdateBorder(const SvxLRSpaceItem * pItem)
{
/* Border distance */
if(bActive)
{
+ if (pItem)
+ mxBorderItem.reset(new SvxLRSpaceItem(*pItem));
+ else
+ mxBorderItem.reset();
+
StartListening_Impl();
}
}
@@ -1206,6 +1211,9 @@ tools::Long SvxRuler::GetLeftFrameMargin() const
nLeft = mxColumnItem->GetActiveColumnDescription().nStart;
}
+ if (mxBorderItem && (!mxColumnItem || mxColumnItem->IsTable()))
+ nLeft += mxBorderItem->GetLeft();
+
return nLeft;
}
@@ -1257,6 +1265,9 @@ tools::Long SvxRuler::GetRightFrameMargin() const
else if(!bHorz && mxULSpaceItem)
lResult += mxULSpaceItem->GetLower();
+ if (bHorz && mxBorderItem && (!mxColumnItem || mxColumnItem->IsTable()))
+ lResult += mxBorderItem->GetRight();
+
if(bHorz)
lResult = mxPagePosItem->GetWidth() - lResult;
else