Kaydet (Commit) 948283ca authored tarafından Mark Hung's avatar Mark Hung Kaydeden (comit) Miklos Vajna

tdf#106390 Intersect the table borders with upper frames.

Also removes dead code because SwTabFramePainter::Insert()
is always called with a cell frame and IsTabFrame() always
returns false.

Reviewed-on: https://gerrit.libreoffice.org/54684Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
(cherry picked from commit e87cc12e)

Conflicts:
	sw/qa/extras/layout/layout.cxx
	sw/source/core/layout/paintfrm.cxx

Change-Id: I2505d876d20e44ded1faf760bc3b7b1d34b0fd8d
üst 5109f63c
......@@ -19,9 +19,11 @@ class SwLayoutWriter : public SwModelTestBase
{
public:
void testUserFieldTypeLanguage();
void testTdf106390();
CPPUNIT_TEST_SUITE(SwLayoutWriter);
CPPUNIT_TEST(testUserFieldTypeLanguage);
CPPUNIT_TEST(testTdf106390);
CPPUNIT_TEST_SUITE_END();
private:
......@@ -57,6 +59,24 @@ void SwLayoutWriter::testUserFieldTypeLanguage()
assertXPath(pXmlDoc, "/root/page/body/txt/Special[@nType='POR_FLD']", "rText", "1,234.56");
}
void SwLayoutWriter::testTdf106390()
{
SwDoc* pDoc = createDoc("tdf106390.odt");
SwDocShell* pShell = pDoc->GetDocShell();
// Dump the rendering of the first page as an XML file.
std::shared_ptr<GDIMetaFile> xMetaFile = pShell->GetPreviewMetaFile();
MetafileXmlDump dumper;
xmlDocPtr pXmlDoc = dumper.dumpAndParse(*xMetaFile);
CPPUNIT_ASSERT(pXmlDoc);
sal_Int32 nBottom = getXPath(pXmlDoc, "//sectrectclipregion", "bottom").toInt32();
// No end point of line segments shall go below the bottom of the clipping area.
const OString sXPath = "//polyline/point[@y>" + OString::number(nBottom) + "]";
assertXPath(pXmlDoc, sXPath, 0);
}
CPPUNIT_TEST_SUITE_REGISTRATION(SwLayoutWriter);
CPPUNIT_PLUGIN_IMPLEMENT();
......
......@@ -2960,10 +2960,16 @@ void SwTabFramePainter::Insert( const SwFrame& rFrame, const SvxBoxItem& rBoxIte
{
// build 4 line entries for the 4 borders:
SwRect aBorderRect = rFrame.Frame();
if ( rFrame.IsTabFrame() )
{
aBorderRect = rFrame.Prt();
aBorderRect.Pos() += rFrame.Frame().Pos();
// Frame area of a table might be larger than the containing frame
// so we have to intersect the border rect with upper frames til
// the first frame that is not part of a table.
const SwLayoutFrame *pUpper = rFrame.GetUpper();
while(pUpper)
{
aBorderRect.Intersection(pUpper->Frame());
if (!pUpper->IsInTab())
break;
pUpper = pUpper->GetUpper();
}
bool const bBottomAsTop(lcl_IsFirstRowInFollowTableWithoutRepeatedHeadlines(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment