Kaydet (Commit) 44a3eb37 authored tarafından Miklos Vajna's avatar Miklos Vajna

tdf#99120 DOC import: fix lack of first share after odd section break

Commit 848b1a05 (fix for bnc#659631,
2011-02-04) made wwSectionManager::InsertSegments() use
SwPageDesc::WriteUseOn() directly, instead of going via
SwPageDesc::SetUseOn() that takes care of not throwing away the higher
share bits of the bitfield. This way the "is first shared" flag of the
bitfield got cleared, even when the input document had no title page
declared, so first header/footer must be shared.

Fix the problem by using SetUseOn() in the DOC import as well when it
comes to handling odd/even page section breaks.

Change-Id: If167f4582919fa177840ed81e0a53aa379485598
Reviewed-on: https://gerrit.libreoffice.org/23885Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
üst a3eadcd4
......@@ -189,6 +189,7 @@ public:
bool IsHidden() const { return m_IsHidden; }
void SetHidden(bool const bValue) { m_IsHidden = bValue; }
/// Same as WriteUseOn(), but the >= PD_HEADERSHARE part of the bitfield is not modified.
inline void SetUseOn( UseOnPage eNew );
inline UseOnPage GetUseOn() const;
......
This diff was suppressed by a .gitattributes entry.
......@@ -544,6 +544,15 @@ DECLARE_WW8IMPORT_TEST(testTdf99100, "tdf99100.doc")
CPPUNIT_ASSERT(xField->supportsService("com.sun.star.text.textfield.Chapter"));
}
DECLARE_WW8IMPORT_TEST(testTdf99120, "tdf99120.doc")
{
CPPUNIT_ASSERT_EQUAL(OUString("Section 1, odd."), parseDump("/root/page[1]/header/txt/text()"));
CPPUNIT_ASSERT_EQUAL(OUString("Section 1, even."), parseDump("/root/page[2]/header/txt/text()"));
// This failed: the header was empty on the 3rd page, as the first page header was shown.
CPPUNIT_ASSERT_EQUAL(OUString("Section 2, odd."), parseDump("/root/page[3]/header/txt/text()"));
CPPUNIT_ASSERT_EQUAL(OUString("Section 2, even."), parseDump("/root/page[4]/header/txt/text()"));
}
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -4536,7 +4536,8 @@ void wwSectionManager::InsertSegments()
if ( aIter->maSep.bkc == 4 ) // Odd ( right ) Section break
eUseOnPage = nsUseOnPage::PD_RIGHT;
aDesc.GetPageDesc()->WriteUseOn( eUseOnPage );
// Keep the share flags.
aDesc.GetPageDesc()->SetUseOn( eUseOnPage );
aDesc.GetPageDesc()->SetFollow( aFollow.GetPageDesc() );
}
......
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