Kaydet (Commit) 2cd1673f authored tarafından Kohei Yoshida's avatar Kohei Yoshida

fdo#75260: Apply the same fix from writer table to character bordering.

And mirror the right and bottom borders while I'm at it. I guess it was
originally meant to.

Change-Id: I408b077c1524d19bbadd6f0b284ce204064eb735
üst 961da51a
...@@ -4965,23 +4965,25 @@ void PaintCharacterBorder( ...@@ -4965,23 +4965,25 @@ void PaintCharacterBorder(
// Init borders, after this initialization top, bottom, right and left means the // Init borders, after this initialization top, bottom, right and left means the
// absolute position // absolute position
const boost::optional<editeng::SvxBorderLine> aTopBorder = boost::optional<editeng::SvxBorderLine> aTopBorder =
(bTop ? rFont.GetAbsTopBorder(bVerticalLayout) : boost::none); (bTop ? rFont.GetAbsTopBorder(bVerticalLayout) : boost::none);
const boost::optional<editeng::SvxBorderLine> aBottomBorder = boost::optional<editeng::SvxBorderLine> aBottomBorder =
(bBottom ? rFont.GetAbsBottomBorder(bVerticalLayout) : boost::none); (bBottom ? rFont.GetAbsBottomBorder(bVerticalLayout) : boost::none);
const boost::optional<editeng::SvxBorderLine> aLeftBorder = boost::optional<editeng::SvxBorderLine> aLeftBorder =
(bLeft ? rFont.GetAbsLeftBorder(bVerticalLayout) : boost::none); (bLeft ? rFont.GetAbsLeftBorder(bVerticalLayout) : boost::none);
const boost::optional<editeng::SvxBorderLine> aRightBorder = boost::optional<editeng::SvxBorderLine> aRightBorder =
(bRight ? rFont.GetAbsRightBorder(bVerticalLayout) : boost::none); (bRight ? rFont.GetAbsRightBorder(bVerticalLayout) : boost::none);
if( aTopBorder ) if( aTopBorder )
{ {
sal_uInt16 nOffset = aTopBorder->GetDistance();
Point aLeftTop( Point aLeftTop(
aAlignedRect.Left(), aAlignedRect.Left() - nOffset,
aAlignedRect.Top()); aAlignedRect.Top() - nOffset);
Point aRightBottom( Point aRightBottom(
aAlignedRect.Right(), aAlignedRect.Right() + nOffset,
aAlignedRect.Top() + aTopBorder.get().GetScaledWidth()); aAlignedRect.Top() - nOffset + aTopBorder->GetScaledWidth());
lcl_MakeBorderLine( lcl_MakeBorderLine(
SwRect(aLeftTop, aRightBottom), SwRect(aLeftTop, aRightBottom),
...@@ -4993,6 +4995,8 @@ void PaintCharacterBorder( ...@@ -4993,6 +4995,8 @@ void PaintCharacterBorder(
if( aBottomBorder ) if( aBottomBorder )
{ {
aBottomBorder->SetMirrorWidths(true);
Point aLeftTop( Point aLeftTop(
aAlignedRect.Left(), aAlignedRect.Left(),
aAlignedRect.Bottom() - aBottomBorder.get().GetScaledWidth()); aAlignedRect.Bottom() - aBottomBorder.get().GetScaledWidth());
...@@ -5010,12 +5014,14 @@ void PaintCharacterBorder( ...@@ -5010,12 +5014,14 @@ void PaintCharacterBorder(
if( aLeftBorder ) if( aLeftBorder )
{ {
sal_uInt16 nOffset = aLeftBorder->GetDistance();
Point aLeftTop( Point aLeftTop(
aAlignedRect.Left(), aAlignedRect.Left() - nOffset,
aAlignedRect.Top()); aAlignedRect.Top() - nOffset);
Point aRightBottom( Point aRightBottom(
aAlignedRect.Left() + aLeftBorder.get().GetScaledWidth(), aAlignedRect.Left() - nOffset + aLeftBorder->GetScaledWidth(),
aAlignedRect.Bottom()); aAlignedRect.Bottom() + nOffset);
lcl_MakeBorderLine( lcl_MakeBorderLine(
SwRect(aLeftTop, aRightBottom), SwRect(aLeftTop, aRightBottom),
...@@ -5027,6 +5033,8 @@ void PaintCharacterBorder( ...@@ -5027,6 +5033,8 @@ void PaintCharacterBorder(
if( aRightBorder ) if( aRightBorder )
{ {
aRightBorder->SetMirrorWidths(true);
Point aLeftTop( Point aLeftTop(
aAlignedRect.Right() - aRightBorder.get().GetScaledWidth(), aAlignedRect.Right() - aRightBorder.get().GetScaledWidth(),
aAlignedRect.Top()); aAlignedRect.Top());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment