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

RTF import: fix import of \line symbol

"Required line break" was eaten by the newly added code in text() to
ignore \'0a.  (regression from f593a2e4)

Change-Id: Id32687c40a17ddb99196635cedfc850182705799
üst cf8f6fe1
...@@ -138,6 +138,7 @@ public: ...@@ -138,6 +138,7 @@ public:
void testFdo58933(); void testFdo58933();
void testFdo44053(); void testFdo44053();
void testFdo48440(); void testFdo48440();
void testFdo58646line();
void testFdo58646(); void testFdo58646();
void testFdo59419(); void testFdo59419();
void testFdo58076_2(); void testFdo58076_2();
...@@ -250,6 +251,7 @@ void Test::run() ...@@ -250,6 +251,7 @@ void Test::run()
{"fdo58933.rtf", &Test::testFdo58933}, {"fdo58933.rtf", &Test::testFdo58933},
{"fdo44053.rtf", &Test::testFdo44053}, {"fdo44053.rtf", &Test::testFdo44053},
{"fdo48440.rtf", &Test::testFdo48440}, {"fdo48440.rtf", &Test::testFdo48440},
{"fdo58646line.rtf", &Test::testFdo58646line},
{"fdo58646.rtf", &Test::testFdo58646}, {"fdo58646.rtf", &Test::testFdo58646},
{"fdo59419.rtf", &Test::testFdo59419}, {"fdo59419.rtf", &Test::testFdo59419},
{"fdo58076-2.rtf", &Test::testFdo58076_2}, {"fdo58076-2.rtf", &Test::testFdo58076_2},
...@@ -1076,6 +1078,12 @@ void Test::testFdo48440() ...@@ -1076,6 +1078,12 @@ void Test::testFdo48440()
CPPUNIT_ASSERT_EQUAL(2, getPages()); CPPUNIT_ASSERT_EQUAL(2, getPages());
} }
void Test::testFdo58646line()
{
// \line symbol was ignored
getParagraph(1, "foo\nbar");
}
void Test::testFdo58646() void Test::testFdo58646()
{ {
// Page break was ignored inside a continous section, on title page. // Page break was ignored inside a continous section, on title page.
......
...@@ -1605,12 +1605,16 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword) ...@@ -1605,12 +1605,16 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
checkUnicode(); checkUnicode();
setNeedSect(); setNeedSect();
RTFSkipDestination aSkip(*this); RTFSkipDestination aSkip(*this);
sal_uInt8 cCh = 0;
if (RTF_LINE == nKeyword)
{ // very special handling since text() will eat lone '\n'
singleChar('\n');
return 0;
}
// Trivial symbols // Trivial symbols
sal_uInt8 cCh = 0;
switch (nKeyword) switch (nKeyword)
{ {
case RTF_LINE: cCh = '\n'; break;
case RTF_TAB: cCh = '\t'; break; case RTF_TAB: cCh = '\t'; break;
case RTF_BACKSLASH: cCh = '\\'; break; case RTF_BACKSLASH: cCh = '\\'; break;
case RTF_LBRACE: cCh = '{'; break; case RTF_LBRACE: cCh = '{'; break;
......
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