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

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