summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-05-26 17:27:15 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-05-31 16:18:43 +0200
commit0a73929a8225227fe540c5920c15382bc61dec61 (patch)
tree7a4819a3e718f981046a0e61eb9592a56060db42 /sw
parent096bda90377caa7a3e2a7c52cbbd8553901dfb88 (diff)
tdf#108056 sw SubtractFlys: add missing expansion of the clip path
With this finally the bugdoc has no more unexpected white lines around the fly frame. In the non-SubtractFlys case DrawFillAttributes() already did an expansion of the clip path, but this was overwritten in case the layout flag was set. Fix the problem by taking care of this in lcl_SubtractFlys() itself. Change-Id: Iac91279f8bc19588e763425aff5cb800e793da83 Reviewed-on: https://gerrit.libreoffice.org/38079 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit 0714d2f3009bbb24501561c1a8e96a6feb9a42ca)
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/layout/paintfrm.cxx21
1 files changed, 18 insertions, 3 deletions
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index a2b9df5e4360..db06709f5969 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -1537,6 +1537,21 @@ static void lcl_ExtendLeftAndRight( SwRect& _rRect,
}
}
+/// Returns a range suitable for subtraction when lcl_SubtractFlys() is used.
+/// Otherwise DrawFillAttributes() expands the clip path itself.
+static basegfx::B2DRange lcl_ShrinkFly(const SwRect& rRect)
+{
+ static MapMode aMapMode(MapUnit::MapTwip);
+ static const Size aSingleUnit = Application::GetDefaultDevice()->PixelToLogic(Size(1, 1), aMapMode);
+
+ double x1 = rRect.Left() + aSingleUnit.getWidth();
+ double y1 = rRect.Top() + aSingleUnit.getHeight();
+ double x2 = rRect.Right() - aSingleUnit.getWidth();
+ double y2 = rRect.Bottom() - aSingleUnit.getHeight();
+
+ return basegfx::B2DRange(x1, y1, x2, y2);
+}
+
static void lcl_SubtractFlys( const SwFrame *pFrame, const SwPageFrame *pPage,
const SwRect &rRect, SwRegionRects &rRegion, basegfx::tools::B2DClipState& rClipState, SwPaintProperties & rProperties)
{
@@ -1671,7 +1686,7 @@ static void lcl_SubtractFlys( const SwFrame *pFrame, const SwPageFrame *pPage,
const SwBorderAttrs &rAttrs = *aAccess.Get();
::lcl_CalcBorderRect( aRect, pFly, rAttrs, true, rProperties );
rRegion -= aRect;
- rClipState.subtractRange(basegfx::B2DRange(aRect.Left(), aRect.Top(), aRect.Right(), aRect.Bottom()));
+ rClipState.subtractRange(lcl_ShrinkFly(aRect));
continue;
}
else
@@ -1689,14 +1704,14 @@ static void lcl_SubtractFlys( const SwFrame *pFrame, const SwPageFrame *pPage,
const SwBorderAttrs &rAttrs = *aAccess.Get();
::lcl_CalcBorderRect( aRect, pFly, rAttrs, true, rProperties );
rRegion -= aRect;
- rClipState.subtractRange(basegfx::B2DRange(aRect.Left(), aRect.Top(), aRect.Right(), aRect.Bottom()));
+ rClipState.subtractRange(lcl_ShrinkFly(aRect));
}
else
{
SwRect aRect( pFly->Prt() );
aRect += pFly->Frame().Pos();
rRegion -= aRect;
- rClipState.subtractRange(basegfx::B2DRange(aRect.Left(), aRect.Top(), aRect.Right(), aRect.Bottom()));
+ rClipState.subtractRange(lcl_ShrinkFly(aRect));
}
}
if (gProp.pSRetoucheFly == gProp.pSRetoucheFly2)