summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-09-07 16:37:22 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-09-07 16:57:24 +0100
commit1ff5ecda9ccfcf3e65e90c404db93fcbbefb889e (patch)
tree2ec39c08d5fbe028616406b901cae464b87f786e /sw
parent302963374d7d8597b6e11c3a6a537ae766656298 (diff)
Related: tdf#93676 msword wraps slightly differently than us
Change-Id: I91ba41cb052c38aa3b047cf079090b01bbe93b39
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx17
1 files changed, 15 insertions, 2 deletions
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index 763fb44b9287..fd6dfbc1f1be 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -803,6 +803,19 @@ void PlcDrawObj::WritePlc( WW8Export& rWrt ) const
SwTwips nLeft = aRect.Left() + nThick;
SwTwips nRight = aRect.Right() - nThick;
+ SwTwips nTop = aRect.Top() + nThick;
+ SwTwips nBottom = aRect.Bottom() - nThick;
+
+ // tdf#93675, 0 below line/paragraph and/or top line/paragraph with
+ // wrap top+bottom or other wraps is affecting the line directly
+ // above the anchor line, which seems odd, but a tiny adjustment
+ // here to bring the top down convinces msoffice to wrap like us
+ if (nTop < 8 && !rFrameFormat.IsInline() &&
+ rVOr.GetVertOrient() == text::VertOrientation::NONE &&
+ rVOr.GetRelationOrient() == text::RelOrientation::FRAME)
+ {
+ nTop = 8;
+ }
//Nasty swap for bidi if necessary
rWrt.MiserableRTLFrameFormatHack(nLeft, nRight, rFrameFormat);
@@ -811,9 +824,9 @@ void PlcDrawObj::WritePlc( WW8Export& rWrt ) const
//(most of) the border is outside the graphic is word, so
//change dimensions to fit
SwWW8Writer::WriteLong(*rWrt.pTableStrm, nLeft);
- SwWW8Writer::WriteLong(*rWrt.pTableStrm,aRect.Top() + nThick);
+ SwWW8Writer::WriteLong(*rWrt.pTableStrm, nTop);
SwWW8Writer::WriteLong(*rWrt.pTableStrm, nRight);
- SwWW8Writer::WriteLong(*rWrt.pTableStrm,aRect.Bottom() - nThick);
+ SwWW8Writer::WriteLong(*rWrt.pTableStrm, nBottom);
//fHdr/bx/by/wr/wrk/fRcaSimple/fBelowText/fAnchorLock
sal_uInt16 nFlags=0;