Blame SOURCES/0001-Related-tdf-93676-msword-wraps-slightly-differently-.patch

f325b2
From 1ff5ecda9ccfcf3e65e90c404db93fcbbefb889e Mon Sep 17 00:00:00 2001
f325b2
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
f325b2
Date: Mon, 7 Sep 2015 16:37:22 +0100
f325b2
Subject: [PATCH] Related: tdf#93676 msword wraps slightly differently than us
f325b2
f325b2
Change-Id: I91ba41cb052c38aa3b047cf079090b01bbe93b39
f325b2
---
f325b2
 sw/source/filter/ww8/wrtw8esh.cxx | 17 +++++++++++++++--
f325b2
 1 file changed, 15 insertions(+), 2 deletions(-)
f325b2
f325b2
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
f325b2
index 763fb44..fd6dfbc 100644
f325b2
--- a/sw/source/filter/ww8/wrtw8esh.cxx
f325b2
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
f325b2
@@ -803,6 +803,19 @@ void PlcDrawObj::WritePlc( WW8Export& rWrt ) const
f325b2
 
f325b2
             SwTwips nLeft = aRect.Left() + nThick;
f325b2
             SwTwips nRight = aRect.Right() - nThick;
f325b2
+            SwTwips nTop = aRect.Top() + nThick;
f325b2
+            SwTwips nBottom = aRect.Bottom() - nThick;
f325b2
+
f325b2
+            // tdf#93675, 0 below line/paragraph and/or top line/paragraph with
f325b2
+            // wrap top+bottom or other wraps is affecting the line directly
f325b2
+            // above the anchor line, which seems odd, but a tiny adjustment
f325b2
+            // here to bring the top down convinces msoffice to wrap like us
f325b2
+            if (nTop < 8 && !rFrameFormat.IsInline() &&
f325b2
+                rVOr.GetVertOrient() == text::VertOrientation::NONE &&
f325b2
+                rVOr.GetRelationOrient() == text::RelOrientation::FRAME)
f325b2
+            {
f325b2
+                nTop = 8;
f325b2
+            }
f325b2
 
f325b2
             //Nasty swap for bidi if necessary
f325b2
             rWrt.MiserableRTLFrameFormatHack(nLeft, nRight, rFrameFormat);
f325b2
@@ -811,9 +824,9 @@ void PlcDrawObj::WritePlc( WW8Export& rWrt ) const
f325b2
             //(most of) the border is outside the graphic is word, so
f325b2
             //change dimensions to fit
f325b2
             SwWW8Writer::WriteLong(*rWrt.pTableStrm, nLeft);
f325b2
-            SwWW8Writer::WriteLong(*rWrt.pTableStrm,aRect.Top() + nThick);
f325b2
+            SwWW8Writer::WriteLong(*rWrt.pTableStrm, nTop);
f325b2
             SwWW8Writer::WriteLong(*rWrt.pTableStrm, nRight);
f325b2
-            SwWW8Writer::WriteLong(*rWrt.pTableStrm,aRect.Bottom() - nThick);
f325b2
+            SwWW8Writer::WriteLong(*rWrt.pTableStrm, nBottom);
f325b2
 
f325b2
             //fHdr/bx/by/wr/wrk/fRcaSimple/fBelowText/fAnchorLock
f325b2
             sal_uInt16 nFlags=0;
f325b2
-- 
f325b2
2.1.0
f325b2