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

f325b2
From d9aed0bc2e741fa02a6ffdf90193aae7ce471e52 Mon Sep 17 00:00:00 2001
f325b2
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
f325b2
Date: Tue, 8 Sep 2015 09:45:12 +0100
f325b2
Subject: [PATCH] Related: tdf#93676 msword wraps slightly differently than us
f325b2
f325b2
Change-Id: I688d4d193709d9c9829065c87f0d656a94fd9f16
f325b2
---
f325b2
 sw/source/filter/ww8/docxsdrexport.cxx | 16 +++++++++++++++-
f325b2
 sw/source/filter/ww8/wrtw8esh.cxx      |  2 +-
f325b2
 2 files changed, 16 insertions(+), 2 deletions(-)
f325b2
f325b2
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx
f325b2
index 02b134a..71a357e 100644
f325b2
--- a/sw/source/filter/ww8/docxsdrexport.cxx
f325b2
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
f325b2
@@ -516,6 +516,21 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons
f325b2
         }
f325b2
         m_pImpl->m_pSerializer->endElementNS(XML_wp, XML_positionH);
f325b2
         m_pImpl->m_pSerializer->startElementNS(XML_wp, XML_positionV, XML_relativeFrom, relativeFromV, FSEND);
f325b2
+
f325b2
+        sal_Int64 nTwipstoEMU = TwipsToEMU(aPos.Y);
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 (nTwipstoEMU == 0 &&
f325b2
+            (strcmp(relativeFromV, "line") == 0 || strcmp(relativeFromV, "paragraph") == 0) &&
f325b2
+            (!alignV || strcmp(alignV, "top") == 0))
f325b2
+        {
f325b2
+            alignV = NULL;
f325b2
+            nTwipstoEMU = 635;
f325b2
+        }
f325b2
+
f325b2
         if (alignV != NULL)
f325b2
         {
f325b2
             m_pImpl->m_pSerializer->startElementNS(XML_wp, XML_align, FSEND);
f325b2
@@ -525,7 +540,6 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons
f325b2
         else
f325b2
         {
f325b2
             m_pImpl->m_pSerializer->startElementNS(XML_wp, XML_posOffset, FSEND);
f325b2
-            sal_Int64 nTwipstoEMU = TwipsToEMU(aPos.Y);
f325b2
             if (nTwipstoEMU > MAX_INTEGER_VALUE)
f325b2
             {
f325b2
                 nTwipstoEMU = MAX_INTEGER_VALUE;
f325b2
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
f325b2
index fd6dfbc..2b7cebe 100644
f325b2
--- a/sw/source/filter/ww8/wrtw8esh.cxx
f325b2
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
f325b2
@@ -810,7 +810,7 @@ void PlcDrawObj::WritePlc( WW8Export& rWrt ) const
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
+            if (nTop == 0 && !rFrameFormat.IsInline() &&
f325b2
                 rVOr.GetVertOrient() == text::VertOrientation::NONE &&
f325b2
                 rVOr.GetRelationOrient() == text::RelOrientation::FRAME)
f325b2
             {
f325b2
-- 
f325b2
2.1.0
f325b2