Kaydet (Commit) 6aeba04b authored tarafından Justin Luth's avatar Justin Luth

tdf#120511 writerfilter: track inserted frame per section

The logic using IsTextFrameInserted is worried about whether
a frame has been inserted before a table *in this section*,
so track frame's existence per section, not per document.

Change-Id: I8aa8a695b89727832e65535adae3fc3c94f95be5
Reviewed-on: https://gerrit.libreoffice.org/65720
Tested-by: Jenkins
Reviewed-by: 's avatarJustin Luth <justin_luth@sil.org>
üst c5ab6819
......@@ -462,6 +462,17 @@ DECLARE_OOXMLEXPORT_TEST(testTdf113258_noBeforeAutospacing, "tdf113258_noBeforeA
getProperty<sal_Int32>(xShape->getStart(), "ParaTopMargin"));
}
DECLARE_OOXMLEXPORT_TEST(testTdf120511_eatenSection, "tdf120511_eatenSection.docx")
{
xmlDocPtr pXmlDoc = parseLayoutDump();
sal_Int32 nHeight = getXPath(pXmlDoc, "/root/page[1]/infos/prtBounds", "height").toInt32();
sal_Int32 nWidth = getXPath(pXmlDoc, "/root/page[1]/infos/prtBounds", "width").toInt32();
CPPUNIT_ASSERT_MESSAGE( "Page1 is portrait", nWidth < nHeight );
nHeight = getXPath(pXmlDoc, "/root/page[2]/infos/prtBounds", "height").toInt32();
nWidth = getXPath(pXmlDoc, "/root/page[2]/infos/prtBounds", "width").toInt32();
CPPUNIT_ASSERT_MESSAGE( "Page2 is landscape", nWidth > nHeight );
}
DECLARE_OOXMLEXPORT_TEST(testTdf104354, "tdf104354.docx")
{
uno::Reference<text::XTextRange> xShape(getShape(1), uno::UNO_QUERY);
......
......@@ -2882,6 +2882,7 @@ void DomainMapper::lcl_endSectionGroup()
if (m_pImpl->GetIsDummyParaAddedForTableInSection())
m_pImpl->RemoveDummyParaForTableInSection();
}
m_pImpl->SetIsTextFrameInserted( false );
m_pImpl->PopProperties(CONTEXT_SECTION);
}
}
......
......@@ -604,8 +604,11 @@ public:
bool GetIsFirstParagraphInShape() { return m_bIsFirstParaInShape; }
void SetIsDummyParaAddedForTableInSection( bool bIsAdded );
bool GetIsDummyParaAddedForTableInSection() { return m_bDummyParaAddedForTableInSection;}
/// Track if a textframe has been inserted into this section
void SetIsTextFrameInserted( bool bIsInserted );
bool GetIsTextFrameInserted() { return m_bTextFrameInserted;}
void SetIsPreviousParagraphFramed( bool bIsFramed ) { m_bIsPreviousParagraphFramed = bIsFramed; }
bool GetIsPreviousParagraphFramed() { return m_bIsPreviousParagraphFramed; }
void SetParaSectpr(bool bParaSectpr);
......
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