Kaydet (Commit) 74b3f4f0 authored tarafından Michael Stahl's avatar Michael Stahl

RTF import: fix paragraphs in header/footer

Change-Id: I91f04cad7a39428ce6f9555d18b974f0d45181f7
üst f03218f4
{\rtf1\fbidis\ansi\ansicpg0\uc0\deff0\deflang0\deflangfe0\paperw11905\paperh16838\margl1200\margr1200\margt1200\margb1200\headery600\footery600\viewscale100\viewzk0\titlepg
{\fonttbl{\f0\fnil Arial;}}
{\footerf
\pard\s0\fi0\li0\qc\ri0\sb0\sa0\itap0 \plain \f0\fs18 All Rights Reserved.\par}
\pard\par}
......@@ -1445,6 +1445,20 @@ DECLARE_RTFIMPORT_TEST(testContSectionPageBreak, "cont-section-pagebreak.rtf")
CPPUNIT_ASSERT_EQUAL(2, getPages());
}
DECLARE_RTFIMPORT_TEST(testFooterPara, "footer-para.rtf")
{
// check that paragraph properties in footer are imported
uno::Reference<text::XText> xFooterText =
getProperty< uno::Reference<text::XText> >(
getStyles("PageStyles")->getByName("First Page"), "FooterText");
uno::Reference<text::XTextContent> xParagraph =
getParagraphOrTable(1, xFooterText);
CPPUNIT_ASSERT_EQUAL(OUString("All Rights Reserved."),
uno::Reference<text::XTextRange>(xParagraph, uno::UNO_QUERY)->getString());
CPPUNIT_ASSERT_EQUAL((sal_Int16)style::ParagraphAdjust_CENTER,
getProperty</*style::ParagraphAdjust*/sal_Int16>(xParagraph, "ParaAdjust"));
}
DECLARE_RTFIMPORT_TEST(testCp1000016, "hello.rtf")
{
// The single-line document had a second fake empty para on Windows.
......
......@@ -424,8 +424,9 @@ void RTFDocumentImpl::setNeedSect(bool bNeedSect)
if (!m_pSuperstream) // no sections in header/footer!
{
Mapper().startSectionGroup();
m_bNeedSect = bNeedSect;
}
// set flag in substream too - otherwise multiple startParagraphGroup
m_bNeedSect = bNeedSect;
Mapper().startParagraphGroup();
setNeedPar(true);
}
......
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