namespace
{ /// Covers sw/source/core/layout/anchoredobject.cxx fixes. class Test : public SwModelTestBase
{ public:
Test()
: SwModelTestBase(u"/sw/qa/core/layout/data/"_ustr)
{
}
};
CPPUNIT_TEST_FIXTURE(Test, testTextBoxFlyPageCapture)
{ // Given a document with a draw shape with complex content, positioned to be outside the page // frame, but capture to page frame is enabled: // When loading that document:
createSwDoc("textbox-fly-page-capture.odt");
// Then make sure the right edge of the inner fly frame is the same as the right edge of the // draw frame:
SwDoc* pDoc = getSwDocShell()->GetDoc();
SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout(); auto pPage = pLayout->GetLower()->DynCastPageFrame();
CPPUNIT_ASSERT(pPage->GetSortedObjs()); const SwSortedObjs& rPageObjs = *pPage->GetSortedObjs();
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), rPageObjs.size());
SwAnchoredObject* pDraw = rPageObjs[0];
SwTwips nDrawRight = pDraw->GetObjRect().Right();
SwAnchoredObject* pFly = rPageObjs[1];
SwTwips nFlyRight = pFly->GetObjRect().Right(); // Without the accompanying fix in place, this test would have failed with: // - Expected: 5081 // - Actual : 4798 // i.e. the position of the draw shape was corrected to be inside the page frame, but this // didn't happen for the inner fly frame.
CPPUNIT_ASSERT_EQUAL(nDrawRight, nFlyRight);
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.