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>
diff --git a/sw/qa/extras/layout/data/btlr-cell.odt b/sw/qa/extras/layout/data/btlr-cell.odt
index 17a9c19..a443921 100644
--- a/sw/qa/extras/layout/data/btlr-cell.odt
+++ b/sw/qa/extras/layout/data/btlr-cell.odt
Binary files differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index daca397..ea0eaac 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 b18e727..4fe1bf9 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() );