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

fdo#55187 fix DOCX import of unicode 0xNN0d when it's a separate run

E.g. 0x010d was parsed as a newline character... This also makes the RTF
workaround from fdo#39856 unnecessary.

Change-Id: I5e4a95b4436e1492b64961820702caace0a33e4b
üst 01207ca9
...@@ -91,6 +91,7 @@ public: ...@@ -91,6 +91,7 @@ public:
void testInk(); void testInk();
void testN779834(); void testN779834();
void testN779627(); void testN779627();
void testFdo55187();
CPPUNIT_TEST_SUITE(Test); CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT) #if !defined(MACOSX) && !defined(WNT)
...@@ -128,6 +129,7 @@ public: ...@@ -128,6 +129,7 @@ public:
CPPUNIT_TEST(testInk); CPPUNIT_TEST(testInk);
CPPUNIT_TEST(testN779834); CPPUNIT_TEST(testN779834);
CPPUNIT_TEST(testN779627); CPPUNIT_TEST(testN779627);
CPPUNIT_TEST(testFdo55187);
#endif #endif
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
...@@ -885,6 +887,13 @@ void Test::testN779627() ...@@ -885,6 +887,13 @@ void Test::testN779627()
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nLeftMargin); CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nLeftMargin);
} }
void Test::testFdo55187()
{
// 0x010d was imported as a newline.
load("fdo55187.docx");
getParagraph(1, OUString("lupčka", 7, RTL_TEXTENCODING_UTF8));
}
CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT(); CPPUNIT_PLUGIN_IMPLEMENT();
......
...@@ -3523,8 +3523,7 @@ void DomainMapper::lcl_utext(const sal_uInt8 * data_, size_t len) ...@@ -3523,8 +3523,7 @@ void DomainMapper::lcl_utext(const sal_uInt8 * data_, size_t len)
{ {
m_pImpl->getTableManager().utext(data_, len); m_pImpl->getTableManager().utext(data_, len);
// RTF always uses text() instead of utext() for run break if(len == 1 && (sText[0] == 0x0d || sText[0] == 0x07))
if(len == 1 && ((*data_) == 0x0d || (*data_) == 0x07) && !IsRTFImport())
{ {
bool bSingleParagraph = m_pImpl->GetIsFirstParagraphInSection() && m_pImpl->GetIsLastParagraphInSection(); bool bSingleParagraph = m_pImpl->GetIsFirstParagraphInSection() && m_pImpl->GetIsLastParagraphInSection();
// If the paragraph contains only the section properties and it has // If the paragraph contains only the section properties and it has
......
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