[Libreoffice-commits] .: sw/qa writerfilter/source
Miklos Vajna
vmiklos at suse.cz
Fri Feb 1 02:31:51 PST 2013
sw/qa/extras/rtfimport/data/fdo48440.rtf | 5 +++++
sw/qa/extras/rtfimport/rtfimport.cxx | 8 ++++++++
writerfilter/source/rtftok/rtfdocumentimpl.cxx | 1 +
3 files changed, 14 insertions(+)
New commits:
commit b70f74cb5f4b499f14831fd6ad49d9238735e6ef
Author: Miklos Vajna <vmiklos at suse.cz>
Date: Fri Feb 1 11:20:52 2013 +0100
fdo#48440 fix import of RTF_PAGE between text frames
Normally such a page break is surrounded by text, and text() already
calls checkNeedPap(), but in case the whole paragraph contains a page
break only, we need it here as well.
Change-Id: I3961272d77c743e0e6da2d5052e57cec5f5937e7
diff --git a/sw/qa/extras/rtfimport/data/fdo48440.rtf b/sw/qa/extras/rtfimport/data/fdo48440.rtf
new file mode 100755
index 0000000..8c5ac2dc
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo48440.rtf
@@ -0,0 +1,5 @@
+{\rtf1
+{\pard\plain\qc\sl-200\sb40\phmrg\pvmrg\posx840\posy1120\absw5200\absh0\dxfrtext0\dfrmtxtx0\dfrmtxty0{\f1\fs20\b first page}\par}
+{\par\plain\page\par}
+{\pard\plain\ql\sl-200\sb40\phmrg\pvmrg\posx880\posy1280\absw1160\absh0\dxfrtext0\dfrmtxtx0\dfrmtxty0{\f1\fs20\b second page}\par}
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 480a63b..f1e9626 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -137,6 +137,7 @@ public:
void testFdo54612();
void testFdo58933();
void testFdo44053();
+ void testFdo48440();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -245,6 +246,7 @@ void Test::run()
{"fdo54612.rtf", &Test::testFdo54612},
{"fdo58933.rtf", &Test::testFdo58933},
{"fdo44053.rtf", &Test::testFdo44053},
+ {"fdo48440.rtf", &Test::testFdo48440},
};
header();
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
@@ -1062,6 +1064,12 @@ void Test::testFdo44053()
getProperty< uno::Sequence<text::TableColumnSeparator> >(xTableRows->getByIndex(1), "TableColumnSeparators")[0].Position);
}
+void Test::testFdo48440()
+{
+ // Page break was ignored.
+ CPPUNIT_ASSERT_EQUAL(2, getPages());
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 4964791..4f47d9d 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1820,6 +1820,7 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
}
else
{
+ checkNeedPap();
sal_uInt8 sBreak[] = { 0xc };
Mapper().text(sBreak, 1);
if (!m_bNeedPap)
More information about the Libreoffice-commits
mailing list