diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-04-15 21:01:11 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-04-16 14:04:33 +0200 |
commit | 8072a926da2a02dfaf3fa848a2976634641a594f (patch) | |
tree | 611fab8ce92f4522dc9b3449b28e204652ddb694 /sw/qa/extras/layout/layout.cxx | |
parent | 8c75e66234b01b0a336f2eff107cc378286583e4 (diff) |
tdf#124521 sw btlr writing mode render: fix paint rectangle on scroll
By implementing btlr support in
SwTextFrame::SwitchVerticalToHorizontal(SwRect), so not only
invalidation but paint rectangle is also correct, which means actual
text painting happens.
Change-Id: I4215799ff63c93b300e4e8f97c6824f75d7c5401
Reviewed-on: https://gerrit.libreoffice.org/70797
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/qa/extras/layout/layout.cxx')
-rw-r--r-- | sw/qa/extras/layout/layout.cxx | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index ff06af442bff..e44acc8ba1c0 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -22,6 +22,7 @@ #include <wrtsh.hxx> #include <edtwin.hxx> #include <view.hxx> +#include <txtfrm.hxx> static char const DATA_DIRECTORY[] = "/sw/qa/extras/layout/data/"; @@ -2839,6 +2840,36 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testBtlrCell) ss << "selection rectangle " << rRect << " is not inside cell rectangle " << aCellRect; CPPUNIT_ASSERT_MESSAGE(ss.str(), aCellRect.IsInside(rRect)); } + + // Make sure that the correct rectangle gets repainted on scroll. + SwFrame* pPageFrame = pLayout->GetLower(); + CPPUNIT_ASSERT(pPageFrame->IsPageFrame()); + + SwFrame* pBodyFrame = pPageFrame->GetLower(); + CPPUNIT_ASSERT(pBodyFrame->IsBodyFrame()); + + SwFrame* pTabFrame = pBodyFrame->GetLower(); + CPPUNIT_ASSERT(pTabFrame->IsTabFrame()); + + SwFrame* pRowFrame = pTabFrame->GetLower(); + CPPUNIT_ASSERT(pRowFrame->IsRowFrame()); + + SwFrame* pCellFrame = pRowFrame->GetLower(); + CPPUNIT_ASSERT(pCellFrame->IsCellFrame()); + + SwFrame* pFrame = pCellFrame->GetLower(); + CPPUNIT_ASSERT(pFrame->IsTextFrame()); + + SwTextFrame* pTextFrame = static_cast<SwTextFrame*>(pFrame); + pTextFrame->SwapWidthAndHeight(); + // Mimic what normally SwTextFrame::PaintSwFrame() does: + SwRect aRect(4207, 2273, 269, 572); + pTextFrame->SwitchVerticalToHorizontal(aRect); + // Without the accompanying fix in place, this test would have failed with: + // Expected: 572x269@(1691,4217) + // Actual : 572x269@(2263,4217) + // i.e. the paint rectangle position was incorrect, text was not painted on scrolling up. + CPPUNIT_ASSERT_EQUAL(SwRect(1691, 4217, 572, 269), aRect); #endif } |