Kaydet (Commit) 8e3afdb5 authored tarafından Patrick Jaap's avatar Patrick Jaap Kaydeden (comit) Miklos Vajna

tdf#122878: enable wrap for flys in footer

This patch removes the check for a footer node,
intoduced by
23f698ec
preserving the behaviour for the connected bug reports
i13832 and i24135.

Without this check, the wraping becomes enabled for footer
objects, too.

With this enhencement, the commits
7df33caa
d3db6ff4
are directly affected and therefore the unit test is edited.

Change-Id: I093add9e251ac97859a66cb8b8563010ef734c2d
Reviewed-on: https://gerrit.libreoffice.org/67069
Tested-by: Jenkins
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.com>
üst 8a7a93b3
...@@ -64,7 +64,7 @@ public: ...@@ -64,7 +64,7 @@ public:
void testTdf120287(); void testTdf120287();
void testTdf120287b(); void testTdf120287b();
void testTdf120287c(); void testTdf120287c();
void testTdf116989(); void testTdf122878();
void testTdf115094(); void testTdf115094();
CPPUNIT_TEST_SUITE(SwLayoutWriter); CPPUNIT_TEST_SUITE(SwLayoutWriter);
...@@ -103,7 +103,7 @@ public: ...@@ -103,7 +103,7 @@ public:
CPPUNIT_TEST(testTdf120287); CPPUNIT_TEST(testTdf120287);
CPPUNIT_TEST(testTdf120287b); CPPUNIT_TEST(testTdf120287b);
CPPUNIT_TEST(testTdf120287c); CPPUNIT_TEST(testTdf120287c);
CPPUNIT_TEST(testTdf116989); CPPUNIT_TEST(testTdf122878);
CPPUNIT_TEST(testTdf115094); CPPUNIT_TEST(testTdf115094);
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
...@@ -2718,17 +2718,17 @@ void SwLayoutWriter::testTdf120287c() ...@@ -2718,17 +2718,17 @@ void SwLayoutWriter::testTdf120287c()
assertXPath(pXmlDoc, "/root/page/body/txt[1]/LineBreak", 3); assertXPath(pXmlDoc, "/root/page/body/txt[1]/LineBreak", 3);
} }
void SwLayoutWriter::testTdf116989() void SwLayoutWriter::testTdf122878()
{ {
createDoc("tdf116989.docx"); createDoc("tdf122878.docx");
xmlDocPtr pXmlDoc = parseLayoutDump(); xmlDocPtr pXmlDoc = parseLayoutDump();
// FIXME: the XPath should be adjusted when the proper floating table would be imported // FIXME: the XPath should be adjusted when the proper floating table would be imported
const sal_Int32 nTblTop const sal_Int32 nTblTop
= getXPath(pXmlDoc, "/root/page[1]/footer/tab/infos/bounds", "top").toInt32(); = getXPath(pXmlDoc, "/root/page[1]/footer/txt/anchored/fly/tab/infos/bounds", "top")
.toInt32();
const sal_Int32 nFirstPageParaCount const sal_Int32 nFirstPageParaCount
= getXPathContent(pXmlDoc, "count(/root/page[1]/body/txt)").toInt32(); = getXPathContent(pXmlDoc, "count(/root/page[1]/body/txt)").toInt32();
// FIXME: should be exactly 30, when proper floating tables in footers are supported CPPUNIT_ASSERT_EQUAL(sal_Int32(30), nFirstPageParaCount);
CPPUNIT_ASSERT_GREATEREQUAL(sal_Int32(30), nFirstPageParaCount);
for (sal_Int32 i = 1; i <= nFirstPageParaCount; ++i) for (sal_Int32 i = 1; i <= nFirstPageParaCount; ++i)
{ {
const OString xPath = "/root/page[1]/body/txt[" + OString::number(i) + "]/infos/bounds"; const OString xPath = "/root/page[1]/body/txt[" + OString::number(i) + "]/infos/bounds";
......
...@@ -803,7 +803,6 @@ bool SwTextFly::GetTop( const SwAnchoredObject* _pAnchoredObj, ...@@ -803,7 +803,6 @@ bool SwTextFly::GetTop( const SwAnchoredObject* _pAnchoredObj,
// #i13832#, #i24135# wrap around objects in page header // #i13832#, #i24135# wrap around objects in page header
( !pIDSA->get(DocumentSettingId::USE_FORMER_TEXT_WRAPPING) && ( !pIDSA->get(DocumentSettingId::USE_FORMER_TEXT_WRAPPING) &&
nullptr != ( pHeader = pTmp->FindFooterOrHeader() ) && nullptr != ( pHeader = pTmp->FindFooterOrHeader() ) &&
!pHeader->IsFooterFrame() &&
m_pCurrFrame->IsInDocBody()))) m_pCurrFrame->IsInDocBody())))
{ {
if( pHeader || RndStdIds::FLY_AT_FLY == rNewA.GetAnchorId() ) if( pHeader || RndStdIds::FLY_AT_FLY == rNewA.GetAnchorId() )
......
...@@ -1176,8 +1176,7 @@ void DomainMapperTableHandler::endTable(unsigned int nestedTableLevel, bool bTab ...@@ -1176,8 +1176,7 @@ void DomainMapperTableHandler::endTable(unsigned int nestedTableLevel, bool bTab
m_aTableProperties->getValue(TablePropertyMap::TABLE_WIDTH_TYPE, nTableWidthType); m_aTableProperties->getValue(TablePropertyMap::TABLE_WIDTH_TYPE, nTableWidthType);
if (m_rDMapper_Impl.GetSectionContext() && nestedTableLevel <= 1 && !m_rDMapper_Impl.IsInHeaderFooter()) if (m_rDMapper_Impl.GetSectionContext() && nestedTableLevel <= 1 && !m_rDMapper_Impl.IsInHeaderFooter())
m_rDMapper_Impl.m_aPendingFloatingTables.emplace_back(xStart, xEnd, comphelper::containerToSequence(aFrameProperties), nTableWidth, nTableWidthType); m_rDMapper_Impl.m_aPendingFloatingTables.emplace_back(xStart, xEnd, comphelper::containerToSequence(aFrameProperties), nTableWidth, nTableWidthType);
else if (!m_rDMapper_Impl.IsInFooter()) // FIXME: tdf#116989 floating objects anchored else
//to footer cannot have proper wrapping
{ {
// m_xText points to the body text, get the current xText from m_rDMapper_Impl, in case e.g. we would be in a header. // m_xText points to the body text, get the current xText from m_rDMapper_Impl, in case e.g. we would be in a header.
uno::Reference<text::XTextAppendAndConvert> xTextAppendAndConvert(m_rDMapper_Impl.GetTopTextAppend(), uno::UNO_QUERY); uno::Reference<text::XTextAppendAndConvert> xTextAppendAndConvert(m_rDMapper_Impl.GetTopTextAppend(), uno::UNO_QUERY);
......
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