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

RTF import: add unit test for page break in continuous section

Change-Id: I8b766aa61b1121f9b7068f5ccbdc24ef97253432
üst e3f254ab
{\rtf1 \ansi
\fet0 \ftnbj \paperw11905 \paperh16837 \margt2267 \margb1133 \margl1417 \margr1417
\sectd
\sbknone
FIRST
\par
\sect
SECOND
\par
\page
\sect
THIRD
\par
\sect
}
......@@ -17,6 +17,7 @@
#include <com/sun/star/drawing/LineStyle.hpp>
#include <com/sun/star/graphic/GraphicType.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/style/BreakType.hpp>
#include <com/sun/star/style/CaseMap.hpp>
#include <com/sun/star/style/LineSpacing.hpp>
#include <com/sun/star/style/LineSpacingMode.hpp>
......@@ -1420,6 +1421,30 @@ DECLARE_RTFIMPORT_TEST(testNestedTable, "rhbz1065629.rtf")
CPPUNIT_ASSERT_EQUAL(1, getPages());
}
DECLARE_RTFIMPORT_TEST(testContSectionPageBreak, "cont-section-pagebreak.rtf")
{
uno::Reference<text::XTextRange> xParaSecond = getParagraph(2);
CPPUNIT_ASSERT_EQUAL(OUString("SECOND"), xParaSecond->getString());
CPPUNIT_ASSERT_EQUAL(style::BreakType_NONE,
getProperty<style::BreakType>(xParaSecond, "BreakType"));
CPPUNIT_ASSERT_EQUAL(OUString(""),
getProperty<OUString>(xParaSecond, "PageDescName"));
// actually not sure how many paragraph there should be between
// SECOND and THIRD - important is that the page break is on there
uno::Reference<text::XTextRange> xParaNext = getParagraph(3);
CPPUNIT_ASSERT_EQUAL(OUString(""), xParaNext->getString());
CPPUNIT_ASSERT_EQUAL(OUString("Converted1"),
getProperty<OUString>(xParaNext, "PageDescName"));
uno::Reference<text::XTextRange> xParaThird = getParagraph(4);
CPPUNIT_ASSERT_EQUAL(OUString("THIRD"), xParaThird->getString());
CPPUNIT_ASSERT_EQUAL(style::BreakType_NONE,
getProperty<style::BreakType>(xParaThird, "BreakType"));
CPPUNIT_ASSERT_EQUAL(OUString(""),
getProperty<OUString>(xParaThird, "PageDescName"));
CPPUNIT_ASSERT_EQUAL(2, getPages());
}
DECLARE_RTFIMPORT_TEST(testCp1000016, "hello.rtf")
{
// The single-line document had a second fake empty para on Windows.
......
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