diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-09-08 09:45:12 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-09-08 11:17:54 +0100 |
commit | d9aed0bc2e741fa02a6ffdf90193aae7ce471e52 (patch) | |
tree | a3872a4fc074796587badda325fc60719aa03d1a /sw | |
parent | 81ced97e322be1316e4709ce2dadff50a01b8973 (diff) |
Related: tdf#93676 msword wraps slightly differently than us
Change-Id: I688d4d193709d9c9829065c87f0d656a94fd9f16
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ww8/docxsdrexport.cxx | 16 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8esh.cxx | 2 |
2 files changed, 16 insertions, 2 deletions
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx index 02b134a8247f..71a357e6dabb 100644 --- a/sw/source/filter/ww8/docxsdrexport.cxx +++ b/sw/source/filter/ww8/docxsdrexport.cxx @@ -516,6 +516,21 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons } m_pImpl->m_pSerializer->endElementNS(XML_wp, XML_positionH); m_pImpl->m_pSerializer->startElementNS(XML_wp, XML_positionV, XML_relativeFrom, relativeFromV, FSEND); + + sal_Int64 nTwipstoEMU = TwipsToEMU(aPos.Y); + + // 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 (nTwipstoEMU == 0 && + (strcmp(relativeFromV, "line") == 0 || strcmp(relativeFromV, "paragraph") == 0) && + (!alignV || strcmp(alignV, "top") == 0)) + { + alignV = NULL; + nTwipstoEMU = 635; + } + if (alignV != NULL) { m_pImpl->m_pSerializer->startElementNS(XML_wp, XML_align, FSEND); @@ -525,7 +540,6 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons else { m_pImpl->m_pSerializer->startElementNS(XML_wp, XML_posOffset, FSEND); - sal_Int64 nTwipstoEMU = TwipsToEMU(aPos.Y); if (nTwipstoEMU > MAX_INTEGER_VALUE) { nTwipstoEMU = MAX_INTEGER_VALUE; diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index fd6dfbc1f1be..2b7cebe8ffae 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -810,7 +810,7 @@ void PlcDrawObj::WritePlc( WW8Export& rWrt ) const // 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() && + if (nTop == 0 && !rFrameFormat.IsInline() && rVOr.GetVertOrient() == text::VertOrientation::NONE && rVOr.GetRelationOrient() == text::RelOrientation::FRAME) { |