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

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