diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-03-21 21:05:44 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-03-22 09:02:20 +0100 |
commit | 4c5d0e4822dcd0c6c9397a45e3afb66d53ebaafc (patch) | |
tree | c60cda5e6d8b147a4dc53a26e64595f4ac582b2f /sw | |
parent | 9b1ae71ee1ff4ba159a9265900ef019604b9b64e (diff) |
tdf#123943 sw btlr writing mode render: fix text portion background
The text frame is swapped in this case, so handle BTLR similar to the
normal vert (TBRL) case and the background will be positioned correctly
behind the text portion.
Change-Id: I2399131ef74ea8849577a467ad9bb02d980d8609
Reviewed-on: https://gerrit.libreoffice.org/69539
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/layout/data/btlr-cell.odt | bin | 9179 -> 9223 bytes | |||
-rw-r--r-- | sw/qa/extras/layout/layout.cxx | 5 | ||||
-rw-r--r-- | sw/source/core/text/inftxt.cxx | 2 |
3 files changed, 6 insertions, 1 deletions
diff --git a/sw/qa/extras/layout/data/btlr-cell.odt b/sw/qa/extras/layout/data/btlr-cell.odt Binary files differindex 17a9c19eef25..a4439218b057 100644 --- a/sw/qa/extras/layout/data/btlr-cell.odt +++ b/sw/qa/extras/layout/data/btlr-cell.odt diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index daca397a4d05..ea0eaac86c61 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -2817,6 +2817,11 @@ void SwLayoutWriter::testBtlrCell() assertXPath(pXmlDoc, "//textarray[1]", "x", "1915"); assertXPath(pXmlDoc, "//textarray[1]", "y", "2707"); + // Without the accompanying fix in place, this test would have failed with 'Expected: 1979; + // Actual : 2129', i.e. the gray background of the "AAA2." text was too close to the right edge + // of the text portion. Now it's exactly behind the text portion. + assertXPath(pXmlDoc, "//rect[@top='2159']", "left", "1979"); + // Without the accompanying fix in place, this test would have failed with 'Expected: 269; // Actual : 0', i.e. the AAA2 frame was not visible due to 0 width. pXmlDoc = parseLayoutDump(); diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index b18e7273672c..4fe1bf96e9bb 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -749,7 +749,7 @@ void SwTextPaintInfo::CalcRect( const SwLinePortion& rPor, else { aPoint.setX( X() ); - if ( GetTextFrame()->IsVertLR() ) + if (GetTextFrame()->IsVertLR() && !GetTextFrame()->IsVertLRBT()) aPoint.setY( Y() - rPor.Height() + rPor.GetAscent() ); else aPoint.setY( Y() - rPor.GetAscent() ); |